Skip to content
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

Fix sarif formatting issues #565

Merged
merged 4 commits into from Feb 5, 2021

Conversation

DimaSalakhov
Copy link
Contributor

closes #563

PR attempts to fix issues formatting issues with produced SARIF report.
Covered changes:

  1. Use running tip version of the SARIF $schema
  2. tool declares it's version. Used the same version as the $schema, might not be ideal but that fixes the immediate problem of invalid SARIF schema. The other option could be passing through commit SHA or gosec module version.
  3. tool's rules couldn't be duplicated
  4. results' locations array should have only a single entry (https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317650).

output/formatter.go Show resolved Hide resolved
output/formatter.go Show resolved Hide resolved
output/formatter.go Outdated Show resolved Hide resolved
output/formatter.go Show resolved Hide resolved
@ccojocar ccojocar merged commit 6c57ae1 into securego:master Feb 5, 2021
kirbyquerby added a commit to orijtech/gosec that referenced this pull request Sep 15, 2022
This change is based on securego/gosec#565 .

Fixes include:
* add a version field to the driver
* report start and end line of issues
* report correct sarif level based on the issue's reported severity rather than always warning
* avoid duplicate entries in rules

Updates cosmos#38
kirbyquerby added a commit to cosmos/gosec that referenced this pull request Sep 15, 2022
This change is based on securego/gosec#565 .

Fixes include:
* add a version field to the driver
* report start and end line of issues
* report correct sarif level based on the issue's reported severity rather than always warning
* avoid duplicate entries in rules

Updates #38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gosec is generating invalid sarif files
2 participants