Check ID: secretsmanager_not_publicly_accessible
Provider: AWS
Service: secretsmanager
Severity: HIGH
Categories: internet-exposed, secrets
Resource type: AwsSecretsManagerSecret

What this check verifies

AWS Secrets Manager secrets are evaluated for public exposure through resource-based policies that grant broad access, such as Principal: "*", which would allow any principal to perform actions on the secret.

Risk

Public access to a secret enables uncontrolled retrieval of secret values, compromising confidentiality. If broad actions are allowed, attackers can modify or delete the secret, impacting integrity and availability, and use exposed credentials for unauthorized data access and lateral movement.

Recommendation

Apply least privilege to resource policies:
  • Remove wildcards and limit access to specific principals
  • Add contextual conditions (e.g., VPC endpoints, source account/ARN)
  • Enable safeguards that block public policies
  • Prefer private access paths
  • Periodically review related identity and KMS policies

Remediation

aws secretsmanager put-resource-policy --secret-id <secret-id> --resource-policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::<ACCOUNT_ID>:root"},"Action":"secretsmanager:GetSecretValue","Resource":"*"}]}' --block-public-policy

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = secretsmanager_not_publicly_accessible. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks