Skip to content

Commit

Permalink
Add parent-id header to outgoing http requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lovesh-ap committed Oct 9, 2023
1 parent 8fd0d5b commit 7bf44a0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public static AbstractOperation preprocessSecurityHook(HttpRequest request, Stri
request.setHeader(ServletHelper.CSEC_IAST_FUZZ_REQUEST_ID, iastHeader);
}

String csecParentId = getParentId();
if(csecParentId!= null && !csecParentId.isEmpty()){
request.setHeader(GenericHelper.CSEC_PARENT_ID, csecParentId);
}

SSRFOperation operation = new SSRFOperation(uri, className, methodName);
try {
NewRelicSecurity.getAgent().registerOperation(operation);
Expand All @@ -84,4 +89,8 @@ public static AbstractOperation preprocessSecurityHook(HttpRequest request, Stri
}
return null;
}

public static String getParentId(){
return NewRelicSecurity.getAgent().getSecurityMetaData().getCustomAttribute(GenericHelper.CSEC_PARENT_ID, String.class);
}
}

0 comments on commit 7bf44a0

Please sign in to comment.