@newrelic/security-agent 0.6.0 → 1.0.1

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +20 -25
  3. package/README.md +13 -1
  4. package/THIRD_PARTY_NOTICES.md +1 -211
  5. package/lib/instrumentation-security/core/constants.js +1 -1
  6. package/lib/instrumentation-security/core/event-constants.js +1 -1
  7. package/lib/instrumentation-security/core/request-manager.js +1 -1
  8. package/lib/instrumentation-security/core/route-manager.js +1 -1
  9. package/lib/instrumentation-security/core/sec-trace.js +1 -1
  10. package/lib/instrumentation-security/core/sec-utils.js +1 -1
  11. package/lib/instrumentation-security/core/security-metadata.js +1 -1
  12. package/lib/instrumentation-security/core/stack-trace.js +1 -1
  13. package/lib/instrumentation-security/hooks/@nestjs/nr-nestjs-core.js +1 -1
  14. package/lib/instrumentation-security/hooks/director/nr-director.js +1 -1
  15. package/lib/instrumentation-security/hooks/express/nr-express.js +1 -1
  16. package/lib/instrumentation-security/hooks/fastify/nr-fastify.js +1 -1
  17. package/lib/instrumentation-security/hooks/fs/nr-fs.js +40 -9
  18. package/lib/instrumentation-security/hooks/hapi/nr-hapi.js +1 -1
  19. package/lib/instrumentation-security/hooks/http/nr-http.js +68 -4
  20. package/lib/instrumentation-security/hooks/koa/@koa/nr-@koa-router.js +1 -1
  21. package/lib/instrumentation-security/hooks/ldap/nr-ldap.js +1 -1
  22. package/lib/instrumentation-security/hooks/mongodb/common.js +1 -1
  23. package/lib/instrumentation-security/hooks/mongodb/constants.js +1 -1
  24. package/lib/instrumentation-security/hooks/mongodb/nr-mongodb.js +1 -1
  25. package/lib/instrumentation-security/hooks/mongodb/v2-mongo.js +1 -1
  26. package/lib/instrumentation-security/hooks/mongodb/v3-mongo.js +1 -1
  27. package/lib/instrumentation-security/hooks/mongodb/v4-mongo.js +1 -1
  28. package/lib/instrumentation-security/hooks/mysql/nr-mysql.js +1 -1
  29. package/lib/instrumentation-security/hooks/native/nr-childProcess.js +1 -1
  30. package/lib/instrumentation-security/hooks/postgres/nr-postgres.js +1 -1
  31. package/lib/instrumentation-security/hooks/require/nr-require.js +4 -3
  32. package/lib/instrumentation-security/hooks/restify/nr-restify.js +1 -1
  33. package/lib/instrumentation-security/hooks/xpath/nr-xpath.js +1 -1
  34. package/lib/instrumentation-security/index.js +1 -1
  35. package/lib/nr-security-agent/index.js +1 -1
  36. package/lib/nr-security-agent/lib/core/Auth-headers.js +1 -1
  37. package/lib/nr-security-agent/lib/core/ContainerProperties.js +1 -1
  38. package/lib/nr-security-agent/lib/core/ECSProperties.js +1 -1
  39. package/lib/nr-security-agent/lib/core/FuzzFailEvent.js +1 -1
  40. package/lib/nr-security-agent/lib/core/LinkingMetadata.js +1 -1
  41. package/lib/nr-security-agent/lib/core/LogMessage.js +4 -3
  42. package/lib/nr-security-agent/lib/core/PodProperties.js +1 -1
  43. package/lib/nr-security-agent/lib/core/Policy.js +1 -1
  44. package/lib/nr-security-agent/lib/core/agent-status.js +1 -1
  45. package/lib/nr-security-agent/lib/core/agent.js +1 -1
  46. package/lib/nr-security-agent/lib/core/applicationinfo.js +1 -1
  47. package/lib/nr-security-agent/lib/core/commonUtils.js +8 -1
  48. package/lib/nr-security-agent/lib/core/connections/aws-lambda-client.js +7 -9
  49. package/lib/nr-security-agent/lib/core/connections/restclient.js +1 -1
  50. package/lib/nr-security-agent/lib/core/connections/websocket/index.js +1 -1
  51. package/lib/nr-security-agent/lib/core/connections/websocket/response/IASTUtils.js +1 -1
  52. package/lib/nr-security-agent/lib/core/connections/websocket/response/collecotor-policy-error-handler.js +1 -1
  53. package/lib/nr-security-agent/lib/core/connections/websocket/response/collector-policy-handler.js +1 -1
  54. package/lib/nr-security-agent/lib/core/connections/websocket/response/fuzz-request-handler.js +2 -2
  55. package/lib/nr-security-agent/lib/core/connections/websocket/response/iast-cool-down.js +1 -1
  56. package/lib/nr-security-agent/lib/core/connections/websocket/response/iast-record-deletion.js +1 -1
  57. package/lib/nr-security-agent/lib/core/connections/websocket/response/index.js +2 -2
  58. package/lib/nr-security-agent/lib/core/connections/websocket/response/no-op-handler.js +1 -1
  59. package/lib/nr-security-agent/lib/core/connections/websocket/response/startup-handshake-handler.js +4 -1
  60. package/lib/nr-security-agent/lib/core/connections/websocket/response/unsupported-agent-handler.js +1 -1
  61. package/lib/nr-security-agent/lib/core/connections/websocket/response/ws-reconnect.js +1 -1
  62. package/lib/nr-security-agent/lib/core/connections/websocket/websocket.js +1 -1
  63. package/lib/nr-security-agent/lib/core/event-stats.js +1 -1
  64. package/lib/nr-security-agent/lib/core/event.js +7 -2
  65. package/lib/nr-security-agent/lib/core/health-check.js +1 -1
  66. package/lib/nr-security-agent/lib/core/json-file-handler.js +1 -1
  67. package/lib/nr-security-agent/lib/core/jsonValidator.js +1 -1
  68. package/lib/nr-security-agent/lib/core/lambda-delegated-task-service.js +1 -1
  69. package/lib/nr-security-agent/lib/core/logging.js +1 -1
  70. package/lib/nr-security-agent/lib/core/sec-agent-constants.js +1 -1
  71. package/lib/nr-security-agent/lib/core/sec-util.js +1 -1
  72. package/lib/nr-security-agent/lib/core/sha-size-util.js +1 -1
  73. package/lib/nr-security-agent/lib/core/sha_worker.js +1 -1
  74. package/lib/nr-security-agent/lib/core/startup-config.js +1 -1
  75. package/lib/nr-security-agent/lib/core/statusUtils.js +5 -2
  76. package/lib/nr-security-agent/lib/core/timeunit.js +1 -1
  77. package/lib/nr-security-agent/lib/core/websocket-client.js +11 -1
  78. package/lib/nr-security-agent/lib/core/xss-utils.js +1 -1
  79. package/lib/nr-security-agent/lib/models/lambda-delegated-task/constants.js +1 -1
  80. package/lib/nr-security-agent/lib/models/lambda-delegated-task/index.js +1 -1
  81. package/lib/nr-security-agent/lib/models/lambda-delegated-task/lambda-delegated-sha-calculation.js +1 -1
  82. package/lib/nr-security-agent/lib/models/lambda-delegated-task/lambda-delegated-task-base.js +1 -1
  83. package/lib/nr-security-agent/lib/models/lambda-delegated-task/lambda-delegated-task-type.js +1 -1
  84. package/lib/nr-security-agent/resources/config.js +1 -1
  85. package/lib/nr-security-api/index.js +1 -1
  86. package/package.json +3 -4
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ### v1.0.1 (2024-02-07)
2
+ #### Bug fixes
3
+ * Reporting of framework in security event json
4
+ #### Miscellaneous chores
5
+ * Updated software license to New Relic Software License Version 1.0
6
+ * Ability to send critical messages on successful startup of agent
7
+ * Updated Copyright headers
8
+ * Updated license in readme
9
+
10
+ ### v0.7.0 (2024-01-18)
11
+ #### Features
12
+ * Handling to exclude unsupported content types from rxss processing
13
+ * Handling to report errors/critical messages to Security Engine
14
+ #### Bug fixes
15
+ * Fix for file operation event's parameter must be absolute path of file
16
+ * Fix for ReferenceError of commonUtils module
17
+ #### Miscellaneous chores
18
+ * Updated log event jsonName to "critical-messages"
19
+ * Removed dependency @aws-sdk/client-lambda
20
+ * Bumped follow-redirects from v1.15.2 to v1.15.4
21
+ * Upgraded axios to v1.6.5
22
+
1
23
  ### v0.6.0 (2024-01-03)
