Skip to content

Commit 841e914

Browse files
committed
More rules
1 parent 007ae8d commit 841e914

File tree

43 files changed

+3409
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3409
-1
lines changed

.github/workflows/spelling.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Check Spelling
2+
3+
# Comment management is handled through a secondary job, for details see:
4+
# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
5+
#
6+
# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
7+
# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare)
8+
# it needs `contents: write` in order to add a comment.
9+
#
10+
# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
11+
# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment)
12+
# it needs `pull-requests: write` in order to manipulate those comments.
13+
14+
# Updating pull request branches is managed via comment handling.
15+
# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list
16+
#
17+
# These elements work together to make it happen:
18+
#
19+
# `on.issue_comment`
20+
# This event listens to comments by users asking to update the metadata.
21+
#
22+
# `jobs.update`
23+
# This job runs in response to an issue_comment and will push a new commit
24+
# to update the spelling metadata.
25+
#
26+
# `with.experimental_apply_changes_via_bot`
27+
# Tells the action to support and generate messages that enable it
28+
# to make a commit to update the spelling metadata.
29+
#
30+
# `with.ssh_key`
31+
# In order to trigger workflows when the commit is made, you can provide a
32+
# secret (typically, a write-enabled github deploy key).
33+
#
34+
# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key
35+
36+
# Sarif reporting
37+
#
38+
# Access to Sarif reports is generally restricted (by GitHub) to members of the repository.
39+
#
40+
# Requires enabling `security-events: write`
41+
# and configuring the action with `use_sarif: 1`
42+
#
43+
# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Sarif-output
44+
45+
# Minimal workflow structure:
46+
#
47+
# on:
48+
# push:
49+
# ...
50+
# pull_request_target:
51+
# ...
52+
# jobs:
53+
# # you only want the spelling job, all others should be omitted
54+
# spelling:
55+
# # remove `security-events: write` and `use_sarif: 1`
56+
# # remove `experimental_apply_changes_via_bot: 1`
57+
# ... otherwise adjust the `with:` as you wish
58+
59+
on:
60+
push:
61+
branches:
62+
- "**"
63+
tags-ignore:
64+
- "**"
65+
pull_request_target:
66+
branches:
67+
- "**"
68+
types:
69+
- 'opened'
70+
- 'reopened'
71+
- 'synchronize'
72+
issue_comment:
73+
types:
74+
- 'created'
75+
76+
jobs:
77+
spelling:
78+
name: Check Spelling
79+
permissions:
80+
contents: read
81+
pull-requests: read
82+
actions: read
83+
security-events: write
84+
outputs:
85+
followup: ${{ steps.spelling.outputs.followup }}
86+
runs-on: ubuntu-latest
87+
if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }}
88+
concurrency:
89+
group: spelling-${{ github.event.pull_request.number || github.ref }}
90+
# note: If you use only_check_changed_files, you do not want cancel-in-progress
91+
cancel-in-progress: true
92+
steps:
93+
- name: check-spelling
94+
id: spelling
95+
uses: check-spelling/check-spelling@main
96+
with:
97+
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
98+
checkout: true
99+
check_file_names: 1
100+
spell_check_this: check-spelling/spell-check-this@prerelease
101+
post_comment: 0
102+
use_magic_file: 1
103+
report-timing: 1
104+
warnings: bad-regex,binary-file,deprecated-feature,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check
105+
experimental_apply_changes_via_bot: 1
106+
use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }}
107+
extra_dictionary_limit: 20
108+
extra_dictionaries:
109+
cspell:software-terms/dict/softwareTerms.txt
110+
111+
comment-push:
112+
name: Report (Push)
113+
# If your workflow isn't running on push, you can remove this job
114+
runs-on: ubuntu-latest
115+
needs: spelling
116+
permissions:
117+
contents: write
118+
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
119+
steps:
120+
- name: comment
121+
uses: check-spelling/check-spelling@main
122+
with:
123+
checkout: true
124+
spell_check_this: check-spelling/spell-check-this@prerelease
125+
task: ${{ needs.spelling.outputs.followup }}
126+
127+
comment-pr:
128+
name: Report (PR)
129+
# If you workflow isn't running on pull_request*, you can remove this job
130+
runs-on: ubuntu-latest
131+
needs: spelling
132+
permissions:
133+
contents: read
134+
pull-requests: write
135+
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
136+
steps:
137+
- name: comment
138+
uses: check-spelling/check-spelling@main
139+
with:
140+
checkout: true
141+
spell_check_this: check-spelling/spell-check-this@prerelease
142+
task: ${{ needs.spelling.outputs.followup }}
143+
experimental_apply_changes_via_bot: 1
144+
145+
update:
146+
name: Update PR
147+
permissions:
148+
contents: write
149+
pull-requests: write
150+
actions: read
151+
runs-on: ubuntu-latest
152+
if: ${{
153+
github.event_name == 'issue_comment' &&
154+
github.event.issue.pull_request &&
155+
contains(github.event.comment.body, '@check-spelling-bot apply')
156+
}}
157+
concurrency:
158+
group: spelling-update-${{ github.event.issue.number }}
159+
cancel-in-progress: false
160+
steps:
161+
- name: apply spelling updates
162+
uses: check-spelling/check-spelling@main
163+
with:
164+
experimental_apply_changes_via_bot: 1
165+
checkout: true
166+
ssh_key: "${{ secrets.CHECK_SPELLING }}"

