@hclsoftware/secagent
Version:
IAST agent
74 lines (70 loc) • 1.76 kB
JavaScript
//IASTIGNORE
/*
* ****************************************************
* Licensed Materials - Property of HCL.
* (c) Copyright HCL Technologies Ltd. 2017, 2025.
* Note to U.S. Government Users *Restricted Rights.
* ****************************************************
*/
const { Vulnerability } = require('../TaintTracker')
const HookType = require('../Rules/HookRules/HookRuleFactory').Type
const BeforeType = require('../Rules/BeforeRules/BeforeRuleFactory').Type
// See instructions for adding a new hook in Hooks.js.
const hooks = {
global: [
{
methodName: 'eval',
taintCondition: ['0'],
beforeRules: [
{
type: BeforeType.SKIP_ORIG_METHOD
},
{
type: BeforeType.ADD_HOOK_VALUE_NAMES,
hookValueNames: { that: 'global' }
}
],
rules: [
{
type: HookType.SINK,
from: '0',
vulnerability: Vulnerability.COMMAND_INJECTION
}
]
}
],
crypto: [
{
methodName: 'createCipher',
rules: [
{
type: HookType.EXPLOIT,
from: '0',
vulnerability: Vulnerability.WEAK_RANDOM
}
],
additionalInfo: {'vulnerability': 'unsafe deprecated function'}
}
],
sqlite3: [
{
scopes: ['Database', 'prototype'],
methodName: 'exec',
taintCondition: ['0'],
beforeRules: [
{
type: BeforeType.ARGS_TO_STRING,
applyFor: ['0']
}
],
rules: [
{
type: HookType.SINK,
from: '0',
vulnerability: Vulnerability.SQL_INJECTION
}
]
}
]
}
module.exports = hooks