@newrelic/security-agent 1.4.0 → 1.5.0

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,3 +1,14 @@
1
+ ### v1.5.0 (2024-08-14)
2
+ #### Features
3
+ * Support for Node.js v22.x
4
+ #### Bug fixes
5
+ * Fix for traceId in error reporting
6
+ #### Miscellaneous chores
7
+ * (deps): bumped axios from 1.6.8 to 1.7.4
8
+ * (deps-dev): bumped ws from 7.5.9 to 8.18.0
9
+ #### Continuous integration
10
+ * Added Node.js v22.x to unit tests
11
+
1
12
  ### v1.4.0 (2024-06-24)
2
13
  #### Features
3
14
  * Added support to report application's errors while IAST scanning
@@ -77,7 +77,7 @@ code, the source code can be found at [https://github.com/newrelic/csec-node-age
77
77
 
78
78
  ### axios
79
79
 
80
- This product includes source derived from [axios](https://github.com/axios/axios) ([v1.7.2](https://github.com/axios/axios/tree/v1.7.2)), distributed under the [MIT License](https://github.com/axios/axios/blob/v1.7.2/LICENSE):
80
+ This product includes source derived from [axios](https://github.com/axios/axios) ([v1.7.4](https://github.com/axios/axios/tree/v1.7.4)), distributed under the [MIT License](https://github.com/axios/axios/blob/v1.7.4/LICENSE):
81
81
 
82
82
  ```
83
83
  # Copyright (c) 2014-present Matt Zabriskie & Collaborators
@@ -98,9 +98,7 @@ function exceptionReporting(exception, request, responseCode) {
98
98
  this.category = exception.name;
99
99
  this.traceId = shaUtil.getSHA256ForData(this.exception.stackTrace.join('|') + this.category + this.httpRequest.route + this.httpRequest.method);
100
100
  }
101
- else {
102
- this.traceId = shaUtil.getSHA256ForData(this.category + this.httpRequest.route + this.httpRequest.method);
103
- }
101
+
104
102
  if (responseCode) {
105
103
  if (responseCode >= 500) {
106
104
  this.category = http.STATUS_CODES[responseCode];
@@ -124,6 +122,9 @@ function exceptionReporting(exception, request, responseCode) {
124
122
  function generateExceptionReportingEvent(error, request) {
125
123
  try {
126
124
  const exception = new exceptionReporting(error, request);
125
+ if(!exception.traceId){
126
+ return;
127
+ }
127
128
  let key = exception.exception.type + exception.exception.stackTrace[0];
128
129
  if (!exceptionsMap.has(key)) {
129
130
  exceptionsMap.set(key, exception);
@@ -141,6 +142,9 @@ function generateExceptionReportingEvent(error, request) {
141
142
  function generate5xxReportingEvent(error, request, responseCode) {
142
143
  try {
143
144
  const exception = new exceptionReporting(error, request, responseCode);
145
+ if(!exception.traceId){
146
+ return;
147
+ }
144
148
  let key = (request.uri ? request.uri : request.url) + responseCode;
145
149
  if (!exceptionsMap.has(key)) {
146
150
  exceptionsMap.set(key, exception);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/security-agent",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "New Relic Security Agent for Node.js",
5
5
  "main": "index.js",
6
6
  "jsonVersion": "1.2.3",
@@ -35,7 +35,7 @@
35
35
  "url": "https://github.com/newrelic/csec-node-agent.git"
36
36
  },
37
37
  "dependencies": {
38
- "axios": "^1.6.8",
38
+ "axios": "^1.7.4",
39
39
  "check-disk-space": "^3.4.0",
40
40
  "content-type": "^1.0.5",
41
41
  "fast-safe-stringify": "^2.1.1",