@contrast/agent-bundle 5.39.1 → 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 (279) hide show
  1. package/node_modules/@contrast/agent/lib/start-agent.js +50 -40
  2. package/node_modules/@contrast/agent/package.json +11 -11
  3. package/node_modules/@contrast/agent-swc-plugin/index.js +9 -3
  4. package/node_modules/@contrast/agent-swc-plugin/methods.js +15 -1
  5. package/node_modules/@contrast/agent-swc-plugin/package.json +5 -8
  6. package/node_modules/@contrast/agent-swc-plugin/rewriter.wasm +0 -0
  7. package/node_modules/@contrast/agentify/lib/index.js +2 -2
  8. package/node_modules/@contrast/agentify/package.json +15 -14
  9. package/node_modules/@contrast/architecture-components/package.json +5 -5
  10. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/string/replace.js +6 -3
  11. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
  12. package/node_modules/@contrast/assess/lib/dataflow/sources/index.js +1 -1
  13. package/node_modules/@contrast/assess/lib/dataflow/sources/install/{body-parser1.js → body-parser.js} +2 -2
  14. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +3 -1
  15. package/node_modules/@contrast/assess/lib/dataflow/sources/install/qs6.js +5 -5
  16. package/node_modules/@contrast/assess/lib/dataflow/sources/install/querystring.js +2 -1
  17. package/node_modules/@contrast/assess/lib/index.d.ts +0 -1
  18. package/node_modules/@contrast/assess/lib/make-source-context.js +7 -37
  19. package/node_modules/@contrast/assess/lib/sampler/common.js +7 -11
  20. package/node_modules/@contrast/assess/package.json +12 -11
  21. package/node_modules/@contrast/common/lib/constants.d.ts +6 -0
  22. package/node_modules/@contrast/common/lib/constants.js +8 -1
  23. package/node_modules/@contrast/common/lib/types.d.ts +7 -1
  24. package/node_modules/@contrast/common/package.json +1 -1
  25. package/node_modules/@contrast/config/lib/common.js +1 -1
  26. package/node_modules/@contrast/config/lib/config.js +49 -27
  27. package/node_modules/@contrast/config/lib/index.d.ts +3 -2
  28. package/node_modules/@contrast/config/lib/options.js +4 -4
  29. package/node_modules/@contrast/config/package.json +4 -3
  30. package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +15 -15
  31. package/node_modules/@contrast/core/package.json +6 -6
  32. package/node_modules/@contrast/deadzones/package.json +5 -5
  33. package/node_modules/@contrast/dep-hooks/package.json +3 -3
  34. package/node_modules/@contrast/esm-hooks/package.json +6 -6
  35. package/node_modules/@contrast/instrumentation/lib/index.js +0 -1
  36. package/node_modules/@contrast/instrumentation/package.json +5 -5
  37. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +300 -152
  38. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/index.js +9 -2
  39. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/utils.js +54 -43
  40. package/node_modules/@contrast/library-analysis/package.json +4 -4
  41. package/node_modules/@contrast/logger/lib/serializers.js +2 -2
  42. package/node_modules/@contrast/logger/package.json +3 -3
  43. package/node_modules/@contrast/metrics/package.json +6 -6
  44. package/node_modules/@contrast/patcher/package.json +2 -2
  45. package/node_modules/@contrast/protect/lib/get-source-context.js +3 -1
  46. package/node_modules/@contrast/protect/lib/index.js +6 -1
  47. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +7 -9
  48. package/node_modules/@contrast/protect/lib/input-analysis/index.js +1 -1
  49. package/node_modules/@contrast/protect/lib/input-analysis/install/{body-parser1.js → body-parser.js} +1 -1
  50. package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +18 -19
  51. package/node_modules/@contrast/protect/lib/input-analysis/install/qs6.js +18 -17
  52. package/node_modules/@contrast/protect/lib/input-analysis/install/universal-cookie4.js +2 -3
  53. package/node_modules/@contrast/protect/lib/make-source-context.js +22 -66
  54. package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +73 -72
  55. package/node_modules/@contrast/protect/package.json +11 -11
  56. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +7 -7
  57. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +3 -3
  58. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +24 -21
  59. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/routes-observed.js +2 -1
  60. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
  61. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -2
  62. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +8 -2
  63. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -2
  64. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +22 -20
  65. package/node_modules/@contrast/reporter/package.json +7 -7
  66. package/node_modules/@contrast/rewriter/lib/index.js +2 -2
  67. package/node_modules/@contrast/rewriter/package.json +6 -6
  68. package/node_modules/@contrast/route-coverage/lib/index.d.ts +2 -0
  69. package/node_modules/@contrast/route-coverage/lib/index.js +15 -17
  70. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +489 -202
  71. package/node_modules/@contrast/route-coverage/package.json +9 -9
  72. package/node_modules/@contrast/scopes/package.json +5 -5
  73. package/node_modules/@contrast/sec-obs/lib/traces/http.js +2 -2
  74. package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +17 -0
  75. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.js +2 -2
  76. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.test.js +17 -0
  77. package/node_modules/@contrast/sec-obs/package.json +9 -9
  78. package/node_modules/@contrast/sources/lib/index.js +109 -0
  79. package/node_modules/@contrast/sources/lib/index.test.js +120 -0
  80. package/node_modules/@contrast/{route-coverage/lib/normalized-url-mapper.js → sources/lib/normalized-uri-mapper.js} +10 -3
  81. package/node_modules/@contrast/sources/lib/normalized-uri-mapper.test.js +59 -0
  82. package/node_modules/@contrast/{sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/constants.js → sources/lib/req-data.js} +0 -6
  83. package/node_modules/@contrast/sources/lib/source-info.js +183 -0
  84. package/node_modules/@contrast/sources/lib/source-info.test.js +68 -0
  85. package/node_modules/@contrast/sources/package.json +16 -0
  86. package/node_modules/@contrast/telemetry/package.json +6 -6
  87. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +2831 -77
  88. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +2831 -77
  89. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  90. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +415 -98
  91. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +415 -98
  92. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  93. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +106 -0
  94. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +106 -0
  95. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  96. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  97. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  98. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  99. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +2831 -77
  100. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +2831 -77
  101. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  102. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +415 -98
  103. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +415 -98
  104. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  105. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +106 -0
  106. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +106 -0
  107. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  108. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  109. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  110. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  111. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +2831 -77
  112. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +2858 -103
  113. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  114. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +415 -98
  115. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +420 -102
  116. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  117. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +106 -0
  118. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +106 -0
  119. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  120. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  121. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  122. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  123. package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -3
  124. package/node_modules/@types/node/README.md +2 -2
  125. package/node_modules/@types/node/buffer.d.ts +5 -0
  126. package/node_modules/@types/node/dns/promises.d.ts +11 -10
  127. package/node_modules/@types/node/dns.d.ts +18 -19
  128. package/node_modules/@types/node/fs.d.ts +13 -1
  129. package/node_modules/@types/node/http.d.ts +4 -19
  130. package/node_modules/@types/node/inspector.d.ts +53 -0
  131. package/node_modules/@types/node/package.json +2 -82
  132. package/node_modules/@types/node/stream/web.d.ts +4 -0
  133. package/node_modules/axios/CHANGELOG.md +17 -0
  134. package/node_modules/axios/README.md +1 -4
  135. package/node_modules/axios/dist/axios.js +39 -5
  136. package/node_modules/axios/dist/axios.js.map +1 -1
  137. package/node_modules/axios/dist/axios.min.js +2 -2
  138. package/node_modules/axios/dist/axios.min.js.map +1 -1
  139. package/node_modules/axios/dist/browser/axios.cjs +46 -9
  140. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  141. package/node_modules/axios/dist/esm/axios.js +46 -9
  142. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  143. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  144. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  145. package/node_modules/axios/dist/node/axios.cjs +46 -9
  146. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  147. package/node_modules/axios/index.d.cts +13 -2
  148. package/node_modules/axios/lib/core/Axios.js +2 -2
  149. package/node_modules/axios/lib/core/mergeConfig.js +1 -1
  150. package/node_modules/axios/lib/env/data.js +1 -1
  151. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  152. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  153. package/node_modules/axios/lib/utils.js +36 -0
  154. package/node_modules/axios/package.json +5 -5
  155. package/node_modules/deepmerge/.editorconfig +7 -0
  156. package/node_modules/deepmerge/.eslintcache +1 -0
  157. package/node_modules/deepmerge/changelog.md +167 -0
  158. package/node_modules/deepmerge/dist/cjs.js +133 -0
  159. package/node_modules/deepmerge/dist/umd.js +139 -0
  160. package/node_modules/deepmerge/index.d.ts +20 -0
  161. package/node_modules/deepmerge/index.js +106 -0
  162. package/node_modules/{path-to-regexp/LICENSE → deepmerge/license.txt} +1 -1
  163. package/node_modules/deepmerge/package.json +42 -0
  164. package/node_modules/deepmerge/readme.md +264 -0
  165. package/node_modules/deepmerge/rollup.config.js +22 -0
  166. package/node_modules/follow-redirects/package.json +1 -1
  167. package/node_modules/form-data/CHANGELOG.md +601 -0
  168. package/node_modules/form-data/{Readme.md → README.md} +4 -4
  169. package/node_modules/form-data/lib/form_data.js +2 -6
  170. package/node_modules/form-data/package.json +22 -6
  171. package/node_modules/nan/.github/workflows/ci.yml +8 -10
  172. package/node_modules/nan/.pre-commit-config.yaml +8 -0
  173. package/node_modules/nan/CHANGELOG.md +5 -1
  174. package/node_modules/nan/README.md +4 -4
  175. package/node_modules/nan/nan.h +16 -12
  176. package/node_modules/nan/nan_callbacks.h +13 -0
  177. package/node_modules/nan/nan_callbacks_12_inl.h +16 -2
  178. package/node_modules/nan/nan_callbacks_pre_12_inl.h +6 -2
  179. package/node_modules/nan/nan_maybe_43_inl.h +1 -1
  180. package/node_modules/nan/nan_maybe_pre_43_inl.h +1 -1
  181. package/node_modules/nan/nan_scriptorigin.h +11 -9
  182. package/node_modules/nan/nan_typedarray_contents.h +1 -1
  183. package/node_modules/nan/package.json +2 -2
  184. package/package.json +5 -3
  185. package/node_modules/@contrast/agentify/lib/sources.js +0 -94
  186. package/node_modules/@contrast/route-coverage/lib/install/http.js +0 -44
  187. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/LICENSE +0 -12
  188. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.d.ts +0 -385
  189. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.js +0 -270
  190. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.d.ts +0 -40
  191. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.js +0 -228
  192. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.d.ts +0 -65
  193. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.js +0 -66
  194. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.d.ts +0 -383
  195. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.js +0 -30
  196. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/package.json +0 -23
  197. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/LICENSE +0 -12
  198. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/README.md +0 -44
  199. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/common.js +0 -131
  200. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/config.js +0 -290
  201. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.d.ts +0 -328
  202. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.js +0 -29
  203. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/options.js +0 -836
  204. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/validators.js +0 -23
  205. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/package.json +0 -27
  206. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/LICENSE +0 -12
  207. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/README.md +0 -98
  208. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/agent-info.js +0 -36
  209. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/app-info.js +0 -233
  210. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/build-id.js +0 -51
  211. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/capture-stacktrace.js +0 -256
  212. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/contrast-methods.js +0 -155
  213. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/index.d.ts +0 -52
  214. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/ioc/core.js +0 -95
  215. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/is-agent-path.js +0 -37
  216. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/messages.js +0 -28
  217. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +0 -63
  218. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
  219. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/server-settings-listener.js +0 -44
  220. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/cloud-provider-metadata.js +0 -146
  221. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/index.js +0 -225
  222. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/linux-os-info.js +0 -137
  223. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/utils.js +0 -35
  224. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/package.json +0 -33
  225. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/LICENSE +0 -12
  226. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/README.md +0 -94
  227. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +0 -121
  228. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +0 -206
  229. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +0 -72
  230. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +0 -88
  231. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +0 -46
  232. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -106
  233. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -28
  234. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.js +0 -66
  235. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.d.ts +0 -115
  236. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.js +0 -208
  237. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +0 -43
  238. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.js +0 -79
  239. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/package.json +0 -29
  240. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/LICENSE +0 -12
  241. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/README.md +0 -270
  242. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.d.ts +0 -16
  243. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.js +0 -132
  244. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.d.ts +0 -33
  245. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.js +0 -75
  246. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.d.ts +0 -15
  247. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.js +0 -34
  248. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/package.json +0 -28
  249. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/LICENSE +0 -12
  250. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/README.md +0 -51
  251. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.d.ts +0 -101
  252. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.js +0 -544
  253. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/package.json +0 -25
  254. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/LICENSE +0 -12
  255. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/README.md +0 -6
  256. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/cache.js +0 -318
  257. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/index.js +0 -216
  258. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/rewrite-is-deadzoned.js +0 -143
  259. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/package.json +0 -30
  260. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/LICENSE +0 -12
  261. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/constants.js +0 -26
  262. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.d.ts +0 -46
  263. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.js +0 -70
  264. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/bluebird.js +0 -128
  265. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/index.js +0 -34
  266. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb-core.js +0 -83
  267. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb3.js +0 -89
  268. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb4.js +0 -80
  269. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb6.js +0 -46
  270. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mysql.js +0 -151
  271. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/redis.js +0 -79
  272. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/utils.js +0 -35
  273. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/package.json +0 -28
  274. package/node_modules/form-data/README.md.bak +0 -355
  275. package/node_modules/path-to-regexp/Readme.md +0 -216
  276. package/node_modules/path-to-regexp/dist/index.d.ts +0 -136
  277. package/node_modules/path-to-regexp/dist/index.js +0 -403
  278. package/node_modules/path-to-regexp/dist/index.js.map +0 -1
  279. package/node_modules/path-to-regexp/package.json +0 -62
@@ -1,836 +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
- // @ts-check
17
-
18
- 'use strict';
19
-
20
- const os = require('os');
21
- const url = require('url');
22
- const path = require('path');
23
- const { Rule, primordials: { BufferFrom, BufferPrototypeToString, StringPrototypeReplace, StringPrototypeReplaceAll, StringPrototypeSplit, StringPrototypeToLowerCase, StringPrototypeToUpperCase, JSONParse } } = require('@contrast/common');
24
- const { ConfigSource: { DEFAULT_VALUE } } = require('./common');
25
-
26
- /**
27
- * Takes strings "true"|"t" or "false"|"f" (case insensitive) and return the appropriate boolean.
28
- * @param {boolean | string} value passed arg; never undefined or the function isn't called
29
- * @return {boolean | undefined}
30
- */
31
- function castBoolean(value) {
32
- const type = typeof value;
33
- if (type !== 'string' && type !== 'boolean') {
34
- return;
35
- }
36
- value = StringPrototypeToLowerCase.call(value.toString());
37
- return value === 'true' || value === 't'
38
- ? true
39
- : value === 'false' || value === 'f'
40
- ? false
41
- : undefined;
42
- }
43
-
44
- /**
45
- * Takes string path and resolves absolute path based on current working dir
46
- *
47
- * @param {string} value passed arg; never undefined or the function isn't called
48
- * @return {string | undefined} absolute path resolve from process.cwd()
49
- */
50
- function toAbsolutePath(value) {
51
- return value ? path.resolve(process.cwd(), String(value)) : undefined;
52
- }
53
-
54
- function clearBaseCase(val) {
55
- const type = typeof val;
56
- return (type === 'string' && val === '') || (type === 'number' && isNaN(val))
57
- ? undefined
58
- : val;
59
- }
60
-
61
- const split = (val) => {
62
- if (val === '') return [];
63
- if (val === undefined) return val;
64
- return StringPrototypeSplit.call(val, ',');
65
- };
66
-
67
- const uppercase = (val = '') => clearBaseCase(`${StringPrototypeToUpperCase.call(val)}`);
68
- const lowercase = (val = '') => clearBaseCase(`${StringPrototypeToLowerCase.call(val)}`);
69
- const parseNum = (val) => {
70
- const float = parseFloat(val);
71
- return clearBaseCase(Math.ceil(float));
72
- };
73
-
74
- /**
75
- * Sets up the agent config. All options include a name and a description.
76
- * Where the setting is not a boolean, they include args as well.
77
- *
78
- * The module currently houses all new common config settings.
79
- *
80
- * Other settings include:
81
- * - fn: a function to run on the original value (eg type coercion or sanitizing). Returns undefined if it can't do anything with the value it is given.
82
- * - enum: validation of whether type matches enumerated value
83
- *
84
- * NOTE: I'm not sure if validation should also be specified and handled here.
85
- *
86
- * TODO: add defaults to all new options
87
- *
88
- * TODO: add mapping for TeamServer FeatureSet analogues where they differ
89
- *
90
- * @type {import('.').ConfigOption[]}
91
- */
92
- const options = [
93
- {
94
- name: 'enable',
95
- arg: '[true]',
96
- default: true,
97
- fn: castBoolean,
98
- desc: 'Set to `false` to disable Contrast agent.',
99
- },
100
- // api
101
- {
102
- name: 'api.enable',
103
- arg: '[false]',
104
- default: true,
105
- fn: castBoolean,
106
- desc: 'Set to `false` to disable Contrast UI communication.',
107
- },
108
- {
109
- name: 'api.url',
110
- arg: '<url>',
111
- default: 'https://app.contrastsecurity.com/Contrast',
112
- // The old json spec used to expect that the url would not end in /Contrast
113
- // Common config expects this to be there. So, we need to do a bit of massaging
114
- // to make sure our reporter gets a consistent URL one way or the other.
115
- fn: (value) => {
116
- if (value === undefined) {
117
- return;
118
- }
119
-
120
- value = String(value);
121
- let uri;
122
- try {
123
- uri = new url.URL(value);
124
- } catch (e) {
125
- // the url customer provided is invalid, return null and this will eventually
126
- // fail when trying to talk to TS
127
- return null;
128
- }
129
-
130
- if (uri.pathname) {
131
- // kill trailling /
132
- uri.pathname = StringPrototypeReplace.call(uri.pathname, /\/+$/, '');
133
-
134
- if (!uri.pathname.endsWith('Contrast')) {
135
- uri.pathname += 'Contrast';
136
- }
137
-
138
- return url.format(uri);
139
- }
140
- return value;
141
- },
142
- desc: 'Set the URL for the Contrast UI.',
143
- },
144
- {
145
- name: 'api.api_key',
146
- arg: '<key>',
147
- desc: 'Set the API key needed to communicate with the Contrast UI.',
148
- },
149
- {
150
- name: 'api.service_key',
151
- arg: '<key>',
152
- desc: 'Set the service key needed to communicate with the Contrast UI. It is used to calculate the Authorization header.',
153
- },
154
- {
155
- name: 'api.user_name',
156
- arg: '<name>',
157
- desc: 'Set the user name used to communicate with the Contrast UI. It is used to calculate the Authorization header.',
158
- },
159
- {
160
- name: 'api.token',
161
- arg: '<token>',
162
- desc: 'base64 encoded JSON object containing the `url`, `api_key`, `service_key`, and `user_name` config options, allowing them all to be set in a single variable.',
163
- fn(value, cfg, source) {
164
- try {
165
- // parse the base64 encoded value
166
- const parsed = JSONParse(BufferPrototypeToString.call(BufferFrom(value, 'base64'), 'utf8'));
167
- // set the top level `api` keys only if they aren't already present.
168
- // since this value comes after the others, they should be set first if present in the config file or environment.
169
- ['url', 'api_key', 'service_key', 'user_name'].forEach(key => {
170
- const canonicalName = `api.${key}`;
171
- const existingSource = cfg.getEffectiveSource(canonicalName);
172
- if (existingSource !== DEFAULT_VALUE) {
173
- cfg._logs.push({
174
- level: 'warn',
175
- msg: 'Using configured value for `%s` (set by %s) instead of `api.token`.',
176
- args: [canonicalName, existingSource]
177
- });
178
- } else {
179
- cfg.setValue(canonicalName, parsed[key], source);
180
- }
181
- });
182
- return value;
183
- } catch {
184
- return null;
185
- }
186
- }
187
- },
188
- // api.certificate
189
- {
190
- name: 'api.certificate.enable',
191
- desc: 'If set to `false`, the agent will ignore the certificate configuration in this section.',
192
- arg: '[false]',
193
- default: true,
194
- },
195
- {
196
- name: 'api.certificate.ca_file',
197
- description: 'Set the absolute or relative path to a CA for communication with the Contrast UI using a self-signed certificate.',
198
- arg: '<path>',
199
- fn: toAbsolutePath,
200
- },
201
- {
202
- name: 'api.certificate.cert_file',
203
- description: 'Set the absolute or relative path to the Certificate PEM file for communication with the Contrast UI.',
204
- arg: '<path>',
205
- fn: toAbsolutePath,
206
- },
207
- {
208
- name: 'api.certificate.key_file',
209
- description: 'Set the absolute or relative path to the Key PEM file for communication with the Contrast UI.',
210
- arg: '<path>',
211
- fn: toAbsolutePath,
212
- },
213
- {
214
- name: 'api.certificate.ignore_cert_errors',
215
- description: 'When set to `true`, the agent ignores certificate verification errors when the agent communicates with the Contrast UI.',
216
- arg: '[true]',
217
- default: false,
218
- },
219
- // api.proxy
220
- {
221
- name: 'api.proxy.enable',
222
- arg: '[true]',
223
- default: false,
224
- desc: "Set value to `true` for the agent to communicate with the Contrast web interface over a proxy. Set value to `false` if you don't want to use the proxy.",
225
- },
226
- {
227
- name: 'api.proxy.url',
228
- arg: '<url>',
229
- desc: 'Set the URL for your Proxy Server. The URL form is `scheme://host:port`.',
230
- },
231
- // agent
232
- {
233
- name: 'agent.stack_trace_limit',
234
- arg: '<limit>',
235
- default: 10,
236
- fn: parseNum,
237
- desc: 'Set to limit the length of Error stack traces to a specified number. Larger limits will improve accuracy but increase memory usage.',
238
- },
239
- {
240
- name: 'agent.stack_trace_filters',
241
- arg: '<list,of,filters>',
242
- default: 'agent-,@contrast,node-agent',
243
- fn: split,
244
- desc: 'Comma-separated list of patterns to ignore within stack traces.',
245
- },
246
- // agent.diagnostics
247
- {
248
- name: 'agent.diagnostics.enable',
249
- arg: '[false]',
250
- default: true,
251
- fn: castBoolean,
252
- desc: 'Set to `false` to disable agent diagnostics.',
253
- },
254
- {
255
- name: 'agent.diagnostics.report_path',
256
- arg: '<path>',
257
- default: '.',
258
- fn: toAbsolutePath,
259
- desc: "Set the directory in which to write diagnostic files. Defaults to the application's current working directory.",
260
- },
261
- // agent.route_coverage
262
- {
263
- name: 'agent.route_coverage.enable',
264
- arg: '[false]',
265
- default: true,
266
- fn: castBoolean,
267
- desc: 'Set to `false` for the agent to not send route-based coverage data to the Contrast UI.',
268
- },
269
- // agent.reporters
270
- // NOTE: Java has a `reporting` node--use that?
271
- {
272
- name: 'agent.reporters.file',
273
- arg: '<path>',
274
- desc: 'path indicating where to report all agent findings',
275
- },
276
- // agent.heap_dump
277
- {
278
- name: 'agent.heap_dump.enable',
279
- arg: '[true]',
280
- fn: castBoolean,
281
- default: false,
282
- desc: 'Set to \'true\' for the agent to automatically take heap dumps of the instrumented application.',
283
- },
284
- {
285
- name: 'agent.heap_dump.path',
286
- arg: '<path>',
287
- default: 'contrast_heap_dumps',
288
- desc: "Set the location to which to save the heap dump files. If relative, the path is determined based on the process' working directory.",
289
- },
290
- {
291
- name: 'agent.heap_dump.delay_ms',
292
- arg: '<time>',
293
- default: 10000,
294
- desc: 'Set the amount of time to wait, in milliseconds, after agent startup to begin taking heap dumps.',
295
- },
296
- {
297
- name: 'agent.heap_dump.window_ms',
298
- arg: '<number>',
299
- default: 10000,
300
- desc: 'Set the amount of time to wait, in milliseconds, between each heap dump.',
301
- },
302
- {
303
- name: 'agent.heap_dump.count',
304
- arg: '<number>',
305
- default: 5,
306
- desc: 'Set the number of heap dumps to take before disabling this feature.',
307
- },
308
-
309
- // agent.polling
310
- {
311
- name: 'agent.polling.app_activity_ms',
312
- arg: '<ms>',
313
- default: 5000,
314
- fn: parseNum,
315
- desc: 'Set the frequency with which the agent sends application activity to the Contrast UI.',
316
- },
317
- {
318
- name: 'agent.polling.app_settings_ms',
319
- arg: '<ms>',
320
- default: 30000,
321
- fn: parseNum,
322
- desc: 'Set the frequency with which the agent sends application settings polls to the Contrast UI.',
323
- },
324
- {
325
- name: 'agent.polling.app_update_ms',
326
- arg: '<ms>',
327
- default: 5000,
328
- fn: parseNum,
329
- desc: 'Set the the frequency with which the agent sends application updates to the Contrast UI.',
330
- },
331
- {
332
- name: 'agent.polling.server_settings_ms',
333
- arg: '<ms>',
334
- default: 30000,
335
- fn: parseNum,
336
- desc: 'Set the frequency with which the agent sends server settings polls to the Contrast UI.',
337
- },
338
- // agent.logger
339
- {
340
- name: 'agent.logger.path',
341
- arg: '<path>',
342
- default: 'contrast.log',
343
- fn: toAbsolutePath,
344
- desc: `Enable diagnostic logging by setting a path to a log file. While diagnostic logging hurts performance, it generates useful information for debugging Contrast. The value set here is the location to which the agent saves log output. If no log file exists at this location, the agent creates a file.
345
- Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\` directory, and rotates it automatically as needed.`,
346
- },
347
- {
348
- name: 'agent.logger.level',
349
- arg: '<level>',
350
- enum: ['error', 'warn', 'info', 'debug', 'trace'],
351
- default: 'info',
352
- fn: lowercase,
353
- desc: 'Set the the log output level. Valid options are `ERROR`, `WARN`, `INFO`, `DEBUG`, and `TRACE`.',
354
- },
355
- {
356
- name: 'agent.logger.append',
357
- arg: '[false]',
358
- default: true,
359
- fn: castBoolean,
360
- desc: 'Set to `false` for the agent to always create a new log file instead of appending and rolling.',
361
- },
362
- {
363
- name: 'agent.logger.stdout',
364
- arg: '[false]',
365
- default: true,
366
- fn: castBoolean,
367
- desc: 'Set to `false` to suppress log output to `stdout`.',
368
- },
369
- // agent.security_logger
370
- {
371
- name: 'agent.security_logger.path',
372
- arg: '<path>',
373
- default: 'security.log',
374
- fn: toAbsolutePath,
375
- desc: 'Set the file to which the agent logs security events.',
376
- },
377
- {
378
- name: 'agent.security_logger.level',
379
- arg: '<level>',
380
- enum: ['error', 'warn', 'info', 'debug', 'trace'],
381
- default: 'error',
382
- fn: lowercase,
383
- desc: 'Set the log level for security logging. Valid options are `ERROR`, `WARN`, `INFO`, `DEBUG`, and `TRACE`.',
384
- },
385
- {
386
- name: 'agent.security_logger.stdout',
387
- arg: '[false]',
388
- default: false,
389
- fn: castBoolean,
390
- desc: 'Set to `true` to log output to `stdout` as well as the configured file.',
391
- },
392
- // agent.security_logger.syslog
393
- {
394
- name: 'agent.security_logger.syslog.enable',
395
- arg: '[true]',
396
- default: false,
397
- fn: castBoolean,
398
- desc: 'Set to `true` to enable Syslog logging.',
399
- },
400
- {
401
- name: 'agent.security_logger.syslog.ip',
402
- arg: '<ip>',
403
- default: '127.0.0.1',
404
- desc: 'Set the IP address of the Syslog server to which the agent should send messages.',
405
- },
406
- {
407
- name: 'agent.security_logger.syslog.port',
408
- arg: '<port>',
409
- default: 514,
410
- fn: parseNum,
411
- desc: 'Set the port of the Syslog server to which the agent should send messages.',
412
- },
413
- {
414
- name: 'agent.security_logger.syslog.facility',
415
- arg: '<facility>',
416
- enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
417
- default: 19,
418
- fn: parseNum,
419
- desc: 'Set the facility code of the messages the agent sends to Syslog.',
420
- },
421
- {
422
- name: 'agent.security_logger.syslog.severity_exploited',
423
- arg: '<level>',
424
- enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
425
- default: 'alert',
426
- fn: lowercase,
427
- desc: 'Set the log level of Exploited attacks. Value options are `ALERT`, `CRITICAL`, `ERROR`, `WARNING`, `NOTICE`, `INFO`, and `DEBUG`.',
428
- },
429
- {
430
- name: 'agent.security_logger.syslog.severity_blocked',
431
- arg: '<level>',
432
- enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
433
- default: 'notice',
434
- fn: lowercase,
435
- desc: 'Set the log level of Blocked attacks. Value options are `ALERT`, `CRITICAL`, `ERROR`, `WARNING`, `NOTICE`, `INFO`, and `DEBUG`.',
436
- },
437
- {
438
- name: 'agent.security_logger.syslog.severity_blocked_perimiter',
439
- arg: '<level>',
440
- enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
441
- default: 'notice',
442
- fn: lowercase,
443
- desc: 'Set the log level of Blocked At Perimeter attacks. Value options are `ALERT`, `CRITICAL`, `ERROR`, `WARNING`, `NOTICE`, `INFO`, and `DEBUG`.',
444
- },
445
- {
446
- name: 'agent.security_logger.syslog.severity_probed',
447
- arg: '<level>',
448
- enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
449
- default: 'warning',
450
- fn: lowercase,
451
- desc: 'Set the log level of Probed attacks. Value options are `ALERT`, `CRITICAL`, `ERROR`, `WARNING`, `NOTICE`, `INFO`, and `DEBUG`.',
452
- },
453
- {
454
- name: 'agent.security_logger.syslog.severity_suspicious',
455
- arg: '<level>',
456
- enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
457
- default: 'warning',
458
- fn: lowercase,
459
- desc: 'Set the log level of Suspicious attacks. Value options are `ALERT`, `CRITICAL`, `ERROR`, `WARNING`, `NOTICE`, `INFO`, and `DEBUG`.',
460
- },
461
- // agent.node
462
- {
463
- name: 'agent.node.app_root',
464
- arg: '<path>',
465
- default: process.cwd(),
466
- desc: "Set the directory containing the application's `package.json` file.",
467
- },
468
- {
469
- // SEE NODE-2886
470
- name: 'agent.node.cmd_ignore_list',
471
- arg: '<commands>',
472
- default: '',
473
- fn: (arg) => StringPrototypeSplit.call(arg, ',').filter((v) => v),
474
- desc: 'comma-separated list of commands that will not startup the agent if agent is required; npm* will ignore all npm executables but not your application\'s scripts'
475
- },
476
- {
477
- // SEE NODE-2886
478
- name: 'agent.node.exclusive_entrypoint',
479
- arg: '<entrypoint.js>',
480
- desc: 'an entrypoint for an application that, when specified, will prevent the agent instrumenting on anything else'
481
- },
482
- {
483
- name: 'agent.node.rewrite.enable',
484
- arg: '[false]',
485
- default: true,
486
- fn: castBoolean,
487
- desc: 'Set to `false` to disable source code rewriting. Not recommended.',
488
- },
489
- {
490
- name: 'agent.node.rewrite.cache.enable',
491
- arg: '[false]',
492
- default: true,
493
- fn: castBoolean,
494
- desc: 'Set to `false` to disable caching rewritten source code files.',
495
- },
496
- {
497
- name: 'agent.node.rewrite.cache.path',
498
- arg: '<path>',
499
- default: '.contrast',
500
- fn: toAbsolutePath,
501
- desc: "Set the directory in which to cache rewritten source code files. Defaults to `.contrast/` in the application's current working directory.",
502
- },
503
- {
504
- name: 'agent.node.rewrite.minify',
505
- arg: '[false]',
506
- default: true,
507
- fn: castBoolean,
508
- desc: 'Set to `false` to disable minification of rewritten source code files.'
509
- },
510
- {
511
- name: 'agent.node.source_maps.enable',
512
- arg: '[false]',
513
- default: true,
514
- fn: castBoolean,
515
- desc: 'Set to `false` to disable source map generation when rewriting.',
516
- },
517
- // agent.node.library_usage.reporting
518
- {
519
- name: 'agent.node.library_usage.reporting.enable',
520
- arg: '[false]',
521
- default: true,
522
- fn: castBoolean,
523
- desc: 'Set to `false` to disable enhanced library usage features, i.e. scanning for composition of dependencies, reporting library usage.',
524
- },
525
- {
526
- name: 'agent.node.library_usage.reporting.interval_ms',
527
- arg: '<num>',
528
- fn: parseNum,
529
- default: 100,
530
- desc: 'Set the interval (in milliseconds) for collecting code events for library usage.',
531
- },
532
- {
533
- name: 'agent.node.metrics.enable',
534
- arg: '[false]',
535
- default: true,
536
- fn: castBoolean,
537
- desc: 'Set to `false` to disable response latency metrics recording.'
538
- },
539
- {
540
- name: 'agent.node.metrics.warn_ms',
541
- arg: '<num>',
542
- default: 5000,
543
- fn: parseNum,
544
- desc: 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.'
545
- },
546
- {
547
- name: 'agent.node.npm_path',
548
- arg: '<path>',
549
- default: 'npm',
550
- desc: 'Set the full path of the npm executable, used for library analysis',
551
- },
552
- // inventory
553
- {
554
- name: 'inventory.analyze_libraries',
555
- arg: '[false]',
556
- default: true,
557
- fn: castBoolean,
558
- desc: 'Set to `false` to disable library analysis.',
559
- },
560
- {
561
- name: 'inventory.gather_metadata_via',
562
- arg: '<provider>',
563
- enum: ['AWS', 'Azure', 'GCP'],
564
- desc: 'Specifies the cloud provider from which the agent should gather metadata (such as resource identifiers). Options are `AWS`, `Azure`, or `GCP`'
565
- },
566
- // assess
567
- {
568
- name: 'assess.enable',
569
- arg: '[true]',
570
- default: false,
571
- fn: castBoolean,
572
- desc: 'Include this property to determine if the Assess feature should be enabled. If this property is not present, the decision is delegated to the Contrast UI.',
573
- },
574
- {
575
- name: 'assess.probabilistic_sampling.enable',
576
- arg: '[true]',
577
- default: false,
578
- fn: castBoolean,
579
- desc: 'Set to true to enable sampling of requests for dataflow and other Assess features',
580
- },
581
- {
582
- name: 'assess.probabilistic_sampling.baseline',
583
- arg: '<baseline>',
584
- default: 5,
585
- fn: parseNum,
586
- desc: 'This property indicates the number of requests to analyze in each window before sampling begins.',
587
- },
588
- {
589
- // effective based on local config and 'assess.sampling' TeamServer DTM
590
- name: 'assess.probabilistic_sampling.base_probability',
591
- arg: '<probability>',
592
- /** @param {string} val */
593
- fn: (val) => {
594
- const p = parseFloat(val);
595
- if (p >= 0 && p <= 1) return p;
596
-
597
- if (val && val != 'undefined') {
598
- throw new Error('Invalid option: assess.probabilistic_sampling.base_probability', {
599
- cause: `${val} is not not in interval 0 <= p <= 1. value as float: ${p}`
600
- });
601
- }
602
- },
603
- default: 0.05,
604
- desc: 'A value p within the range [0, 1]. Each request will share same probability p of being sampled.',
605
- },
606
- {
607
- name: 'assess.probabilistic_sampling.window_ms',
608
- arg: '<window_ms>',
609
- default: 180_000,
610
- fn: parseNum,
611
- desc: 'This property indicates the duration for which a sample set is valid.',
612
- },
613
- {
614
- name: 'assess.probabilistic_sampling.event_detail',
615
- arg: '<level>',
616
- default: 'FULL',
617
- fn: (value) => {
618
- if (!value) return undefined;
619
- value = String(value).toUpperCase();
620
- const valids = new Set(['FULL', 'MINIMAL']);
621
- if (valids.has(value)) {
622
- return value;
623
- }
624
- throw new Error(`Invalid option assess.probabilistic_sampling.event_detail: value must be one of ${Array.from(valids)}`);
625
- },
626
- desc: 'Control the values captured by Assess vulnerability events. FULL captures more context by stringifying all values involved in dataflow activity which can add performance overhead. MINIMAL can improve performance by only capturing type name for non-string event values. FULL is the default.',
627
- },
628
- {
629
- name: 'assess.probabilistic_sampling.route_monitor.enable',
630
- arg: '[true]',
631
- default: true,
632
- fn: castBoolean,
633
- desc: 'The agent will keep track of which routes have been analyzed and skip analysis if the route was recently sampled.',
634
- },
635
- {
636
- name: 'assess.probabilistic_sampling.route_monitor.ttl_ms',
637
- arg: '<number>',
638
- default: 1_800_000,
639
- fn: parseNum,
640
- desc: 'Limits individual route analysis to once per this value. Defaults to 1_800_000ms (30 minutes).',
641
- },
642
- {
643
- name: 'assess.tags',
644
- arg: '<tags>',
645
- desc: `Apply a list of labels to vulnerabilities and preflight messages. Labels must be formatted as a comma-delimited list.
646
- Example - \`label1, label2, label3\``,
647
- },
648
- {
649
- name: 'assess.stacktraces',
650
- arg: '<level>',
651
- enum: ['ALL', 'SOME', 'SINK', 'NONE'],
652
- default: 'ALL',
653
- fn: uppercase,
654
- desc: 'Select the level of collected stacktraces. ALL - for all assess events, SOME - for Source and Sink events, SINK - for Sink events, NONE - no stacktraces collected',
655
- },
656
- {
657
- name: 'assess.max_context_source_events',
658
- arg: '<limit>',
659
- default: 150,
660
- fn: parseNum,
661
- desc: 'Set the maximum number of untrusted data flows to observe per request.',
662
- },
663
- {
664
- name: 'assess.max_propagation_events',
665
- arg: '<limit>',
666
- default: 500,
667
- fn: parseNum,
668
- desc: 'Set the maximum number of untrusted data flow propagations to observe per request.',
669
- },
670
- {
671
- name: 'assess.safe_positives.enable',
672
- arg: '[false]',
673
- default: false,
674
- fn: castBoolean,
675
- desc: 'enable detection and reporting of findings regarding safe security practices, aka safe positives. ' +
676
- 'these results will be written to the location described by the `agent.reporters.file` option.',
677
- },
678
- {
679
- name: 'assess.trust_custom_validators',
680
- arg: '<trust-custom-validators>',
681
- default: false,
682
- fn: castBoolean,
683
- desc: 'Set to `true` to trust incoming strings when they pass custom validators (Mongoose, Joi, validator, fastify-static).',
684
- },
685
- // protect
686
- {
687
- name: 'protect.enable',
688
- arg: '[true]',
689
- default: false,
690
- fn: castBoolean,
691
- desc: 'Include this property to determine if the Protect feature should be enabled. If this property is not present, the decision is delegated to the Contrast UI.',
692
- },
693
- {
694
- name: 'protect.probe_analysis.enable',
695
- arg: '[false]',
696
- default: true,
697
- fn: castBoolean,
698
- desc: 'Set to `false` to disable probe analysis.',
699
- },
700
- {
701
- name: 'protect.rules.disabled_rules',
702
- arg: '<list,of,rules>',
703
- default: '',
704
- fn: split,
705
- desc: 'Define a list of Protect rules to disable in the agent. The rules must be formatted as a comma-delimited list.',
706
- },
707
- ...Object.values(Rule)
708
- .filter((ruleId) => ![Rule.BOT_BLOCKER, Rule.IP_DENYLIST, Rule.VIRTUAL_PATCH].includes(ruleId))
709
- .map((ruleId) => ({
710
- name: `protect.rules.${ruleId}.mode`,
711
- arg: '<mode>',
712
- default: 'off',
713
- enum: ['monitor', 'block', 'block_at_perimeter', 'off'],
714
- desc: 'Set the mode of the rule. Value options are `monitor`, `block`, `block_at_perimeter`, or `off`.',
715
- })),
716
- // observability
717
- {
718
- name: 'observe.enable',
719
- arg: '[true]',
720
- default: false, // TODO: Default true when MVP is done
721
- fn: castBoolean,
722
- desc: 'Lightweight and low overhead observation mode for the agent.',
723
- },
724
- {
725
- name: 'observe.periodic_export_interval_ms',
726
- arg: '[true]',
727
- default: 60000,
728
- fn: parseNum,
729
- desc: 'Interval the metrics are flushed to the upstream collector.',
730
- },
731
- // application
732
- {
733
- name: 'application.name',
734
- arg: '<name>',
735
- desc: 'Override the reported application name.',
736
- },
737
- {
738
- name: 'application.path',
739
- arg: '<path>',
740
- default: '/',
741
- desc: 'Override the reported application path.',
742
- },
743
- {
744
- name: 'application.group',
745
- arg: '<group>',
746
- desc: 'Add the name of the application group with which this application should be associated in the Contrast UI.',
747
- },
748
- {
749
- name: 'application.code',
750
- arg: '<code>',
751
- desc: 'Add the application code this application should use in the Contrast UI.'
752
- },
753
- {
754
- name: 'application.version',
755
- arg: '<version>',
756
- desc: 'Override the reported application version.',
757
- },
758
- {
759
- name: 'application.tags',
760
- arg: '<tags>',
761
- desc: 'Apply labels to an application. Labels must be formatted as a comma-delimited list. Example - `label1,label2,label3`'
762
- },
763
- {
764
- name: 'application.metadata',
765
- arg: '<metadata>',
766
- desc: 'Define a set of `key=value` pairs (which conforms to RFC 2253) for specifying user-defined metadata associated with the application. The set must be formatted as a comma-delimited list of `key=value` pairs. Example - `business-unit=accounting, office=Baltimore`',
767
- },
768
- {
769
- name: 'application.session_id',
770
- arg: '<session_id>',
771
- desc: 'Provide the ID of a session which already exists in the Contrast UI. Vulnerabilities discovered by the agent are associated with this session. If an invalid ID is supplied, the agent will be disabled. This option and `application.session_metadata` are mutually exclusive; if both are set, the agent will be disabled.',
772
- },
773
- {
774
- name: 'application.session_metadata',
775
- arg: '<session_metadata>',
776
- desc: 'Provide metadata which is used to create a new session ID in the Contrast UI. Vulnerabilities discovered by the agent are associated with this new session. This value should be formatted as `key=value` pairs (conforming to RFC 2253). Available key names for this configuration are branchName, buildNumber, commitHash, committer, gitTag, repository, testRun, and version. This option and `application.session_id` are mutually exclusive; if both are set the agent will be disabled.',
777
- },
778
- // server
779
- {
780
- name: 'server.name',
781
- arg: '<name>',
782
- default: os.hostname(),
783
- desc: 'Override the reported server name. Defaults to the operating system hostname.',
784
- },
785
- {
786
- name: 'server.type',
787
- arg: '<type>',
788
- default: `Node.js ${process.version}`,
789
- desc: 'Override the reported server type.',
790
- },
791
- {
792
- name: 'server.environment',
793
- arg: '<environment>',
794
- /** @param {string} val */
795
- fn: (val) => {
796
- if (!val) return val;
797
-
798
- const valid = new Set(['QA', 'PRODUCTION', 'DEVELOPMENT']);
799
- const normalized = uppercase(val);
800
- if (!valid.has(normalized)) {
801
- throw new Error(`Invalid option: server.environment must be one of ${Array.from(valid)}`);
802
- }
803
-
804
- return normalized;
805
- },
806
- desc: `Set the environment directly to override the default set by the Contrast UI. This allows the user to configure the environment dynamically at startup rather than manually updating the Server in the Contrast UI themselves afterwards.
807
- Valid values include \`QA\`, \`PRODUCTION\` and \`DEVELOPMENT\`. For example, \`PRODUCTION\` registers this Server as running in a \`PRODUCTION\` environment, regardless of the organization's default environment in the Contrast UI.`,
808
- },
809
- {
810
- name: 'server.tags',
811
- arg: '<tags>',
812
- desc: `Apply a list of labels to the server. Labels must be formatted as a comma-delimited list.
813
- Example - \`label1, label2, label3\``,
814
- },
815
- {
816
- // NOTE: not in common config, and the desc here doesn't really make sense.
817
- name: 'server.version',
818
- arg: '<version>',
819
- desc: "override the reported server version (if different from 'version' field in the application's package.json)",
820
- },
821
- {
822
- name: 'server.discover_cloud_resource',
823
- arg: '[false]',
824
- default: true,
825
- fn: castBoolean,
826
- desc: 'Set to `false` to disable detection of cloud provider metadata such as resource identifiers.'
827
- },
828
- ].map((opt) => {
829
- let env = StringPrototypeReplaceAll.call(StringPrototypeToUpperCase.call(opt.name), '.', '__');
830
- env = StringPrototypeReplaceAll.call(env, '-', '_');
831
- return Object.assign(opt, { env: `CONTRAST__${env}` });
832
- });
833
-
834
- module.exports = options;
835
- module.exports.clearBaseCase = clearBaseCase;
836
- module.exports.castBoolean = castBoolean;