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
What is the current behavior?
When scanning a .yml file where a potential "Secret Keyword" secret is identified, it is added with an off by one line_number to the results (baseline). Running an audit on the baseline results in an ERROR: Secret not found on line x! where the line number is totally different than the line_number in the baseline.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Run the following command on pipeline-golden-database-backup.yml: detect-secrets scan pipeline-golden-database-backup.yml > .wrongLineNumber.secrets.baseline
Note that the one result in the baseline file identifies line 37 as the line with the potential "Secret Keyword" secret. I'm guessing that line 38 or 39 trigger the KeywordDetector plugin and line 37 is reported because of transformers?
Now run the audit on the baseline file with the following command: detect-secrets audit .wrongLineNumber.secrets.baseline
This gives me the following dialog, where the line number 5 seems totally off.
Secret: 1 of 1
Filename: pipeline-golden-database-backup.yml
Secret Type: Secret Keyword
----------
ERROR: Secret not found on line 5!
Try recreating your baseline to fix this issue.
----------
What would you like to do? (s)kip, (q)uit:
What is the expected behavior?
Scan result should contain either 38 or 39 as line_number. If that is not possible/hard to do because of the transformation, maybe a hint ("Secret may be in one of the following x lines") could be added?
Audit should work.
What is the motivation / use case for changing the behavior?
To correctly identify and audit secrets.
Please tell us about your environment:
detect-secrets Version: 1.5.0
Python Version: 3.12.6
OS Version: Windows 11 Enterprise 23H2
File type (if applicable): YAML
Other information
First time user of detect-secrets, thanks for making this available. I tried to check for existing issues and while I found some with off by one line numbers in the scan result, these are all closed. Hope I did not miss anything obvious.
The text was updated successfully, but these errors were encountered:
I'm submitting a ...
What is the current behavior?
When scanning a .yml file where a potential "Secret Keyword" secret is identified, it is added with an off by one line_number to the results (baseline). Running an audit on the baseline results in an
ERROR: Secret not found on line x!
where the line number is totally different than the line_number in the baseline.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
detect-secrets scan pipeline-golden-database-backup.yml > .wrongLineNumber.secrets.baseline
detect-secrets audit .wrongLineNumber.secrets.baseline
This gives me the following dialog, where the line number 5 seems totally off.
What is the expected behavior?
What is the motivation / use case for changing the behavior?
To correctly identify and audit secrets.
Please tell us about your environment:
Other information
First time user of detect-secrets, thanks for making this available. I tried to check for existing issues and while I found some with off by one line numbers in the scan result, these are all closed. Hope I did not miss anything obvious.
The text was updated successfully, but these errors were encountered: