@eurekadevsecops/radar 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/scan.js +1 -1
- package/src/util/sarif/transforms/normalize.js +12 -16
- package/scan.sarif +0 -1
package/package.json
CHANGED
package/src/commands/scan.js
CHANGED
|
@@ -180,7 +180,7 @@ module.exports = {
|
|
|
180
180
|
SARIF.transforms.normalize(results.sarif, target, metadata, git.root(target))
|
|
181
181
|
|
|
182
182
|
// Write findings to the destination SARIF file.
|
|
183
|
-
if (outfile) fs.writeFileSync(outfile, JSON.stringify(results.sarif))
|
|
183
|
+
if (outfile) fs.writeFileSync(outfile, JSON.stringify(results.sarif, null, 2))
|
|
184
184
|
|
|
185
185
|
// Send telemetry: scan results.
|
|
186
186
|
if (telemetry.enabled && scanID) {
|
|
@@ -3,34 +3,30 @@ module.exports = (sarif, dir, git, root) => {
|
|
|
3
3
|
// Normalize findings.
|
|
4
4
|
for (const run of sarif.runs) {
|
|
5
5
|
|
|
6
|
+
// Subfolder within the repo root where the scan took place:
|
|
7
|
+
const subfolder = path.relative(root, dir)
|
|
8
|
+
|
|
6
9
|
// Record the source repo location and the relative target subfolder within the repo.
|
|
7
|
-
run.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
text: "Source origin for the target being scanned (ie. git repo URL)."
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
TARGET: {
|
|
15
|
-
uri: `${path.relative(root, dir)}`,
|
|
16
|
-
uriBaseId: "SOURCE",
|
|
17
|
-
description: {
|
|
18
|
-
text: "Scan target (subfolder) within the source repo or folder."
|
|
19
|
-
}
|
|
10
|
+
run.properties = {
|
|
11
|
+
repository: {
|
|
12
|
+
type: 'git',
|
|
13
|
+
url: git.repo.url.https
|
|
20
14
|
}
|
|
21
15
|
}
|
|
16
|
+
if (subfolder) run.properties.includedirs = [ `${subfolder}` ]
|
|
22
17
|
|
|
23
|
-
// Make all physical locations for the result relative to the
|
|
18
|
+
// Make all physical locations for the result relative to the repo root directory.
|
|
19
|
+
// (or if the root is not available then to the scan directory)
|
|
24
20
|
if (!run.results) continue
|
|
25
21
|
for (const result of run.results) {
|
|
26
22
|
for (const location of result.locations) {
|
|
27
23
|
if (location.physicalLocation?.artifactLocation?.uri?.startsWith('/app')) {
|
|
28
|
-
let file = path.relative('/app', location.physicalLocation.artifactLocation.uri)
|
|
24
|
+
let file = path.join(subfolder, path.relative('/app', location.physicalLocation.artifactLocation.uri))
|
|
29
25
|
if (result?.message?.text) result.message.text = result.message.text.replace(location.physicalLocation.artifactLocation.uri, file)
|
|
30
26
|
location.physicalLocation.artifactLocation.uri = file
|
|
31
27
|
}
|
|
32
28
|
else if (location.physicalLocation?.artifactLocation?.uri?.startsWith('/')) {
|
|
33
|
-
let file = path.relative('/', location.physicalLocation.artifactLocation.uri)
|
|
29
|
+
let file = path.join(subfolder, path.relative('/', location.physicalLocation.artifactLocation.uri))
|
|
34
30
|
if (result?.message?.text) result.message.text = result.message.text.replace(location.physicalLocation.artifactLocation.uri, file)
|
|
35
31
|
location.physicalLocation.artifactLocation.uri = file
|
|
36
32
|
}
|
package/scan.sarif
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0.json","runs":[{"tool":{"driver":{"name":"abcgitleaks","semanticVersion":"v8.0.0","informationUri":"https://github.com/gitleaks/gitleaks","properties":{"officialName":"gitleaks"},"rules":[]}},"results":[],"originalUriBaseIds":{"SOURCE":{"uri":"https://github.com/EurekaDevSecOps/radarctl.git","description":{"text":"Source origin for the target being scanned (ie. git repo URL)."}},"TARGET":{"uri":"","uriBaseId":"SOURCE","description":{"text":"Scan target (subfolder) within the source repo or folder."}}}},{"tool":{"driver":{"name":"abcgrype","informationUri":"https://github.com/anchore/grype","properties":{"officialName":"grype"},"rules":[{"id":"GHSA-pfrx-2q88-qq97-got","name":"JavascriptMatcherExactDirectMatch","shortDescription":{"text":"GHSA-pfrx-2q88-qq97 medium vulnerability for got package"},"fullDescription":{"text":"Got allows a redirect to a UNIX socket"},"helpUri":"https://github.com/anchore/grype","help":{"text":"Vulnerability GHSA-pfrx-2q88-qq97\nSeverity: medium\nPackage: got\nVersion: 9.6.0\nFix Version: 11.8.5\nType: npm\nLocation: /package-lock.json\nData Namespace: github:language:javascript\nLink: [GHSA-pfrx-2q88-qq97](https://github.com/advisories/GHSA-pfrx-2q88-qq97)","markdown":"**Vulnerability GHSA-pfrx-2q88-qq97**\n| Severity | Package | Version | Fix Version | Type | Location | Data Namespace | Link |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| medium | got | 9.6.0 | 11.8.5 | npm | /package-lock.json | github:language:javascript | [GHSA-pfrx-2q88-qq97](https://github.com/advisories/GHSA-pfrx-2q88-qq97) |\n"},"properties":{"purls":["pkg:npm/got@9.6.0"],"security-severity":"5.3"}}]}},"results":[{"ruleId":"GHSA-pfrx-2q88-qq97-got","level":"warning","message":{"text":"A medium vulnerability in npm package: got, version 9.6.0 was found at: package-lock.json"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"package-lock.json"},"region":{"startLine":1,"startColumn":1,"endLine":1,"endColumn":1}}}],"partialFingerprints":{"primaryLocationLineHash":"677706e2c84cd6dfb855b123e8a34db12a8f4eeb5df5b8ab253aa5299b80da0b:1"}}],"originalUriBaseIds":{"SOURCE":{"uri":"https://github.com/EurekaDevSecOps/radarctl.git","description":{"text":"Source origin for the target being scanned (ie. git repo URL)."}},"TARGET":{"uri":"","uriBaseId":"SOURCE","description":{"text":"Scan target (subfolder) within the source repo or folder."}}}},{"tool":{"driver":{"name":"abcopengrep","semanticVersion":"1.5.0","properties":{"officialName":"Opengrep OSS"},"rules":[]}},"invocations":[{"executionSuccessful":true,"toolExecutionNotifications":[]}],"results":[],"originalUriBaseIds":{"SOURCE":{"uri":"https://github.com/EurekaDevSecOps/radarctl.git","description":{"text":"Source origin for the target being scanned (ie. git repo URL)."}},"TARGET":{"uri":"","uriBaseId":"SOURCE","description":{"text":"Scan target (subfolder) within the source repo or folder."}}}}]}
|