Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for IAST scanning in node 18 #22

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/nr-security-agent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ function initialize() {
// Initialize Agent Status
const status = agentStatus.getInstance();

// Initialize Collector config

// Initialize
Agent.init(applicationInfo, logger, wsClient, status);
initLogger.info(LOG_MESSAGES.AGENT_INIT_SUCCESSFUL, applicationInfo.pid, applicationInfo.applicationUUID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { Agent } = require('../../../agent');
const { FuzzFailEvent } = require('../../../FuzzFailEvent');
const { hasWorker: isWorkerSupported } = require('../../../commonUtils');
const { CSEC_HOME_TMP, COLON, NR_CSEC_FUZZ_REQUEST_ID } = require('../../../sec-agent-constants');
const LOCALHOST = '127.0.0.1';
const LOCALHOST = 'localhost';
const COLON_SLASH_SLASH = '://';
const http = require('http');
const https = require('https');
Expand Down Expand Up @@ -121,9 +121,10 @@ function handleFuzzResponse (request, fuzzDetails) {
* @param {JSON} requestObject
*/
function parseAxiosHttpRequestToFuzz (requestObject) {
const serverName = requestObject.serverName ? requestObject.serverName : LOCALHOST;
let serverName = requestObject.serverName ? requestObject.serverName : LOCALHOST;
let host = serverName + COLON + requestObject.serverPort
return {
url: requestObject.protocol + COLON_SLASH_SLASH + serverName + COLON + requestObject.serverPort + requestObject.url,
url: requestObject.protocol + COLON_SLASH_SLASH + host + requestObject.url,
method: requestObject.method,
data: requestObject.body,
headers: requestObject.headers,
Expand Down
2 changes: 1 addition & 1 deletion lib/nr-security-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

let newrelic;
let NRAgent;
let NRAgent;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@newrelic/security-agent",
"version": "0.0.1",
"version": "0.0.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't be updating the version manually. This is being done in the npm-publish.yml workflow

"description": "Newrelic Security Agent for Node.js",
"main": "index.js",
"collectorVersion": "1.0.1-limited-preview",
Expand Down