AAK-SECRET-003: AWS credentials exposed
- Severity
- CRITICAL
- Category
- Secret Exposure (
secret-exposure) - Scanner
agent_audit_kit/scanners/secret_exposure.py- Auto-fixable
- No.
- SARIF name
AwsCredentialsExposed
What it detects
AWS access key ID or secret access key found in a project file.
How to fix
Delete the access key from the file and deactivate or rotate it in IAM, since it is exposed once committed. Then use an IAM role, AWS SSO or a secrets manager so that no static key is needed.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-SECRET-003
Limitations
Looks for an AKIA access key ID and for a secret key written as the lower-case assignment aws_secret_access_key = <40 characters>. The same secret as the upper-case environment variable, AWS_SECRET_ACCESS_KEY=<40 characters>, is not reported, so a file that holds the secret without its key ID is missed. In Markdown, a key shaped like a documentation stand-in (one repeated character after the prefix, a run of x, REPLACE, YOUR, EXAMPLE, PLACEHOLDER or CHANGEME in it, or the AWS IAM User Guide's example key) is skipped. A file over 1,000,000 bytes is not read.
References
- OWASP MCP Top 10: MCP01:2025 (Token Mismanagement & Secret Exposure)
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-TOKEN-05 (AWS Credential Exposure)
- CSA AI Controls Matrix (AICM): DSP-17
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-SECRET-003.md: the page then shows that text, with the registry reference appended under it.