ENG-14840: Ignore harmless sec warnings#4
Merged
rodolforeitz merged 8 commits intomainfrom Feb 14, 2025
Merged
Conversation
added 4 commits
February 14, 2025 17:46
yoursnerdly
reviewed
Feb 14, 2025
yoursnerdly
left a comment
There was a problem hiding this comment.
Can you please fix the workflow file so it triggers on PR/push to main?
bootstrap/bootstrap.go
Outdated
| return err | ||
| } | ||
| return ioutil.WriteFile(g.OutName, out, 0644) | ||
| return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- Auto code generation. |
There was a problem hiding this comment.
Suggested change
| return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- Auto code generation. | |
| return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- autogenerated code file, 0644 is fine. |
Author
There was a problem hiding this comment.
There was a problem hiding this comment.
I meant that the file being written here is autogenerated code file.
added 2 commits
February 14, 2025 18:20
yoursnerdly
reviewed
Feb 14, 2025
There was a problem hiding this comment.
We can delete the step test-non-amd64 as we don't use the library on anything other than amd64. The check is failing and it does not seem worthwhile to invest time in it.
yoursnerdly
approved these changes
Feb 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gosec -fmt=sonarqube -exclude-generated -out secreport.json ./...after
{ "issues": [] }before:
{ "issues": [ { "engineId": "gosec", "ruleId": "G304", "primaryLocation": { "message": "Potential file inclusion via variable", "filePath": "parser/pkgpath.go", "textRange": { "startLine": 114, "endLine": 114 } }, "type": "VULNERABILITY", "severity": "MAJOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G306", "primaryLocation": { "message": "Expect WriteFile permissions to be 0600 or less", "filePath": "bootstrap/bootstrap.go", "textRange": { "startLine": 215, "endLine": 215 } }, "type": "VULNERABILITY", "severity": "MAJOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G103", "primaryLocation": { "message": "Use of unsafe calls should be audited", "filePath": "jlexer/bytestostr.go", "textRange": { "startLine": 20, "endLine": 20 } }, "type": "VULNERABILITY", "severity": "MINOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G103", "primaryLocation": { "message": "Use of unsafe calls should be audited", "filePath": "helpers.go", "textRange": { "startLine": 47, "endLine": 47 } }, "type": "VULNERABILITY", "severity": "MINOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G103", "primaryLocation": { "message": "Use of unsafe calls should be audited", "filePath": "buffer/pool.go", "textRange": { "startLine": 55, "endLine": 55 } }, "type": "VULNERABILITY", "severity": "MINOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G104", "primaryLocation": { "message": "Errors unhandled", "filePath": "gen/generator.go", "textRange": { "startLine": 78, "endLine": 78 } }, "type": "VULNERABILITY", "severity": "MINOR", "effortMinutes": 5 }, { "engineId": "gosec", "ruleId": "G104", "primaryLocation": { "message": "Errors unhandled", "filePath": "bootstrap/bootstrap.go", "textRange": { "startLine": 199, "endLine": 199 } }, "type": "VULNERABILITY", "severity": "MINOR", "effortMinutes": 5 } ] }