Skip to content

Commit

Permalink
Handlig to generate event for crypto hash and random in interval of 3…
Browse files Browse the repository at this point in the history
…0 mins
  • Loading branch information
sumitsuthar committed Oct 14, 2024
1 parent 5a9bfec commit 1c3cf58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/nr-security-agent/lib/core/sec-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const initLogger = logs.getInitLogger();

const NODE_SER = 'node-serialize/lib/serialize.js';
const SECURE_COOKIE = 'SECURE_COOKIE';
const HASH = "HASH";
const CRYPTO = "CRYPTO";
const RANDOM = "RANDOM";

const insecureSettingApiIdSet = new Set();

Expand Down Expand Up @@ -110,7 +113,7 @@ function generateSecEvent(securityMetadata) {

let apiId = shaUtil.getSHA256ForData(traceObject.stacktrace.join('|') + uri);
apiId = securityMetadata.eventType + HYPHEN + apiId;
if (securityMetadata.eventType == SECURE_COOKIE) {
if (securityMetadata.eventType == SECURE_COOKIE || securityMetadata.eventType == CRYPTO || securityMetadata.eventType == HASH || securityMetadata.eventType == RANDOM) {
if (insecureSettingApiIdSet.has(apiId)) {
return;
}
Expand Down

0 comments on commit 1c3cf58

Please sign in to comment.