docs/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
|[azurerm_eventhub_namespace_public_network_access_enabled](./rules/azurerm_eventhub_namespace_public_network_access_enabled.md)|Notice||
88
|[azurerm_eventhub_namespace_unsecure_tls](./rules/azurerm_eventhub_namespace_unsecure_tls.md)|Warning||
99
|[azurerm_iothub_endpoint_eventhub_authentication_type](./rules/azurerm_iothub_endpoint_eventhub_authentication_type.md)|Notice||
10+
|[azurerm_key_vault_enable_rbac_authorization](./rules/azurerm_key_vault_enable_rbac_authorization.md)|Warning||
1011
|[azurerm_key_vault_network_acls_default_deny](./rules/azurerm_key_vault_network_acls_default_deny.md)|Warning||
1112
|[azurerm_key_vault_public_network_access_enabled](./rules/azurerm_key_vault_public_network_access_enabled.md)|Notice||
1213
|[azurerm_linux_function_app_ftps_state](./rules/azurerm_linux_function_app_ftps_state.md)|Warning||
1314
|[azurerm_linux_function_app_https_only](./rules/azurerm_linux_function_app_https_only.md)|Warning||
1415
|[azurerm_linux_function_app_minimum_tls_version](./rules/azurerm_linux_function_app_minimum_tls_version.md)|Warning||
16+
|[azurerm_linux_function_app_slot_ftps_state](./rules/azurerm_linux_function_app_slot_ftps_state.md)|Warning||
17+
|[azurerm_linux_function_app_slot_https_only](./rules/azurerm_linux_function_app_slot_https_only.md)|Warning||
18+
|[azurerm_linux_function_app_slot_minimum_tls_version](./rules/azurerm_linux_function_app_slot_minimum_tls_version.md)|Warning||
1519
|[azurerm_linux_web_app_ftps_state](./rules/azurerm_linux_web_app_ftps_state.md)|Warning||
1620
|[azurerm_linux_web_app_https_only](./rules/azurerm_linux_web_app_https_only.md)|Warning||
1721
|[azurerm_linux_web_app_minimum_tls_version](./rules/azurerm_linux_web_app_minimum_tls_version.md)|Warning||
22+
|[azurerm_linux_web_app_slot_ftps_state](./rules/azurerm_linux_web_app_slot_ftps_state.md)|Warning||
23+
|[azurerm_linux_web_app_slot_https_only](./rules/azurerm_linux_web_app_slot_https_only.md)|Warning||
24+
|[azurerm_linux_web_app_slot_minimum_tls_version](./rules/azurerm_linux_web_app_slot_minimum_tls_version.md)|Warning||
1825
|[azurerm_mssql_database_encryption](./rules/azurerm_mssql_database_encryption.md)|Warning||
1926
|[azurerm_mssql_firewall_rule_all_allowed](./rules/azurerm_mssql_firewall_rule_all_allowed.md)|Error||
2027
|[azurerm_mssql_server_azuread_authentication_only](./rules/azurerm_mssql_server_azuread_authentication_only.md)|Warning||
@@ -26,9 +33,15 @@
2633
|[azurerm_windows_function_app_ftps_state](./rules/azurerm_windows_function_app_ftps_state.md)|Warning||
2734
|[azurerm_windows_function_app_https_only](./rules/azurerm_windows_function_app_https_only.md)|Warning||
2835
|[azurerm_windows_function_app_minimum_tls_version](./rules/azurerm_windows_function_app_minimum_tls_version.md)|Warning||
36+
|[azurerm_windows_function_app_slot_ftps_state](./rules/azurerm_windows_function_app_slot_ftps_state.md)|Warning||
37+
|[azurerm_windows_function_app_slot_https_only](./rules/azurerm_windows_function_app_slot_https_only.md)|Warning||
38+
|[azurerm_windows_function_app_slot_minimum_tls_version](./rules/azurerm_windows_function_app_slot_minimum_tls_version.md)|Warning||
2939
|[azurerm_windows_web_app_ftps_state](./rules/azurerm_windows_web_app_ftps_state.md)|Warning||
3040
|[azurerm_windows_web_app_https_only](./rules/azurerm_windows_web_app_https_only.md)|Warning||
3141
|[azurerm_windows_web_app_minimum_tls_version](./rules/azurerm_windows_web_app_minimum_tls_version.md)|Warning||
42+
|[azurerm_windows_web_app_slot_ftps_state](./rules/azurerm_windows_web_app_slot_ftps_state.md)|Warning||
43+
|[azurerm_windows_web_app_slot_https_only](./rules/azurerm_windows_web_app_slot_https_only.md)|Warning||
44+
|[azurerm_windows_web_app_slot_minimum_tls_version](./rules/azurerm_windows_web_app_slot_minimum_tls_version.md)|Warning||
3245

3346
## Rules by Resource
3447

@@ -43,6 +56,7 @@
4356

4457
### azurerm_key_vault
4558

59+
- [azurerm_key_vault_enable_rbac_authorization](./rules/azurerm_key_vault_enable_rbac_authorization.md)
4660
- [azurerm_key_vault_network_acls_default_deny](./rules/azurerm_key_vault_network_acls_default_deny.md)
4761
- [azurerm_key_vault_public_network_access_enabled](./rules/azurerm_key_vault_public_network_access_enabled.md)
4862

@@ -52,12 +66,24 @@
5266
- [azurerm_linux_function_app_https_only](./rules/azurerm_linux_function_app_https_only.md)
5367
- [azurerm_linux_function_app_minimum_tls_version](./rules/azurerm_linux_function_app_minimum_tls_version.md)
5468

69+
### azurerm_linux_function_app_slot
70+
71+
- [azurerm_linux_function_app_slot_ftps_state](./rules/azurerm_linux_function_app_slot_ftps_state.md)
72+
- [azurerm_linux_function_app_slot_https_only](./rules/azurerm_linux_function_app_slot_https_only.md)
73+
- [azurerm_linux_function_app_slot_minimum_tls_version](./rules/azurerm_linux_function_app_slot_minimum_tls_version.md)
74+
5575
### azurerm_linux_web_app
5676

5777
- [azurerm_linux_web_app_ftps_state](./rules/azurerm_linux_web_app_ftps_state.md)
5878
- [azurerm_linux_web_app_https_only](./rules/azurerm_linux_web_app_https_only.md)
5979
- [azurerm_linux_web_app_minimum_tls_version](./rules/azurerm_linux_web_app_minimum_tls_version.md)
6080

81+
### azurerm_linux_web_app_slot
82+
83+
- [azurerm_linux_web_app_slot_ftps_state](./rules/azurerm_linux_web_app_slot_ftps_state.md)
84+
- [azurerm_linux_web_app_slot_https_only](./rules/azurerm_linux_web_app_slot_https_only.md)
85+
- [azurerm_linux_web_app_slot_minimum_tls_version](./rules/azurerm_linux_web_app_slot_minimum_tls_version.md)
86+
6187
### azurerm_mssql_database
6288

6389
- [azurerm_mssql_database_encryption](./rules/azurerm_mssql_database_encryption.md)
@@ -84,9 +110,21 @@
84110
- [azurerm_windows_function_app_https_only](./rules/azurerm_windows_function_app_https_only.md)
85111
- [azurerm_windows_function_app_minimum_tls_version](./rules/azurerm_windows_function_app_minimum_tls_version.md)
86112

