-
Notifications
You must be signed in to change notification settings - Fork 0
/
VulnerabilityInfo.js
43 lines (35 loc) · 1.19 KB
/
VulnerabilityInfo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//IASTIGNORE
/*
* ****************************************************
* Licensed Materials - Property of HCL.
* (c) Copyright HCL Technologies Ltd. 2017, 2024.
* Note to U.S. Government Users *Restricted Rights.
* ****************************************************
*/
'use strict'
const SessionTracker = require("./SessionTracker");
const Utils = require("./Utils/Utils");
const {ConfigInfo} = require("./ConfigFile/ConfigInfo");
function VulnerabilityInfo (requestInfo, entity, v, hash, stack, timestamp, additionalInfoObj) {
this.id = hash
this['agent-type'] = "NodeJS"
this['issue-type'] = {
ref: v
}
this['additionalInfo'] = additionalInfoObj == null ? undefined : additionalInfoObj
let newEntity = entity
if (ConfigInfo.ConfigInfo.hidePasswords && SessionTracker.isPasswordName(entity.name)){
newEntity = Object.assign({}, entity);
newEntity.value = Utils.PASSWORD_TEXT
}
this['variant-group'] = [
{
id: '1',
request: requestInfo != null ? requestInfo.getInfoForReporting() : null,
entity: newEntity,
'call-trace': stack
}
]
this.timestamp = timestamp
}
module.exports = VulnerabilityInfo