You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
infisical scan (0.43.136+) never reports an AWS access key ID that has no secret within 5 lines #428
Version: CLI 0.43.136 through 0.43.141 (betterleaks engine). 0.43.135 (gitleaks engine) is not affected.
Since #406 vendored betterleaks 1.8.1, infisical scan no longer reports an AWS access key ID unless an AWS secret access key sits within 5 lines of it in the same file. This holds at every --confidence level, so a key ID alone in a .env, a ~/.aws/credentials file, a JSON/YAML config, a URL, or a log line is never reported.
Same with --confidence low or high. Adding AWS_SECRET_ACCESS_KEY=<40 chars> on the next line makes the key ID appear again, with the secret nested under ComponentSets.
Measured on 30 random samples x 19 lone-key shapes (env, ini, json, yaml, URL, boto3 kwargs, aws configure set, Terraform, properties, ...): 570/570 reported by 0.43.135, 0/570 by 0.43.141.
Cause
Upstream: the aws-access-token rule became a composite in betterleaks/betterleaks#53, requiring an aws-secret-access-key component (within = "5L", skipReport = true); see detect/config/betterleaks.toml:739-818 at v0.43.141. When the component is missing, the primary finding is dropped in detect/detect.go (hasAllRequiredComponents) before confidence filtering. Reported upstream as betterleaks/betterleaks#408 with a fix in betterleaks/betterleaks#409: a standalone medium-confidence aws-access-key-id rule that leaves the composite untouched.
Separately, the default --confidence medium drops lone AWS secret access keys, generic API keys and passwords, because betterleaks rates its generic rules low. That one is a documented trade-off rather than a bug, but it compounds this gap for anyone who moved from 0.43.135 expecting the same findings.
Proposed fix
Re-vendor once the upstream fix is released, or cherry-pick the 21-line aws-access-key-id block into detect/config/betterleaks.toml. I tested that block against a rebuild of v0.43.141: lone key IDs went from 0/570 to 570/570, paired keys were unchanged, and 4,428 secret-free files produced no new findings. Happy to open the PR once you're OK with the approach.
FYI, upstream betterleaks fixed this by marking the secret component as optional on the aws-access-token rule, in commit c613797 (always report access keys). The vendored detect/config/betterleaks.toml here predates that. I tried the same one line change locally: a lone key is reported under the existing aws-access-token rule, and a key with a nearby secret still gives exactly one finding, with the EXAMPLE and low entropy filters still working. I am not opening a competing PR since one is already open, but I am happy to share the test cases if they would help.
Activity
Krish6115 commentedon Oct 30, 2026
FYI, upstream betterleaks fixed this by marking the secret component as optional on the aws-access-token rule, in commit c613797 (always report access keys). The vendored detect/config/betterleaks.toml here predates that. I tried the same one line change locally: a lone key is reported under the existing aws-access-token rule, and a key with a nearby secret still gives exactly one finding, with the EXAMPLE and low entropy filters still working. I am not opening a competing PR since one is already open, but I am happy to share the test cases if they would help.