Skip to content

Commit

Permalink
fix tests add violation test to parser
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Dec 12, 2024
1 parent 72c24b1 commit d632cb7
Show file tree
Hide file tree
Showing 18 changed files with 1,639 additions and 7,390 deletions.
2,581 changes: 0 additions & 2,581 deletions tests/testdata/output/audit/audit_results.json

This file was deleted.

1,397 changes: 439 additions & 958 deletions tests/testdata/output/audit/audit_sarif.json

Large diffs are not rendered by default.

1,438 changes: 267 additions & 1,171 deletions tests/testdata/output/audit/audit_simple_json.json

Large diffs are not rendered by default.

139 changes: 70 additions & 69 deletions tests/testdata/output/audit/audit_summary.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
{
"scans": [
{
"target": "/Users/user/ejs-frog-demo",
"vulnerabilities": {
"sca": {
"scan_ids": [
"711851ce-68c4-4dfd-7afb-c29737ebcb96"
],
"security": {
"Critical": {
"Applicable": 1,
"Not Applicable": 2
},
"High": {
"Not Applicable": 2
},
"Medium": {
"Not Applicable": 3,
"Not Covered": 3
},
"Unknown": {
"Not Covered": 1
}
}
},
"iac": {},
"secrets": {
"Medium": {
"": 3
}
},
"sast": {
"High": {
"": 1
},
"Low": {
"": 3
}
}
"scans": [
{
"target": "/Users/user/project-with-issues",
"vulnerabilities": {
"sca": {
"scan_ids": [
"711851ce-68c4-4dfd-7afb-c29737ebcb96"
],
"security": {
"High": {
"Undetermined": 1
},
"violations": {
"watches": [
"Security_watch_1"
],
"sca": {
"scan_ids": [
"711851ce-68c4-4dfd-7afb-c29737ebcb96"
],
"security": {
"Critical": {
"Applicable": 1,
"Not Applicable": 2
},
"High": {
"Not Applicable": 2
}
}
},
"iac": {},
"secrets": {
"Medium": {
"": 1
}
},
"sast": {
"High": {
"": 1
}
}
"Medium": {
"Applicable": 1,
"Undetermined": 1
},
"Unknown": {
"Applicable": 1
}
}
},
"iac": {
"High": {
"": 1
}
},
"secrets": {
"Medium": {
"": 2
}
},
"sast": {}
},
"violations": {
"watches": [
"security-watch",
"license-watch"
],
"sca": {
"scan_ids": [
"711851ce-68c4-4dfd-7afb-c29737ebcb96"
],
"security": {
"Medium": {
"Undetermined": 1
},
"Unknown": {
"Applicable": 1
}
},
"license": {
"High": {
"": 1
}
}
},
"iac": {},
"secrets": {
"Medium": {
"": 2
}
},
"sast": {
"High": {
"": 1
},
"Low": {
"": 1
}
}
]
}
}
]
}
1,124 changes: 0 additions & 1,124 deletions tests/testdata/output/dockerscan/docker_results.json

This file was deleted.

674 changes: 94 additions & 580 deletions tests/testdata/output/dockerscan/docker_sarif.json

Large diffs are not rendered by default.

686 changes: 81 additions & 605 deletions tests/testdata/output/dockerscan/docker_simple_json.json

Large diffs are not rendered by default.

88 changes: 38 additions & 50 deletions tests/testdata/output/dockerscan/docker_summary.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,44 @@
{
"scans": [
{
"target": "/var/folders/xv/th4cksxn7jv9wjrdnn1h4tj00000gq/T/jfrog.cli.temp.-1726210535-1985298017/image.tar",
"name": "platform.jfrog.io/swamp-docker/swamp:latest",
"vulnerabilities": {
"sca": {
"scan_ids": [
"27da9106-88ea-416b-799b-bc7d15783473"
],
"security": {
"Critical": {
"Not Applicable": 2,
"Not Covered": 1,
"Undetermined": 1
},
"Low": {
"Applicable": 1,
"Not Applicable": 1
},
"Unknown": {
"Applicable": 2
}
}
},
"iac": {},
"secrets": {
"Medium": {
"": 3
}
},
"sast": {}
},
"violations": {
"watches": [
"Security_watch_2"
"scans": [
{
"target": "temp/folders/T/jfrog.cli.temp.-11-11/image.tar",
"name": "platform.jfrog.io/swamp-docker/swamp:latest",
"vulnerabilities": {
"sca": {
"scan_ids": [
"27da9106-88ea-416b-799b-bc7d15783473"
],
"sca": {
"scan_ids": [
"27da9106-88ea-416b-799b-bc7d15783473"
],
"security": {
"Critical": {
"Undetermined": 1
}
}
},
"secrets": {
"Medium": {
"": 2
"security": {
"Critical": {
"Undetermined": 1
},
"Unknown": {
"Applicable": 1
}
}
},
"secrets": {
"Medium": {
"Inactive": 1
}
}
},
"violations": {
"watches": [
"security-watch",
"watch"
],
"sca": {
"scan_ids": [
"27da9106-88ea-416b-799b-bc7d15783473"
]
},
"secrets": {
"Medium": {
"Inactive": 1
}
}
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion utils/formats/sarifutils/sarifutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func GetToolVersion(run *sarif.Run) string {

func CopyRun(run *sarif.Run) *sarif.Run {
copy := CopyRunMetadata(run)
if copy.Tool.Driver != nil {
if run.Tool.Driver != nil {
copy.Tool.Driver.Rules = CopyRules(run.Tool.Driver.Rules...)
}
for _, result := range run.Results {
Expand Down
Loading

0 comments on commit d632cb7

Please sign in to comment.