-
Notifications
You must be signed in to change notification settings - Fork 102
[BUG] Azure.Deployment.SecureParameter is matching the keys param in public:avm/res/key-vault/vault #3697
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingpillar: securityAligned to the Security pillar.Aligned to the Security pillar.rule: keyvaultRules for Azure Key VaultRules for Azure Key Vault
Description
Existing rule
Azure.Deployment.SecureParameter
Description of the issue
When using the AVM Key Vault module like below I get hit with Azure.Deployment.SecureParameter on the keys param.
module keyVault 'br/public:avm/res/key-vault/vault:0.13.3' = {
scope: resourceGroup(resourceGroupName)
params: {
name: keyVaultName
enableTelemetry: false
roleAssignments: keyVaultRoleAssignments
location:location
tags: tags
enableRbacAuthorization: true
enablePurgeProtection: false
enableSoftDelete: true
softDeleteRetentionInDays: 30
}
}Error messages
keyVault-fbbc992f04770 : Microsoft.Resources/deployments [7/8]
FAIL Azure.Deployment.SecureParameter (AZR-000408)
Sensitive parameters that have been not been marked as secure may leak the secret into deployment history or logs.
Parameter: Deployments/foo/params/prd.bicepparam:0:0
Recommend:
Consider using secure parameters for any parameter that contain sensitive
information.
Reason:
- The parameter 'keys' with type '#/definitions/keyType' is not secure.
Help:
- https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Deployment.SecureParameter/
Reproduction
- Use the Bicep above.
- Run PSRule
Assert-PSRule -Format File -InputPath .\Deployments\ -Module 'PSRule.Rules.Azure' -Outcome fail
Version of PSRule
2.9.0
Version of PSRule for Azure
1.47.0
Additional context
My workaround for now is to add keys to AZURE_DEPLOYMENT_NONSENSITIVE_PARAMETER_NAMES which feels wrong as keys seems like the exact kind of param I would want catch with Azure.Deployment.SecureParameter
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpillar: securityAligned to the Security pillar.Aligned to the Security pillar.rule: keyvaultRules for Azure Key VaultRules for Azure Key Vault