@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.
- package/node_modules/@contrast/agent/package.json +11 -11
- package/node_modules/@contrast/agent-swc-plugin/index.js +9 -3
- package/node_modules/@contrast/agent-swc-plugin/methods.js +15 -1
- package/node_modules/@contrast/agent-swc-plugin/package.json +5 -8
- package/node_modules/@contrast/agent-swc-plugin/rewriter.wasm +0 -0
- package/node_modules/@contrast/agentify/lib/index.js +2 -2
- package/node_modules/@contrast/agentify/package.json +15 -14
- package/node_modules/@contrast/architecture-components/package.json +5 -5
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/body-parser.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +3 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/qs6.js +5 -5
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/querystring.js +2 -1
- package/node_modules/@contrast/assess/lib/index.d.ts +0 -1
- package/node_modules/@contrast/assess/lib/make-source-context.js +7 -37
- package/node_modules/@contrast/assess/lib/sampler/common.js +7 -11
- package/node_modules/@contrast/assess/package.json +12 -11
- package/node_modules/@contrast/common/lib/types.d.ts +7 -1
- package/node_modules/@contrast/common/package.json +1 -1
- package/node_modules/@contrast/config/lib/common.js +1 -1
- package/node_modules/@contrast/config/lib/config.js +49 -27
- package/node_modules/@contrast/config/lib/index.d.ts +2 -2
- package/node_modules/@contrast/config/lib/options.js +4 -4
- package/node_modules/@contrast/config/package.json +4 -3
- package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +15 -15
- package/node_modules/@contrast/core/package.json +6 -6
- package/node_modules/@contrast/deadzones/package.json +5 -5
- package/node_modules/@contrast/dep-hooks/package.json +3 -3
- package/node_modules/@contrast/esm-hooks/package.json +6 -6
- package/node_modules/@contrast/instrumentation/lib/index.js +0 -1
- package/node_modules/@contrast/instrumentation/package.json +5 -5
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +298 -148
- package/node_modules/@contrast/library-analysis/package.json +4 -4
- package/node_modules/@contrast/logger/lib/serializers.js +2 -2
- package/node_modules/@contrast/logger/package.json +3 -3
- package/node_modules/@contrast/metrics/package.json +6 -6
- package/node_modules/@contrast/patcher/package.json +2 -2
- package/node_modules/@contrast/protect/lib/get-source-context.js +3 -1
- package/node_modules/@contrast/protect/lib/index.js +6 -1
- package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +7 -9
- package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +18 -19
- package/node_modules/@contrast/protect/lib/input-analysis/install/qs6.js +18 -17
- package/node_modules/@contrast/protect/lib/input-analysis/install/universal-cookie4.js +2 -3
- package/node_modules/@contrast/protect/lib/make-source-context.js +22 -66
- package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +73 -72
- package/node_modules/@contrast/protect/package.json +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +7 -7
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +3 -3
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +24 -21
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -2
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +8 -2
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -2
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +22 -20
- package/node_modules/@contrast/reporter/package.json +7 -7
- package/node_modules/@contrast/rewriter/lib/index.js +2 -2
- package/node_modules/@contrast/rewriter/package.json +6 -6
- package/node_modules/@contrast/route-coverage/lib/index.js +1 -9
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +17 -19
- package/node_modules/@contrast/route-coverage/package.json +8 -8
- package/node_modules/@contrast/scopes/package.json +5 -5
- package/node_modules/@contrast/sec-obs/lib/traces/http.js +2 -2
- package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +17 -0
- package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.js +2 -2
- package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.test.js +17 -0
- package/node_modules/@contrast/sec-obs/package.json +9 -9
- package/node_modules/@contrast/sources/lib/index.js +109 -0
- package/node_modules/@contrast/sources/lib/index.test.js +120 -0
- package/node_modules/@contrast/{route-coverage/lib/normalized-url-mapper.js → sources/lib/normalized-uri-mapper.js} +10 -3
- package/node_modules/@contrast/sources/lib/normalized-uri-mapper.test.js +59 -0
- package/node_modules/@contrast/{sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/constants.js → sources/lib/req-data.js} +0 -6
- package/node_modules/@contrast/sources/lib/source-info.js +183 -0
- package/node_modules/@contrast/sources/lib/source-info.test.js +68 -0
- package/node_modules/@contrast/sources/package.json +16 -0
- package/node_modules/@contrast/telemetry/package.json +6 -6
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +2858 -103
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +420 -102
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -3
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/fs.d.ts +13 -1
- package/node_modules/@types/node/http.d.ts +4 -19
- package/node_modules/@types/node/inspector.d.ts +53 -0
- package/node_modules/@types/node/package.json +2 -82
- package/node_modules/axios/CHANGELOG.md +17 -0
- package/node_modules/axios/README.md +1 -4
- package/node_modules/axios/dist/axios.js +39 -5
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +46 -9
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +46 -9
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +46 -9
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +13 -2
- package/node_modules/axios/lib/core/Axios.js +2 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/throttle.js +1 -1
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
- package/node_modules/axios/lib/utils.js +36 -0
- package/node_modules/axios/package.json +5 -5
- package/node_modules/deepmerge/.editorconfig +7 -0
- package/node_modules/deepmerge/.eslintcache +1 -0
- package/node_modules/deepmerge/changelog.md +167 -0
- package/node_modules/deepmerge/dist/cjs.js +133 -0
- package/node_modules/deepmerge/dist/umd.js +139 -0
- package/node_modules/deepmerge/index.d.ts +20 -0
- package/node_modules/deepmerge/index.js +106 -0
- package/node_modules/deepmerge/license.txt +21 -0
- package/node_modules/deepmerge/package.json +42 -0
- package/node_modules/deepmerge/readme.md +264 -0
- package/node_modules/deepmerge/rollup.config.js +22 -0
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/form-data/CHANGELOG.md +601 -0
- package/node_modules/form-data/{Readme.md → README.md} +4 -4
- package/node_modules/form-data/lib/form_data.js +2 -6
- package/node_modules/form-data/package.json +22 -6
- package/node_modules/nan/.github/workflows/ci.yml +8 -10
- package/node_modules/nan/.pre-commit-config.yaml +8 -0
- package/node_modules/nan/CHANGELOG.md +5 -1
- package/node_modules/nan/README.md +4 -4
- package/node_modules/nan/nan.h +16 -12
- package/node_modules/nan/nan_callbacks.h +13 -0
- package/node_modules/nan/nan_callbacks_12_inl.h +16 -2
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +6 -2
- package/node_modules/nan/nan_maybe_43_inl.h +1 -1
- package/node_modules/nan/nan_maybe_pre_43_inl.h +1 -1
- package/node_modules/nan/nan_scriptorigin.h +11 -9
- package/node_modules/nan/nan_typedarray_contents.h +1 -1
- package/node_modules/nan/package.json +2 -2
- package/package.json +2 -2
- package/node_modules/@contrast/agentify/lib/sources.js +0 -95
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.d.ts +0 -385
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.js +0 -270
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.d.ts +0 -40
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.js +0 -228
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.d.ts +0 -65
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.js +0 -66
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.d.ts +0 -383
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.js +0 -30
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/package.json +0 -23
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/README.md +0 -44
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/common.js +0 -131
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/config.js +0 -290
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.d.ts +0 -328
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.js +0 -29
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/options.js +0 -836
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/validators.js +0 -23
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/package.json +0 -27
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/README.md +0 -98
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/agent-info.js +0 -36
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/app-info.js +0 -233
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/build-id.js +0 -51
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/capture-stacktrace.js +0 -256
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/contrast-methods.js +0 -155
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/index.d.ts +0 -52
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/ioc/core.js +0 -95
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/is-agent-path.js +0 -37
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/messages.js +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +0 -63
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/server-settings-listener.js +0 -44
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/cloud-provider-metadata.js +0 -146
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/index.js +0 -225
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/linux-os-info.js +0 -137
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/utils.js +0 -35
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/package.json +0 -33
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/README.md +0 -94
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +0 -121
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +0 -206
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +0 -72
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +0 -88
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -106
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.js +0 -66
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.d.ts +0 -115
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.js +0 -208
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +0 -43
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.js +0 -79
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/package.json +0 -29
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/README.md +0 -270
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.d.ts +0 -16
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.js +0 -132
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.d.ts +0 -33
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.js +0 -75
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.d.ts +0 -15
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.js +0 -34
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/package.json +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/README.md +0 -51
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.d.ts +0 -101
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.js +0 -544
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/package.json +0 -25
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/README.md +0 -6
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/cache.js +0 -318
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/index.js +0 -216
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/rewrite-is-deadzoned.js +0 -143
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/package.json +0 -30
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/constants.js +0 -26
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.d.ts +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.js +0 -70
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/bluebird.js +0 -128
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/index.js +0 -34
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb-core.js +0 -83
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb3.js +0 -89
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb4.js +0 -80
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb6.js +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mysql.js +0 -151
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/redis.js +0 -79
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/utils.js +0 -35
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/package.json +0 -28
- package/node_modules/form-data/README.md.bak +0 -355
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agent",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.41.0",
|
|
4
4
|
"description": "Assess and Protect agents for Node.js",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"test": "bash ../scripts/test.sh"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@contrast/agentify": "1.
|
|
31
|
-
"@contrast/architecture-components": "1.
|
|
32
|
-
"@contrast/assess": "1.
|
|
33
|
-
"@contrast/common": "1.
|
|
34
|
-
"@contrast/core": "1.
|
|
35
|
-
"@contrast/library-analysis": "1.
|
|
36
|
-
"@contrast/protect": "1.
|
|
37
|
-
"@contrast/route-coverage": "1.
|
|
38
|
-
"@contrast/sec-obs": "1.0.0-alpha.
|
|
39
|
-
"@contrast/telemetry": "1.
|
|
30
|
+
"@contrast/agentify": "1.53.0",
|
|
31
|
+
"@contrast/architecture-components": "1.43.0",
|
|
32
|
+
"@contrast/assess": "1.59.0",
|
|
33
|
+
"@contrast/common": "1.35.0",
|
|
34
|
+
"@contrast/core": "1.55.0",
|
|
35
|
+
"@contrast/library-analysis": "1.45.0",
|
|
36
|
+
"@contrast/protect": "1.65.0",
|
|
37
|
+
"@contrast/route-coverage": "1.46.0",
|
|
38
|
+
"@contrast/sec-obs": "1.0.0-alpha.9",
|
|
39
|
+
"@contrast/telemetry": "1.30.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright:
|
|
2
|
+
* Copyright: 2025 Contrast Security, Inc
|
|
3
3
|
* Contact: support@contrastsecurity.com
|
|
4
4
|
* License: Commercial
|
|
5
5
|
|
|
@@ -12,7 +12,13 @@
|
|
|
12
12
|
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
13
|
* way not consistent with the End User License Agreement.
|
|
14
14
|
*/
|
|
15
|
+
|
|
16
|
+
const rewriter = require.resolve('./rewriter.wasm');
|
|
17
|
+
const unwriter = require.resolve('./unwriter.wasm');
|
|
18
|
+
|
|
15
19
|
module.exports = {
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
rewriter,
|
|
21
|
+
unwriter,
|
|
22
|
+
defaultRewriter: rewriter,
|
|
23
|
+
defaultUnwriter: unwriter,
|
|
18
24
|
};
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
module.exports = [
|
|
1
|
+
module.exports = [
|
|
2
|
+
'concat',
|
|
3
|
+
'match',
|
|
4
|
+
'matchAll',
|
|
5
|
+
'replace',
|
|
6
|
+
'replaceAll',
|
|
7
|
+
'slice',
|
|
8
|
+
'split',
|
|
9
|
+
'substring',
|
|
10
|
+
'substr',
|
|
11
|
+
'toLowerCase',
|
|
12
|
+
'toUpperCase',
|
|
13
|
+
'trim',
|
|
14
|
+
'join',
|
|
15
|
+
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agent-swc-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "SWC plugins Contrast Node agent",
|
|
5
5
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
"swc-plugin"
|
|
9
9
|
],
|
|
10
10
|
"main": "index.js",
|
|
11
|
-
"types": "index.d.ts",
|
|
12
11
|
"files": [
|
|
13
12
|
"index.js",
|
|
14
|
-
"index.d.ts",
|
|
15
13
|
"methods.js",
|
|
16
14
|
"*.wasm"
|
|
17
15
|
],
|
|
@@ -27,15 +25,14 @@
|
|
|
27
25
|
"@swc/core": "^1.11.24"
|
|
28
26
|
},
|
|
29
27
|
"devDependencies": {
|
|
30
|
-
"@swc/cli": "0.7.
|
|
28
|
+
"@swc/cli": "0.7.8",
|
|
31
29
|
"@swc/core": "^1.11.24",
|
|
32
|
-
"@tsconfig/node16": "16.1.
|
|
33
|
-
"@types/express": "5.0.1",
|
|
30
|
+
"@tsconfig/node16": "16.1.4",
|
|
34
31
|
"benchmark": "2.1.4",
|
|
35
|
-
"chai": "5.2.
|
|
32
|
+
"chai": "5.2.1",
|
|
36
33
|
"express": "5.1.0",
|
|
37
34
|
"lodash": "4.17.21",
|
|
38
|
-
"mocha": "11.
|
|
35
|
+
"mocha": "11.7.1",
|
|
39
36
|
"rimraf": "6.0.1",
|
|
40
37
|
"source-map": "^0.7.4",
|
|
41
38
|
"tinybench": "4.0.1",
|
|
Binary file
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
13
|
* way not consistent with the End User License Agreement.
|
|
14
14
|
*/
|
|
15
|
-
/*eslint node/no-unsupported-features/es-syntax: ["error", {version: >=10.0.0}]*/
|
|
16
15
|
'use strict';
|
|
17
16
|
|
|
18
17
|
const Module = require('module');
|
|
@@ -137,6 +136,7 @@ module.exports = function init(core = {}) {
|
|
|
137
136
|
|
|
138
137
|
logger.info('Starting %s v%s', core.agentName, core.agentVersion);
|
|
139
138
|
logger.info({ config }, 'Agent configuration');
|
|
139
|
+
logger.debug({ effectiveConfig: config.getReport({ redact: true }) }, 'Effective configuration');
|
|
140
140
|
|
|
141
141
|
const plugin = await _callback?.(core);
|
|
142
142
|
|
|
@@ -191,9 +191,9 @@ module.exports = function init(core = {}) {
|
|
|
191
191
|
{ name: 'reporter', spec: '@contrast/reporter', default: true },
|
|
192
192
|
{ name: 'instrumentation', spec: '@contrast/instrumentation' },
|
|
193
193
|
{ name: 'metrics', spec: '@contrast/metrics' },
|
|
194
|
+
{ name: 'sources', spec: '@contrast/sources' },
|
|
194
195
|
// compose additional local services
|
|
195
196
|
{ name: 'heap-snapshots', spec: './heap-snapshots' },
|
|
196
|
-
{ name: 'sources', spec: './sources' },
|
|
197
197
|
{ name: 'function-hooks', spec: './function-hooks' },
|
|
198
198
|
{ name: 'diagnostics', spec: './diagnostics' },
|
|
199
199
|
{ name: 'rewrite-hooks', spec: './rewrite-hooks' },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agentify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Configures Contrast agent services and instrumentation within an application",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -20,21 +20,22 @@
|
|
|
20
20
|
"test": "bash ../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contrast/common": "1.
|
|
24
|
-
"@contrast/config": "1.
|
|
25
|
-
"@contrast/core": "1.
|
|
26
|
-
"@contrast/deadzones": "1.
|
|
27
|
-
"@contrast/dep-hooks": "1.
|
|
28
|
-
"@contrast/esm-hooks": "2.
|
|
23
|
+
"@contrast/common": "1.35.0",
|
|
24
|
+
"@contrast/config": "1.50.0",
|
|
25
|
+
"@contrast/core": "1.55.0",
|
|
26
|
+
"@contrast/deadzones": "1.27.0",
|
|
27
|
+
"@contrast/dep-hooks": "1.24.0",
|
|
28
|
+
"@contrast/esm-hooks": "2.29.0",
|
|
29
29
|
"@contrast/find-package-json": "^1.1.0",
|
|
30
|
-
"@contrast/instrumentation": "1.
|
|
31
|
-
"@contrast/logger": "1.
|
|
32
|
-
"@contrast/metrics": "1.
|
|
33
|
-
"@contrast/patcher": "1.
|
|
30
|
+
"@contrast/instrumentation": "1.34.0",
|
|
31
|
+
"@contrast/logger": "1.28.0",
|
|
32
|
+
"@contrast/metrics": "1.32.0",
|
|
33
|
+
"@contrast/patcher": "1.27.0",
|
|
34
34
|
"@contrast/perf": "1.3.1",
|
|
35
|
-
"@contrast/reporter": "1.
|
|
36
|
-
"@contrast/rewriter": "1.
|
|
37
|
-
"@contrast/scopes": "1.
|
|
35
|
+
"@contrast/reporter": "1.52.0",
|
|
36
|
+
"@contrast/rewriter": "1.31.0",
|
|
37
|
+
"@contrast/scopes": "1.25.0",
|
|
38
|
+
"@contrast/sources": "1.1.0",
|
|
38
39
|
"on-finished": "^2.4.1",
|
|
39
40
|
"semver": "^7.6.0"
|
|
40
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/architecture-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
4
4
|
"description": "Detects external systems being connected to by applications.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"test": "bash ../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contrast/common": "1.
|
|
24
|
-
"@contrast/dep-hooks": "1.
|
|
25
|
-
"@contrast/logger": "1.
|
|
26
|
-
"@contrast/patcher": "1.
|
|
23
|
+
"@contrast/common": "1.35.0",
|
|
24
|
+
"@contrast/dep-hooks": "1.24.0",
|
|
25
|
+
"@contrast/logger": "1.28.0",
|
|
26
|
+
"@contrast/patcher": "1.27.0"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -24,12 +24,35 @@ module.exports = function(core) {
|
|
|
24
24
|
patcher,
|
|
25
25
|
depHooks,
|
|
26
26
|
assess: {
|
|
27
|
+
inspect,
|
|
27
28
|
getPropagatorContext,
|
|
28
29
|
eventFactory: { createPropagationEvent },
|
|
29
30
|
dataflow: { tracker }
|
|
30
31
|
}
|
|
31
32
|
} = core;
|
|
32
33
|
|
|
34
|
+
function traverseObject(obj, result, tags, history, depth = 1) {
|
|
35
|
+
let i = 0;
|
|
36
|
+
for (const val of Object.values(obj)) {
|
|
37
|
+
|
|
38
|
+
if (typeof val === 'object' && depth <= 4) tags = traverseObject(val, result, tags, history, depth += 1);
|
|
39
|
+
|
|
40
|
+
const valInfo = tracker.getData(val);
|
|
41
|
+
if (!valInfo || depth > 4) break;
|
|
42
|
+
|
|
43
|
+
const currIdx = result.indexOf(val, i);
|
|
44
|
+
if (currIdx > -1) {
|
|
45
|
+
i = currIdx + val.length;
|
|
46
|
+
} else {
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
tags = createAppendTags(tags, valInfo.tags, currIdx);
|
|
50
|
+
history.push({ ...valInfo });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return tags;
|
|
54
|
+
}
|
|
55
|
+
|
|
33
56
|
return core.assess.dataflow.propagation.utilFormat = {
|
|
34
57
|
install() {
|
|
35
58
|
depHooks.resolve({ name: 'util', version: '*' }, (util) => {
|
|
@@ -57,13 +80,14 @@ module.exports = function(core) {
|
|
|
57
80
|
|
|
58
81
|
for (i; i < args.length; i++) {
|
|
59
82
|
let arg = args[i];
|
|
83
|
+
if (!arg) continue;
|
|
84
|
+
|
|
60
85
|
const formatChar = formatChars[i - 1];
|
|
61
86
|
if (formatChar) {
|
|
62
87
|
switch (formatChar) {
|
|
63
88
|
case 's':
|
|
64
89
|
if (typeof arg === 'object') {
|
|
65
|
-
//
|
|
66
|
-
arg = arg?.toString ? arg.toString() : util.inspect(arg, { depth: 0, colors: false, compact: 3 });
|
|
90
|
+
break; // handled below
|
|
67
91
|
} else {
|
|
68
92
|
arg = String(arg);
|
|
69
93
|
}
|
|
@@ -77,36 +101,35 @@ module.exports = function(core) {
|
|
|
77
101
|
arg = JSON.stringify(arg) ?? 'undefined';
|
|
78
102
|
break;
|
|
79
103
|
case 'o':
|
|
80
|
-
//
|
|
81
|
-
arg = util.inspect(arg, { showHidden: true, showProxy: true });
|
|
82
|
-
break;
|
|
104
|
+
break; // handled below
|
|
83
105
|
case 'O':
|
|
84
|
-
//
|
|
85
|
-
arg = util.inspect(arg);
|
|
86
|
-
break;
|
|
106
|
+
break; // handled below
|
|
87
107
|
case 'c':
|
|
88
108
|
// c is ignored and skipped
|
|
89
109
|
arg = '';
|
|
90
110
|
break;
|
|
91
111
|
}
|
|
92
112
|
} else if (typeof arg !== 'string') {
|
|
93
|
-
arg =
|
|
113
|
+
arg = inspect(arg);
|
|
94
114
|
}
|
|
95
115
|
|
|
96
|
-
|
|
97
|
-
|
|
116
|
+
if (typeof arg === 'string') {
|
|
117
|
+
const argInfo = tracker.getData(arg);
|
|
118
|
+
if (!argInfo) continue;
|
|
98
119
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
120
|
+
const currIdx = result.indexOf(arg, idx);
|
|
121
|
+
if (currIdx > -1) {
|
|
122
|
+
idx = currIdx + arg.length;
|
|
123
|
+
} else {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
newTags = createAppendTags(newTags, argInfo.tags, currIdx);
|
|
127
|
+
history.push({ ...argInfo });
|
|
128
|
+
eventArgs.push({ value: argInfo ? argInfo.value : arg, tracked: !!argInfo });
|
|
129
|
+
} else if (typeof arg === 'object') {
|
|
130
|
+
newTags = traverseObject(arg, result, newTags, history);
|
|
131
|
+
eventArgs.push({ value: inspect(arg), tracked: false });
|
|
104
132
|
}
|
|
105
|
-
|
|
106
|
-
newTags = createAppendTags(newTags, argInfo.tags, currIdx);
|
|
107
|
-
|
|
108
|
-
history.push({ ...argInfo });
|
|
109
|
-
eventArgs.push({ value: argInfo ? argInfo.value : arg, tracked: !!argInfo });
|
|
110
133
|
}
|
|
111
134
|
|
|
112
135
|
const resultInfo = tracker.getData(result);
|
|
@@ -85,7 +85,7 @@ module.exports = function init(core) {
|
|
|
85
85
|
},
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
sourceContext.parsedBody = !!Object.keys(_data).length;
|
|
88
|
+
sourceContext.parsedBody = !!(_data && Object.keys(_data).length);
|
|
89
89
|
} catch (err) {
|
|
90
90
|
logger.error({ err, funcKey: data.funcKey }, 'unable to handle source');
|
|
91
91
|
}
|
|
@@ -23,6 +23,7 @@ module.exports = (core) => {
|
|
|
23
23
|
depHooks,
|
|
24
24
|
patcher,
|
|
25
25
|
logger,
|
|
26
|
+
scopes,
|
|
26
27
|
assess: {
|
|
27
28
|
getSourceContext,
|
|
28
29
|
dataflow: { sources }
|
|
@@ -51,7 +52,8 @@ module.exports = (core) => {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
data.args[1] = async function contrastNext(origErr) {
|
|
54
|
-
const
|
|
55
|
+
const contentType = scopes.sources.getStore()?.sourceInfo?.contentType;
|
|
56
|
+
const inputType = contentType?.includes?.('/json')
|
|
55
57
|
? InputType.JSON_VALUE
|
|
56
58
|
: typeof ctx.request.body == 'object'
|
|
57
59
|
? InputType.PARAMETER_VALUE
|
|
@@ -23,6 +23,7 @@ module.exports = (core) => {
|
|
|
23
23
|
depHooks,
|
|
24
24
|
patcher,
|
|
25
25
|
logger,
|
|
26
|
+
scopes,
|
|
26
27
|
assess: {
|
|
27
28
|
getSourceContext,
|
|
28
29
|
dataflow: { sources }
|
|
@@ -38,21 +39,20 @@ module.exports = (core) => {
|
|
|
38
39
|
patchType,
|
|
39
40
|
post({ args, hooked, orig, result, funcKey }) {
|
|
40
41
|
const sourceContext = getSourceContext();
|
|
41
|
-
|
|
42
|
-
if (!sourceContext) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
42
|
+
if (!sourceContext) return;
|
|
45
43
|
|
|
46
44
|
if (sourceContext.parsedQuery) {
|
|
47
45
|
logger.trace({ inputType, funcKey }, 'values already tracked');
|
|
48
46
|
return;
|
|
49
47
|
}
|
|
50
48
|
|
|
49
|
+
const queries = scopes.sources.getStore()?.sourceInfo?.queries;
|
|
50
|
+
|
|
51
51
|
// We need to run analysis for the `qs` result only when it's used as a query parser.
|
|
52
52
|
// `qs` is used also for parsing bodies, but these cases we handle individually with
|
|
53
53
|
// the respective library that's using it (e.g. `formidable`, `co-body`) because in
|
|
54
54
|
// some cases its use is optional and we cannot rely on it.
|
|
55
|
-
if (
|
|
55
|
+
if (queries === args[0]) {
|
|
56
56
|
try {
|
|
57
57
|
sources.handle({
|
|
58
58
|
context: 'req.query',
|
|
@@ -24,6 +24,7 @@ module.exports = (core) => {
|
|
|
24
24
|
depHooks,
|
|
25
25
|
patcher,
|
|
26
26
|
logger,
|
|
27
|
+
scopes,
|
|
27
28
|
} = core;
|
|
28
29
|
|
|
29
30
|
core.assess.dataflow.sources.querystringInstrumentation = {
|
|
@@ -46,7 +47,7 @@ module.exports = (core) => {
|
|
|
46
47
|
|
|
47
48
|
// We only run analysis for the `querystring` result when it's used
|
|
48
49
|
// as the framework's query parser
|
|
49
|
-
if (
|
|
50
|
+
if (scopes.sources.getStore().sourceInfo?.queries === args[0]) {
|
|
50
51
|
try {
|
|
51
52
|
core.assess.dataflow.sources.handle({
|
|
52
53
|
context: 'req.query',
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
const { primordials: { StringPrototypeToLowerCase, StringPrototypeSlice } } = require('@contrast/common');
|
|
19
18
|
const { Core } = require('@contrast/core/lib/ioc/core');
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -33,57 +32,28 @@ function factory(core) {
|
|
|
33
32
|
const { assess, logger } = core;
|
|
34
33
|
|
|
35
34
|
/**
|
|
35
|
+
* todo: how to handle non-HTTP sources
|
|
36
36
|
* @returns {import('@contrast/assess').SourceContext}
|
|
37
37
|
*/
|
|
38
|
-
return core.assess.makeSourceContext = function(
|
|
39
|
-
try {
|
|
38
|
+
return core.assess.makeSourceContext = function ({ store, incomingMessage: req }) {
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
try {
|
|
41
|
+
const ctx = store.assess = {
|
|
42
42
|
// default policy to `null` until it is set later below. this will cause
|
|
43
43
|
// all instrumentation to short-circuit, see `./get-source-context.js`.
|
|
44
44
|
policy: null,
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
if (!core.config.getEffectiveValue('assess.enable'))
|
|
48
|
-
return ctx;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// todo: how to handle non-HTTP sources
|
|
52
|
-
const { incomingMessage: req } = sourceData;
|
|
53
|
-
|
|
54
|
-
// minimally process the request data for sampling and exclusions.
|
|
55
|
-
// more request fields will be appended in final result below.
|
|
56
|
-
let uriPath;
|
|
57
|
-
let queries;
|
|
58
|
-
const idx = req.url.indexOf('?');
|
|
59
|
-
if (idx >= 0) {
|
|
60
|
-
uriPath = StringPrototypeSlice.call(req.url, 0, idx);
|
|
61
|
-
queries = StringPrototypeSlice.call(req.url, idx + 1);
|
|
62
|
-
} else {
|
|
63
|
-
uriPath = req.url;
|
|
64
|
-
queries = '';
|
|
65
|
-
}
|
|
66
|
-
ctx.reqData = {
|
|
67
|
-
method: req.method,
|
|
68
|
-
uriPath,
|
|
69
|
-
queries,
|
|
70
|
-
};
|
|
47
|
+
if (!core.config.getEffectiveValue('assess.enable')) return ctx;
|
|
71
48
|
|
|
72
49
|
// check whether sampling allows processing
|
|
73
|
-
ctx.sampleInfo = assess.sampler?.getSampleInfo(
|
|
50
|
+
ctx.sampleInfo = assess.sampler?.getSampleInfo(store.sourceInfo) ?? null;
|
|
74
51
|
if (ctx.sampleInfo?.canSample === false) return ctx;
|
|
75
52
|
|
|
76
53
|
// set policy - can be returned as `null` if request is url-excluded.
|
|
77
|
-
ctx.policy = assess.getPolicy(
|
|
54
|
+
ctx.policy = assess.getPolicy(store.sourceInfo);
|
|
78
55
|
if (!ctx.policy) return ctx;
|
|
79
56
|
|
|
80
|
-
// build remaining reqData
|
|
81
|
-
ctx.reqData.headers = { ...req.headers }; // copy to avoid storing tracked values
|
|
82
|
-
ctx.reqData.ip = req.socket.remoteAddress;
|
|
83
|
-
ctx.reqData.httpVersion = req.httpVersion;
|
|
84
|
-
if (ctx.reqData.headers['content-type'])
|
|
85
|
-
ctx.reqData.contentType = StringPrototypeToLowerCase.call(ctx.reqData.headers['content-type']);
|
|
86
|
-
|
|
87
57
|
ctx.propagationEventsCount = 0;
|
|
88
58
|
ctx.sourceEventsCount = 0;
|
|
89
59
|
ctx.responseData = {};
|
|
@@ -31,23 +31,22 @@ class RouteAnalysisMonitor {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* @param {
|
|
35
|
-
* @param {string}
|
|
34
|
+
* @param {import('@contrast/common').SourceInfo} sourceInfo
|
|
35
|
+
* @param {string} sourceInfo.normalizedUri
|
|
36
36
|
* @returns {AnalysisInfo}
|
|
37
37
|
*/
|
|
38
|
-
getAnalysisInfo({ method,
|
|
39
|
-
const normalizedUrl = this._core.routeCoverage.uriPathToNormalizedUrl(uriPath);
|
|
38
|
+
getAnalysisInfo({ method, normalizedUri }) {
|
|
40
39
|
const now = Date.now();
|
|
41
40
|
|
|
42
|
-
if (
|
|
43
|
-
const key = `${method}:${
|
|
41
|
+
if (normalizedUri) {
|
|
42
|
+
const key = `${method}:${normalizedUri}`;
|
|
44
43
|
let routeMeta = this._normalCache.get(key);
|
|
45
44
|
|
|
46
45
|
// not in cache, not paused
|
|
47
46
|
if (!routeMeta) {
|
|
48
47
|
routeMeta = {
|
|
49
48
|
pauseEnd: now + this._ttl,
|
|
50
|
-
normalizedUrl,
|
|
49
|
+
normalizedUrl: normalizedUri,
|
|
51
50
|
};
|
|
52
51
|
this._normalCache.set(key, routeMeta);
|
|
53
52
|
|
|
@@ -64,8 +63,6 @@ class RouteAnalysisMonitor {
|
|
|
64
63
|
|
|
65
64
|
// was in cache and still paused
|
|
66
65
|
return { paused: true, ...routeMeta };
|
|
67
|
-
} else {
|
|
68
|
-
// todo - handle "dynamic" routes
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
return this._defaultAnalysisInfo;
|
|
@@ -105,7 +102,6 @@ class ProbabilisticSampler extends BaseSampler {
|
|
|
105
102
|
|
|
106
103
|
getSampleInfo(sourceInfo) {
|
|
107
104
|
const { baseline, base_probability } = this.opts;
|
|
108
|
-
const { reqData } = sourceInfo.store.assess;
|
|
109
105
|
|
|
110
106
|
if (this.baseline < baseline) {
|
|
111
107
|
this.baseline++;
|
|
@@ -119,7 +115,7 @@ class ProbabilisticSampler extends BaseSampler {
|
|
|
119
115
|
|
|
120
116
|
// check route monitoring before sampling
|
|
121
117
|
if (canSample) {
|
|
122
|
-
const routeInfo = this.routeMonitor?.getAnalysisInfo(
|
|
118
|
+
const routeInfo = this.routeMonitor?.getAnalysisInfo(sourceInfo);
|
|
123
119
|
|
|
124
120
|
if (routeInfo) {
|
|
125
121
|
// don't sample if analysis is paused
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/assess",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.0",
|
|
4
4
|
"description": "Contrast service providing framework-agnostic Assess support",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -20,17 +20,18 @@
|
|
|
20
20
|
"test": "bash ../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contrast/common": "1.
|
|
24
|
-
"@contrast/config": "1.
|
|
25
|
-
"@contrast/core": "1.
|
|
26
|
-
"@contrast/dep-hooks": "1.
|
|
23
|
+
"@contrast/common": "1.35.0",
|
|
24
|
+
"@contrast/config": "1.50.0",
|
|
25
|
+
"@contrast/core": "1.55.0",
|
|
26
|
+
"@contrast/dep-hooks": "1.24.0",
|
|
27
27
|
"@contrast/distringuish": "^5.1.0",
|
|
28
|
-
"@contrast/instrumentation": "1.
|
|
29
|
-
"@contrast/logger": "1.
|
|
30
|
-
"@contrast/patcher": "1.
|
|
31
|
-
"@contrast/rewriter": "1.
|
|
32
|
-
"@contrast/route-coverage": "1.
|
|
33
|
-
"@contrast/scopes": "1.
|
|
28
|
+
"@contrast/instrumentation": "1.34.0",
|
|
29
|
+
"@contrast/logger": "1.28.0",
|
|
30
|
+
"@contrast/patcher": "1.27.0",
|
|
31
|
+
"@contrast/rewriter": "1.31.0",
|
|
32
|
+
"@contrast/route-coverage": "1.46.0",
|
|
33
|
+
"@contrast/scopes": "1.25.0",
|
|
34
|
+
"@contrast/sources": "1.1.0",
|
|
34
35
|
"semver": "^7.6.0"
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -207,7 +207,6 @@ export declare class Blocker {
|
|
|
207
207
|
block(mode: string, ruleId: string): void;
|
|
208
208
|
}
|
|
209
209
|
export interface ProtectMessage {
|
|
210
|
-
reqData: ReqData;
|
|
211
210
|
blocker: Blocker;
|
|
212
211
|
policy: Partial<Record<Rule, ProtectRuleMode>>;
|
|
213
212
|
exclusions: any[];
|
|
@@ -226,6 +225,13 @@ export interface SourceInfo {
|
|
|
226
225
|
port: number;
|
|
227
226
|
protocol: string;
|
|
228
227
|
time: number;
|
|
228
|
+
method: string;
|
|
229
|
+
rawHeaders: string[];
|
|
230
|
+
uriPath: string;
|
|
231
|
+
queries: string;
|
|
232
|
+
contentType?: string;
|
|
233
|
+
ip: string;
|
|
234
|
+
httpVersion: string;
|
|
229
235
|
}
|
|
230
236
|
/**
|
|
231
237
|
* this is known as RequestStore even though, in the future, instrumentation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0",
|
|
4
4
|
"description": "Shared constants and utilities for all Contrast Agent modules",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -45,7 +45,7 @@ const {
|
|
|
45
45
|
} = require('@contrast/common');
|
|
46
46
|
|
|
47
47
|
function coerceLowerCase(path) {
|
|
48
|
-
return function(remoteData) {
|
|
48
|
+
return function (remoteData) {
|
|
49
49
|
const value = get(remoteData, path);
|
|
50
50
|
if (value && isString(value)) return StringPrototypeToLowerCase.call(value);
|
|
51
51
|
};
|