-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update Gitleaks to 8.18.1 and custom rules #85
Conversation
This looks awesome. I was able to update to this version with:
I think only The However, |
Passes local tests for me. |
Changes proposed in this pull request:
caulking
was flagging lines such as this as secrets because of the wordkeyword
:https://github.com/cloud-gov/logsearch-for-cloudfoundry/blob/develop/jobs/upload-kibana-objects/templates/kibana-objects/index-pattern/logs.json.erb#L10
I began exploring how to update our
local.toml
to ignore these false positives. Initially, I planned to leverage theregexTarget: "line
feature added in v8.16.0 to ignore any lines with"type":"keyword"
, so I updated to Gitleaks v8.18.1.But I was having issues with this repo's tests after upgrading to 8.18.1. It turns out that you need an
id
for every rule and that without that property, you get unexpected results.I was adding
id
attributes to all of our rules when I also discovered that you can have your custom config extend the default config that comes withgitleaks
. By doing this, we can eliminate all of the rules fromgitleaks
that we copied into our custom config as ofgitleaks
version 4.1.1 and instead just inherit them fromgitleaks
core. We also benefit from new rules that have been added togitleaks
core.Specifically, I removed the
Generic Credential
rule that now exists asgeneric-api-key
ingitleaks
core. Removing this rule and relying on the defaults fromgitleaks
resolved my initial issues.I did preserve some of our custom rules that didn't seem like they are covered in the upstream
gitleaks
core.caulking
will inherit all of the rules that are maintained upstream ingitleaks
(https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml), rather than us having to manually copy in those rulessecurity considerations
This is a pretty significant refactor of our configuration, but with definite security benefits:
gitleaks
coregitleaks
coremake audit
is passing with these changes, demonstrating that at least as far the tests demonstrate, these changes provide the same security guarantees.