Check ID: cloudwatch_log_group_no_secrets_in_logs
Provider: AWS
Service: cloudwatch
Severity: MEDIUM
Categories: secrets
Resource type: Other

What this check verifies

CloudWatch Logs log groups are analyzed for potential secrets embedded in log events across their streams. Detection flags patterns resembling credentials (API keys, passwords, tokens, keys) and reports the secret types and where they appear within the log group.

Risk

Leaked credentials in logs erode confidentiality and enable unauthorized API calls. Attackers reusing tokens/keys can escalate privileges, alter resources, and exfiltrate data. Subscriptions and exports widen exposure, and users with logs:Unmask can reveal values, increasing the blast radius.

Recommendation

Avoid logging secrets via application sanitization and data minimization. Apply CloudWatch data protection policies to audit and mask sensitive patterns. Enforce least privilege for log readers and restrict logs:Unmask. Rotate exposed keys, reduce retention, and monitor findings to validate controls.

Remediation

aws logs put-data-protection-policy --log-group-identifier <example_resource_name> --policy-document '{"Statement":[{"DataIdentifier":["arn:aws:dataprotection::aws:data-identifier/Credentials"],"Operation":{"Audit":{"FindingsDestination":{}}}},{"DataIdentifier":["arn:aws:dataprotection::aws:data-identifier/Credentials"],"Operation":{"Deidentify":{"MaskConfig":{}}}}]}'

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