-
Notifications
You must be signed in to change notification settings - Fork 15
fix: remove duplicate rules from SARIF output #583
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
45 changes: 45 additions & 0 deletions
45
internal/presenters/testdata/ufm/secrets.duplicated-sarif-rules.human.readable
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| [1mTesting () ...[0m | ||
|
|
||
| [1mOpen Secrets issues: 5[0m | ||
|
|
||
| ✗ [31m[HIGH][0m [1mGeneric Secret Key[0m | ||
| Finding ID: 00000000-0000-0000-0000-000000000000 | ||
| Info: Detected a generic secret, which could lead to unauthorized access and sensitive data exposure. | ||
| Path: generic/file with spaces, line 2 to 2 | ||
| Path: generic/file with spaces, line 3 to 3 | ||
|
|
||
| ✗ [31m[HIGH][0m [1mGeneric Secret Key[0m | ||
| Finding ID: 00000000-0000-0000-0000-000000000001 | ||
| Info: Detected a generic secret, which could lead to unauthorized access and sensitive data exposure. | ||
| Path: generic/secret, line 2 to 2 | ||
| Path: generic/secret, line 3 to 3 | ||
|
|
||
| ✗ [31m[HIGH][0m [1mGeneric Secret Key[0m | ||
| Finding ID: 00000000-0000-0000-0000-000000000002 | ||
| Info: Detected a generic secret, which could lead to unauthorized access and sensitive data exposure. | ||
| Path: generic/config.json, line 2 to 2 | ||
| Path: generic/config.json, line 3 to 3 | ||
| Path: generic/config.json, line 4 to 4 | ||
|
|
||
| ✗ [31m[HIGH][0m [1mGeneric Secret Key[0m | ||
| Finding ID: 00000000-0000-0000-0000-000000000003 | ||
| Info: Detected a generic secret, which could lead to unauthorized access and sensitive data exposure. | ||
| Path: generic/file with spaces, line 1 to 1 | ||
|
|
||
| ✗ [31m[HIGH][0m [1mGeneric Secret Key[0m | ||
| Finding ID: 00000000-0000-0000-0000-000000000004 | ||
| Info: Detected a generic secret, which could lead to unauthorized access and sensitive data exposure. | ||
| Path: generic/secret, line 1 to 1 | ||
|
|
||
| ╭─────────────────────────────────────────────────────────╮ | ||
| │ [1mTest Summary[0m │ | ||
| │ │ | ||
| │ Organization: My Org │ | ||
| │ Test type: Secret Detection │ | ||
| │ Project path: │ | ||
| │ │ | ||
| │ Total secrets issues: 5 │ | ||
| │ Ignored: [1m0[0m [[35m 0 CRITICAL [0m[31m 0 HIGH [0m[33m 0 MEDIUM [0m 0 LOW ] │ | ||
| │ Open : [1m5[0m [[35m 0 CRITICAL [0m[31m 5 HIGH [0m[33m 0 MEDIUM [0m 0 LOW ] │ | ||
| ╰─────────────────────────────────────────────────────────╯ | ||
|
|
169 changes: 169 additions & 0 deletions
169
internal/presenters/testdata/ufm/secrets.duplicated-sarif-rules.sarif.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| { | ||
| "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", | ||
| "runs": [ | ||
| { | ||
| "automationDetails": { | ||
| "id": "Snyk/Secrets/0/*" | ||
| }, | ||
| "results": [ | ||
| { | ||
| "fingerprints": { | ||
| "identity": "00000000-0000-0000-0000-000000000002", | ||
| "snyk/asset/finding/v1": "00000000-0000-0000-0000-000000000002" | ||
| }, | ||
| "level": "error", | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "artifactLocation": { | ||
| "uri": "generic/config.json" | ||
| }, | ||
| "region": { | ||
| "endColumn": 48, | ||
| "endLine": 2, | ||
| "startColumn": 16, | ||
| "startLine": 2 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "message": { | ||
| "text": "This file contains a high severity Generic Secret Key vulnerability." | ||
| }, | ||
| "ruleId": "generic-secret" | ||
| }, | ||
| { | ||
| "fingerprints": { | ||
| "identity": "00000000-0000-0000-0000-000000000000", | ||
| "snyk/asset/finding/v1": "00000000-0000-0000-0000-000000000000" | ||
| }, | ||
| "level": "error", | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "artifactLocation": { | ||
| "uri": "generic/file with spaces" | ||
| }, | ||
| "region": { | ||
| "endColumn": 99, | ||
| "endLine": 2, | ||
| "startColumn": 11, | ||
| "startLine": 2 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "message": { | ||
| "text": "This file contains a high severity Generic Secret Key vulnerability." | ||
| }, | ||
| "ruleId": "generic-secret" | ||
| }, | ||
| { | ||
| "fingerprints": { | ||
| "identity": "00000000-0000-0000-0000-000000000003", | ||
| "snyk/asset/finding/v1": "00000000-0000-0000-0000-000000000003" | ||
| }, | ||
| "level": "error", | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "artifactLocation": { | ||
| "uri": "generic/file with spaces" | ||
| }, | ||
| "region": { | ||
| "endColumn": 29, | ||
| "endLine": 1, | ||
| "startColumn": 9, | ||
| "startLine": 1 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "message": { | ||
| "text": "This file contains a high severity Generic Secret Key vulnerability." | ||
| }, | ||
| "ruleId": "generic-secret" | ||
| }, | ||
| { | ||
| "fingerprints": { | ||
| "identity": "00000000-0000-0000-0000-000000000001", | ||
| "snyk/asset/finding/v1": "00000000-0000-0000-0000-000000000001" | ||
| }, | ||
| "level": "error", | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "artifactLocation": { | ||
| "uri": "generic/secret" | ||
| }, | ||
| "region": { | ||
| "endColumn": 99, | ||
| "endLine": 2, | ||
| "startColumn": 11, | ||
| "startLine": 2 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "message": { | ||
| "text": "This file contains a high severity Generic Secret Key vulnerability." | ||
| }, | ||
| "ruleId": "generic-secret" | ||
| }, | ||
| { | ||
| "fingerprints": { | ||
| "identity": "00000000-0000-0000-0000-000000000004", | ||
| "snyk/asset/finding/v1": "00000000-0000-0000-0000-000000000004" | ||
| }, | ||
| "level": "error", | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "artifactLocation": { | ||
| "uri": "generic/secret" | ||
| }, | ||
| "region": { | ||
| "endColumn": 29, | ||
| "endLine": 1, | ||
| "startColumn": 9, | ||
| "startLine": 1 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "message": { | ||
| "text": "This file contains a high severity Generic Secret Key vulnerability." | ||
| }, | ||
| "ruleId": "generic-secret" | ||
| } | ||
| ], | ||
| "tool": { | ||
| "driver": { | ||
| "informationUri": "https://docs.snyk.io/", | ||
| "name": "Snyk Secrets", | ||
| "rules": [ | ||
| { | ||
| "help": { | ||
| "markdown": "Detected a generic secret, which could lead to unauthorized access and sensitive data exposure.", | ||
| "text": "" | ||
| }, | ||
| "id": "generic-secret", | ||
| "properties": { | ||
| "tags": [ | ||
| "CWE-798", | ||
| "security" | ||
| ] | ||
| }, | ||
| "shortDescription": { | ||
| "text": "Generic Secret Key" | ||
| } | ||
| } | ||
| ], | ||
| "semanticVersion": "1.1301.0", | ||
| "version": "1.1301.0" | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "version": "2.1.0" | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.