Securityflags: g
AWS Access Key ID
Match AWS access key IDs (both long-term AKIA and temporary ASIA prefixes).
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
\b(?:AKIA|ASIA)[0-9A-Z]{16}\b (flags: g)Raw source: \b(?:AKIA|ASIA)[0-9A-Z]{16}\b
How it works
Starts with AKIA (long-term user key) or ASIA (short-term STS session key), followed by exactly 16 uppercase alphanumeric characters. Word boundaries prevent partial matches.
Examples
Input
AKIAIOSFODNN7EXAMPLEMatches
AKIAIOSFODNN7EXAMPLE
Input
ASIAIOSFODNN7EXAMPLEMatches
ASIAIOSFODNN7EXAMPLE
Input
not a keyNo match
—Common use cases
- •Secret scanning in git repos
- •Preventing accidental AWS credential commits
- •Log redaction pipelines
- •Security audit tooling
Related patterns
Generic API Key
SecurityMatch generic long alphanumeric tokens (32+ chars) typical of API keys and access tokens.
GitHub Personal Access Token
SecurityMatch GitHub Personal Access Tokens (classic + fine-grained) and OAuth tokens by their `ghX_` prefix.
PEM Private Key Block
SecurityMatch PEM-encoded private key blocks across the common variants (RSA, EC, DSA, OpenSSH, encrypted, PGP).
SSH Public Key
SecurityMatch SSH public keys in OpenSSH `authorized_keys` format, including the optional comment field.