-
Notifications
You must be signed in to change notification settings - Fork 44
feat(materials): add gitleaks json material type support #2693
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
Conversation
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
| } | ||
|
|
||
| var findings []GitleaksFinding | ||
| if err = json.Unmarshal(data, &findings); err != nil { |
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.
what kind of validation are we making here to make sure it's a gitleaks report?
Do we check the tool? Does the json output have any openAPI spec published? I believe we make spec validations in some of those materials.
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.
We can't check the tool, the report is returned as an json array [{},{}] there's no tool information attached. There's no offical schema published. I decided to do validation similar to GHAS_SECRET_SCAN where we unmarshal and then check for a required field
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Summary
This PR adds a new
GITLEAKS_JSONmaterial type. JSON report returned bygitleaksis an array of objects, for validation we unmarshal each finding and then check forfingerprintfieldCloses #2694