2
24
  #### Features
3
25
  * Added ws headers NR-CSEC-ENTITY-GUID and NR-CSEC-ENTITY-NAME
package/LICENSE CHANGED
@@ -1,43 +1,38 @@
1
- ## New Relic Pre-Release Software Notice
1
+ ## New Relic Software License v1.0
2
2
 
3
3
  ### Acceptance
4
4
 
5
- This software license applies to the repositories, directories, or files that it has been associated with (referred to here as the “Pre-Release Software”). In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
6
- License
5
+ This software license applies to the repositories, directories, or files that it has been associated with (referred to here as “the Software”). In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
7
6
 
8
- New Relic, Inc. (“New Relic”) grants you a license under its copyrights and patents to do everything necessary for you to use the Pre-Release Software for the Permitted Purposes and subject to your compliance with the Confidentiality terms and all other Restrictions on Use. All other uses are prohibited.
7
+ ### License
9
8
 
10
- ### Permitted Purposes
11
-
12
- The Pre-Release Software is solely for use with New Relic’s proprietary SaaS service (“New Relic Service”). To use the Pre-Release Software you must have a valid and active subscription agreement to the New Relic Service. You may not use the Pre-Release Software in conjunction with any other similar service.
13
-
14
- Use of the Pre-Release Software is limited to evaluation and feedback, including pull requests, of the pre-release features and capabilities. The use of the Pre-Release Software requires a signed New Relic Pre-Release Agreement. The New Relic Pre-Release Agreement will control in event of a conflict with this license. The Pre-Release Software is also subject to the New Relic pre-release policy. A copy of the New Relic Pre-release policy available at https://docs.newrelic.com/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy/.
9
+ New Relic grants you a license for the Software to do everything you might do with the Software that would otherwise infringe the New Relic’s copyrights or patent rights, conditional on only using the Software for Permitted Purposes and compliance with all other Restrictions on Use. All other uses are prohibited.
15
10
 
