Check ID: ssm_document_secrets
Provider: AWS
Service: ssm
Severity: HIGH
Categories: secrets
Resource type: AwsSsmPatchCompliance

What this check verifies

AWS Systems Manager documents are inspected for embedded secrets within their content. Patterns resembling passwords, access keys, tokens, or private keys in document steps are flagged when values appear hardcoded rather than referenced securely.

Risk

Hardcoded secrets in SSM documents weaken CIA:
  • Confidentiality: readers of the document can exfiltrate credentials.
  • Integrity: stolen keys enable privilege escalation and automation tampering.
  • Availability: abused credentials can disrupt systems and impede recovery.

Recommendation

Avoid embedding secrets. Store them in Secrets Manager or Parameter Store as SecureString (KMS-encrypted) and reference at runtime. Apply least privilege to documents and secrets, prefer short-lived role credentials, rotate credentials, continuously scan/audit documents, and enforce separation of duties for authoring and approval.

Remediation

aws ssm update-document —name <example_resource_name> —content file://<SANITIZED_DOCUMENT_FILE>.json

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 = ssm_document_secrets. 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