Skip to content

Commit a723b9b

Browse files
authored
Rule WAF docs update Azure#2570 (Azure#2955)
1 parent 83348a5 commit a723b9b

Some content is hidden

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

44 files changed

+1230
-257
lines changed

data/policy-ignore.json

+22
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,33 @@
268268
"reason": "Duplicate",
269269
"value": "Azure.SQL.Auditing"
270270
},
271+
{
272+
"policyDefinitionIds": [
273+
"/providers/Microsoft.Authorization/policyDefinitions/17k78e20-9358-41c9-923c-fb736d382a12"
274+
],
275+
"reason": "Duplicate",
276+
"value": "Azure.SQL.TDE"
277+
},
278+
{
279+
"policyDefinitionIds": [
280+
"/providers/Microsoft.Authorization/policyDefinitions/abda6d70-9778-44e7-84a8-06713e6db027"
281+
],
282+
"reason": "Duplicate",
283+
"value": "Azure.SQL.AADOnly"
284+
},
271285
{
272286
"policyDefinitionIds": [
273287
"/providers/Microsoft.Authorization/policyDefinitions/4750c32b-89c0-46af-bfcb-2e4541a818d5"
274288
],
275289
"reason": "Duplicate",
276290
"value": "Azure.Cosmos.DisableMetadataWrite"
291+
},
292+
{
293+
"policyDefinitionIds": [
294+
"/providers/Microsoft.Authorization/policyDefinitions/b08ab3ca-1062-4db3-8803-eec9cae605d6",
295+
"/providers/Microsoft.Authorization/policyDefinitions/72bc14af-4ab8-43af-b4e4-38e7983f9a1f"
296+
],
297+
"reason": "Duplicate",
298+
"value": "Azure.AppConfig.DisableLocalAuth"
277299
}
278300
]

docs/CHANGELOG-v1.md

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
2929

3030
## Unreleased
3131