16
- ### Confidentiality
11
+ ### Permitted Purposes
17
12
 
18
- Any Pre-Release Software not posted publicly contains New Relic Trade Secrets. You may not disclose the features and capabilities of the Pre-Release Software to any third party by any means. You will use commercially reasonable measures to maintain the secrecy of the features and capabilities of the Pre-Release Software. Without limiting the permissions you receive under any open source software (“OSS”) license, you may not disclose the source code of any OSS included as part of the Pre-Release Software in a way that discloses the New Relic Trade Secrets.
13
+ The Software is solely for use with New Relic’s proprietary SaaS service (“New Relic Service”). To use the Software you must have a valid and active subscription agreement to the New Relic Service. You may not use the Software in conjunction with any other similar service.
19
14
 
20
- ### Restrictions on Use
15
+ ### Restrictions on Use
21
16
 
22
- 1. The use of the Pre-Release Software is limited to you and your organization. You cannot expose the Pre-Release Software to third parties via the network or use the Pre-Release Software on behalf of anyone else.
23
- 2. You cannot modify the Pre-Release Software. You can compile or link the Pre-Release Software into your programs as described in the New Relic Documentation, but you cannot otherwise make any derivative works of the Pre-Release Software.
24
- 3. You cannot reverse engineer or decompile the Pre-Release Software.
25
- 4. You cannot use the Pre-Release Software for competitive analysis, benchmarking, or any purposes that compete with or are intended to compete with New Relic.
26
- 5. You cannot remove or obscure any proprietary notices in the Pre-Release Software.
27
- 6. You can only copy the Software to the extent needed to use the Pre-Release Software within your organization. You cannot distribute the Software to any third parties.
28
- 7. You can only use the New Relic Services and the Pre-Release Software consistent with New Relic’s product Documentation and Acceptable Use Policy.
17
+ 1. The use of the Software is limited to you and your organization. You cannot expose the Software to third parties via the network or use the Software on behalf of anyone else.
18
+ 2. You cannot modify the Software. You can compile or link the Software into your programs as described in the New Relic Documentation, but you cannot otherwise make any derivative works of the Software.
19
+ 3. You cannot reverse engineer or decompile the Software.
20
+ 4. You cannot use the Software for competitive analysis, benchmarking, or any purposes that compete with or are intended to compete with New Relic.
21
+ 5. You cannot remove or obscure any proprietary notices in the Software.
22
+ 6. You can only copy the Software to the extent needed to use the Software within your organization. You cannot distribute the Software to any third parties.
23
+ 7. You can only use the New Relic Services and the Software consistent with your subscription agreement with New Relic, New Relic’s product Documentation and Acceptable Use Policy.
29
24
 
30
25
  ### Intellectual Property
31
26
 
32
- Any feedback provided to New Relic about the Pre-Release Software, including feedback provided as source code, comments, or other copyrightable or patentable material, is provided to New Relic under the terms of the Apache Software License, version 2. If you do not provide attribution information or a copy of the license with your feedback, you waive the performance of those requirements of the Apache License with respect to New Relic. The license grant regarding any feedback is irrevocable and persists past the termination of this license.
27
+ Any feedback provided to New Relic about the Software, including feedback provided as source code, comments, or other copyrightable or patentable material, is provided to New Relic under the terms of the Apache Software License, version 2. If you do not provide attribution information or a copy of the license with your feedback, you waive the performance of those requirements of the Apache License with respect to New Relic. The license grant regarding any feedback is irrevocable and persists past the termination of this license.
33
28
 
34
29
  ### Termination
35
30
 
36
- This license terminates when the Pre-Release Software stops being provided by New Relic or when described by the New Relic Pre-Release Agreement, whichever comes first. When this license terminates, you have a commercially reasonable time to either remove the Pre-Release Software from your systems or to upgrade to a publicly released version of the Software.
31
+ This license terminates when the Software stops being provided by New Relic or when described by the New Relic subscription agreement, whichever comes first. When this license terminates, you have a commercially reasonable time to either remove the Software from your systems.
37
32
 
38
33
  ### Other Terms
39
34
 
40
- 1. The Pre-Release Software is provided “AS IS.” New Relic disclaims all warranties, whether express, implied, statutory or otherwise, including warranties of merchantability, fitness for a particular purpose, title and noninfringement.
41
- 2. The Pre-Release Software has known flaws. You use the Pre-Release Software at your own risk.
42
- 3. To the full extent permitted by law, New Relic will have no liability arising from or related to the Pre-Release Software or from this license for any direct, indirect, special, incidental, or consequential damages of any kind, even if advised of their possibility in advance, and regardless of legal theory (whether contract, tort, negligence, strict liability or otherwise).
43
- 4. The Pre-Release Software may contain third-party software, including open source software. The third party software is governed by its own license and subject to its own terms, disclosed in the provided licensing information associated with the third party components. If a source code disclosure is required under the terms of the license covering any OSS component, the source code can be requested of New Relic by emailing opensource@newrelic.com.
35
+ 1. The Software is provided “AS IS.” New Relic disclaims all warranties, whether express, implied, statutory or otherwise, including warranties of merchantability, fitness for a particular purpose, title, and noninfringement.
36
+ 2. To the full extent permitted by law, New Relic will have no liability arising from or related to the Software or from this license for any direct, indirect, special, incidental, or consequential damages of any kind, even if advised of their possibility in advance, and regardless of legal theory (whether contract, tort, negligence, strict liability or otherwise).
37
+ 3. The Software may contain third-party software, including open source software (“OSS”). The third party software is governed by its own license and subject to its own terms, disclosed in the provided licensing information associated with the third party components. If a source code disclosure is required under the terms of the license covering any OSS component, the source code can be requested of New Relic by emailing opensource@newrelic.com.
38
+
package/README.md CHANGED
@@ -70,6 +70,18 @@ The [Developer docs](http://newrelic.github.io/node-newrelic/) for writing instr
70
70
 
71
71
  For more information, please see New Relic Node.js agent [compatibility and requirements](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent/).
72
72
 
73
+ ### Supported Vulnerabilities
74
+ - Remote Code Execution
75
+ - SQL Injection
76
+ - NoSQL Injection
77
+ - Stored XSS
78
+ - Reflected XSS
79
+ - Reverse Shell attack
80
+ - File Access
81
+ - SSRF
82
+ - Application Integrity Violation
83
+ - LDAP Injection
84
+ - XPath Injection
73
85
  ## Testing
74
86
 
75
87
  The module includes a suite of unit and functional tests which should be used to
@@ -99,7 +111,7 @@ If you believe you have found a security vulnerability in this project or any of
99
111
  If you would like to contribute to this project, review [these guidelines](https://github.com/newrelic/csec-node-agent/blob/main/CONTRIBUTING.md).
100
112
 
101
113
  ## License
102
- The New Relic security agent is licensed under the New Relic Pre-Release Software Notice.
114
+ The New Relic security agent is licensed under the New Relic Software License v1.0.
103
115
  The `@newrelic/security-agent` also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.
104
116
 
105
117
  [1]: https://img.shields.io/npm/v/@newrelic/security-agent.svg
@@ -14,7 +14,6 @@ code, the source code can be found at [https://github.com/newrelic/csec-node-age
14
14
 
15
15
  **[dependencies](#dependencies)**
16
16
 
17
- * [@aws-sdk/client-lambda](#aws-sdkclient-lambda)
18
17
  * [axios](#axios)
19
18
  * [check-disk-space](#check-disk-space)
20
19
  * [content-type](#content-type)
@@ -73,218 +72,9 @@ code, the source code can be found at [https://github.com/newrelic/csec-node-age
73
72
 
74
73
  ## dependencies
75
74
 
76
- ### @aws-sdk/client-lambda
77
-
78
- This product includes source derived from [@aws-sdk/client-lambda](https://github.com/aws/aws-sdk-js-v3) ([v3.436.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.436.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.436.0/LICENSE):
79
-
80
- ```
81
- Apache License
82
- Version 2.0, January 2004
83
- http://www.apache.org/licenses/
84
-
85
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
86
-
87
- 1. Definitions.
88
-
89
- "License" shall mean the terms and conditions for use, reproduction,
90
- and distribution as defined by Sections 1 through 9 of this document.
91
-
92
- "Licensor" shall mean the copyright owner or entity authorized by
93
- the copyright owner that is granting the License.
94
-
95
- "Legal Entity" shall mean the union of the acting entity and all
96
- other entities that control, are controlled by, or are under common
97
- control with that entity. For the purposes of this definition,
98
- "control" means (i) the power, direct or indirect, to cause the
99
- direction or management of such entity, whether by contract or
100
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
101
- outstanding shares, or (iii) beneficial ownership of such entity.
102
-
103
- "You" (or "Your") shall mean an individual or Legal Entity
104
- exercising permissions granted by this License.
105
-
106
- "Source" form shall mean the preferred form for making modifications,
107
- including but not limited to software source code, documentation
108
- source, and configuration files.
109
-
110
- "Object" form shall mean any form resulting from mechanical
111
- transformation or translation of a Source form, including but
112
- not limited to compiled object code, generated documentation,
113
- and conversions to other media types.
114
-
115
- "Work" shall mean the work of authorship, whether in Source or
116
- Object form, made available under the License, as indicated by a
117
- copyright notice that is included in or attached to the work
118
- (an example is provided in the Appendix below).
119
-
120
- "Derivative Works" shall mean any work, whether in Source or Object
121
- form, that is based on (or derived from) the Work and for which the
122
- editorial revisions, annotations, elaborations, or other modifications
123
- represent, as a whole, an original work of authorship. For the purposes
124
- of this License, Derivative Works shall not include works that remain
125
- separable from, or merely link (or bind by name) to the interfaces of,
126
- the Work and Derivative Works thereof.
127
-
128
- "Contribution" shall mean any work of authorship, including
129
- the original version of the Work and any modifications or additions
130
- to that Work or Derivative Works thereof, that is intentionally
131
- submitted to Licensor for inclusion in the Work by the copyright owner
132
- or by an individual or Legal Entity authorized to submit on behalf of
133
- the copyright owner. For the purposes of this definition, "submitted"
134
- means any form of electronic, verbal, or written communication sent
135
- to the Licensor or its representatives, including but not limited to
136
- communication on electronic mailing lists, source code control systems,
137
- and issue tracking systems that are managed by, or on behalf of, the
138
- Licensor for the purpose of discussing and improving the Work, but
139
- excluding communication that is conspicuously marked or otherwise
140
- designated in writing by the copyright owner as "Not a Contribution."
141
-
142
- "Contributor" shall mean Licensor and any individual or Legal Entity
143
- on behalf of whom a Contribution has been received by Licensor and
144
- subsequently incorporated within the Work.
145
-
146
- 2. Grant of Copyright License. Subject to the terms and conditions of
147
- this License, each Contributor hereby grants to You a perpetual,
148
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
149
- copyright license to reproduce, prepare Derivative Works of,
150
- publicly display, publicly perform, sublicense, and distribute the
151
- Work and such Derivative Works in Source or Object form.
152
-
153
- 3. Grant of Patent License. Subject to the terms and conditions of
154
- this License, each Contributor hereby grants to You a perpetual,
155
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
156
- (except as stated in this section) patent license to make, have made,
157
- use, offer to sell, sell, import, and otherwise transfer the Work,
158
- where such license applies only to those patent claims licensable
159
- by such Contributor that are necessarily infringed by their
160
- Contribution(s) alone or by combination of their Contribution(s)
161
- with the Work to which such Contribution(s) was submitted. If You
162
- institute patent litigation against any entity (including a
163
- cross-claim or counterclaim in a lawsuit) alleging that the Work
164
- or a Contribution incorporated within the Work constitutes direct
165
- or contributory patent infringement, then any patent licenses
166
- granted to You under this License for that Work shall terminate
167
- as of the date such litigation is filed.
168
-
169
- 4. Redistribution. You may reproduce and distribute copies of the
170
- Work or Derivative Works thereof in any medium, with or without
171
- modifications, and in Source or Object form, provided that You
172
- meet the following conditions:
173
-
174
- (a) You must give any other recipients of the Work or
175
- Derivative Works a copy of this License; and
176
-
177
- (b) You must cause any modified files to carry prominent notices
178
- stating that You changed the files; and
179
-
180
- (c) You must retain, in the Source form of any Derivative Works
181
- that You distribute, all copyright, patent, trademark, and
182
- attribution notices from the Source form of the Work,
183
- excluding those notices that do not pertain to any part of
184
- the Derivative Works; and
185
-
186
- (d) If the Work includes a "NOTICE" text file as part of its
187
- distribution, then any Derivative Works that You distribute must
188
- include a readable copy of the attribution notices contained
189
- within such NOTICE file, excluding those notices that do not
190
- pertain to any part of the Derivative Works, in at least one
191
- of the following places: within a NOTICE text file distributed
192
- as part of the Derivative Works; within the Source form or
193
- documentation, if provided along with the Derivative Works; or,
194
- within a display generated by the Derivative Works, if and
195
- wherever such third-party notices normally appear. The contents
196
- of the NOTICE file are for informational purposes only and
197
- do not modify the License. You may add Your own attribution
198
- notices within Derivative Works that You distribute, alongside
199
- or as an addendum to the NOTICE text from the Work, provided
200
- that such additional attribution notices cannot be construed
201
- as modifying the License.
202
-
203
- You may add Your own copyright statement to Your modifications and
204
- may provide additional or different license terms and conditions
205
- for use, reproduction, or distribution of Your modifications, or
206
- for any such Derivative Works as a whole, provided Your use,
207
- reproduction, and distribution of the Work otherwise complies with
208
- the conditions stated in this License.
209
-
210
- 5. Submission of Contributions. Unless You explicitly state otherwise,
211
- any Contribution intentionally submitted for inclusion in the Work
212
- by You to the Licensor shall be under the terms and conditions of
213
- this License, without any additional terms or conditions.
214
- Notwithstanding the above, nothing herein shall supersede or modify
215
- the terms of any separate license agreement you may have executed
216
- with Licensor regarding such Contributions.
217
-
218
- 6. Trademarks. This License does not grant permission to use the trade
219
- names, trademarks, service marks, or product names of the Licensor,
220
- except as required for reasonable and customary use in describing the
221
- origin of the Work and reproducing the content of the NOTICE file.
222
-
223
- 7. Disclaimer of Warranty. Unless required by applicable law or
224
- agreed to in writing, Licensor provides the Work (and each
225
- Contributor provides its Contributions) on an "AS IS" BASIS,
226
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
227
- implied, including, without limitation, any warranties or conditions
228
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
229
- PARTICULAR PURPOSE. You are solely responsible for determining the
230
- appropriateness of using or redistributing the Work and assume any
231
- risks associated with Your exercise of permissions under this License.
232
-
233
- 8. Limitation of Liability. In no event and under no legal theory,
234
- whether in tort (including negligence), contract, or otherwise,
235
- unless required by applicable law (such as deliberate and grossly
236
- negligent acts) or agreed to in writing, shall any Contributor be
237
- liable to You for damages, including any direct, indirect, special,
238
- incidental, or consequential damages of any character arising as a
239
- result of this License or out of the use or inability to use the
240
- Work (including but not limited to damages for loss of goodwill,
241
- work stoppage, computer failure or malfunction, or any and all
242
- other commercial damages or losses), even if such Contributor
243
- has been advised of the possibility of such damages.
244
-
245
- 9. Accepting Warranty or Additional Liability. While redistributing
246
- the Work or Derivative Works thereof, You may choose to offer,
247
- and charge a fee for, acceptance of support, warranty, indemnity,
248
- or other liability obligations and/or rights consistent with this
249
- License. However, in accepting such obligations, You may act only
250
- on Your own behalf and on Your sole responsibility, not on behalf
251
- of any other Contributor, and only if You agree to indemnify,
252
- defend, and hold each Contributor harmless for any liability
253
- incurred by, or claims asserted against, such Contributor by reason
254
- of your accepting any such warranty or additional liability.
255
-
256
- END OF TERMS AND CONDITIONS
257
-
258
- APPENDIX: How to apply the Apache License to your work.
259
-
260
- To apply the Apache License to your work, attach the following
261
- boilerplate notice, with the fields enclosed by brackets "{}"
262
- replaced with your own identifying information. (Don't include
263
- the brackets!) The text should be enclosed in the appropriate
264
- comment syntax for the file format. We also recommend that a
265
- file or class name and description of purpose be included on the
266
- same "printed page" as the copyright notice for easier
267
- identification within third-party archives.
268
-
269
- Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
270
-
271
- Licensed under the Apache License, Version 2.0 (the "License");
272
- you may not use this file except in compliance with the License.
273
- You may obtain a copy of the License at
274
-
275
- http://www.apache.org/licenses/LICENSE-2.0
276
-
277
- Unless required by applicable law or agreed to in writing, software
278
- distributed under the License is distributed on an "AS IS" BASIS,
279
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
- See the License for the specific language governing permissions and
281
- limitations under the License.
282
-
283
- ```
284
-
285
75
  ### axios
286
76
 
287
- This product includes source derived from [axios](https://github.com/axios/axios) ([v1.6.3](https://github.com/axios/axios/tree/v1.6.3)), distributed under the [MIT License](https://github.com/axios/axios/blob/v1.6.3/LICENSE):
77
+ This product includes source derived from [axios](https://github.com/axios/axios) ([v1.6.5](https://github.com/axios/axios/tree/v1.6.5)), distributed under the [MIT License](https://github.com/axios/axios/blob/v1.6.5/LICENSE):
288
78
 
289
79
  ```
290
80
  # Copyright (c) 2014-present Matt Zabriskie & Collaborators
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  * Copyright 2023 New Relic Corporation. All rights reserved.
4
- * SPDX-License-Identifier: New Relic Pre-Release
4
+ * SPDX-License-Identifier: New Relic Software License v1.0
5
5
  */
6
6
 
7
7
  'use strict';
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  * Copyright 2023 New Relic Corporation. All rights reserved.
4
- * SPDX-License-Identifier: New Relic Pre-Release
4
+ * SPDX-License-Identifier: New Relic Software License v1.0
5
5
  */
6
6
 
7
7
  const EVENT_TYPE = {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  const requestMap = new Map();
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  const path = require('path');
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  const stackTraceModule = require('./stack-trace');
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  'use strict'
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  'use strict'
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  'use strict'
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6
  module.exports = initialize;
@@ -118,7 +118,7 @@ function openHook(shim, mod, moduleName) {
118
118
  shim.wrap(mod, "open", function makeOpenWrapper(shim, fn) {
119
119
  logger.debug(`Instrumenting ${moduleName}.open`);
120
120
  return function openWrapper() {
121
- const parameters = Array.prototype.slice.apply(arguments);
121
+ let parameters = Array.prototype.slice.apply(arguments);
122
122
  const interceptedArgs = [arguments[0]];
123
123
  shim.interceptedArgs = interceptedArgs;
124
124
  const request = requestManager.getRequest(shim);
@@ -147,8 +147,9 @@ function openHook(shim, mod, moduleName) {
147
147
  } catch (error) {
148
148
 
149
149
  }
150
+ let absoluteParameters = [parameters[0]];
150
151
  const traceObject = secUtils.getTraceObject(shim);
151
- const secMetadata = securityMetaData.getSecurityMetaData(request, interceptedArgs, traceObject, secUtils.getExecutionId(), getCaseType(parameters[1], parameters[0]), EVENT_CATEGORY.FILE)
152
+ const secMetadata = securityMetaData.getSecurityMetaData(request, absoluteParameters, traceObject, secUtils.getExecutionId(), getCaseType(parameters[1], parameters[0]), EVENT_CATEGORY.FILE)
152
153
  this.secEvent = API.generateSecEvent(secMetadata);
153
154
  API.sendEvent(this.secEvent);
154
155
  const callbackFlag = isCallback(arguments);
@@ -180,12 +181,19 @@ function probableToFAHooks(shim, mod, moduleName) {
180
181
  shim.wrap(mod, fun, function makeFAWrapper(shim, fn) {
181
182
  logger.debug(`Instrumenting ${moduleName}.${fun}`);
182
183
  return function FAWrapper() {
184
+ let parameters = Array.prototype.slice.apply(arguments);
183
185
  const interceptedArgs = [arguments[0]];
184
186
  shim.interceptedArgs = interceptedArgs;
185
187
  const request = requestManager.getRequest(shim);
186
188
  if (request && typeof arguments[0] === STRING && !lodash.isEmpty(arguments[0])) {
187
189
  const traceObject = secUtils.getTraceObject(shim);
188
- const secMetadata = securityMetaData.getSecurityMetaData(request, interceptedArgs, traceObject, secUtils.getExecutionId(), EVENT_TYPE.FILE_OPERATION, EVENT_CATEGORY.FILE)
190
+ try {
191
+ parameters[0] = path.resolve(parameters[0]);
192
+ } catch (error) {
193
+
194
+ }
195
+ let absoluteParameters = [parameters[0]];
196
+ const secMetadata = securityMetaData.getSecurityMetaData(request, absoluteParameters, traceObject, secUtils.getExecutionId(), EVENT_TYPE.FILE_OPERATION, EVENT_CATEGORY.FILE)
189
197
  this.secEvent = API.generateSecEvent(secMetadata);
190
198
  API.sendEvent(this.secEvent);
191
199
  const callbackFlag = isCallback(arguments);
@@ -210,17 +218,25 @@ function probableToFIHooks(shim, mod, moduleName) {
210
218
  shim.wrap(mod, fun, function makeFIWrapper(shim, fn) {
211
219
  logger.debug(`Instrumenting ${moduleName}.${fun}`);
212
220
  return function FIWrapper() {
221
+ let parameters = Array.prototype.slice.apply(arguments);
213
222
  const interceptedArgs = [arguments[0]];
214
223
  shim.interceptedArgs = interceptedArgs;
215
224
  const request = requestManager.getRequest(shim);
216
225
  if (request && typeof arguments[0] === STRING && !lodash.isEmpty(arguments[0])) {
217
226
  const traceObject = secUtils.getTraceObject(shim);
227
+ try {
228
+ parameters[0] = path.resolve(parameters[0]);
229
+ parameters[1] = path.resolve(parameters[1]);
230
+ } catch (error) {
231
+
232
+ }
233
+ let absoluteParameters = [parameters[0]];
218
234
  if (fun === COPY_FILE || fun === RENAME) {
219
- const secMetadata = securityMetaData.getSecurityMetaData(request, arguments[1], traceObject, secUtils.getExecutionId(), getCase(arguments[1]), EVENT_CATEGORY.FILE)
235
+ const secMetadata = securityMetaData.getSecurityMetaData(request, parameters[1], traceObject, secUtils.getExecutionId(), getCase(arguments[1]), EVENT_CATEGORY.FILE)
220
236
  this.secEvent = API.generateSecEvent(secMetadata);
221
237
  API.sendEvent(this.secEvent);
222
238
  }
223
- const secMetadata = securityMetaData.getSecurityMetaData(request, interceptedArgs, traceObject, secUtils.getExecutionId(), getCase(arguments[0]), EVENT_CATEGORY.FILE)
239
+ const secMetadata = securityMetaData.getSecurityMetaData(request, absoluteParameters, traceObject, secUtils.getExecutionId(), getCase(arguments[0]), EVENT_CATEGORY.FILE)
224
240
  this.secEvent = API.generateSecEvent(secMetadata);
225
241
  API.sendEvent(this.secEvent);
226
242
  const callbackFlag = isCallback(arguments);
@@ -245,12 +261,19 @@ function probablePromiseToFAHooks(shim, mod, moduleName) {
245
261
  logger.debug(`Instrumenting Promise ${moduleName}.${fun}`);
246
262
  shim.wrap(mod, fun, function makeFAWrapper(shim, fn) {
247
263
  return function FAWrapper() {
264
+ let parameters = Array.prototype.slice.apply(arguments);
248
265
  const interceptedArgs = [arguments[0]];
249
266
  shim.interceptedArgs = interceptedArgs;
250
267
  const request = requestManager.getRequest(shim);
251
268
  if (request && typeof arguments[0] === STRING && !lodash.isEmpty(arguments[0])) {
252
269
  const traceObject = secUtils.getTraceObject(shim);
253
- const secMetadata = securityMetaData.getSecurityMetaData(request, interceptedArgs, traceObject, secUtils.getExecutionId(), EVENT_TYPE.FILE_OPERATION, EVENT_CATEGORY.FILE)
270
+ try {
271
+ parameters[0] = path.resolve(parameters[0]);
272
+ } catch (error) {
273
+
274
+ }
275
+ let absoluteParameters = [parameters[0]];
276
+ const secMetadata = securityMetaData.getSecurityMetaData(request, absoluteParameters, traceObject, secUtils.getExecutionId(), EVENT_TYPE.FILE_OPERATION, EVENT_CATEGORY.FILE)
254
277
  this.secEvent = API.generateSecEvent(secMetadata);
255
278
  API.sendEvent(this.secEvent);
256
279
  }
@@ -271,17 +294,25 @@ function probablePromiseToFIHooks(shim, mod, moduleName) {
271
294
  logger.debug(`Instrumenting Promise ${moduleName}.${fun}`);
272
295
  shim.wrap(mod, fun, function makeFIWrapper(shim, fn) {
273
296
  return function FIWrapper() {
297
+ let parameters = Array.prototype.slice.apply(arguments);
274
298
  const interceptedArgs = [arguments[0]];
275
299
  shim.interceptedArgs = interceptedArgs;
276
300
  const request = requestManager.getRequest(shim);
277
301
  if (request && typeof arguments[0] === STRING && !lodash.isEmpty(arguments[0])) {
278
302
  const traceObject = secUtils.getTraceObject(shim);
303
+ try {
304
+ parameters[0] = path.resolve(parameters[0]);
305
+ parameters[1] = path.resolve(parameters[1]);
306
+ } catch (error) {
307
+
308
+ }
309
+ let absoluteParameters = [parameters[0]];
279
310
  if (fun === COPY_FILE || fun === RENAME) {
280
- const secMetadata = securityMetaData.getSecurityMetaData(request, arguments[1], traceObject, secUtils.getExecutionId(), getCase(arguments[1]), EVENT_CATEGORY.FILE)
311
+ const secMetadata = securityMetaData.getSecurityMetaData(request, parameters[1], traceObject, secUtils.getExecutionId(), getCase(arguments[1]), EVENT_CATEGORY.FILE)
281
312
  this.secEvent = API.generateSecEvent(secMetadata);
282
313
  API.sendEvent(this.secEvent);
283
314
  }
284
- const secMetadata = securityMetaData.getSecurityMetaData(request, interceptedArgs, traceObject, secUtils.getExecutionId(), getCase(arguments[0]), EVENT_CATEGORY.FILE)
315
+ const secMetadata = securityMetaData.getSecurityMetaData(request, absoluteParameters, traceObject, secUtils.getExecutionId(), getCase(arguments[0]), EVENT_CATEGORY.FILE)
285
316
  this.secEvent = API.generateSecEvent(secMetadata);
286
317
  API.sendEvent(this.secEvent);
287
318
  }
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright 2023 New Relic Corporation. All rights reserved.
3
- * SPDX-License-Identifier: New Relic Pre-Release
3
+ * SPDX-License-Identifier: New Relic Software License v1.0
4
4
  */
5
5
 
6
6