-
Notifications
You must be signed in to change notification settings - Fork 25
fix: correct regex anchor #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
0fe47da
to
4fdbe8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we try to slim down the code that we are importing and do our specific logic after detection or before detection on our wrapper?
) | ||
|
||
// Detector is the main detector struct | ||
type Detector struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a wrapper, hold a pointer to the gileaks detector and leave the most of it to the gitleaks detector. Only pull something to here if absolutely necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same for the other structs.
if runtime.GOOS == "windows" { | ||
executable += ".exe" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we avoid this? The tests will run on linux always on CI/CD and locally its nice if you develop making sure that the tests will pass on CI/CD. To fix this for your side, you should just run the tests on WSL.
- be73c0549f927433e81284de4b3d1094fc3e0e20 # engine/engine_test.go - generic-api-key | ||
- 234b995eeac64bf996c32397906ff8ce1aacbe10 # engine/engine_test.go - jfrog-api-key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have some ids repeated (they changed IDs between commits but they refer to the same secret). Can you completely clean your changes in this file and run 2ms so you can add them in one go to avoid cluttering the file unecessarily.
Closes #307
Proposed Changes
$
stopped matching end-of-line in multi-line files, which affected detection of secrets stored on a single line (e.g., in files namedPASSWORD
orSECRET
).regexp.MustCompile("\n|$").FindAllStringIndex(fragment.Raw, -1)
,so that
$
in regex rules continues to match end-of-line as expected.$
for line endings.detect
logic into our own codebase, allowing us to adjust and maintain the detection behavior as required.Checklist