32+
What's changed since pre-release v1.38.0-B0034:
33+
34+
- Engineering:
35+
- Quality updates to rule documentation by @BernieWhite.
36+
[#2570](https://github.com/Azure/PSRule.Rules.Azure/issues/2570)
37+
3238
## v1.38.0-B0034 (pre-release)
3339

3440
What's changed since pre-release v1.38.0-B0011:

docs/en/rules/Azure.AKS.DNSPrefix.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
severity: Awareness
33
pillar: Operational Excellence
4-
category: Tagging and resource naming
4+
category: OE:04 Continuous integration
55
resource: Azure Kubernetes Service
66
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.AKS.DNSPrefix/
77
---
@@ -27,7 +27,7 @@ Consider using a DNS prefix that meets naming requirements.
2727

2828
## LINKS
2929

30-
- [Repeatable infrastructure](https://learn.microsoft.com/azure/architecture/framework/devops/automation-infrastructure)
30+
- [OE:04 Continuous integration](https://learn.microsoft.com/azure/well-architected/operational-excellence/release-engineering-continuous-integration)
3131
- [Naming rules and restrictions for Azure resources](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules)
3232
- [Recommended abbreviations for Azure resource types](https://learn.microsoft.com/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations)
3333
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.containerservice/managedclusters)

docs/en/rules/Azure.APIM.APIDescriptors.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
reviewed: 2023-03-05
33
severity: Awareness
44
pillar: Operational Excellence
5-
category: Instrumentation
5+
category: OE:04 Tools and processes
66
resource: API Management
77
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.APIM.APIDescriptors/
88
---
@@ -11,7 +11,7 @@ online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.APIM.A
1111

1212
## SYNOPSIS
1313

14-
API Management APIs should have a display name and description.
14+
APIs should have a display name and description.
1515

1616
## DESCRIPTION
1717

@@ -44,7 +44,7 @@ For example:
4444
```json
4545
{
4646
"type": "Microsoft.ApiManagement/service/apis",
47-
"apiVersion": "2021-08-01",
47+
"apiVersion": "2022-08-01",
4848
"name": "[format('{0}/{1}', parameters('name'), 'echo-v1')]",
4949
"properties": {
5050
"displayName": "Echo API",
@@ -76,7 +76,7 @@ To deploy API Management APIs that pass this rule:
7676
For example:
7777

7878
```bicep
79-
resource api 'Microsoft.ApiManagement/service/apis@2021-08-01' = {
79+
resource api 'Microsoft.ApiManagement/service/apis@2022-08-01' = {
8080
parent: service
8181
name: 'echo-v1'
8282
properties: {
@@ -97,6 +97,6 @@ resource api 'Microsoft.ApiManagement/service/apis@2021-08-01' = {
9797

9898
## LINKS
9999

100-
- [Human-readable data](https://learn.microsoft.com/azure/architecture/framework/devops/monitor-instrument#human-readable-data)
100+
- [OE:04 Tools and processes](https://learn.microsoft.com/azure/well-architected/operational-excellence/tools-processes)
101101
- [Import and publish your first API](https://learn.microsoft.com/azure/api-management/import-and-publish)
102102
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.apimanagement/service/apis)

docs/en/rules/Azure.APIM.AvailabilityZone.md

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ resource service_api_mgmt_test2_name_resource 'Microsoft.ApiManagement/service@2
170170
}
171171
```
172172

173+
<!-- external:avm avm/res/api-management/service zones -->
174+
173175
## NOTES
174176

175177
This rule applies when analyzing resources deployed to Azure using *pre-flight* and *in-flight* data.

docs/en/rules/Azure.APIM.Ciphers.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
reviewed: 2023-03-05
33
severity: Critical
44
pillar: Security
5-
category: Encryption
5+
category: SE:07 Encryption
66
resource: API Management
77
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.APIM.Ciphers/
88
---
@@ -147,9 +147,11 @@ resource service 'Microsoft.ApiManagement/service@2021-08-01' = {
147147
}
148148
```
149149

150+
<!-- external:avm avm/res/api-management/service customProperties -->
151+
150152
## LINKS
151153

152-
- [Data encryption in Azure](https://learn.microsoft.com/azure/architecture/framework/security/design-storage-encryption#data-in-transit)
154+
- [SE:07 Encryption](https://learn.microsoft.com/azure/well-architected/security/encryption#data-in-transit)
153155
- [Manage protocols and ciphers in Azure API Management](https://learn.microsoft.com/azure/api-management/api-management-howto-manage-protocols-ciphers)
154156
- [Cryptographic Recommendations](https://learn.microsoft.com/security/sdl/cryptographic-recommendations)
155157
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.apimanagement/service)

docs/en/rules/Azure.APIM.ManagedIdentity.md

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ resource service 'Microsoft.ApiManagement/service@2021-08-01' = {
121121
}
122122
```
123123

124+
<!-- external:avm avm/res/api-management/service managedIdentities -->
125+
124126
## LINKS
125127

126128
- [SE:05 Identity and access management](https://learn.microsoft.com/azure/well-architected/security/identity-access#resource-identity)

docs/en/rules/Azure.APIM.MinAPIVersion.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ You can transition to API version 2021-08-01 or later at any point prior to 30 S
2424

2525
## RECOMMENDATION
2626

27-
Limit control plane API calls to API Management with version '2021-08-01' or newer.
27+
Limit control plane API calls to API Management with version `2021-08-01` or newer.
2828

2929
## EXAMPLES
3030

3131
### Configure with Azure template
3232

3333
To deploy API Management services that pass this rule:
3434

35-
- Set the `apiVersion` property to `'2021-08-01'` or newer.
36-
- Set the `properties.apiVersionConstraint.minApiVersion` property to `'2021-08-01'` or newer.
35+
- Set the `apiVersion` property to `2021-08-01` or newer.
36+
- Set the `properties.apiVersionConstraint.minApiVersion` property to `2021-08-01` or newer.
3737

3838
For example:
3939

@@ -82,7 +82,7 @@ For example:
8282
To deploy API Management services that pass this rule:
8383

8484
- Use the API Version `Microsoft.ApiManagement/service@2021-08-01` or newer.
85-
- Set the `properties.apiVersionConstraint.minApiVersion` property to `'2021-08-01'` or newer.
85+
- Set the `properties.apiVersionConstraint.minApiVersion` property to `2021-08-01` or newer.
8686

8787
For example:
8888

@@ -124,6 +124,8 @@ resource service 'Microsoft.ApiManagement/service@2021-08-01' = {
124124
}
125125
```
126126

127+
<!-- external:avm avm/res/api-management/service minApiVersion -->
128+
127129
## NOTES
128130

129131
This rule fails:
@@ -137,6 +139,10 @@ This rule fails:
137139
- When you use the Azure portal or REST API version 2020-06-01-preview or later to delete an API Management instance, it's soft-deleted.
138140
- An API Management instance deleted using a REST API version before 2020-06-01-preview is permanently deleted.
139141

142+
### Rule configuration
143+
144+
<!-- module:config rule AZURE_APIM_MIN_API_VERSION -->
145+
140146
Configure `AZURE_APIM_MIN_API_VERSION` to set the minimum API version used for control plane API calls to the API Management instance.
141147

142148
```yaml

docs/en/rules/Azure.AppConfig.DisableLocalAuth.md

+5-30
Original file line numberDiff line numberDiff line change
@@ -86,40 +86,16 @@ resource store 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
8686
}
8787
```
8888

89-
### Configure with Bicep Public Registry
90-
91-
To deploy App Configuration Stores that pass this rule:
92-
93-
- Set the `params.disableLocalAuth` parameter to `true`.
94-
95-
For example:
96-
97-
```bicep
98-
module br_public_store 'br/public:app/app-configuration:1.1.2' = {
99-
name: 'store'
100-
params: {
101-
skuName: 'Standard'
102-
disableLocalAuth: true
103-
enablePurgeProtection: true
104-
publicNetworkAccess: 'Disabled'
105-
replicas: [
106-
{
107-
name: 'eastus'
108-
location: 'eastus'
109-
}
110-
]
111-
}
112-
}
113-
```
89+
<!-- external:avm avm/res/app-configuration/configuration-store disableLocalAuth -->
11490

11591
### Configure with Azure Policy
11692

11793
To address this issue at runtime use the following policies:
11894

119-
Name | Resource
120-
---- | --------
121-
App Configuration stores should have local authentication methods disabled | `/providers/Microsoft.Authorization/policyDefinitions/b08ab3ca-1062-4db3-8803-eec9cae605d6`
122-
Configure App Configuration stores to disable local authentication methods | `/providers/Microsoft.Authorization/policyDefinitions/72bc14af-4ab8-43af-b4e4-38e7983f9a1f`
95+
- [App Configuration stores should have local authentication methods disabled](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/App%20Configuration/DisableLocalAuth_Audit.json)
96+
`/providers/Microsoft.Authorization/policyDefinitions/b08ab3ca-1062-4db3-8803-eec9cae605d6`
97+
- [Configure App Configuration stores to disable local authentication methods](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/App%20Configuration/DisableLocalAuth_Modify.json)
98+
`/providers/Microsoft.Authorization/policyDefinitions/72bc14af-4ab8-43af-b4e4-38e7983f9a1f`
12399

124100
## LINKS
125101

@@ -129,5 +105,4 @@ Configure App Configuration stores to disable local authentication methods | `/p
129105
- [Disable access key authentication](https://learn.microsoft.com/azure/azure-app-configuration/howto-disable-access-key-authentication)
130106
- [Azure security baseline for Azure App Configuration](https://learn.microsoft.com/security/benchmark/azure/baselines/azure-app-configuration-security-baseline)
131107
- [Azure Policy built-in definitions for Azure App Configuration](https://learn.microsoft.com/azure/azure-app-configuration/policy-reference)
132-
- [Bicep public registry](https://azure.github.io/bicep-registry-modules/#app)
133108
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.appconfiguration/configurationstores)

docs/en/rules/Azure.AppConfig.Name.md

+9-31
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
reviewed: 2022-09-24
33
severity: Awareness
44
pillar: Operational Excellence
5-
category: Repeatable infrastructure
5+
category: OE:04 Continuous integration
66
resource: App Configuration
77
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.AppConfig.Name/
88
---
@@ -41,15 +41,16 @@ For example:
4141
```json
4242
{
4343
"type": "Microsoft.AppConfiguration/configurationStores",
44-
"apiVersion": "2022-05-01",
44+
"apiVersion": "2023-03-01",
4545
"name": "[parameters('name')]",
4646
"location": "[parameters('location')]",
4747
"sku": {
4848
"name": "standard"
4949
},
5050
"properties": {
5151
"disableLocalAuth": true,
52-
"enablePurgeProtection": true
52+
"enablePurgeProtection": true,
53+
"publicNetworkAccess": "Disabled"
5354
}
5455
}
5556
```
@@ -58,12 +59,12 @@ For example:
5859

5960
To deploy configuration stores that pass this rule:
6061

61-
- Set `name` to a value that meets the requirements.
62+
- Set the `name` property to a value that meets the requirements.
6263

6364
For example:
6465

6566
```bicep
66-
resource store 'Microsoft.AppConfiguration/configurationStores@2022-05-01' = {
67+
resource store 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
6768
name: name
6869
location: location
6970
sku: {
@@ -72,43 +73,20 @@ resource store 'Microsoft.AppConfiguration/configurationStores@2022-05-01' = {
7273
properties: {
7374
disableLocalAuth: true
7475
enablePurgeProtection: true
75-
}
76-
}
77-
```
78-
79-
### Configure with Bicep Public Registry
80-
81-
To deploy App Configuration Stores that pass this rule:
82-
83-
- Set `params.name` to a value that meets the requirements.
84-
85-
For example:
86-
87-
```bicep
88-
module br_public_store 'br/public:app/app-configuration:1.1.2' = {
89-
name: 'store'
90-
params: {
91-
skuName: 'Standard'
92-
disableLocalAuth: true
93-
enablePurgeProtection: true
9476
publicNetworkAccess: 'Disabled'
95-
replicas: [
96-
{
97-
name: 'eastus'
98-
location: 'eastus'
99-
}
100-
]
10177
}
10278
}
10379
```
10480

81+
<!-- external:avm avm/res/app-configuration/configuration-store name -->
82+
10583
## NOTES
10684

10785
This rule does not check if App Configuration store names are unique.
10886

10987
## LINKS
11088

111-
- [Repeatable infrastructure](https://learn.microsoft.com/azure/architecture/framework/devops/automation-infrastructure)
89+
- [OE:04 Continuous integration](https://learn.microsoft.com/azure/well-architected/operational-excellence/release-engineering-continuous-integration)
11290
- [Naming rules and restrictions for Azure resources](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftappconfiguration)
11391
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.appconfiguration/configurationstores)
11492
- [Recommended abbreviations for Azure resource types](https://learn.microsoft.com/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations)

docs/en/rules/Azure.AppConfig.PurgeProtect.md

+1-26
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,10 @@ resource store 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
7575
}
7676
```
7777

78-
### Configure with Bicep Public Registry
79-
80-
To deploy App Configuration Stores that pass this rule:
81-
82-
- Set the `params.enablePurgeProtection` parameter to `true`.
83-
84-
For example:
85-
86-
```bicep
87-
module br_public_store 'br/public:app/app-configuration:1.1.2' = {
88-
name: 'store'
89-
params: {
90-
skuName: 'Standard'
91-
disableLocalAuth: true
92-
enablePurgeProtection: true
93-
publicNetworkAccess: 'Disabled'
94-
replicas: [
95-
{
96-
name: 'eastus'
97-
location: 'eastus'
98-
}
99-
]
100-
}
101-
}
102-
```
78+
<!-- external:avm avm/res/app-configuration/configuration-store enablePurgeProtection -->
10379

10480
## LINKS
10581

10682
- [Data management for reliability](https://learn.microsoft.com/azure/architecture/framework/resiliency/data-management)
10783
- [Purge protection](https://learn.microsoft.com/azure/azure-app-configuration/concept-soft-delete#purge-protection)
108-
- [Bicep public registry](https://azure.github.io/bicep-registry-modules/#app)
10984
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.appconfiguration/configurationstores)

0 commit comments

Comments
 (0)