Skip to content

Commit 777e13e

Browse files
authored
Add additional exclusions for Azure.Deployment.SecureParameter Azure#2857 (Azure#2858)
1 parent 793cf0c commit 777e13e

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

docs/CHANGELOG-v1.md

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ What's changed since v1.36.0:
3939
- Cosmos DB:
4040
- Check that database accounts use a paid tier by @BernieWhite.
4141
[#2845](https://github.com/Azure/PSRule.Rules.Azure/issues/2845)
42+
- Updated rules:
43+
- Deployment:
44+
- Add additional exclusions for `Azure.Deployment.SecureParameter` by @BernieWhite.
45+
[#2857](https://github.com/Azure/PSRule.Rules.Azure/issues/2857)
4246
- General improvements:
4347
- Quality updates to documentation by @BernieWhite.
4448
[#2570](https://github.com/Azure/PSRule.Rules.Azure/issues/2570)

docs/en/rules/Azure.Deployment.SecureParameter.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
reviewed: 2023-11-13
2+
reviewed: 2024-05-07
33
severity: Critical
44
pillar: Security
5-
category: Infrastructure provisioning
5+
category: SE:02 Secured development lifecycle
66
resource: Deployment
77
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Deployment.SecureParameter/
88
---
@@ -86,18 +86,23 @@ This rule uses a heuristics to determine if a parameter should use a secure type
8686
- Parameters with the type `int` or `bool` are ignored regardless of how they are named.
8787
- Any parameter with a name containing `password`, `secret`, or `token` will be considered sensitive.
8888
- Except parameter names containing any of the following:
89-
`passwordlength`, `secretname`, `secreturl`, `secreturi`, `secretrotation`, `secretinterval`, `secretprovider`,
90-
`secretsprovider`, `secretref`, `secretid`, `disablepassword`, `sync*passwords`, or `tokenname`.
89+
`length`, `interval`, `secretname`, `secreturl`, `secreturi`, `secrettype`, `secretrotation`,
90+
`secretprovider`, `secretsprovider`, `secretref`, `secretid`, `disablepassword`, `sync*passwords`,
91+
`tokenname`, `tokentype`, `keyvaultpath`, `keyvaultname`, or `keyvaulturi`.
9192
- Any parameter with a name ending in `key` or `keys` will be considered sensitive.
9293
- Except parameter names ending in `publickey` or `publickeys`.
9394

95+
### Rule configuration
96+
97+
<!-- module:config rule AZURE_DEPLOYMENT_NONSENSITIVE_PARAMETER_NAMES -->
98+
9499
If you identify a parameter that is _not sensitive_, and is incorrectly flagged by this rule, you can override the rule.
95100
To override this rule:
96101

97102
- Set the `AZURE_DEPLOYMENT_NONSENSITIVE_PARAMETER_NAMES` configuration value to identify parameters that are not sensitive.
98103

99104
## LINKS
100105

101-
- [Infrastructure provisioning considerations in Azure](https://learn.microsoft.com/azure/architecture/framework/security/deploy-infrastructure)
106+
- [SE:02 Secured development lifecycle](https://learn.microsoft.com/azure/well-architected/security/secure-development-lifecycle)
102107
- [Use Azure Key Vault to pass secure parameter value during Bicep deployment](https://learn.microsoft.com/azure/azure-resource-manager/bicep/key-vault-parameter)
103108
- [Integrate Azure Key Vault in your ARM template deployment](https://learn.microsoft.com/azure/azure-resource-manager/templates/template-tutorial-use-key-vault#edit-the-parameters-file)

src/PSRule.Rules.Azure/rules/Azure.Deployment.Rule.ps1

+8-3
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,24 @@ function global:GetSecureParameter {
7575
)).Result -and
7676
$parameter.Name -notLike '*publickey' -and
7777
$parameter.Name -notLike '*publickeys' -and
78-
$parameter.Name -notLike '*passwordlength*' -and
7978
$parameter.Name -notLike '*secretname*' -and
8079
$parameter.Name -notLike '*secreturl*' -and
8180
$parameter.Name -notLike '*secreturi*' -and
82-
$parameter.Name -notLike '*tokenname*' -and
81+
$parameter.Name -notLike '*secrettype*' -and
8382
$parameter.Name -notLike '*secretrotation*' -and
84-
$parameter.Name -notLike '*secretinterval*' -and
83+
$parameter.Name -notLike '*tokenname*' -and
84+
$parameter.Name -notLike '*tokentype*' -and
85+
$parameter.Name -notLike '*interval*' -and
86+
$parameter.Name -notLike '*length*' -and
8587
$parameter.Name -notLike '*secretprovider*' -and
8688
$parameter.Name -notLike '*secretsprovider*' -and
8789
$parameter.Name -notLike '*secretref*' -and
8890
$parameter.Name -notLike '*secretid*' -and
8991
$parameter.Name -notLike '*disablepassword*' -and
9092
$parameter.Name -notLike '*sync*passwords*' -and
93+
$parameter.Name -notLike '*keyvaultpath*' -and
94+
$parameter.Name -notLike '*keyvaultname*' -and
95+
$parameter.Name -notLike '*keyvaulturi*' -and
9196
$Assert.NotIn($parameter, 'Name', $Configuration.GetStringValues('AZURE_DEPLOYMENT_NONSENSITIVE_PARAMETER_NAMES')).Result -and
9297
$Null -ne $parameter.Value.type -and
9398
$parameter.Value.type -ne 'bool' -and

0 commit comments

Comments
 (0)