-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Charles Hu <[email protected]>
- Loading branch information
1 parent
7b33d36
commit 744445a
Showing
4 changed files
with
340 additions
and
48 deletions.
There are no files selected for viewing
258 changes: 258 additions & 0 deletions
258
libs/hdf-converters/sample_jsons/gosec_mapper/gosec-hdf-withraw.json
This file contains 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,258 @@ | ||
{ | ||
"platform": { | ||
"name": "Heimdall Tools", | ||
"release": "2.10.8" | ||
}, | ||
"version": "2.10.8", | ||
"statistics": {}, | ||
"profiles": [ | ||
{ | ||
"name": "Gosec scanner", | ||
"title": "gosec", | ||
"version": "dev", | ||
"supports": [], | ||
"attributes": [], | ||
"groups": [], | ||
"status": "loaded", | ||
"controls": [ | ||
{ | ||
"tags": { | ||
"nist": ["SI-10"], | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"nosec": "", | ||
"suppressions": "", | ||
"confidence": "HIGH" | ||
}, | ||
"refs": [], | ||
"source_location": {}, | ||
"title": "Potential file inclusion via variable", | ||
"id": "G304", | ||
"desc": "", | ||
"impact": 0.5, | ||
"results": [ | ||
{ | ||
"status": "failed", | ||
"code_desc": "82: \t\tcase tar.TypeReg:\n83: \t\t\tf, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode))\n84: \t\t\tif err != nil {\n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\internal\\file\\tar.go, line:83, column:14", | ||
"start_time": "" | ||
}, | ||
{ | ||
"status": "failed", | ||
"code_desc": "51: \n52: \ttemplateContents, err := os.ReadFile(expandedPathToTemplateFile)\n53: \tif err != nil {\n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\presenter\\template\\presenter.go, line:52, column:27", | ||
"start_time": "" | ||
}, | ||
{ | ||
"status": "failed", | ||
"code_desc": "95: func isPossibleSBOM(userInput string) bool {\n96: \tf, err := os.Open(userInput)\n97: \tif err != nil {\n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\pkg\\syft_sbom_provider.go, line:96, column:12", | ||
"start_time": "" | ||
}, | ||
{ | ||
"status": "failed", | ||
"code_desc": "86: \n87: \tsbom, err := os.Open(expandedPath)\n88: \tif err != nil {\n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\pkg\\syft_sbom_provider.go, line:87, column:15", | ||
"start_time": "" | ||
}, | ||
{ | ||
"status": "failed", | ||
"code_desc": "18: \tdefault:\n19: \t\treportFile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n20: \n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\cmd\\report_writer.go, line:19, column:22", | ||
"start_time": "" | ||
} | ||
] | ||
}, | ||
{ | ||
"tags": { | ||
"nist": ["SI-2", "RA-5"], | ||
"cwe": { | ||
"id": "276", | ||
"url": "https://cwe.mitre.org/data/definitions/276.html" | ||
}, | ||
"nosec": "", | ||
"suppressions": "", | ||
"confidence": "HIGH" | ||
}, | ||
"refs": [], | ||
"source_location": {}, | ||
"title": "Expect file permissions to be 0600 or less", | ||
"id": "G302", | ||
"desc": "", | ||
"impact": 0.5, | ||
"results": [ | ||
{ | ||
"status": "failed", | ||
"code_desc": "18: \tdefault:\n19: \t\treportFile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n20: \n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\cmd\\report_writer.go, line:19, column:22", | ||
"start_time": "" | ||
} | ||
] | ||
}, | ||
{ | ||
"tags": { | ||
"nist": ["SI-2", "RA-5"], | ||
"cwe": { | ||
"id": "276", | ||
"url": "https://cwe.mitre.org/data/definitions/276.html" | ||
}, | ||
"nosec": "", | ||
"suppressions": "", | ||
"confidence": "HIGH" | ||
}, | ||
"refs": [], | ||
"source_location": {}, | ||
"title": "Expect directory permissions to be 0750 or less", | ||
"id": "G301", | ||
"desc": "", | ||
"impact": 0.5, | ||
"results": [ | ||
{ | ||
"status": "failed", | ||
"code_desc": "76: \t\t\tif _, err := os.Stat(target); err != nil {\n77: \t\t\t\tif err := os.MkdirAll(target, 0755); err != nil {\n78: \t\t\t\t\treturn fmt.Errorf(\"failed to mkdir (%s): %w\", target, err)\n", | ||
"message": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\internal\\file\\tar.go, line:77, column:15", | ||
"start_time": "" | ||
} | ||
] | ||
} | ||
], | ||
"sha256": "9109339ee9544698a40d378e6389f61273596593fa61f3aef97aa1a1cf58261c" | ||
} | ||
], | ||
"passthrough": { | ||
"auxiliary_data": [ | ||
{ | ||
"name": "Gosec", | ||
"data": { | ||
"Golang errors": {} | ||
} | ||
} | ||
], | ||
"raw": { | ||
"Golang errors": {}, | ||
"Issues": [ | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"rule_id": "G304", | ||
"details": "Potential file inclusion via variable", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\internal\\file\\tar.go", | ||
"code": "82: \t\tcase tar.TypeReg:\n83: \t\t\tf, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode))\n84: \t\t\tif err != nil {\n", | ||
"line": "83", | ||
"column": "14", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"rule_id": "G304", | ||
"details": "Potential file inclusion via variable", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\presenter\\template\\presenter.go", | ||
"code": "51: \n52: \ttemplateContents, err := os.ReadFile(expandedPathToTemplateFile)\n53: \tif err != nil {\n", | ||
"line": "52", | ||
"column": "27", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"rule_id": "G304", | ||
"details": "Potential file inclusion via variable", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\pkg\\syft_sbom_provider.go", | ||
"code": "95: func isPossibleSBOM(userInput string) bool {\n96: \tf, err := os.Open(userInput)\n97: \tif err != nil {\n", | ||
"line": "96", | ||
"column": "12", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"rule_id": "G304", | ||
"details": "Potential file inclusion via variable", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\grype\\pkg\\syft_sbom_provider.go", | ||
"code": "86: \n87: \tsbom, err := os.Open(expandedPath)\n88: \tif err != nil {\n", | ||
"line": "87", | ||
"column": "15", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "22", | ||
"url": "https://cwe.mitre.org/data/definitions/22.html" | ||
}, | ||
"rule_id": "G304", | ||
"details": "Potential file inclusion via variable", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\cmd\\report_writer.go", | ||
"code": "18: \tdefault:\n19: \t\treportFile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n20: \n", | ||
"line": "19", | ||
"column": "22", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "276", | ||
"url": "https://cwe.mitre.org/data/definitions/276.html" | ||
}, | ||
"rule_id": "G302", | ||
"details": "Expect file permissions to be 0600 or less", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\cmd\\report_writer.go", | ||
"code": "18: \tdefault:\n19: \t\treportFile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n20: \n", | ||
"line": "19", | ||
"column": "22", | ||
"nosec": false, | ||
"suppressions": null | ||
}, | ||
{ | ||
"severity": "MEDIUM", | ||
"confidence": "HIGH", | ||
"cwe": { | ||
"id": "276", | ||
"url": "https://cwe.mitre.org/data/definitions/276.html" | ||
}, | ||
"rule_id": "G301", | ||
"details": "Expect directory permissions to be 0750 or less", | ||
"file": "C:\\Users\\AGILLUM\\OneDrive - The MITRE Corporation\\Documents\\Code\\grype-0.34.4\\internal\\file\\tar.go", | ||
"code": "76: \t\t\tif _, err := os.Stat(target); err != nil {\n77: \t\t\t\tif err := os.MkdirAll(target, 0755); err != nil {\n78: \t\t\t\t\treturn fmt.Errorf(\"failed to mkdir (%s): %w\", target, err)\n", | ||
"line": "77", | ||
"column": "15", | ||
"nosec": false, | ||
"suppressions": null | ||
} | ||
], | ||
"Stats": { | ||
"files": 199, | ||
"lines": 12401, | ||
"nosec": 0, | ||
"found": 7 | ||
}, | ||
"GosecVersion": "dev" | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.