@newrelic/security-agent 2.4.1 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
|
+
### v2.4.3 (2025-07-23)
|
|
2
|
+
#### Bug fixes
|
|
3
|
+
* Removed dependency sync-req and updated axios
|
|
4
|
+
|
|
5
|
+
### v2.4.2 (2025-05-14)
|
|
6
|
+
#### Bug fixes
|
|
7
|
+
* Fixed usage of incorrect method
|
|
8
|
+
|
|
1
9
|
### v2.4.1 (2025-05-13)
|
|
2
10
|
#### Bug fixes
|
|
3
11
|
* Only listen once for uncaughtException
|
|
4
12
|
#### Miscellaneous chores
|
|
5
13
|
* (deps-dev): bump koa from v2.14.2 to v2.16.1
|
|
6
|
-
* (deps-dev): bump tar-fs from v2.1.1 to v2.1.2
|
|
14
|
+
* (deps-dev): bump tar-fs from v2.1.1 to v2.1.2
|
|
7
15
|
|
|
8
16
|
|
|
9
17
|
### v2.4.0 (2025-03-21)
|
|
10
18
|
#### Features
|
|
11
19
|
* Support for gRPC error reporting
|
|
12
|
-
* Support to detect API endpoints in next.js framework
|
|
20
|
+
* Support to detect API endpoints in next.js framework
|
|
13
21
|
#### Miscellaneous chores
|
|
14
22
|
* Updated axios to v1.8.4
|
|
15
23
|
|
|
16
24
|
### v2.3.2 (2025-03-11)
|
|
17
25
|
#### Bug fixes
|
|
18
|
-
* Updated axios to v1.8.2
|
|
26
|
+
* Updated axios to v1.8.2
|
|
19
27
|
#### Miscellaneous chores
|
|
20
|
-
* Updated readme
|
|
28
|
+
* Updated readme
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
### v2.3.1 (2025-02-04)
|
|
@@ -29,20 +37,20 @@
|
|
|
29
37
|
#### Features
|
|
30
38
|
* Added Support for VM module
|
|
31
39
|
* IAST support for Next.js
|
|
32
|
-
* Support for Insecure settings i.e crypto, hash and random modules
|
|
40
|
+
* Support for Insecure settings i.e crypto, hash and random modules
|
|
33
41
|
|
|
34
42
|
#### Bug fixes
|
|
35
43
|
* Fix for special characters in ws header
|
|
36
|
-
* Fix for getting transaction in graphql instrumentation
|
|
37
|
-
* Fix for mongodb unit tests
|
|
44
|
+
* Fix for getting transaction in graphql instrumentation
|
|
45
|
+
* Fix for mongodb unit tests
|
|
38
46
|
|
|
39
47
|
#### Miscellaneous chores
|
|
40
48
|
* deps-dev: bump undici from v5.28.4 to v5.28.5
|
|
41
|
-
* Updated axios to v1.7.9
|
|
49
|
+
* Updated axios to v1.7.9
|
|
42
50
|
|
|
43
51
|
### v2.2.0 (2024-12-18)
|
|
44
52
|
#### Features
|
|
45
|
-
* Support for express 5.x
|
|
53
|
+
* Support for express 5.x
|
|
46
54
|
* IAST support for GraphQL
|
|
47
55
|
* Added support for trustboundary security events
|
|
48
56
|
|
|
@@ -51,7 +59,7 @@
|
|
|
51
59
|
|
|
52
60
|
### v2.1.1 (2024-11-07)
|
|
53
61
|
#### Bug fixes
|
|
54
|
-
* Fix for assignment to logger constant
|
|
62
|
+
* Fix for assignment to logger constant
|
|
55
63
|
|
|
56
64
|
### v2.1.0 (2024-11-05)
|
|
57
65
|
#### Features
|
|
@@ -61,7 +69,7 @@
|
|
|
61
69
|
* Added default values for scan_schedule, scan_controllers and exclude_from_iast_scan config
|
|
62
70
|
* Fix for security home placeholder replacement in fuzz requests
|
|
63
71
|
* Handling to not resolve file path in fs module instrumentation
|
|
64
|
-
* Fix for batch size and condition of iast-data-request sending
|
|
72
|
+
* Fix for batch size and condition of iast-data-request sending
|
|
65
73
|
#### Miscellaneous chores
|
|
66
74
|
* Added requestURI field in http request for application-runtime-error
|
|
67
75
|
* Updated instrumented to get the transaction directly instead of from the active segment
|
|
@@ -90,7 +98,7 @@
|
|
|
90
98
|
#### Bug fixes
|
|
91
99
|
* Fix for traceId in error reporting
|
|
92
100
|
#### Miscellaneous chores
|
|
93
|
-
* (deps): bumped axios from 1.6.8 to 1.7.4
|
|
101
|
+
* (deps): bumped axios from 1.6.8 to 1.7.4
|
|
94
102
|
* (deps-dev): bumped ws from 7.5.9 to 8.18.0
|
|
95
103
|
#### Continuous integration
|
|
96
104
|
* Added Node.js v22.x to unit tests
|
|
@@ -98,26 +106,26 @@
|
|
|
98
106
|
### v1.4.0 (2024-06-24)
|
|
99
107
|
#### Features
|
|
100
108
|
* Added support to report application's errors while IAST scanning
|
|
101
|
-
* Support to detect gRPC API endpoints
|
|
109
|
+
* Support to detect gRPC API endpoints
|
|
102
110
|
#### Bug fixes
|
|
103
111
|
* Remove additional headers added by IAST client
|
|
104
|
-
* Fix for uncaught exception reporting
|
|
112
|
+
* Fix for uncaught exception reporting
|
|
105
113
|
#### Miscellaneous chores
|
|
106
|
-
* Updated package.json to bump ws from 8.14.2 to 8.17.1
|
|
107
|
-
* (deps-dev): bump @grpc/grpc-js from 1.9.12 to 1.10.9
|
|
114
|
+
* Updated package.json to bump ws from 8.14.2 to 8.17.1
|
|
115
|
+
* (deps-dev): bump @grpc/grpc-js from 1.9.12 to 1.10.9
|
|
108
116
|
* (deps-dev): bump braces from 3.0.2 to 3.0.3
|
|
109
|
-
* (deps): bump ws from 8.14.2 to 8.17.1
|
|
117
|
+
* (deps): bump ws from 8.14.2 to 8.17.1
|
|
110
118
|
|
|
111
119
|
### v1.3.0 (2024-05-31)
|
|
112
120
|
#### Features
|
|
113
121
|
* Added route field in security event for API endpoint mapping
|
|
114
122
|
#### Bug fixes
|
|
115
|
-
* Fix for control commands acknowledgement in security agent
|
|
116
|
-
* Added assert for typeof response data in Reflected XSS validation
|
|
117
|
-
* Updated @grpc/grpc-js instrumentation to instrument submodules
|
|
123
|
+
* Fix for control commands acknowledgement in security agent
|
|
124
|
+
* Added assert for typeof response data in Reflected XSS validation
|
|
125
|
+
* Updated @grpc/grpc-js instrumentation to instrument submodules
|
|
118
126
|
* Handling to convert header values into string
|
|
119
127
|
#### Miscellaneous chores
|
|
120
|
-
* Updated log level for critical messages
|
|
128
|
+
* Updated log level for critical messages
|
|
121
129
|
* Readme update
|
|
122
130
|
* (deps-dev): bump axios from 0.21.4 to 1.7.2
|
|
123
131
|
|
|
@@ -125,7 +133,7 @@
|
|
|
125
133
|
#### Features
|
|
126
134
|
* Added instrumentation for express framework's res.download() and res.sendFile()
|
|
127
135
|
#### Bug fixes
|
|
128
|
-
* Handling to decrypt fuzz header data for IAST scanning
|
|
136
|
+
* Handling to decrypt fuzz header data for IAST scanning
|
|
129
137
|
* Logging and snapshot file fixes
|
|
130
138
|
#### Miscellaneous chores
|
|
131
139
|
* Prepend vulnerability case type with apiId
|
|
@@ -138,13 +146,13 @@
|
|
|
138
146
|
|
|
139
147
|
### v1.1.0 (2024-03-19)
|
|
140
148
|
#### Features
|
|
141
|
-
* IAST support for grpc
|
|
149
|
+
* IAST support for grpc
|
|
142
150
|
* Functionality to report API endpoints of the application
|
|
143
151
|
* IAST support for undici
|
|
144
152
|
#### Bug fixes
|
|
145
153
|
* Updated permissions for file/directory created by security agent
|
|
146
154
|
#### Miscellaneous chores
|
|
147
|
-
* Bumped follow-redirects from v1.15.2 to v1.15.4
|
|
155
|
+
* Bumped follow-redirects from v1.15.2 to v1.15.4
|
|
148
156
|
* Updated axios to v1.6.8
|
|
149
157
|
* Bumped ip from v2.0.0 to v2.0.1
|
|
150
158
|
* Bumped undici from 5.28.2 to v5.28.3
|
|
@@ -152,7 +160,7 @@
|
|
|
152
160
|
|
|
153
161
|
### v1.0.1 (2024-02-07)
|
|
154
162
|
#### Bug fixes
|
|
155
|
-
* Reporting of framework in security event json
|
|
163
|
+
* Reporting of framework in security event json
|
|
156
164
|
#### Miscellaneous chores
|
|
157
165
|
* Updated software license to New Relic Software License Version 1.0
|
|
158
166
|
* Ability to send critical messages on successful startup of agent
|
|
@@ -169,8 +177,8 @@
|
|
|
169
177
|
#### Miscellaneous chores
|
|
170
178
|
* Updated log event jsonName to "critical-messages"
|
|
171
179
|
* Removed dependency @aws-sdk/client-lambda
|
|
172
|
-
* Bumped follow-redirects from v1.15.2 to v1.15.4
|
|
173
|
-
* Upgraded axios to v1.6.5
|
|
180
|
+
* Bumped follow-redirects from v1.15.2 to v1.15.4
|
|
181
|
+
* Upgraded axios to v1.6.5
|
|
174
182
|
|
|
175
183
|
### v0.6.0 (2024-01-03)
|
|
176
184
|
#### Features
|
|
@@ -182,7 +190,7 @@
|
|
|
182
190
|
* Fix for honouring probing interval from policy
|
|
183
191
|
#### Miscellaneous chores
|
|
184
192
|
* Added nestjs test cases
|
|
185
|
-
* Additional logging for instrumented modules and methods
|
|
193
|
+
* Additional logging for instrumented modules and methods
|
|
186
194
|
* Upgraded axios to v1.6.3
|
|
187
195
|
* Removed pinned version for axios and check-disk-space
|
|
188
196
|
* Update in lockfileVersion of package-lock.json
|
|
@@ -203,10 +211,10 @@
|
|
|
203
211
|
|
|
204
212
|
### v0.4.0 (2023-10-27)
|
|
205
213
|
#### Features
|
|
206
|
-
* Added event stats for RASP, IAST and exit events in healthcheck.
|
|
214
|
+
* Added event stats for RASP, IAST and exit events in healthcheck.
|
|
207
215
|
#### Miscellaneous chores
|
|
208
216
|
* Deps: Updated uuid to v9.0.1 and @aws-sdk/client-lambda to v3.405.0
|
|
209
|
-
* Upgraded axios to 1.6.0 to resolve CVE-2023-45857
|
|
217
|
+
* Upgraded axios to 1.6.0 to resolve CVE-2023-45857
|
|
210
218
|
#### Continuous integration
|
|
211
219
|
* Removed Node.js 14.x from CI.
|
|
212
220
|
* Added should_skip flag to skip CI based on label.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -32,7 +32,6 @@ code, the source code can be found at [https://github.com/newrelic/csec-node-age
|
|
|
32
32
|
* [request-ip](#request-ip)
|
|
33
33
|
* [ringbufferjs](#ringbufferjs)
|
|
34
34
|
* [semver](#semver)
|
|
35
|
-
* [sync-request](#sync-request)
|
|
36
35
|
* [unescape-js](#unescape-js)
|
|
37
36
|
* [unescape](#unescape)
|
|
38
37
|
* [uuid](#uuid)
|
|
@@ -78,7 +77,7 @@ code, the source code can be found at [https://github.com/newrelic/csec-node-age
|
|
|
78
77
|
|
|
79
78
|
### axios
|
|
80
79
|
|
|
81
|
-
This product includes source derived from [axios](https://github.com/axios/axios) ([v1.
|
|
80
|
+
This product includes source derived from [axios](https://github.com/axios/axios) ([v1.11.0](https://github.com/axios/axios/tree/v1.11.0)), distributed under the [MIT License](https://github.com/axios/axios/blob/v1.11.0/LICENSE):
|
|
82
81
|
|
|
83
82
|
```
|
|
84
83
|
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
|
@@ -532,32 +531,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
532
531
|
|
|
533
532
|
```
|
|
534
533
|
|
|
535
|
-
### sync-request
|
|
536
|
-
|
|
537
|
-
This product includes source derived from [sync-request](https://github.com/ForbesLindesay/sync-request) ([v6.1.0](https://github.com/ForbesLindesay/sync-request/tree/v6.1.0)), distributed under the [MIT License](https://github.com/ForbesLindesay/sync-request/blob/v6.1.0/LICENSE):
|
|
538
|
-
|
|
539
|
-
```
|
|
540
|
-
Copyright (c) 2014 Forbes Lindesay
|
|
541
|
-
|
|
542
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
543
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
544
|
-
in the Software without restriction, including without limitation the rights
|
|
545
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
546
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
547
|
-
furnished to do so, subject to the following conditions:
|
|
548
|
-
|
|
549
|
-
The above copyright notice and this permission notice shall be included in
|
|
550
|
-
all copies or substantial portions of the Software.
|
|
551
|
-
|
|
552
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
553
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
554
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
555
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
556
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
557
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
558
|
-
THE SOFTWARE.
|
|
559
|
-
```
|
|
560
|
-
|
|
561
534
|
### unescape-js
|
|
562
535
|
|
|
563
536
|
This product includes source derived from [unescape-js](https://github.com/iamakulov/unescape-js) ([v1.1.4](https://github.com/iamakulov/unescape-js/tree/v1.1.4)), distributed under the [MIT License](https://github.com/iamakulov/unescape-js/blob/v1.1.4/LICENSE):
|
|
@@ -46,9 +46,9 @@ const requestBodyLimit = 500;
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Entry point of http module hook
|
|
49
|
-
* @param {*} shim
|
|
50
|
-
* @param {*} mod
|
|
51
|
-
* @param {*} moduleName
|
|
49
|
+
* @param {*} shim
|
|
50
|
+
* @param {*} mod
|
|
51
|
+
* @param {*} moduleName
|
|
52
52
|
*/
|
|
53
53
|
function initialize(shim, mod, moduleName) {
|
|
54
54
|
logger.info(`Instrumenting ${moduleName}`);
|
|
@@ -87,9 +87,9 @@ function setupRequestMapCleanup() {
|
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Hook to intercept outbound http requests.
|
|
90
|
-
* @param {*} shim
|
|
91
|
-
* @param {*} mod
|
|
92
|
-
* @param {*} moduleName
|
|
90
|
+
* @param {*} shim
|
|
91
|
+
* @param {*} mod
|
|
92
|
+
* @param {*} moduleName
|
|
93
93
|
*/
|
|
94
94
|
function outboundHook(shim, mod, method, moduleName) {
|
|
95
95
|
if (API && API.getNRAgent() && API.getNRAgent().config.security.exclude_from_iast_scan.iast_detection_category.ssrf) {
|
|
@@ -167,7 +167,7 @@ function outboundHook(shim, mod, method, moduleName) {
|
|
|
167
167
|
/**
|
|
168
168
|
* Function to parse fuzzheaders and create temp files in case of dynamic scanning
|
|
169
169
|
* Not functional
|
|
170
|
-
* @param {*} fuzzheaders
|
|
170
|
+
* @param {*} fuzzheaders
|
|
171
171
|
*/
|
|
172
172
|
function parseFuzzheaders(requestData, transactionId) {
|
|
173
173
|
let fuzzheaders = requestData.headers;
|
|
@@ -226,14 +226,14 @@ function parseFuzzheaders(requestData, transactionId) {
|
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* Utility function to add request data in a Map
|
|
229
|
-
* @param {*} shim
|
|
230
|
-
* @param {*} request
|
|
231
|
-
* @param {*} resp
|
|
229
|
+
* @param {*} shim
|
|
230
|
+
* @param {*} request
|
|
231
|
+
* @param {*} resp
|
|
232
232
|
*/
|
|
233
233
|
function addRequestData(shim, request) {
|
|
234
234
|
try {
|
|
235
235
|
const data = Object.assign({});
|
|
236
|
-
const transaction = shim.tracer.getTransaction();
|
|
236
|
+
const transaction = shim.tracer.getTransaction();
|
|
237
237
|
if (transaction) {
|
|
238
238
|
data.protocol = (request.connection && request.connection.encrypted) ? 'https' : 'http';
|
|
239
239
|
data.body = null;
|
|
@@ -280,10 +280,10 @@ function addRequestData(shim, request) {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
/**
|
|
283
|
-
* Wrappert to hook http.server.emit()
|
|
284
|
-
* @param {*} shim
|
|
285
|
-
* @param {*} mod
|
|
286
|
-
* @param {*} moduleName
|
|
283
|
+
* Wrappert to hook http.server.emit()
|
|
284
|
+
* @param {*} shim
|
|
285
|
+
* @param {*} mod
|
|
286
|
+
* @param {*} moduleName
|
|
287
287
|
*/
|
|
288
288
|
function emitHook(shim, mod, moduleName) {
|
|
289
289
|
shim.wrap(mod && mod.Server && mod.Server.prototype, 'emit', function makeEmitWrapper(shim, fn) {
|
|
@@ -328,8 +328,8 @@ function emitHook(shim, mod, moduleName) {
|
|
|
328
328
|
|
|
329
329
|
/**
|
|
330
330
|
* Wrapper for http.createServer method
|
|
331
|
-
* @param {*} shim
|
|
332
|
-
* @param {*} mod
|
|
331
|
+
* @param {*} shim
|
|
332
|
+
* @param {*} mod
|
|
333
333
|
*/
|
|
334
334
|
function createServerHook(shim, mod, moduleName) {
|
|
335
335
|
shim.wrap(mod, 'createServer', function createServerWrapper(shim, fn) {
|
|
@@ -356,9 +356,9 @@ function createServerHook(shim, mod, moduleName) {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
|
-
* Wrapper to hook http request body
|
|
360
|
-
* @param {*} shim
|
|
361
|
-
* @param {*} mod
|
|
359
|
+
* Wrapper to hook http request body
|
|
360
|
+
* @param {*} shim
|
|
361
|
+
* @param {*} mod
|
|
362
362
|
*/
|
|
363
363
|
function onDataHook(shim, mod) {
|
|
364
364
|
shim.wrap(mod, '1', function makeOnDataWrapper(shim, fn) {
|
|
@@ -399,13 +399,13 @@ function onDataHook(shim, mod) {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
/**
|
|
402
|
-
* Wrapper to hook response.write() and reponse.end() method
|
|
403
|
-
* @param {*} resp
|
|
404
|
-
* @param {*} req
|
|
405
|
-
* @param {*} shim
|
|
402
|
+
* Wrapper to hook response.write() and reponse.end() method
|
|
403
|
+
* @param {*} resp
|
|
404
|
+
* @param {*} req
|
|
405
|
+
* @param {*} shim
|
|
406
406
|
*/
|
|
407
407
|
function responseHook(resp, req, shim) {
|
|
408
|
-
// wrapper for response.write()
|
|
408
|
+
// wrapper for response.write()
|
|
409
409
|
resp.res = {};
|
|
410
410
|
resp.res.body = EMPTY_STRING;
|
|
411
411
|
|
|
@@ -419,7 +419,7 @@ function responseHook(resp, req, shim) {
|
|
|
419
419
|
return fn.apply(this, arguments);
|
|
420
420
|
}
|
|
421
421
|
})
|
|
422
|
-
// wrapper for response.end()
|
|
422
|
+
// wrapper for response.end()
|
|
423
423
|
shim.wrap(resp, 'end', function makeEndWrapper(shim, fn) {
|
|
424
424
|
if (!shim.isFunction(fn)) {
|
|
425
425
|
return fn
|
|
@@ -460,7 +460,7 @@ function responseHook(resp, req, shim) {
|
|
|
460
460
|
const dynamicScanningFlag = policy.data ? (policy.data.vulnerabilityScan?.enabled && policy.data.vulnerabilityScan.iastScan.enabled) : false;
|
|
461
461
|
const type = response.getHeader(CONTENT_TYPE);
|
|
462
462
|
let isUnsupportedType = isUnsupportedContentType(type, response);
|
|
463
|
-
|
|
463
|
+
|
|
464
464
|
if (request && (construct || dynamicScanningFlag) && !isUnsupportedType) {
|
|
465
465
|
const args = [];
|
|
466
466
|
args.push(construct);
|
|
@@ -478,8 +478,8 @@ function responseHook(resp, req, shim) {
|
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
480
|
* Utility to check unsupported content types
|
|
481
|
-
* @param {*} conType
|
|
482
|
-
* @returns
|
|
481
|
+
* @param {*} conType
|
|
482
|
+
* @returns
|
|
483
483
|
*/
|
|
484
484
|
function isUnsupportedContentType(conType, response) {
|
|
485
485
|
try {
|
|
@@ -570,10 +570,10 @@ function responseBodyCompute(response, args) {
|
|
|
570
570
|
|
|
571
571
|
/**
|
|
572
572
|
* Callback hook to generate exit event
|
|
573
|
-
* @param {*} shim
|
|
574
|
-
* @param {*} mod
|
|
575
|
-
* @param {*} fun
|
|
576
|
-
* @param {*} secEvent
|
|
573
|
+
* @param {*} shim
|
|
574
|
+
* @param {*} mod
|
|
575
|
+
* @param {*} fun
|
|
576
|
+
* @param {*} secEvent
|
|
577
577
|
*/
|
|
578
578
|
function callbackHook(shim, mod, fun, secEvent) {
|
|
579
579
|
shim.secEvent = secEvent;
|
|
@@ -593,9 +593,9 @@ function callbackHook(shim, mod, fun, secEvent) {
|
|
|
593
593
|
|
|
594
594
|
/**
|
|
595
595
|
* Utility to check if child path is inside parent path
|
|
596
|
-
* @param {*} childPath
|
|
597
|
-
* @param {*} parentPath
|
|
598
|
-
* @returns
|
|
596
|
+
* @param {*} childPath
|
|
597
|
+
* @param {*} parentPath
|
|
598
|
+
* @returns
|
|
599
599
|
*/
|
|
600
600
|
function isPathInside(childPath, parentPath) {
|
|
601
601
|
childPath = path.resolve(childPath);
|
|
@@ -614,7 +614,7 @@ function isPathInside(childPath, parentPath) {
|
|
|
614
614
|
|
|
615
615
|
/**
|
|
616
616
|
* Delete Temporary file for IAST. Do not call this in RASP
|
|
617
|
-
* @param {*} file
|
|
617
|
+
* @param {*} file
|
|
618
618
|
*/
|
|
619
619
|
function deleteTempFileForIAST(file) {
|
|
620
620
|
try {
|
|
@@ -630,7 +630,7 @@ function deleteTempFileForIAST(file) {
|
|
|
630
630
|
* Collect and report the uncaught Exception
|
|
631
631
|
*/
|
|
632
632
|
const listeners = process.listeners('uncaughtException')
|
|
633
|
-
if (listeners.
|
|
633
|
+
if (listeners.indexOf(uncaughtListener) === -1) {
|
|
634
634
|
process.on('uncaughtException', uncaughtListener);
|
|
635
635
|
}
|
|
636
636
|
|
|
@@ -650,8 +650,8 @@ function uncaughtListener(err, origin) {
|
|
|
650
650
|
|
|
651
651
|
/**
|
|
652
652
|
* utility to parse response headers for cookie check
|
|
653
|
-
* @param {*} headersString
|
|
654
|
-
* @returns
|
|
653
|
+
* @param {*} headersString
|
|
654
|
+
* @returns
|
|
655
655
|
*/
|
|
656
656
|
function responseRawHeaderParsing(headersString) {
|
|
657
657
|
let setCookieValue;
|
|
@@ -671,8 +671,8 @@ function responseRawHeaderParsing(headersString) {
|
|
|
671
671
|
|
|
672
672
|
/**
|
|
673
673
|
* Utility to check insecure cookie settings
|
|
674
|
-
* @param {*} response
|
|
675
|
-
* @param {*} shim
|
|
674
|
+
* @param {*} response
|
|
675
|
+
* @param {*} shim
|
|
676
676
|
*/
|
|
677
677
|
function secureCookieCheck(response, shim) {
|
|
678
678
|
let cookieHeader = response.getHeader('set-cookie') ? response.getHeader('set-cookie') : responseRawHeaderParsing(response._header);
|
|
@@ -743,8 +743,8 @@ function truncateStringToBytes(inputString, maxBytes) {
|
|
|
743
743
|
|
|
744
744
|
/**
|
|
745
745
|
* Utility to generate trustboundary events.
|
|
746
|
-
* @param {*} sessionObject
|
|
747
|
-
* @param {*} shim
|
|
746
|
+
* @param {*} sessionObject
|
|
747
|
+
* @param {*} shim
|
|
748
748
|
*/
|
|
749
749
|
function trustBoundaryCheck(sessionObject, shim) {
|
|
750
750
|
try {
|
|
@@ -138,7 +138,7 @@ function ApplicationInfo () {
|
|
|
138
138
|
? `${process.env[AWS_LAMBDA_FUNCTION_NAME_ENV_IDENTIFIER]}:${lambdaVersion}`
|
|
139
139
|
: `${lambdaARN}:${lambdaVersion}`;
|
|
140
140
|
this.identifier.lambdaAWSSessionToken = process.env[AWS_SESSION_TOKEN_ENV_IDENTIFIER];
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
} else {
|
|
143
143
|
this.identifier.kind = "HOST";
|
|
144
144
|
this.identifier.envInfo = setHostProperties();
|
|
@@ -482,42 +482,9 @@ function getECSTaskId () {
|
|
|
482
482
|
|
|
483
483
|
function populateECSInfo (ecsObj) {
|
|
484
484
|
ecsObj.ecsTaskId = getECSTaskId();
|
|
485
|
-
const ecsData = getECSInfo();
|
|
486
|
-
if (!_.isEmpty(ecsData)) {
|
|
487
|
-
const imageId = ecsData.ImageID;
|
|
488
|
-
const imageName = ecsData.Image;
|
|
489
|
-
|
|
490
|
-
ecsObj.imageId = imageId;
|
|
491
|
-
ecsObj.imageName = imageName;
|
|
492
|
-
|
|
493
|
-
const labels = ecsData.Labels;
|
|
494
|
-
|
|
495
|
-
if (!_.isEmpty(labels)) {
|
|
496
|
-
const containerName = labels['com.amazonaws.ecs.container-name'];
|
|
497
|
-
const ecsTaskDefinitionFamily = labels['com.amazonaws.ecs.task-definition-family'];
|
|
498
|
-
const ecsTaskDefinitionVersion = labels['com.amazonaws.ecs.task-definition-version'];
|
|
499
|
-
|
|
500
|
-
ecsObj.containerName = containerName;
|
|
501
|
-
if (ecsTaskDefinitionFamily && ecsTaskDefinitionVersion) {
|
|
502
|
-
ecsObj.ecsTaskDefinition = ecsTaskDefinitionFamily + ':' + ecsTaskDefinitionVersion;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
485
|
return ecsObj;
|
|
507
486
|
}
|
|
508
487
|
|
|
509
|
-
function getECSInfo () {
|
|
510
|
-
const url = process.env.ECS_CONTAINER_METADATA_URI;
|
|
511
|
-
let json = {};
|
|
512
|
-
const request = require('sync-request');
|
|
513
|
-
try {
|
|
514
|
-
const res = request('GET', url);
|
|
515
|
-
const body = res.getBody();
|
|
516
|
-
json = JSON.parse(body);
|
|
517
|
-
} catch (error) {
|
|
518
|
-
}
|
|
519
|
-
return json;
|
|
520
|
-
}
|
|
521
488
|
|
|
522
489
|
function getApplicationSHAAndSizeFromWorker (applicationInfo, applicationPath) {
|
|
523
490
|
const { Worker } = require('worker_threads');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newrelic/security-agent",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "New Relic Security Agent for Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"jsonVersion": "1.2.9",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"url": "https://github.com/newrelic/csec-node-agent.git"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"axios": "^1.
|
|
42
|
+
"axios": "^1.11.0",
|
|
43
43
|
"check-disk-space": "^3.4.0",
|
|
44
44
|
"content-type": "^1.0.5",
|
|
45
45
|
"cron": "^3.1.7",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"request-ip": "^3.3.0",
|
|
58
58
|
"ringbufferjs": "^2.0.0",
|
|
59
59
|
"semver": "^7.5.4",
|
|
60
|
-
"sync-request": "^6.1.0",
|
|
61
60
|
"unescape": "^1.0.1",
|
|
62
61
|
"unescape-js": "^1.1.4",
|
|
63
62
|
"uuid": "^9.0.1",
|