dcg

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
~/.config/dcg/config.toml
[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].

  1. aws-secretsmanager-delete-secret

    Critical

    aws 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
  2. aws-secretsmanager-delete-resource-policy

    High

    aws 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
  3. aws-secretsmanager-remove-regions

    High

    aws 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
  4. aws-ssm-delete-parameter

    High

    aws 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
  5. aws-ssm-delete-parameters

    High

    aws 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
  6. aws-secretsmanager-put-secret-value

    Medium

    aws 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
  7. aws-secretsmanager-update-secret

    Medium

    aws 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-list
  • aws-secretsmanager-describe
  • aws-secretsmanager-get
  • aws-secretsmanager-list-versions
  • aws-secretsmanager-get-resource-policy
  • aws-secretsmanager-get-random-password
  • aws-ssm-get-parameter
  • aws-ssm-get-parameters
  • aws-ssm-describe-parameters