Commit be661227 authored by Fernando's avatar Fernando

Update fingerprint hash

* update fingerprint sha1

Undo cve hash

Update sast container fingerprint

Update vuln hash fingerprints

Remove uneeded unit test

Refactor fingerprints into const
parent b3fa2c43
...@@ -181,7 +181,7 @@ export const parseDependencyScanningIssues = (report = [], feedback = [], path = ...@@ -181,7 +181,7 @@ export const parseDependencyScanningIssues = (report = [], feedback = [], path =
const parsed = { const parsed = {
...adaptDeprecatedIssueFormat(issue), ...adaptDeprecatedIssueFormat(issue),
category: 'dependency_scanning', category: 'dependency_scanning',
project_fingerprint: sha1(issue.cve || issue.message), project_fingerprint: sha1(issue.cve),
title: issue.message, title: issue.message,
}; };
......
...@@ -156,9 +156,7 @@ export const parseSastContainer = (issues = [], feedback = [], image) => ...@@ -156,9 +156,7 @@ export const parseSastContainer = (issues = [], feedback = [], image) =>
before switching to the Backend implementation before switching to the Backend implementation
*/ */
const frontendOnly = { const frontendOnly = {
project_fingerprint: sha1( project_fingerprint: sha1(issue.vulnerability),
`${issue.namespace}:${issue.vulnerability}:${issue.featurename}:${issue.featureversion}`,
),
title: message, title: message,
vulnerability: issue.vulnerability, vulnerability: issue.vulnerability,
}; };
......
const libTiffCveFingerprint = 'e503c23a7776dd5e2c35ac63c8cce6b6468be9ba';
const libTiffCveFingerprint2 = '29af456d1107381bc2511646e2ae488ddfe9a8ed';
export const baseIssues = [ export const baseIssues = [
{ {
categories: ['Security'], categories: ['Security'],
...@@ -697,7 +700,7 @@ export const parsedSastContainerBaseStore = [ ...@@ -697,7 +700,7 @@ export const parsedSastContainerBaseStore = [
value: 'CVE-2014-8130', value: 'CVE-2014-8130',
}, },
], ],
project_fingerprint: '20a19f706d82cec1c04d1c9a8858e89b142d602f', project_fingerprint: 'e1f22cd89e3c306541d7c804b29255b5cc275d6d',
title: 'CVE-2014-8130', title: 'CVE-2014-8130',
vulnerability: 'CVE-2014-8130', vulnerability: 'CVE-2014-8130',
}, },
...@@ -780,7 +783,7 @@ export const dockerNewIssues = [ ...@@ -780,7 +783,7 @@ export const dockerNewIssues = [
url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16232', url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16232',
}, },
], ],
project_fingerprint: '4e010f6d292364a42c6bb05dbd2cc788c2e5e408', project_fingerprint: libTiffCveFingerprint,
title: 'CVE-2017-16232', title: 'CVE-2017-16232',
vulnerability: 'CVE-2017-16232', vulnerability: 'CVE-2017-16232',
}, },
...@@ -804,7 +807,7 @@ export const dockerOnlyHeadParsed = [ ...@@ -804,7 +807,7 @@ export const dockerOnlyHeadParsed = [
url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12944', url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12944',
}, },
], ],
project_fingerprint: '0693a82ef93c5e9d98c23a35ddcd8ed2cbd047d9', project_fingerprint: libTiffCveFingerprint2,
title: 'CVE-2017-12944', title: 'CVE-2017-12944',
vulnerability: 'CVE-2017-12944', vulnerability: 'CVE-2017-12944',
}, },
...@@ -825,7 +828,7 @@ export const dockerOnlyHeadParsed = [ ...@@ -825,7 +828,7 @@ export const dockerOnlyHeadParsed = [
url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16232', url: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16232',
}, },
], ],
project_fingerprint: '4e010f6d292364a42c6bb05dbd2cc788c2e5e408', project_fingerprint: libTiffCveFingerprint,
title: 'CVE-2017-16232', title: 'CVE-2017-16232',
vulnerability: 'CVE-2017-16232', vulnerability: 'CVE-2017-16232',
}, },
...@@ -1466,7 +1469,7 @@ export const containerScanningFeedbacks = [ ...@@ -1466,7 +1469,7 @@ export const containerScanningFeedbacks = [
category: 'container_scanning', category: 'container_scanning',
feedback_type: 'dismissal', feedback_type: 'dismissal',
branch: 'try_new_container_scanning', branch: 'try_new_container_scanning',
project_fingerprint: '0693a82ef93c5e9d98c23a35ddcd8ed2cbd047d9', project_fingerprint: libTiffCveFingerprint2,
}, },
{ {
id: 4, id: 4,
...@@ -1477,6 +1480,6 @@ export const containerScanningFeedbacks = [ ...@@ -1477,6 +1480,6 @@ export const containerScanningFeedbacks = [
category: 'container_scanning', category: 'container_scanning',
feedback_type: 'issue', feedback_type: 'issue',
branch: 'try_new_container_scanning', branch: 'try_new_container_scanning',
project_fingerprint: '0693a82ef93c5e9d98c23a35ddcd8ed2cbd047d9', project_fingerprint: libTiffCveFingerprint2,
}, },
]; ];
...@@ -213,16 +213,6 @@ describe('security reports utils', () => { ...@@ -213,16 +213,6 @@ describe('security reports utils', () => {
expect(parsed.urlPath).toEqual('path/Gemfile.lock'); expect(parsed.urlPath).toEqual('path/Gemfile.lock');
}); });
it('uses message to generate sha1 when cve is undefined', () => {
const issuesWithoutCve = dependencyScanningIssuesOld.map(issue => ({
...issue,
cve: undefined,
}));
const parsed = parseDependencyScanningIssues(issuesWithoutCve, [], 'path')[0];
expect(parsed.project_fingerprint).toEqual(sha1(dependencyScanningIssuesOld[0].message));
});
it('includes vulnerability feedbacks', () => { it('includes vulnerability feedbacks', () => {
const parsed = parseDependencyScanningIssues( const parsed = parseDependencyScanningIssues(
dependencyScanningIssuesOld, dependencyScanningIssuesOld,
...@@ -333,11 +323,7 @@ describe('security reports utils', () => { ...@@ -333,11 +323,7 @@ describe('security reports utils', () => {
}, },
]); ]);
expect(parsed.project_fingerprint).toEqual( expect(parsed.project_fingerprint).toEqual(sha1(issue.vulnerability));
sha1(
`${issue.namespace}:${issue.vulnerability}:${issue.featurename}:${issue.featureversion}`,
),
);
}); });
it('includes vulnerability feedbacks', () => { it('includes vulnerability feedbacks', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment