Ignore line extraction on historic scans
What does this MR do?
This MR fixes the bug described here: gitlab-org/gitlab#223565 (closed). SECRET_DETECTION_HISTORIC_SCAN
was causing the analyzer to fail due to the scanners trying to extract the line number from non-existing files. This bug arises when a secret is detected somewhere in the git history, but later the file that contains that secret is deleted. This MR adds some logic to prevent that from happening.
I also did a little refactoring to consolidate some items into the scanner/scanner.go
file.
What are the relevant issue numbers?
gitlab-org/gitlab#223565 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Lucas Charles