@contrast/agent-bundle 5.40.0 → 5.41.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.
Files changed (258) hide show
  1. package/node_modules/@contrast/agent/package.json +11 -11
  2. package/node_modules/@contrast/agent-swc-plugin/index.js +9 -3
  3. package/node_modules/@contrast/agent-swc-plugin/methods.js +15 -1
  4. package/node_modules/@contrast/agent-swc-plugin/package.json +5 -8
  5. package/node_modules/@contrast/agent-swc-plugin/rewriter.wasm +0 -0
  6. package/node_modules/@contrast/agentify/lib/index.js +2 -2
  7. package/node_modules/@contrast/agentify/package.json +15 -14
  8. package/node_modules/@contrast/architecture-components/package.json +5 -5
  9. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
  10. package/node_modules/@contrast/assess/lib/dataflow/sources/install/body-parser.js +1 -1
  11. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +3 -1
  12. package/node_modules/@contrast/assess/lib/dataflow/sources/install/qs6.js +5 -5
  13. package/node_modules/@contrast/assess/lib/dataflow/sources/install/querystring.js +2 -1
  14. package/node_modules/@contrast/assess/lib/index.d.ts +0 -1
  15. package/node_modules/@contrast/assess/lib/make-source-context.js +7 -37
  16. package/node_modules/@contrast/assess/lib/sampler/common.js +7 -11
  17. package/node_modules/@contrast/assess/package.json +12 -11
  18. package/node_modules/@contrast/common/lib/types.d.ts +7 -1
  19. package/node_modules/@contrast/common/package.json +1 -1
  20. package/node_modules/@contrast/config/lib/common.js +1 -1
  21. package/node_modules/@contrast/config/lib/config.js +49 -27
  22. package/node_modules/@contrast/config/lib/index.d.ts +2 -2
  23. package/node_modules/@contrast/config/lib/options.js +4 -4
  24. package/node_modules/@contrast/config/package.json +4 -3
  25. package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +15 -15
  26. package/node_modules/@contrast/core/package.json +6 -6
  27. package/node_modules/@contrast/deadzones/package.json +5 -5
  28. package/node_modules/@contrast/dep-hooks/package.json +3 -3
  29. package/node_modules/@contrast/esm-hooks/package.json +6 -6
  30. package/node_modules/@contrast/instrumentation/lib/index.js +0 -1
  31. package/node_modules/@contrast/instrumentation/package.json +5 -5
  32. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +298 -148
  33. package/node_modules/@contrast/library-analysis/package.json +4 -4
  34. package/node_modules/@contrast/logger/lib/serializers.js +2 -2
  35. package/node_modules/@contrast/logger/package.json +3 -3
  36. package/node_modules/@contrast/metrics/package.json +6 -6
  37. package/node_modules/@contrast/patcher/package.json +2 -2
  38. package/node_modules/@contrast/protect/lib/get-source-context.js +3 -1
  39. package/node_modules/@contrast/protect/lib/index.js +6 -1
  40. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +7 -9
  41. package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +18 -19
  42. package/node_modules/@contrast/protect/lib/input-analysis/install/qs6.js +18 -17
  43. package/node_modules/@contrast/protect/lib/input-analysis/install/universal-cookie4.js +2 -3
  44. package/node_modules/@contrast/protect/lib/make-source-context.js +22 -66
  45. package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +73 -72
  46. package/node_modules/@contrast/protect/package.json +11 -11
  47. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +7 -7
  48. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +3 -3
  49. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +24 -21
  50. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
  51. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -2
  52. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +8 -2
  53. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -2
  54. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +22 -20
  55. package/node_modules/@contrast/reporter/package.json +7 -7
  56. package/node_modules/@contrast/rewriter/lib/index.js +2 -2
  57. package/node_modules/@contrast/rewriter/package.json +6 -6
  58. package/node_modules/@contrast/route-coverage/lib/index.js +1 -9
  59. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +17 -19
  60. package/node_modules/@contrast/route-coverage/package.json +8 -8
  61. package/node_modules/@contrast/scopes/package.json +5 -5
  62. package/node_modules/@contrast/sec-obs/lib/traces/http.js +2 -2
  63. package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +17 -0
  64. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.js +2 -2
  65. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.test.js +17 -0
  66. package/node_modules/@contrast/sec-obs/package.json +9 -9
  67. package/node_modules/@contrast/sources/lib/index.js +109 -0
  68. package/node_modules/@contrast/sources/lib/index.test.js +120 -0
  69. package/node_modules/@contrast/{route-coverage/lib/normalized-url-mapper.js → sources/lib/normalized-uri-mapper.js} +10 -3
  70. package/node_modules/@contrast/sources/lib/normalized-uri-mapper.test.js +59 -0
  71. package/node_modules/@contrast/{sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/constants.js → sources/lib/req-data.js} +0 -6
  72. package/node_modules/@contrast/sources/lib/source-info.js +183 -0
  73. package/node_modules/@contrast/sources/lib/source-info.test.js +68 -0
  74. package/node_modules/@contrast/sources/package.json +16 -0
  75. package/node_modules/@contrast/telemetry/package.json +6 -6
  76. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +2831 -77
  77. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +2831 -77
  78. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  79. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +415 -98
  80. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +415 -98
  81. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  82. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +106 -0
  83. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +106 -0
  84. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  85. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  86. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  87. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  88. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +2831 -77
  89. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +2831 -77
  90. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  91. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +415 -98
  92. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +415 -98
  93. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  94. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +106 -0
  95. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +106 -0
  96. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  97. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  98. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  99. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  100. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +2831 -77
  101. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +2858 -103
  102. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  103. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +415 -98
  104. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +420 -102
  105. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  106. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +106 -0
  107. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +106 -0
  108. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  109. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  110. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  111. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  112. package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -3
  113. package/node_modules/@types/node/README.md +2 -2
  114. package/node_modules/@types/node/fs.d.ts +13 -1
  115. package/node_modules/@types/node/http.d.ts +4 -19
  116. package/node_modules/@types/node/inspector.d.ts +53 -0
  117. package/node_modules/@types/node/package.json +2 -82
  118. package/node_modules/axios/CHANGELOG.md +17 -0
  119. package/node_modules/axios/README.md +1 -4
  120. package/node_modules/axios/dist/axios.js +39 -5
  121. package/node_modules/axios/dist/axios.js.map +1 -1
  122. package/node_modules/axios/dist/axios.min.js +2 -2
  123. package/node_modules/axios/dist/axios.min.js.map +1 -1
  124. package/node_modules/axios/dist/browser/axios.cjs +46 -9
  125. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  126. package/node_modules/axios/dist/esm/axios.js +46 -9
  127. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  128. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  129. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  130. package/node_modules/axios/dist/node/axios.cjs +46 -9
  131. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  132. package/node_modules/axios/index.d.cts +13 -2
  133. package/node_modules/axios/lib/core/Axios.js +2 -2
  134. package/node_modules/axios/lib/core/mergeConfig.js +1 -1
  135. package/node_modules/axios/lib/env/data.js +1 -1
  136. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  137. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  138. package/node_modules/axios/lib/utils.js +36 -0
  139. package/node_modules/axios/package.json +5 -5
  140. package/node_modules/deepmerge/.editorconfig +7 -0
  141. package/node_modules/deepmerge/.eslintcache +1 -0
  142. package/node_modules/deepmerge/changelog.md +167 -0
  143. package/node_modules/deepmerge/dist/cjs.js +133 -0
  144. package/node_modules/deepmerge/dist/umd.js +139 -0
  145. package/node_modules/deepmerge/index.d.ts +20 -0
  146. package/node_modules/deepmerge/index.js +106 -0
  147. package/node_modules/deepmerge/license.txt +21 -0
  148. package/node_modules/deepmerge/package.json +42 -0
  149. package/node_modules/deepmerge/readme.md +264 -0
  150. package/node_modules/deepmerge/rollup.config.js +22 -0
  151. package/node_modules/follow-redirects/package.json +1 -1
  152. package/node_modules/form-data/CHANGELOG.md +601 -0
  153. package/node_modules/form-data/{Readme.md → README.md} +4 -4
  154. package/node_modules/form-data/lib/form_data.js +2 -6
  155. package/node_modules/form-data/package.json +22 -6
  156. package/node_modules/nan/.github/workflows/ci.yml +8 -10
  157. package/node_modules/nan/.pre-commit-config.yaml +8 -0
  158. package/node_modules/nan/CHANGELOG.md +5 -1
  159. package/node_modules/nan/README.md +4 -4
  160. package/node_modules/nan/nan.h +16 -12
  161. package/node_modules/nan/nan_callbacks.h +13 -0
  162. package/node_modules/nan/nan_callbacks_12_inl.h +16 -2
  163. package/node_modules/nan/nan_callbacks_pre_12_inl.h +6 -2
  164. package/node_modules/nan/nan_maybe_43_inl.h +1 -1
  165. package/node_modules/nan/nan_maybe_pre_43_inl.h +1 -1
  166. package/node_modules/nan/nan_scriptorigin.h +11 -9
  167. package/node_modules/nan/nan_typedarray_contents.h +1 -1
  168. package/node_modules/nan/package.json +2 -2
  169. package/package.json +2 -2
  170. package/node_modules/@contrast/agentify/lib/sources.js +0 -95
  171. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/LICENSE +0 -12
  172. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.d.ts +0 -385
  173. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.js +0 -270
  174. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.d.ts +0 -40
  175. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.js +0 -228
  176. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.d.ts +0 -65
  177. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.js +0 -66
  178. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.d.ts +0 -383
  179. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.js +0 -30
  180. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/package.json +0 -23
  181. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/LICENSE +0 -12
  182. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/README.md +0 -44
  183. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/common.js +0 -131
  184. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/config.js +0 -290
  185. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.d.ts +0 -328
  186. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.js +0 -29
  187. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/options.js +0 -836
  188. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/validators.js +0 -23
  189. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/package.json +0 -27
  190. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/LICENSE +0 -12
  191. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/README.md +0 -98
  192. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/agent-info.js +0 -36
  193. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/app-info.js +0 -233
  194. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/build-id.js +0 -51
  195. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/capture-stacktrace.js +0 -256
  196. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/contrast-methods.js +0 -155
  197. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/index.d.ts +0 -52
  198. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/ioc/core.js +0 -95
  199. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/is-agent-path.js +0 -37
  200. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/messages.js +0 -28
  201. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +0 -63
  202. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
  203. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/server-settings-listener.js +0 -44
  204. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/cloud-provider-metadata.js +0 -146
  205. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/index.js +0 -225
  206. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/linux-os-info.js +0 -137
  207. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/utils.js +0 -35
  208. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/package.json +0 -33
  209. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/LICENSE +0 -12
  210. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/README.md +0 -94
  211. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +0 -121
  212. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +0 -206
  213. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +0 -72
  214. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +0 -88
  215. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +0 -46
  216. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -106
  217. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -28
  218. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.js +0 -66
  219. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.d.ts +0 -115
  220. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.js +0 -208
  221. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +0 -43
  222. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.js +0 -79
  223. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/package.json +0 -29
  224. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/LICENSE +0 -12
  225. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/README.md +0 -270
  226. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.d.ts +0 -16
  227. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.js +0 -132
  228. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.d.ts +0 -33
  229. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.js +0 -75
  230. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.d.ts +0 -15
  231. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.js +0 -34
  232. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/package.json +0 -28
  233. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/LICENSE +0 -12
  234. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/README.md +0 -51
  235. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.d.ts +0 -101
  236. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.js +0 -544
  237. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/package.json +0 -25
  238. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/LICENSE +0 -12
  239. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/README.md +0 -6
  240. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/cache.js +0 -318
  241. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/index.js +0 -216
  242. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/rewrite-is-deadzoned.js +0 -143
  243. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/package.json +0 -30
  244. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/LICENSE +0 -12
  245. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/constants.js +0 -26
  246. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.d.ts +0 -46
  247. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.js +0 -70
  248. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/bluebird.js +0 -128
  249. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/index.js +0 -34
  250. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb-core.js +0 -83
  251. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb3.js +0 -89
  252. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb4.js +0 -80
  253. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb6.js +0 -46
  254. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mysql.js +0 -151
  255. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/redis.js +0 -79
  256. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/utils.js +0 -35
  257. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/package.json +0 -28
  258. package/node_modules/form-data/README.md.bak +0 -355
@@ -1,290 +0,0 @@
1
- /*
2
- * Copyright: 2025 Contrast Security, Inc
3
- * Contact: support@contrastsecurity.com
4
- * License: Commercial
5
-
6
- * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security’s commercial offerings. Even though it is
8
- * made available through public repositories, use of this Software is subject to
9
- * the applicable End User Licensing Agreement found at
10
- * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
- * between Contrast Security and the End User. The Software may not be reverse
12
- * engineered, modified, repackaged, sold, redistributed or otherwise used in a
13
- * way not consistent with the End User License Agreement.
14
- */
15
-
16
- 'use strict';
17
-
18
- const process = require('process');
19
- const path = require('path');
20
- const fs = require('fs');
21
- const os = require('os');
22
- const yaml = require('yaml');
23
- const { Event, get, set, primordials: { ArrayPrototypeJoin, StringPrototypeToUpperCase, JSONParse } } = require('@contrast/common');
24
- const options = require('./options');
25
- const {
26
- ConfigSource: {
27
- CONTRAST_UI,
28
- DEFAULT_VALUE,
29
- ENVIRONMENT_VARIABLE,
30
- USER_CONFIGURATION_FILE,
31
- },
32
- mappings,
33
- ConfigSource,
34
- } = require('./common');
35
-
36
- const CONTRAST_CONFIG_PATH = 'CONTRAST_CONFIG_PATH';
37
- const CONTRAST_PREFIX = 'CONTRAST_';
38
- const HOME_CONFIG_DIR = path.resolve(os.homedir(), '.config', 'contrast');
39
- const OS_CONFIG_DIR = os.platform() === 'win32'
40
- ? path.resolve(process.env.ProgramData || '', 'contrast')
41
- : '/etc/contrast';
42
- const REDACTED_KEYS = ['api.api_key', 'api.service_key', 'api.token'];
43
- const OVERRIDABLE_SOURCES = [DEFAULT_VALUE, CONTRAST_UI];
44
-
45
- const isValid = (opt) => opt !== undefined && opt !== null && opt !== '';
46
-
47
- module.exports = class Config {
48
- constructor(core) {
49
- // internals
50
- this._filepath = '';
51
- this._errors = [];
52
- this._effectiveMap = new Map();
53
- this._status = '';
54
- this._logs = [];
55
-
56
- // config object
57
- this.api = {};
58
- this.agent = {
59
- diagnostics: {},
60
- reporters: {},
61
- security_logger: {},
62
- logger: {},
63
- node: {},
64
- };
65
- this.application = {};
66
- this.assess = {
67
- probabilistic_sampling: {
68
- route_monitor: {}
69
- }
70
- };
71
- this.inventory = {};
72
- this.protect = {
73
- rules: {},
74
- disabled_rules: ''
75
- };
76
- this.server = {};
77
-
78
- // initialize
79
- this._build();
80
- this._validate();
81
-
82
- // report all the errors found during initialization.
83
- if (this._errors.length) {
84
- const errors = ArrayPrototypeJoin.call(this._errors.map((e, ix) => `${ix + 1}) ${e.message}`), '; ');
85
- throw new Error(`Errors found in configuration ${errors}`);
86
- }
87
-
88
- core.messages?.on?.(Event.SERVER_SETTINGS_UPDATE, (msg) => {
89
- if (!this._status) this._status = 'Success';
90
-
91
- for (const [name, mapper] of Object.entries(mappings)) {
92
- if (OVERRIDABLE_SOURCES.includes(this.getEffectiveSource(name))) {
93
- const remoteValue = mapper(msg);
94
- if (isValid(remoteValue)) {
95
- this._effectiveMap.set(name, {
96
- canonical_name: name,
97
- name,
98
- value: remoteValue,
99
- source: CONTRAST_UI,
100
- });
101
- }
102
- }
103
- }
104
- });
105
- }
106
-
107
- _initEnv() {
108
- const { env } = process;
109
-
110
- if (env.pm2_env?.includes(CONTRAST_PREFIX)) {
111
- let parsedEnv;
112
-
113
- try {
114
- parsedEnv = JSONParse(env.pm2_env);
115
- } catch (_err) {
116
- const err = new Error(`Unable to parse pm2 environment variable: '${env.pm2_env}'`);
117
- err.cause = _err;
118
- this._errors.push(err);
119
- }
120
-
121
- for (const pm2EnvConfig of [parsedEnv?.env, parsedEnv]) {
122
- if (!pm2EnvConfig) continue;
123
-
124
- for (const [name, value] of Object.entries(pm2EnvConfig)) {
125
- if (env[name] || !name.startsWith(CONTRAST_PREFIX)) continue;
126
- env[name] = value;
127
- }
128
- }
129
- }
130
-
131
- return Object.entries(env).reduce((acc, [key, val]) => {
132
- const name = StringPrototypeToUpperCase.call(key);
133
- if (name.startsWith('CONTRAST_')) {
134
- acc[name] = val;
135
- }
136
- return acc;
137
- }, {});
138
- }
139
-
140
- /**
141
- * Returns the locations to search for configuration files. Being a function
142
- * allows us to stub these locations within tests.
143
- */
144
- _configDirs() {
145
- return [
146
- process.cwd(),
147
- path.resolve(OS_CONFIG_DIR, 'node'),
148
- OS_CONFIG_DIR,
149
- path.resolve(HOME_CONFIG_DIR, 'node'),
150
- HOME_CONFIG_DIR,
151
- ];
152
- }
153
-
154
- _initFile() {
155
- let fileConfig = {};
156
-
157
- this._filepath = process.env[CONTRAST_CONFIG_PATH];
158
-
159
- if (!this._filepath) {
160
- for (const dir of this._configDirs()) {
161
- const currentPath = path.resolve(dir, 'contrast_security.yaml');
162
- if (fs.existsSync(currentPath)) {
163
- this._filepath = currentPath;
164
- break;
165
- }
166
- }
167
- }
168
-
169
- const { _filepath } = this;
170
-
171
- // deliberately ignore /dev/null (linux) and \\.\\nul (windows)
172
- if (_filepath && _filepath !== os.devNull) {
173
- let fileContents;
174
-
175
- try {
176
- fileContents = fs.readFileSync(_filepath, 'utf-8');
177
- } catch (e) {
178
- const err = new Error(`Unable to read Contrast configuration file: '${_filepath}'`);
179
- err.cause = e;
180
- this._errors.push(err);
181
- }
182
-
183
- if (fileContents) {
184
- try {
185
- fileConfig = yaml.parse(fileContents, { prettyErrors: true });
186
- } catch (e) {
187
- const err = new Error(`Contrast configuration file is malformed: '${_filepath}'`);
188
- this._errors.push(err);
189
- err.cause = e;
190
- }
191
- }
192
- }
193
-
194
- return fileConfig;
195
- }
196
-
197
- _build() {
198
- const envOptions = this._initEnv();
199
- const fileOptions = this._initFile();
200
-
201
- this._effectiveMap.clear();
202
-
203
- for (const opt of options) {
204
- const envValue = envOptions[opt.env];
205
- const fileValue = get(fileOptions, opt.name);
206
- let source, value;
207
-
208
- if (isValid(envValue)) {
209
- source = ENVIRONMENT_VARIABLE;
210
- value = envValue;
211
- } else if (isValid(fileValue)) {
212
- source = USER_CONFIGURATION_FILE;
213
- value = fileValue;
214
- } else {
215
- value = opt.default;
216
- source = DEFAULT_VALUE;
217
- }
218
-
219
- if (opt.fn) value = opt.fn(value, this, source);
220
- if (opt.enum && !opt.enum.includes(value)) value = opt.default;
221
-
222
- set(this, opt.name, value);
223
- this._effectiveMap.set(opt.name, {
224
- canonical_name: opt.name,
225
- name: opt.name,
226
- value,
227
- source,
228
- });
229
- }
230
-
231
- // this is not a common config value
232
- this.setValue('preinstrument', !!process.env.CONTRAST_PREINSTRUMENT, ConfigSource.ENVIRONMENT_VARIABLE);
233
- }
234
-
235
- _redact(name, value) {
236
- if (value === null) return value;
237
- return REDACTED_KEYS.includes(name) ? `contrast-redacted-${name}` : value;
238
- }
239
-
240
- _validate() {
241
- if (
242
- get(this, 'application.session_id') &&
243
- get(this, 'application.session_metadata')
244
- ) {
245
- const err = new Error('Cannot set both `application.session_id` and `application.session_metadata`');
246
- this._errors.push(err);
247
- }
248
- }
249
-
250
- getReport({ redact = true }) {
251
- const report = {
252
- report_create: new Date(),
253
- config: {
254
- status: this._status
255
- }
256
- };
257
- const effective_config = [], environment_variable = [], contrast_ui = [];
258
-
259
- Array.from(this._effectiveMap.values()).forEach((v) => {
260
- let { value, name, canonical_name, source } = v;
261
- if (value === null) return;
262
- if (redact) value = this._redact(name, value);
263
- value = String(value);
264
-
265
- effective_config.push({ value, name, canonical_name, source });
266
-
267
- if (source === ENVIRONMENT_VARIABLE) environment_variable.push({ value, name, canonical_name });
268
- if (source === CONTRAST_UI) contrast_ui.push({ value, name, canonical_name });
269
- });
270
-
271
- report.config['effective_config'] = effective_config;
272
- if (contrast_ui.length) report.config['contrast_ui'] = contrast_ui;
273
- if (environment_variable.length) report.config['environment_variable'] = environment_variable;
274
-
275
- return report;
276
- }
277
-
278
- getEffectiveSource(canonicalName) {
279
- return this._effectiveMap.get(canonicalName)?.source;
280
- }
281
-
282
- getEffectiveValue(canonicalName) {
283
- return this._effectiveMap.get(canonicalName)?.value;
284
- }
285
-
286
- setValue(name, value, source) {
287
- this._effectiveMap.set(name, { canonical_name: name, name, source, value });
288
- set(this, name, value);
289
- }
290
- };
@@ -1,328 +0,0 @@
1
- /*
2
- * Copyright: 2025 Contrast Security, Inc
3
- * Contact: support@contrastsecurity.com
4
- * License: Commercial
5
-
6
- * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security’s commercial offerings. Even though it is
8
- * made available through public repositories, use of this Software is subject to
9
- * the applicable End User Licensing Agreement found at
10
- * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
- * between Contrast Security and the End User. The Software may not be reverse
12
- * engineered, modified, repackaged, sold, redistributed or otherwise used in a
13
- * way not consistent with the End User License Agreement.
14
- */
15
-
16
- import { ProtectRuleMode, Rule } from '@contrast/common';
17
- import { LevelWithSilent } from 'pino';
18
- export { ConfigSource } from './common';
19
-
20
- export interface EffectiveEntry<T> {
21
- canonical_name: string;
22
- name: string;
23
- value: T;
24
- source: string;
25
- }
26
-
27
- export type Level =
28
- | 'error'
29
- | 'warn'
30
- | 'info'
31
- | 'debug'
32
- | 'trace';
33
-
34
- export type SyslogLevel =
35
- | 'alert'
36
- | 'critical'
37
- | 'error'
38
- | 'warning'
39
- | 'notice'
40
- | 'info'
41
- | 'debug';
42
-
43
- export interface ConfigOption<T> {
44
- name: string;
45
- abbrev?: string;
46
- env: string;
47
- arg: string;
48
- enum?: T[];
49
- default?: T;
50
- fn?: (arg: any, cfg: Config, source: string) => T;
51
- desc: string;
52
- }
53
-
54
- export interface Config {
55
- _filepath: string;
56
- _effectiveMap: Map<string, EffectiveEntry<any>>;
57
- _errors: Error[];
58
- _status: string,
59
- _logs: {
60
- level: import('pino').LevelWithSilentOrString;
61
- obj?: any;
62
- msg: string;
63
- args?: any[];
64
- }[];
65
-
66
-
67
- api: {
68
- /** Default: `true` */
69
- enable: boolean;
70
- /** Default: `'https://app.contrastsecurity.com/Contrast'` */
71
- url: string;
72
- /** No default value but required when `api.enable` is `true` */
73
- api_key: string;
74
- /** No default value but required when `api.enable` is `true` */
75
- service_key: string;
76
- /** No default value but required when `api.enable` is `true` */
77
- user_name: string;
78
-
79
- certificate: {
80
- /** If set to `false`, the agent will ignore the certificate configuration in this section. Default: `true` */
81
- enable: boolean;
82
- /** Set the absolute or relative path to a CA for communication with the Contrast UI using a self-signed certificate. */
83
- ca_file?: string;
84
- /** Set the absolute or relative path to the Certificate PEM file for communication with the Contrast UI. */
85
- cert_file?: string;
86
- /** Set the absolute or relative path to the Key PEM file for communication with the Contrast UI. */
87
- key_file?: string;
88
- /** When set to `true`, the agent ignores certificate verification errors when the agent communicates with the Contrast UI. Default: `false` */
89
- ignore_cert_errors: boolean;
90
- };
91
-
92
- proxy: {
93
- /** Default: `false` */
94
- enable: boolean;
95
- /** No default value but required when `api.proxy.enable` is `true` */
96
- url: string;
97
- };
98
- };
99
-
100
- agent: {
101
- /**
102
- * Limit for stack trace size (larger limits will improve accuracy but
103
- * increase memory usage). Default: `10`
104
- */
105
- stack_trace_limit: number;
106
-
107
- /**
108
- * List of patterns to ignore within stack traces.
109
- * Default: `['agent-', '@contrast', 'node-agent']
110
- */
111
- stack_trace_filters: string[];
112
-
113
- diagnostics: {
114
- /** Default: `true` */
115
- enable: boolean;
116
- /** Default: `false` */
117
- quiet: boolean
118
- report_path?: string;
119
- };
120
-
121
- route_coverage: {
122
- /** Default: `true` */
123
- enable: boolean;
124
- };
125
-
126
- reporters: {
127
- /** Path indicating where to report all agent findings. */
128
- file?: string | number;
129
- };
130
-
131
- polling: {
132
- /** Default: `30000` */
133
- app_activity_ms: number;
134
- /** Default: `30000` */
135
- app_settings_ms: number;
136
- /** Default: `30000` */
137
- app_update_ms: number;
138
- /** Default: `30000` */
139
- server_settings_ms: number;
140
- };
141
-
142
- logger: {
143
- /** Default: `'./contrast.log'` */
144
- path: string;
145
-
146
- /**
147
- * Minimum log level. 'silent' disables logging entirely.
148
- * Default: `'info'`
149
- */
150
- level: LevelWithSilent;
151
-
152
- /**
153
- * When false, create a new log file on startup instead of appending and
154
- * rolling daily. Default: `true`
155
- */
156
- append: boolean;
157
-
158
- /** Suppress output when `false`. Default: `true` */
159
- stdout: boolean;
160
- };
161
-
162
- security_logger: {
163
- /** Default: `'./security.log'` */
164
- path: string;
165
- /** Default: `'error'` */
166
- level: Level;
167
- /** Default: `false` */
168
- stdout: boolean;
169
- syslog: {
170
- /** Default: `false` */
171
- enable: boolean;
172
- /** Default: `'127.0.0.1'` */
173
- ip: string;
174
- /** Default: `514` */
175
- port: number;
176
-
177
- /**
178
- * The facility code of the messages the agent sends to Syslog.
179
- * Values: 0-23, inclusive.
180
- * Default: `19`
181
- */
182
- facility: number;
183
-
184
- /** Log level of 'Exploited' attacks. Default: `'alert'` */
185
- severity_exploited: SyslogLevel;
186
- /** Log level of 'Blocked' attacks. Default: `'notice'` */
187
- severity_blocked: SyslogLevel;
188
- /** Log level of 'Blocked at Perimeter' attacks. Default: `'notice'` */
189
- severity_blocked_perimeter: SyslogLevel;
190
- /** Log level of 'Probed' attacks. Default: `'warning'` */
191
- severity_probed: SyslogLevel;
192
- /** Log level of suspcious but not blocked attacks. Default: `'warning'` */
193
- severity_suspicious: SyslogLevel;
194
- };
195
- };
196
-
197
- node: {
198
- /** Location to look for the app's package.json. Default: `process.cwd()` */
199
- app_root: string;
200
- rewrite: {
201
- /** Default: `true` */
202
- enable: boolean;
203
- cache: {
204
- /** Default: `true` */
205
- enable: boolean;
206
- /** Default: `./.contrast` */
207
- path: string;
208
- }
209
- /** Default: `true` */
210
- minify: boolean;
211
- };
212
- source_maps: {
213
- /** Default: `true` */
214
- enable: boolean;
215
- };
216
- library_usage: {
217
- reporting: {
218
- /** Default: `true` */
219
- enable: boolean;
220
- /** Default: `100` */
221
- interval_ms: number;
222
- };
223
- };
224
- metrics: {
225
- /** Default: `true` */
226
- enable: boolean;
227
- /** 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.' Default: `5000` */
228
- warn_ms: number;
229
- };
230
- /** Set the full path of the npm executable, used for library analysis. Default: `'npm'` */
231
- npm_path: string;
232
- };
233
- };
234
-
235
- inventory: {
236
- /** Default: `true` */
237
- analyze_libraries: boolean;
238
- gather_metadata_via: 'AWS' | 'Azure' | 'GCP' | undefined;
239
- };
240
-
241
- assess: {
242
- /** Default: `false` */
243
- enable: boolean;
244
- tags?: string;
245
- /** Default: `'ALL'` */
246
- stacktraces: string;
247
- /** Default: `150` */
248
- max_context_source_events: number;
249
- /** Default: `500` */
250
- max_propagation_events: number;
251
-
252
- safe_positives: {
253
- /** Default: `false` */
254
- enable: boolean;
255
- };
256
-
257
- /** Defualt: `false` */
258
- trust_custom_validators: boolean;
259
-
260
- // effective based on local config and 'assess.sampling' TS DTM
261
- probabilistic_sampling: {
262
- /** Defualt: `false` */
263
- enable: boolean,
264
- route_monitor: {
265
- /** Defualt: `3600000` */
266
- ttl_ms: number,
267
- }
268
- }
269
- };
270
-
271
- protect: {
272
- /** Default: `false` */
273
- enable: boolean;
274
-
275
- probe_analysis: {
276
- /** Default: `true` */
277
- enable: boolean;
278
- }
279
-
280
- rules: {
281
- /**
282
- * List of rule ids to disable.
283
- * Default: `[]`
284
- */
285
- disabled_rules: string[];
286
- } & Record<Omit<Rule, Rule.BOT_BLOCKER | Rule.IP_DENYLIST | Rule.VIRTUAL_PATCH>, { mode: ProtectRuleMode }>;
287
- };
288
-
289
- application: {
290
- /** Override the reported application name. */
291
- name?: string;
292
- /** Override the reported application path. Default: `'/'` */
293
- path: string;
294
- /** Add the name of the application group with which this application should be associated in the Contrast UI. */
295
- group?: string;
296
- /** Add the application code this application should use in the Contrast UI. */
297
- code?: string;
298
- /** Override the reported application version. */
299
- version?: string;
300
- /** Apply labels to an application. Labels must be formatted as a comma-delimited list. Example - `label1,label2,label3` */
301
- tags?: string;
302
- /** Comma-separated list of key=value pairs that are applied to each application reported by the agent. */
303
- metadata?: string;
304
- /** Provide the ID of a session existing within Contrast UI. Exclusive with `session_metadata` */
305
- session_id?: string;
306
- /** Provide metadata used to create a new session within Contrast UI. Exclusive with `session_id` */
307
- session_metadata?: string;
308
- };
309
-
310
- /** Reported server information overrides */
311
- server: {
312
- /** Default: `os.hostname()` */
313
- name: string;
314
- environment?: string;
315
- tags?: string;
316
- version?: string;
317
- /** Default: `true` */
318
- discover_cloud_resource: boolean;
319
- };
320
- getEffectiveSource(cannonicalName: string): string;
321
- getEffectiveValue<T = any>(cannonicalName: string): T;
322
- getReport({ redact: boolean }): any;
323
- setValue<T = any>(name: string, value: T, source: string): void;
324
- }
325
-
326
- declare function init(core: { config?: Config }): Config;
327
-
328
- export = init;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright: 2025 Contrast Security, Inc
3
- * Contact: support@contrastsecurity.com
4
- * License: Commercial
5
-
6
- * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security’s commercial offerings. Even though it is
8
- * made available through public repositories, use of this Software is subject to
9
- * the applicable End User Licensing Agreement found at
10
- * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
- * between Contrast Security and the End User. The Software may not be reverse
12
- * engineered, modified, repackaged, sold, redistributed or otherwise used in a
13
- * way not consistent with the End User License Agreement.
14
- */
15
-
16
- 'use strict';
17
-
18
- const { ConfigSource } = require('./common');
19
- const { Core } = require('@contrast/core/lib/ioc/core');
20
- const Config = require('./config');
21
-
22
- module.exports = Core.makeComponent({
23
- name: 'config',
24
- factory(core = {}) {
25
- return core.config = new Config(core);
26
- }
27
- });
28
-
29
- module.exports.ConfigSource = ConfigSource;