@hclsoftware/secagent
Version:
IAST agent
52 lines (40 loc) • 1.3 kB
JavaScript
//IASTIGNORE
/*
* ****************************************************
* Licensed Materials - Property of HCL.
* (c) Copyright HCL Technologies Ltd. 2017, 2025.
* Note to U.S. Government Users *Restricted Rights.
* ****************************************************
*/
const SessionTracker = require("./SessionTracker");
const Utils = require("./Utils/Utils");
const {ConfigInfo} = require("./ConfigFile/ConfigInfo");
const {EntityType} = require("./Entity");
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 (entity.type === EntityType.NO_TYPE)
{
newEntity = {}
}
else 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