Skip to content

Commit

Permalink
Modify fingerprints and update neuvector-mapper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jtquach1 committed Sep 19, 2024
1 parent aacdbe6 commit 80b65af
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 60 deletions.
6 changes: 3 additions & 3 deletions apps/frontend/src/store/report_intake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
TwistlockResults,
VeracodeMapper,
XCCDFResultsMapper,
ZapMapper,
ZapMapper
} from '@mitre/hdf-converters';
import axios from 'axios';
import {
Expand Down Expand Up @@ -284,8 +284,8 @@ export class InspecIntake extends VuexModule {
return new TrufflehogResults(convertOptions.data).toHdf();
case INPUT_TYPES.GRYPE:
return new AnchoreGrypeMapper(convertOptions.data).toHdf();
case INPUT_TYPES.NEUVECTOR:
return new NeuvectorMapper(convertOptions.data).toHdf();
case INPUT_TYPES.NEUVECTOR:
return new NeuvectorMapper(convertOptions.data).toHdf();
default:
return SnackbarModule.failure(
`Invalid file uploaded (${filename}), no fingerprints matched.`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,8 @@
"depends": [],
"groups": [],
"status": "loaded",
"controls": [
{
"key": "id",
"tags": {},
"descriptions": [],
"refs": [],
"source_location": {},
"title": null,
"id": "",
"desc": null,
"impact": 0,
"code": null,
"results": [
{
"status": "failed",
"code_desc": "",
"message": null,
"run_time": null,
"start_time": ""
}
]
}
],
"sha256": "4ab404f54ac68e77cca22f638b4ab695f2788f31f3a27fecf510b5e4cbe6d9b2"
"controls": [],
"sha256": "56a6f4affb2c6c6d22bd258b4e3a99b16880e93b4a99b128a244f91068f5269c"
}
],
"passthrough": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,8 @@
"depends": [],
"groups": [],
"status": "loaded",
"controls": [
{
"key": "id",
"tags": {},
"descriptions": [],
"refs": [],
"source_location": {},
"title": null,
"id": "",
"desc": null,
"impact": 0,
"code": null,
"results": [
{
"status": "failed",
"code_desc": "",
"message": null,
"run_time": null,
"start_time": ""
}
]
}
],
"sha256": "4ab404f54ac68e77cca22f638b4ab695f2788f31f3a27fecf510b5e4cbe6d9b2"
"controls": [],
"sha256": "56a6f4affb2c6c6d22bd258b4e3a99b16880e93b4a99b128a244f91068f5269c"
}
],
"passthrough": {
Expand Down
10 changes: 7 additions & 3 deletions libs/hdf-converters/src/neuvector-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ export class NeuvectorMapper extends BaseConverter {
status: 'loaded', //Insert data
controls: [
{
path: 'report.Vulnerabilities',
key: 'id',
tags: {}, //Insert data
tags: {
nist: ['RA-5', 'SA-10'],
cve: {path: 'name'}
}, //Insert data
descriptions: [], //Insert data
refs: [], //Insert data
source_location: {}, //Insert data
title: null, //Insert data
id: '', //Insert data
desc: null, //Insert data
id: {path: 'name'}, //Insert data
desc: {path: 'description'}, //Insert data
impact: 0, //Insert data
code: null, //Insert data
results: [
Expand Down
12 changes: 6 additions & 6 deletions libs/hdf-converters/src/utils/fingerprinting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const fileTypeFingerprints: Record<INPUT_TYPES, string[]> = {
[INPUT_TYPES.JFROG]: ['total_count', 'data'],
[INPUT_TYPES.MSFT_SEC_SCORE]: ['secureScore', 'profiles'],
[INPUT_TYPES.NEUVECTOR]: [
'verification_timestamp',
'feed_rating',
'cvedb_version',
'cvedb_create_time',
'signature_data'
'report.signature_data',
'report.signature_data.verification_timestamp',
'report.vulnerabilities[0].feed_rating',
'report.cvedb_version',
'report.cvedb_create_time'
],
[INPUT_TYPES.NIKTO]: ['banner', 'host', 'ip', 'port', 'vulnerabilities'],
[INPUT_TYPES.SARIF]: ['$schema', 'version', 'runs'],
Expand Down Expand Up @@ -94,7 +94,7 @@ const fileTypeFingerprints: Record<INPUT_TYPES, string[]> = {
[INPUT_TYPES.SCOUTSUITE]: [],
[INPUT_TYPES.VERACODE]: [],
[INPUT_TYPES.XCCDF]: [],
[INPUT_TYPES.NOT_FOUND]: [],
[INPUT_TYPES.NOT_FOUND]: []
};

export function fingerprint(guessOptions: {
Expand Down

0 comments on commit 80b65af

Please sign in to comment.