Secrets Manager secret has a restrictive resource-based policy
secretsmanager_has_restrictive_resource_policy
Secrets Manager secrets are evaluated for restrictive resource-based policies: explicit Deny for unauthorized principals, Organization boundary via PrincipalOrgID, aws:SourceAccount for service access. Per-principal NotAction restrictions are optional (defense-in-depth). Regionalized service principals are supported.
Risk
Without a restrictive resource policy, any IAM principal in the account—or even cross-account entities—can read, modify, or delete the secret, compromising confidentiality and integrity. Overly broad policies enable lateral movement and privilege escalation through exposed credentials.
prowler aws --checks secretsmanager_has_restrictive_resource_policy
arn:aws:secretsmanager:region:account-id:secret:secret-name
Recommendation
Apply deny-by-default resource policies to every secret:
- Deny all principals except explicitly authorized roles via
StringNotEqualsonaws:PrincipalArn - Deny access from outside the AWS Organization via
aws:PrincipalOrgID - Constrain AWS service access with
aws:SourceAccount(additional restrictive conditions likeArnLikeare accepted) - Optionally, restrict each authorized principal to least-privilege actions using per-principal
Deny/NotActionstatements (defense-in-depth)
Remediation
aws secretsmanager put-resource-policy --secret-id <example_resource_id> --resource-policy file://policy.json
- Open AWS Console > Secrets Manager
- Select the secret > Overview tab > Resource permissions > Edit permissions
- Add a Deny statement for
Principal: *withStringNotEqualscondition listing only authorizedaws:PrincipalArnvalues - Add a Deny statement with
StringNotEqualsonaws:PrincipalOrgIDto block access from outside your organization - For each authorized principal, add a Deny with
NotActionlisting only the specific actions they need - Save the policy
Source Code
Resource Type
AwsSecretsManagerSecret