Some secret detection regexes expect the value to be surrounded by quotes #6787
Labels
kind/bug
Categorizes issue or PR as related to a bug.
scan/secret
Issues relating to secret scanning
Discussed in #6785
Originally posted by asankov May 27, 2024
Description
I am playing around with the secret detection features and I see that some matchers like
grafana-api-token
,hashicorp-tf-api-token
and others expect that the value of the token is surrounded by quotes['\"]
.This means that If I have a file like this:
or
the value would not be detected by the scanner.
What is the reason to expect them to be like that?
Desired Behavior
The token is matched regardless of whether the value is surrounded by quotes or not.
Actual Behavior
Token is not matched unless value is in quotes.
Reproduction Steps
1. Create a YAML or .env file similar to the one I provided in the description of the issue. 2. Run it via the secret detector 3. Observe that no findings are reported
Target
Filesystem
Scanner
Secret
Output Format
None
Mode
None
Debug Output
Operating System
macOS
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: