AWS Secrets Manager
secrets.aws_secrets
Protects against destructive AWS Secrets Manager and SSM Parameter Store operations like delete-secret and delete-parameter.
- 7blocking rules
- 9safe patterns
- 1Critical
- 4High
- 2Medium
[packs]
enabled = ["secrets.aws_secrets"]Evaluated when a command contains aws, secretsmanager, ssm.
Blocking rules
Each rule ID is secrets.aws_secrets:<name>. Use it in allowlists and [policy.rules].
Criticalaws-secretsmanager-delete-secretaws secretsmanager delete-secret removes secrets and may cause data loss.
Explanation
Deleting a secret schedules it for deletion (default 30 days) or immediately removes it with --force-delete-without-recovery. Applications using this secret will fail to authenticate or decrypt data. Safer alternatives: - aws secretsmanager get-secret-value: Export value first - aws secretsmanager describe-secret: Check rotation/replication - Use --recovery-window-in-days for recoverable deletion
Highaws-secretsmanager-delete-resource-policyaws secretsmanager delete-resource-policy removes access controls.
Explanation
Deleting a resource policy removes cross-account access and custom permissions. Other AWS accounts or services that rely on this policy will lose access to the secret immediately. Safer alternatives: - aws secretsmanager get-resource-policy: Export policy first - Verify no cross-account dependencies exist - Update IAM policies to compensate if needed
Highaws-secretsmanager-remove-regionsaws secretsmanager remove-regions-from-replication can reduce availability.
Explanation
Removing regions from replication deletes the secret replica in those regions. Applications in removed regions will lose local access to the secret, increasing latency or causing failures during cross-region failover. Safer alternatives: - aws secretsmanager describe-secret: Review replica regions - Verify no applications in target regions use the secret - Update disaster recovery documentation
Highaws-ssm-delete-parameteraws ssm delete-parameter removes a parameter and can break deployments.
Explanation
Deleting an SSM parameter immediately removes it. Applications, CloudFormation stacks, and deployment scripts referencing this parameter will fail. There is no recovery window like Secrets Manager. Safer alternatives: - aws ssm get-parameter: Export value first - aws ssm describe-parameters: Check parameter history - Search CloudFormation templates for references
Highaws-ssm-delete-parametersaws ssm delete-parameters removes parameters and can break deployments.
Explanation
Deleting multiple SSM parameters at once can break numerous applications and deployment pipelines simultaneously. Each parameter is deleted immediately with no recovery option. Safer alternatives: - aws ssm get-parameters: Export all values first - Delete one parameter at a time to limit blast radius - Verify no active deployments use these parameters
Mediumaws-secretsmanager-put-secret-valueaws secretsmanager put-secret-value creates a new secret version and can break clients.
Explanation
Creating a new secret version makes it the current value immediately. Applications caching the old value will use outdated credentials until they refresh. Rotation windows should be coordinated with application deployments. Safer alternatives: - aws secretsmanager get-secret-value: Export current value - Use version staging labels for gradual rollout - Coordinate secret updates with application deployments
Mediumaws-secretsmanager-update-secretaws secretsmanager update-secret overwrites secret metadata or value.
Explanation
Updating a secret can change its value, KMS key, or description. The previous value becomes a non-current version. Applications using the old value may fail if automatic rotation is not configured. Safer alternatives: - aws secretsmanager get-secret-value: Export current value - Use put-secret-value to create new version instead - Test new value in non-production environment first
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
aws-secretsmanager-listaws-secretsmanager-describeaws-secretsmanager-getaws-secretsmanager-list-versionsaws-secretsmanager-get-resource-policyaws-secretsmanager-get-random-passwordaws-ssm-get-parameteraws-ssm-get-parametersaws-ssm-describe-parameters