113+
### azurerm_windows_function_app_slot
114+
115+
- [azurerm_windows_function_app_slot_ftps_state](./rules/azurerm_windows_function_app_slot_ftps_state.md)
116+
- [azurerm_windows_function_app_slot_https_only](./rules/azurerm_windows_function_app_slot_https_only.md)
117+
- [azurerm_windows_function_app_slot_minimum_tls_version](./rules/azurerm_windows_function_app_slot_minimum_tls_version.md)
118+
87119
### azurerm_windows_web_app
88120

89121
- [azurerm_windows_web_app_ftps_state](./rules/azurerm_windows_web_app_ftps_state.md)
90122
- [azurerm_windows_web_app_https_only](./rules/azurerm_windows_web_app_https_only.md)
91123
- [azurerm_windows_web_app_minimum_tls_version](./rules/azurerm_windows_web_app_minimum_tls_version.md)
92124

125+
### azurerm_windows_web_app_slot
126+
127+
- [azurerm_windows_web_app_slot_ftps_state](./rules/azurerm_windows_web_app_slot_ftps_state.md)
128+
- [azurerm_windows_web_app_slot_https_only](./rules/azurerm_windows_web_app_slot_https_only.md)
129+
- [azurerm_windows_web_app_slot_minimum_tls_version](./rules/azurerm_windows_web_app_slot_minimum_tls_version.md)
130+

docs/rules/azurerm_iothub_endpoint_eventhub_authentication_type.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Using identityBased authentication with a managed identity enhances security by
1717

1818
## How to Fix
1919

20+
```hcl
2021
resource "azurerm_iothub_endpoint_eventhub" "example" {
2122
authentication_type = "identityBased"
2223
}
23-
24+
```
2425

2526
## How to disable
2627

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# azurerm_key_vault_enable_rbac_authorization
2+
3+
**Severity:** Warning
4+
5+
6+
## Example
7+
8+
```hcl
9+
resource "azurerm_key_vault" "example" {
10+
enable_rbac_authorization = false
11+
}
12+
```
13+
14+
## Why
15+
16+
Enabling enable_rbac_authorization allows access to the Key Vault to be managed through Azure Role-Based Access Control (RBAC), providing granular, centralized, and scalable permissions management. This is considered the current best practice.
17+
18+
## How to Fix
19+
20+
```hcl
21+
resource "azurerm_key_vault" "example" {
22+
enable_rbac_authorization = true
23+
}
24+
```
25+
26+
27+
## How to disable
28+
29+
```hcl
30+
rule "azurerm_key_vault_enable_rbac_authorization" {
31+
enabled = false
32+
}
33+
```
34+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# azurerm_linux_function_app_slot_ftps_state
2+
3+
**Severity:** Warning
4+
5+
6+
## Example
7+
8+
```hcl
9+
resource "azurerm_linux_function_app_slot" "example" {
10+
site_config {
11+
ftps_state = "FtpsOnly"
12+
}
13+
}
14+
```
15+
16+
## Why
17+
18+
Disabling FTPS ensures that file transfer protocols are not used, reducing the risk of data interception and enhancing the overall security of the Linux Function App.
19+
20+
## How to Fix
21+
22+
```hcl
23+
resource "azurerm_linux_function_app_slot" "example" {
24+
site_config {
25+
ftps_state = "Disabled"
26+
}
27+
}
28+
```
29+
30+
31+
## How to disable
32+
33+
```hcl
34+
rule "azurerm_linux_function_app_slot_ftps_state" {
35+
enabled = false
36+
}
37+
```
38+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# azurerm_linux_function_app_slot_https_only
2+
3+
**Severity:** Warning
4+
5+
6+
## Example
7+
8+
```hcl
9+
resource "azurerm_linux_function_app_slot" "example" {
10+
https_only = false
11+
}
12+
```
13+
14+
## Why
15+
16+
Enforcing https_only ensures all communications with the resource are encrypted, protecting sensitive data in transit and mitigating the risk of man-in-the-middle attacks.
17+
18+
## How to Fix
19+
20+
```hcl
21+
resource "azurerm_linux_function_app_slot" "example" {
22+
https_only = true
23+
}
24+
```
25+
26+
27+
## How to disable
28+
29+
```hcl
30+
rule "azurerm_linux_function_app_slot_https_only" {
31+
enabled = false
32+
}
33+
```
34+

0 commit comments

Comments
 (0)