@contrast/agent-bundle 5.41.0 → 5.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -10
- package/node_modules/@contrast/agent/README.md +1 -10
- package/node_modules/@contrast/agent/package.json +13 -12
- package/node_modules/@contrast/agent-swc-plugin/package.json +3 -3
- package/node_modules/@contrast/agentify/lib/rewrite-hooks.js +3 -3
- package/node_modules/@contrast/agentify/lib/utils.js +13 -7
- package/node_modules/@contrast/agentify/package.json +17 -17
- package/node_modules/@contrast/architecture-components/package.json +6 -6
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/ejs/template.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/pug/index.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sinks/install/http/server-response.js +1 -12
- package/node_modules/@contrast/assess/lib/dataflow/sinks/install/restify.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/tracker.js +1 -1
- package/node_modules/@contrast/assess/lib/get-source-context.js +1 -1
- package/node_modules/@contrast/assess/lib/response-scanning/install/http.js +0 -12
- package/node_modules/@contrast/assess/package.json +14 -14
- package/node_modules/@contrast/code-events/binding.gyp +1 -1
- package/node_modules/@contrast/code-events/package.json +11 -9
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi108.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi115.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi127.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/{@contrast+code-events.abi93.node → @contrast+code-events.abi137.node} +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi108.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi115.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi127.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi137.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi108.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi115.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi127.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi137.node +0 -0
- package/node_modules/@contrast/common/lib/constants.d.ts +1 -1
- package/node_modules/@contrast/common/lib/constants.js +1 -1
- package/node_modules/@contrast/common/lib/index.js +15 -15
- package/node_modules/@contrast/common/lib/primordials.d.ts +22 -20
- package/node_modules/@contrast/common/lib/types.d.ts +18 -6
- package/node_modules/@contrast/common/package.json +2 -2
- package/node_modules/@contrast/config/lib/options.js +29 -4
- package/node_modules/@contrast/config/package.json +4 -4
- package/node_modules/@contrast/core/lib/app-info.js +53 -74
- package/node_modules/@contrast/core/lib/index.d.ts +17 -1
- package/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +33 -5
- package/node_modules/@contrast/core/package.json +10 -9
- package/node_modules/@contrast/deadzones/package.json +6 -6
- package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +17 -13
- package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +16 -4
- package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +2 -2
- package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +2 -3
- package/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +6 -6
- package/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -1
- package/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -7
- package/node_modules/@contrast/dep-hooks/lib/helpers.js +2 -18
- package/node_modules/@contrast/dep-hooks/lib/index.d.ts +17 -12
- package/node_modules/@contrast/dep-hooks/lib/index.js +5 -3
- package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -1
- package/node_modules/@contrast/dep-hooks/lib/package-finder.js +6 -6
- package/node_modules/@contrast/dep-hooks/package.json +4 -3
- package/node_modules/@contrast/distringuish/package.json +7 -6
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi108.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi115.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi127.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/{@contrast+distringuish.abi93.node → @contrast+distringuish.abi137.node} +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi108.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi115.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi127.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi137.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi108.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi115.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi127.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi137.node +0 -0
- package/node_modules/@contrast/esm-hooks/lib/debug-methods.mjs +4 -4
- package/node_modules/@contrast/esm-hooks/lib/get-file-type.mjs +2 -9
- package/node_modules/@contrast/esm-hooks/lib/hooks.mjs +0 -2
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs/promises.mjs +2 -0
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs.mjs +3 -0
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/util.mjs +1 -0
- package/node_modules/@contrast/esm-hooks/package.json +7 -7
- package/node_modules/@contrast/fn-inspect/package.json +9 -5
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi108.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi115.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi127.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/{@contrast+fn-inspect.abi93.node → @contrast+fn-inspect.abi137.node} +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi108.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi115.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi127.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi137.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi137.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/{@contrast+fn-inspect.abi93.musl.node → @contrast+fn-inspect.abi137.musl.node} +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi108.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi115.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi127.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi137.node +0 -0
- package/node_modules/@contrast/instrumentation/lib/http2.js +0 -11
- package/node_modules/@contrast/instrumentation/package.json +6 -6
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +312 -224
- package/node_modules/@contrast/library-analysis/package.json +6 -6
- package/node_modules/@contrast/logger/lib/index.js +18 -8
- package/node_modules/@contrast/logger/lib/serializers.js +5 -5
- package/node_modules/@contrast/logger/lib/utils.d.ts +0 -6
- package/node_modules/@contrast/logger/package.json +4 -4
- package/node_modules/@contrast/metrics/lib/index.d.ts +6 -6
- package/node_modules/@contrast/metrics/lib/index.js +0 -1
- package/node_modules/@contrast/metrics/package.json +7 -7
- package/node_modules/@contrast/patcher/package.json +3 -3
- package/node_modules/@contrast/perf/package.json +7 -4
- package/node_modules/@contrast/protect/lib/hardening/handlers.js +37 -21
- package/node_modules/@contrast/protect/lib/index.d.ts +3 -2
- package/node_modules/@contrast/protect/lib/index.js +9 -2
- package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +275 -233
- package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +3 -4
- package/node_modules/@contrast/protect/lib/input-tracing/{handlers/index.js → handlers.js} +15 -15
- package/node_modules/@contrast/protect/lib/input-tracing/index.js +0 -1
- package/node_modules/@contrast/protect/lib/make-source-context.js +5 -7
- package/node_modules/@contrast/protect/lib/policy.js +130 -95
- package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +19 -18
- package/node_modules/@contrast/protect/package.json +12 -12
- package/node_modules/@contrast/reporter/lib/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/base.d.ts +0 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.d.ts +4 -2
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +14 -14
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +43 -6
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +262 -429
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/server-inventory.d.ts +3 -3
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +93 -93
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +12 -13
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/utils.js +6 -7
- package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -3
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +72 -86
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/messages.js +6 -7
- package/node_modules/@contrast/reporter/lib/validators.js +0 -1
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.husky/pre-commit +2 -2
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc +5 -0
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/README.md +2 -4
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/bench.js +5 -36
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/index.js +56 -300
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/package.json +12 -7
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test.js +1684 -0
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/types/index.d.ts +1 -2
- package/node_modules/@contrast/reporter/package.json +10 -10
- package/node_modules/@contrast/rewriter/lib/index.js +5 -43
- package/node_modules/@contrast/rewriter/package.json +8 -8
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -5
- package/node_modules/@contrast/route-coverage/lib/install/hapi.js +9 -2
- package/node_modules/@contrast/route-coverage/lib/install/restify.js +1 -1
- package/node_modules/@contrast/route-coverage/package.json +10 -10
- package/node_modules/@contrast/scopes/package.json +6 -6
- package/node_modules/@contrast/sec-obs/lib/traces/http.js +1 -1
- package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +1 -1
- package/node_modules/@contrast/sec-obs/package.json +10 -10
- package/node_modules/@contrast/sources/lib/index.js +1 -1
- package/node_modules/@contrast/sources/lib/index.test.js +0 -26
- package/node_modules/@contrast/sources/package.json +3 -3
- package/node_modules/@contrast/telemetry/package.json +6 -6
- package/node_modules/@opentelemetry/semantic-conventions/README.md +3 -2
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +154 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +23 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js.map +1 -0
- 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 +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +154 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +23 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js.map +1 -0
- 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 +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +4354 -2883
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +157 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +720 -147
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +10 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +26 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js.map +1 -0
- 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 +6 -7
- package/node_modules/@swc/core/README.md +5 -0
- package/node_modules/@swc/core/binding.d.ts +2 -2
- package/node_modules/@swc/core/index.d.ts +5 -4
- package/node_modules/@swc/core/index.js +2 -2
- package/node_modules/@swc/core/package.json +12 -12
- package/node_modules/@swc/core-darwin-arm64/package.json +1 -1
- package/node_modules/@swc/core-darwin-arm64/swc.darwin-arm64.node +0 -0
- package/node_modules/@swc/core-darwin-x64/package.json +1 -1
- package/node_modules/@swc/core-darwin-x64/swc.darwin-x64.node +0 -0
- package/node_modules/@swc/core-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@swc/core-linux-arm64-gnu/swc.linux-arm64-gnu.node +0 -0
- package/node_modules/@swc/core-linux-arm64-musl/package.json +1 -1
- package/node_modules/@swc/core-linux-arm64-musl/swc.linux-arm64-musl.node +0 -0
- package/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
- package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
- package/node_modules/@swc/core-linux-x64-musl/package.json +1 -1
- package/node_modules/@swc/core-linux-x64-musl/swc.linux-x64-musl.node +0 -0
- package/node_modules/@swc/core-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@swc/core-win32-arm64-msvc/swc.win32-arm64-msvc.node +0 -0
- package/node_modules/@swc/core-win32-x64-msvc/package.json +1 -1
- package/node_modules/@swc/core-win32-x64-msvc/swc.win32-x64-msvc.node +0 -0
- package/node_modules/@swc/types/index.d.ts +15 -5
- package/node_modules/@swc/types/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +1 -1
- package/node_modules/@types/node/child_process.d.ts +26 -122
- package/node_modules/@types/node/crypto.d.ts +61 -11
- package/node_modules/@types/node/dns.d.ts +5 -0
- package/node_modules/@types/node/fs/promises.d.ts +48 -29
- package/node_modules/@types/node/fs.d.ts +52 -37
- package/node_modules/@types/node/globals.d.ts +148 -347
- package/node_modules/@types/node/http.d.ts +29 -5
- package/node_modules/@types/node/http2.d.ts +13 -11
- package/node_modules/@types/node/https.d.ts +5 -0
- package/node_modules/@types/node/index.d.ts +7 -2
- package/node_modules/@types/node/inspector.d.ts +187 -3985
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +25 -0
- package/node_modules/@types/node/net.d.ts +21 -0
- package/node_modules/@types/node/package.json +4 -9
- package/node_modules/@types/node/perf_hooks.d.ts +14 -0
- package/node_modules/@types/node/repl.d.ts +11 -1
- package/node_modules/@types/node/sqlite.d.ts +34 -1
- package/node_modules/@types/node/stream/web.d.ts +4 -0
- package/node_modules/@types/node/stream.d.ts +17 -6
- package/node_modules/@types/node/test.d.ts +120 -1
- package/node_modules/@types/node/timers.d.ts +0 -2
- package/node_modules/@types/node/tls.d.ts +32 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +7 -2
- package/node_modules/@types/node/ts5.7/index.d.ts +7 -2
- package/node_modules/@types/node/url.d.ts +20 -6
- package/node_modules/@types/node/util.d.ts +12 -6
- package/node_modules/@types/node/vm.d.ts +73 -10
- package/node_modules/@types/node/wasi.d.ts +21 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +47 -52
- package/node_modules/@types/node/web-globals/fetch.d.ts +50 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +63 -3
- package/node_modules/@types/node/zlib.d.ts +8 -2
- package/node_modules/axios/CHANGELOG.md +58 -0
- package/node_modules/axios/README.md +87 -10
- package/node_modules/axios/dist/axios.js +355 -289
- 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 +286 -213
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +286 -213
- 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 +377 -213
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +12 -5
- package/node_modules/axios/index.d.ts +13 -4
- package/node_modules/axios/lib/adapters/adapters.js +6 -4
- package/node_modules/axios/lib/adapters/fetch.js +221 -162
- package/node_modules/axios/lib/adapters/http.js +18 -0
- package/node_modules/axios/lib/adapters/xhr.js +11 -8
- package/node_modules/axios/lib/core/Axios.js +0 -2
- package/node_modules/axios/lib/core/AxiosError.js +10 -3
- package/node_modules/axios/lib/core/dispatchRequest.js +1 -1
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +1 -3
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +13 -9
- package/node_modules/axios/lib/utils.js +5 -3
- package/node_modules/axios/package.json +18 -12
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +48 -0
- package/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +135 -0
- package/node_modules/brace-expansion/index.js +203 -0
- package/node_modules/brace-expansion/package.json +49 -0
- package/node_modules/detect-libc/lib/detect-libc.js +59 -13
- package/node_modules/detect-libc/lib/elf.js +39 -0
- package/node_modules/detect-libc/lib/filesystem.js +18 -8
- package/node_modules/detect-libc/package.json +3 -2
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +454 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.js +592 -0
- package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +12 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +22 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1017 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +17 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.js +588 -0
- package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +12 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +18 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1001 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +17 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +20 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +82 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +408 -0
- package/node_modules/node-abi/getNextTarget.js +13 -0
- package/node_modules/node-abi/index.js +161 -0
- package/node_modules/node-abi/package.json +46 -0
- package/node_modules/node-addon-api/README.md +25 -249
- package/node_modules/node-addon-api/common.gypi +1 -0
- package/node_modules/node-addon-api/index.js +2 -0
- package/node_modules/node-addon-api/napi-inl.h +592 -166
- package/node_modules/node-addon-api/napi.h +167 -59
- package/node_modules/node-addon-api/node_addon_api.gyp +10 -0
- package/node_modules/node-addon-api/noexcept.gypi +1 -1
- package/node_modules/node-addon-api/package.json +13 -13
- package/node_modules/node-addon-api/tools/conversion.js +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.min.js +2 -2
- package/node_modules/protobufjs/google/protobuf/descriptor.json +2 -2
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +2 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/undici-types/agent.d.ts +4 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +6 -3
- package/node_modules/undici-types/diagnostics-channel.d.ts +9 -0
- package/node_modules/undici-types/dispatcher.d.ts +3 -2
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -1
- package/node_modules/undici-types/eventsource.d.ts +3 -3
- package/node_modules/undici-types/fetch.d.ts +1 -0
- package/node_modules/undici-types/handlers.d.ts +1 -1
- package/node_modules/undici-types/mock-agent.d.ts +3 -0
- package/node_modules/undici-types/mock-client.d.ts +2 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +2 -0
- package/node_modules/undici-types/mock-pool.d.ts +2 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +2 -0
- package/node_modules/undici-types/proxy-agent.d.ts +1 -0
- package/node_modules/undici-types/retry-handler.d.ts +9 -0
- package/node_modules/undici-types/webidl.d.ts +29 -15
- package/node_modules/undici-types/websocket.d.ts +3 -1
- package/node_modules/yaml/README.md +2 -20
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +1 -1
- package/node_modules/yaml/dist/stringify/stringifyString.js +1 -1
- package/node_modules/yaml/package.json +2 -1
- package/package.json +4 -3
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi93.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi93.node +0 -0
- package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi93.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi93.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi93.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi93.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi93.node +0 -0
- package/node_modules/@contrast/perf/lib/index.test.js +0 -547
- package/node_modules/@contrast/perf/lib/tsconfig.json +0 -31
- package/node_modules/@contrast/protect/lib/input-tracing/install/spdy.js +0 -63
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc.yaml +0 -11
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/destroy.test.js +0 -49
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/end.test.js +0 -98
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush.test.js +0 -419
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/fsync.test.js +0 -63
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/helper.js +0 -42
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/minlength.test.js +0 -35
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/mode.test.js +0 -116
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/reopen.test.js +0 -239
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/retry.test.js +0 -414
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/sync.test.js +0 -261
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/write.test.js +0 -465
- package/node_modules/@types/node/ts5.1/compatibility/disposable.d.ts +0 -12
- package/node_modules/@types/node/ts5.1/index.d.ts +0 -98
- package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
|
@@ -16,13 +16,12 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
const onFinished = require('on-finished');
|
|
19
|
-
const {
|
|
19
|
+
const { primordials: { StringPrototypeToLowerCase, ArrayPrototypeSlice } } = require('@contrast/common');
|
|
20
20
|
const { patchType } = require('../constants');
|
|
21
21
|
|
|
22
22
|
module.exports = function (core) {
|
|
23
23
|
const {
|
|
24
24
|
logger,
|
|
25
|
-
messages,
|
|
26
25
|
scopes: { sources },
|
|
27
26
|
instrumentation: { instrument },
|
|
28
27
|
protect: {
|
|
@@ -75,8 +74,8 @@ module.exports = function (core) {
|
|
|
75
74
|
|
|
76
75
|
onFinished(res, (/* err, req */) => {
|
|
77
76
|
resData.statusCode = res.statusCode;
|
|
77
|
+
// check for probes and method-tampering outcome
|
|
78
78
|
inputAnalysis.handleRequestEnd(store.protect);
|
|
79
|
-
messages.emit(Event.PROTECT, store);
|
|
80
79
|
});
|
|
81
80
|
|
|
82
81
|
const connectInputs = {
|
|
@@ -112,7 +111,7 @@ module.exports = function (core) {
|
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
function install() {
|
|
115
|
-
['http', 'https', '
|
|
114
|
+
['http', 'https', 'http2'].forEach((moduleName) => {
|
|
116
115
|
instrument({
|
|
117
116
|
moduleName,
|
|
118
117
|
patchObjects: [{
|
|
@@ -29,6 +29,7 @@ const {
|
|
|
29
29
|
|
|
30
30
|
module.exports = function(core) {
|
|
31
31
|
const {
|
|
32
|
+
protect,
|
|
32
33
|
protect: {
|
|
33
34
|
agentLib,
|
|
34
35
|
inputTracing,
|
|
@@ -40,16 +41,21 @@ module.exports = function(core) {
|
|
|
40
41
|
function handleFindings(sourceContext, sinkContext, ruleId, result, findings) {
|
|
41
42
|
const { stacktraceOpts } = sinkContext;
|
|
42
43
|
captureStacktrace(sinkContext, stacktraceOpts);
|
|
43
|
-
result.
|
|
44
|
+
result.exploited = true;
|
|
44
45
|
|
|
45
|
-
const mode = sourceContext.policy
|
|
46
|
+
const mode = sourceContext.policy.getRuleMode(ruleId);
|
|
47
|
+
const eventArg = { findings, result, sinkContext };
|
|
46
48
|
|
|
49
|
+
let blockInfo;
|
|
47
50
|
if (BLOCKING_MODES.includes(mode)) {
|
|
48
51
|
result.blocked = true;
|
|
49
|
-
|
|
52
|
+
blockInfo = [mode, ruleId, eventArg];
|
|
50
53
|
sourceContext.securityException = blockInfo;
|
|
51
|
-
throwSecurityException(sourceContext);
|
|
52
54
|
}
|
|
55
|
+
|
|
56
|
+
protect.reportFinding(eventArg);
|
|
57
|
+
|
|
58
|
+
if (blockInfo) throwSecurityException(sourceContext);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
inputTracing.handlePathTraversal = function(sourceContext, sinkContext) {
|
|
@@ -61,7 +67,6 @@ module.exports = function(core) {
|
|
|
61
67
|
for (const result of results) {
|
|
62
68
|
const idx = sinkContext.value.indexOf(result.value);
|
|
63
69
|
const findings = idx !== -1 ? { path: sinkContext.value } : null;
|
|
64
|
-
|
|
65
70
|
if (findings) {
|
|
66
71
|
handleFindings(sourceContext, sinkContext, ruleId, result, findings);
|
|
67
72
|
}
|
|
@@ -218,13 +223,7 @@ module.exports = function(core) {
|
|
|
218
223
|
}
|
|
219
224
|
|
|
220
225
|
if (stringFindings) {
|
|
221
|
-
const nosqlInjectionResult = { ...result, ruleId, mappedId: ruleId };
|
|
222
|
-
|
|
223
|
-
// don't modify ssjs-injection result items so use new exploit metadata array here
|
|
224
|
-
if (nosqlInjectionResult.idsList?.some?.((id) => id.startsWith('SSJS'))) {
|
|
225
|
-
nosqlInjectionResult.exploitMetadata = [];
|
|
226
|
-
}
|
|
227
|
-
|
|
226
|
+
const nosqlInjectionResult = { ...result, ruleId, mappedId: ruleId, exploited: false };
|
|
228
227
|
const nosqlInjectionResults = sourceContext.resultsMap[ruleId];
|
|
229
228
|
const isAlreadyPresentInNosqlresults = result.idsList &&
|
|
230
229
|
result.idsList.some(
|
|
@@ -312,12 +311,13 @@ module.exports = function(core) {
|
|
|
312
311
|
const findings = idx !== -1 ? { value: sinkContext.value } : null;
|
|
313
312
|
|
|
314
313
|
if (findings) {
|
|
315
|
-
result.
|
|
314
|
+
result.exploited = true;
|
|
315
|
+
handleFindings(sourceContext, sinkContext, ruleId, result, findings);
|
|
316
|
+
break;
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
320
|
|
|
320
|
-
|
|
321
321
|
return inputTracing;
|
|
322
322
|
};
|
|
323
323
|
|
|
@@ -328,7 +328,7 @@ module.exports = function(core) {
|
|
|
328
328
|
* @returns {AnalysisResult[]}
|
|
329
329
|
*/
|
|
330
330
|
function getResultsByRuleId(ruleId, context) {
|
|
331
|
-
if (!context.policy || context.policy
|
|
331
|
+
if (!context.policy || context.policy.getRuleMode(ruleId) === OFF) {
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
334
|
// because agent-lib stores all nosql-injection results under nosql-injection-mongo
|
|
@@ -36,7 +36,6 @@ module.exports = function(core) {
|
|
|
36
36
|
require('./install/mysql')(core);
|
|
37
37
|
require('./install/postgres')(core);
|
|
38
38
|
require('./install/sequelize')(core);
|
|
39
|
-
require('./install/spdy')(core);
|
|
40
39
|
require('./install/sqlite3')(core);
|
|
41
40
|
require('./install/vm')(core);
|
|
42
41
|
// TODO: NODE-2360 (oracledb)
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
module.exports = function(core) {
|
|
19
19
|
const { protect } = core;
|
|
20
20
|
|
|
21
|
-
const DISABLED_POLICY = { allowed: true };
|
|
22
|
-
|
|
23
21
|
/**
|
|
24
22
|
* @param {object} param
|
|
25
23
|
* @param {object} param.store
|
|
@@ -33,12 +31,7 @@ module.exports = function(core) {
|
|
|
33
31
|
// incomingMessage,
|
|
34
32
|
serverResponse,
|
|
35
33
|
}) {
|
|
36
|
-
if (!core.config.getEffectiveValue('protect.enable')) return DISABLED_POLICY;
|
|
37
|
-
|
|
38
34
|
const policy = protect.getPolicy({ uriPath: sourceInfo.uriPath });
|
|
39
|
-
// URL exclusions can disable all rules
|
|
40
|
-
if (!policy || policy.rulesMask === 0) return DISABLED_POLICY;
|
|
41
|
-
|
|
42
35
|
const protectStore = {
|
|
43
36
|
resData: {
|
|
44
37
|
statusCode: null,
|
|
@@ -56,6 +49,11 @@ module.exports = function(core) {
|
|
|
56
49
|
resultsMap: Object.create(null),
|
|
57
50
|
};
|
|
58
51
|
|
|
52
|
+
if (policy.allowed) {
|
|
53
|
+
protectStore.allowed = true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
59
57
|
return protectStore;
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -24,10 +24,10 @@ const {
|
|
|
24
24
|
StringPrototypeToLowerCase,
|
|
25
25
|
StringPrototypeSplit,
|
|
26
26
|
RegExpPrototypeTest
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
|
+
set,
|
|
28
29
|
} = require('@contrast/common');
|
|
29
30
|
const { ConfigSource } = require('@contrast/config');
|
|
30
|
-
|
|
31
31
|
const { BLOCK_AT_PERIMETER, OFF } = ProtectRuleMode;
|
|
32
32
|
const {
|
|
33
33
|
BOT_BLOCKER,
|
|
@@ -58,6 +58,121 @@ module.exports = function (core) {
|
|
|
58
58
|
protect: { agentLib }
|
|
59
59
|
} = core;
|
|
60
60
|
|
|
61
|
+
// todo: can we not init this and just set what's needed
|
|
62
|
+
let processedExclusions = initCompiled();
|
|
63
|
+
|
|
64
|
+
const policy = protect.policy = {
|
|
65
|
+
version: Date.now(),
|
|
66
|
+
exclusions: processedExclusions
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class RequestPolicy {
|
|
71
|
+
constructor(core, sourceInfo) {
|
|
72
|
+
Object.defineProperty(this, 'core', { value: core });
|
|
73
|
+
Object.defineProperty(this, 'sourceInfo', { value: sourceInfo });
|
|
74
|
+
|
|
75
|
+
this.init();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
init() {
|
|
79
|
+
const { uriPath } = this.sourceInfo;
|
|
80
|
+
this.version = core.protect.policy.version;
|
|
81
|
+
|
|
82
|
+
if (!this.core.config.getEffectiveValue('protect.enable')) {
|
|
83
|
+
this.allowed = true;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// todo build exclusions
|
|
88
|
+
for (const [inputType, exclusions] of Object.entries(processedExclusions)) {
|
|
89
|
+
for (const e of exclusions) {
|
|
90
|
+
if (!e.matchesUriPath(uriPath)) continue;
|
|
91
|
+
|
|
92
|
+
// url exclusions
|
|
93
|
+
if (inputType === 'url') {
|
|
94
|
+
// if applies to all rules, there is no policy for the request i.e. disable protect
|
|
95
|
+
if (!e.policy) {
|
|
96
|
+
this.allowed = true;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// merge exclusion's policy into the request's policy
|
|
101
|
+
for (const key of Object.keys(e.policy)) {
|
|
102
|
+
const value = e.policy[key];
|
|
103
|
+
if (key === 'rulesMask') {
|
|
104
|
+
if (this.exclusions?.rulesMask == null)
|
|
105
|
+
set(this, 'exclusions.rulesMask', this.core.protect.policy.rulesMask);
|
|
106
|
+
// this is how to disable rules bitwise
|
|
107
|
+
this.exclusions.rulesMask = this.exclusions.rulesMask & ~value;
|
|
108
|
+
} else {
|
|
109
|
+
set(this, `exclusions.${key}`, value);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} else if (inputType === 'querystring') {
|
|
113
|
+
if (!e.policy) {
|
|
114
|
+
set(this, 'exclusions.ignoreQuerystring', true);
|
|
115
|
+
} else {
|
|
116
|
+
// merge exclusion's policy into the querystring's policy
|
|
117
|
+
// this.exclusions.querystringPolicy = this.exclusions.querystringPolicy || {};
|
|
118
|
+
for (const key of Object.keys(e.policy)) {
|
|
119
|
+
const value = e.policy[key];
|
|
120
|
+
if (key !== 'rulesMask') {
|
|
121
|
+
set(this, `exclusions.querystringPolicy.${key}`, value);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} else if (inputType === 'body') {
|
|
126
|
+
if (!e.policy) {
|
|
127
|
+
set(this, 'exclusions.ignoreBody', true);
|
|
128
|
+
} else {
|
|
129
|
+
// merge exclusion's policy into the querystring's policy
|
|
130
|
+
// set(this, `exclusions.bodyPolicy = this.exclusions.bodyPolicy || {};
|
|
131
|
+
for (const key of Object.keys(e.policy)) {
|
|
132
|
+
const value = e.policy[key];
|
|
133
|
+
if (key !== 'rulesMask') {
|
|
134
|
+
set(this, `exclusions.bodyPolicy.${key}`, value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
// copy matching input exclusions into request policy
|
|
140
|
+
if (!this.exclusions?.[inputType]) set(this, `exclusions.${inputType}`, []);
|
|
141
|
+
this.exclusions[inputType].push(e);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
checkInit() {
|
|
148
|
+
if (!this.version == core.protect.policy.version) {
|
|
149
|
+
this.init();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
isDisabled() {
|
|
154
|
+
this.checkInit();
|
|
155
|
+
return this.allowed === true;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
getRulesMask(inputType) {
|
|
159
|
+
this.checkInit();
|
|
160
|
+
if (this.allowed) return 0;
|
|
161
|
+
return this.exclusions?.rulesMask ?? this.core.protect.policy.rulesMask;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
getRuleMode(ruleId) {
|
|
165
|
+
this.checkInit();
|
|
166
|
+
if (this.allowed) return OFF;
|
|
167
|
+
return this.exclusions?.[ruleId] ?? this.core.protect.policy[ruleId];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
getExclusionInfo(key, inputType) {
|
|
171
|
+
this.checkInit();
|
|
172
|
+
return key ? this.exclusions?.[key] : this.exclusions;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
61
176
|
function initCompiled() {
|
|
62
177
|
return {
|
|
63
178
|
url: [],
|
|
@@ -69,12 +184,6 @@ module.exports = function (core) {
|
|
|
69
184
|
};
|
|
70
185
|
}
|
|
71
186
|
|
|
72
|
-
let compiled = initCompiled();
|
|
73
|
-
|
|
74
|
-
const policy = protect.policy = {
|
|
75
|
-
exclusions: compiled
|
|
76
|
-
};
|
|
77
|
-
|
|
78
187
|
function regExpCheck(str) {
|
|
79
188
|
return str.indexOf('*') > 0 ||
|
|
80
189
|
str.indexOf('.') > 0 ||
|
|
@@ -156,96 +265,19 @@ module.exports = function (core) {
|
|
|
156
265
|
ruleId = 'nosql-injection-mongo';
|
|
157
266
|
}
|
|
158
267
|
|
|
159
|
-
if (
|
|
160
|
-
rulesMask = rulesMask |
|
|
268
|
+
if (agentLib.RuleType[ruleId] && mode !== OFF) {
|
|
269
|
+
rulesMask = rulesMask | agentLib.RuleType[ruleId];
|
|
161
270
|
}
|
|
162
271
|
}
|
|
163
272
|
|
|
164
273
|
policy.rulesMask = rulesMask;
|
|
165
274
|
}
|
|
166
275
|
|
|
167
|
-
/**
|
|
168
|
-
* This gets called by protect.makeSourceContext(). We return copy of policy to avoid
|
|
169
|
-
* inconsistent behavior if policy is updated during request handling.
|
|
170
|
-
*/
|
|
171
|
-
function getPolicy({ uriPath } = {}) {
|
|
172
|
-
const requestPolicy = {
|
|
173
|
-
exclusions: {
|
|
174
|
-
ignoreQuerystring: false,
|
|
175
|
-
querystringPolicy: null,
|
|
176
|
-
ignoreBody: false,
|
|
177
|
-
bodyPolicy: null,
|
|
178
|
-
header: [],
|
|
179
|
-
cookie: [],
|
|
180
|
-
parameter: [],
|
|
181
|
-
},
|
|
182
|
-
rulesMask: policy.rulesMask,
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
for (const ruleId of Object.values(Rule)) {
|
|
186
|
-
requestPolicy[ruleId] = policy[ruleId];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// handle exclusions
|
|
190
|
-
for (const [inputType, exclusions] of Object.entries(compiled)) {
|
|
191
|
-
for (const e of exclusions) {
|
|
192
|
-
if (!e.matchesUriPath(uriPath)) continue;
|
|
193
|
-
|
|
194
|
-
// url exclusions
|
|
195
|
-
if (inputType === 'url') {
|
|
196
|
-
// if applies to all rules, there is no policy for the request i.e. disable protect
|
|
197
|
-
if (!e.policy) {
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// merge exclusion's policy into the request's policy
|
|
202
|
-
for (const key of Object.keys(e.policy)) {
|
|
203
|
-
const value = e.policy[key];
|
|
204
|
-
if (key === 'rulesMask') {
|
|
205
|
-
// this is how to disable rules bitwise
|
|
206
|
-
requestPolicy.rulesMask = requestPolicy.rulesMask & ~value;
|
|
207
|
-
} else {
|
|
208
|
-
requestPolicy[key] = value;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
} else if (inputType === 'querystring') {
|
|
212
|
-
if (!e.policy) {
|
|
213
|
-
requestPolicy.exclusions.ignoreQuerystring = true;
|
|
214
|
-
} else {
|
|
215
|
-
// merge exclusion's policy into the querystring's policy
|
|
216
|
-
requestPolicy.exclusions.querystringPolicy = requestPolicy.exclusions.querystringPolicy || {};
|
|
217
|
-
for (const key of Object.keys(e.policy)) {
|
|
218
|
-
const value = e.policy[key];
|
|
219
|
-
if (key !== 'rulesMask') {
|
|
220
|
-
requestPolicy.exclusions.querystringPolicy[key] = value;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
} else if (inputType === 'body') {
|
|
225
|
-
if (!e.policy) {
|
|
226
|
-
requestPolicy.exclusions.ignoreBody = true;
|
|
227
|
-
} else {
|
|
228
|
-
// merge exclusion's policy into the querystring's policy
|
|
229
|
-
requestPolicy.exclusions.bodyPolicy = requestPolicy.exclusions.bodyPolicy || {};
|
|
230
|
-
for (const key of Object.keys(e.policy)) {
|
|
231
|
-
const value = e.policy[key];
|
|
232
|
-
if (key !== 'rulesMask') {
|
|
233
|
-
requestPolicy.exclusions.bodyPolicy[key] = value;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
} else {
|
|
238
|
-
// copy matching input exclusions into request policy
|
|
239
|
-
requestPolicy.exclusions[inputType].push(e);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return requestPolicy;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
276
|
function updateGlobalPolicy(remoteSettings) {
|
|
248
277
|
const protectionRules = remoteSettings?.protect?.rules;
|
|
278
|
+
// last updated
|
|
279
|
+
protect.policy.version = Date.now();
|
|
280
|
+
|
|
249
281
|
if (protectionRules) {
|
|
250
282
|
[
|
|
251
283
|
CMD_INJECTION,
|
|
@@ -290,7 +322,8 @@ module.exports = function (core) {
|
|
|
290
322
|
}
|
|
291
323
|
|
|
292
324
|
updateRulesMask();
|
|
293
|
-
protect.policy.exclusions =
|
|
325
|
+
protect.policy.exclusions = processedExclusions;
|
|
326
|
+
|
|
294
327
|
logger.info({ policy: protect.policy }, 'Protect policy updated');
|
|
295
328
|
}
|
|
296
329
|
}
|
|
@@ -302,7 +335,7 @@ module.exports = function (core) {
|
|
|
302
335
|
].filter((exclusion) => exclusion.modes.includes('defend'));
|
|
303
336
|
|
|
304
337
|
if (!exclusions.length) return;
|
|
305
|
-
|
|
338
|
+
processedExclusions = initCompiled();
|
|
306
339
|
|
|
307
340
|
for (const exclusionDtm of exclusions) {
|
|
308
341
|
exclusionDtm.type = exclusionDtm.type || 'URL';
|
|
@@ -310,7 +343,7 @@ module.exports = function (core) {
|
|
|
310
343
|
const { name, protect_rules, urls, type } = exclusionDtm;
|
|
311
344
|
const key = StringPrototypeToLowerCase.call(type);
|
|
312
345
|
|
|
313
|
-
if (!
|
|
346
|
+
if (!processedExclusions[key]) continue;
|
|
314
347
|
|
|
315
348
|
try {
|
|
316
349
|
const e = { name };
|
|
@@ -354,7 +387,7 @@ module.exports = function (core) {
|
|
|
354
387
|
};
|
|
355
388
|
}
|
|
356
389
|
|
|
357
|
-
|
|
390
|
+
processedExclusions[key].push(e);
|
|
358
391
|
} catch (err) {
|
|
359
392
|
logger.error({ err, exclusionDtm }, 'failed to process exclusion');
|
|
360
393
|
}
|
|
@@ -370,5 +403,7 @@ module.exports = function (core) {
|
|
|
370
403
|
|
|
371
404
|
initPolicy();
|
|
372
405
|
|
|
373
|
-
return protect.getPolicy = getPolicy
|
|
406
|
+
return protect.getPolicy = function getPolicy(sourceInfo) {
|
|
407
|
+
return new RequestPolicy(core, sourceInfo);
|
|
408
|
+
};
|
|
374
409
|
};
|
|
@@ -44,6 +44,7 @@ const getRuleResults = function(obj, prop) {
|
|
|
44
44
|
|
|
45
45
|
module.exports = function(core) {
|
|
46
46
|
const {
|
|
47
|
+
protect,
|
|
47
48
|
protect: {
|
|
48
49
|
agentLib,
|
|
49
50
|
semanticAnalysis,
|
|
@@ -52,27 +53,32 @@ module.exports = function(core) {
|
|
|
52
53
|
captureStacktrace,
|
|
53
54
|
} = core;
|
|
54
55
|
|
|
55
|
-
function handleResult(sourceContext, sinkContext, ruleId, mode,
|
|
56
|
+
function handleResult(sourceContext, sinkContext, ruleId, mode, findings) {
|
|
56
57
|
const { value, stacktraceOpts } = sinkContext;
|
|
57
58
|
captureStacktrace(sinkContext, stacktraceOpts);
|
|
58
59
|
|
|
59
60
|
// shoehorn findings into agent-lib result data model
|
|
60
61
|
const result = {
|
|
61
62
|
blocked: false,
|
|
63
|
+
inputType: InputType.UNKNOWN,
|
|
62
64
|
ruleId,
|
|
63
65
|
value,
|
|
64
66
|
mappedId: ruleId,
|
|
65
|
-
|
|
66
|
-
...finding
|
|
67
|
+
exploited: true,
|
|
67
68
|
};
|
|
69
|
+
|
|
68
70
|
getRuleResults(sourceContext.resultsMap, ruleId).push(result);
|
|
69
71
|
|
|
72
|
+
let blockInfo;
|
|
70
73
|
if (BLOCKING_MODES.includes(mode)) {
|
|
71
74
|
result.blocked = true;
|
|
72
|
-
|
|
75
|
+
blockInfo = [mode, ruleId];
|
|
73
76
|
sourceContext.securityException = blockInfo;
|
|
74
|
-
throwSecurityException(sourceContext);
|
|
75
77
|
}
|
|
78
|
+
|
|
79
|
+
protect.reportFinding({ findings, result, sinkContext });
|
|
80
|
+
|
|
81
|
+
if (blockInfo) throwSecurityException(sourceContext);
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
/**
|
|
@@ -149,7 +155,7 @@ module.exports = function(core) {
|
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
semanticAnalysis.handleCmdInjectionSemanticDangerous = function(sourceContext, sinkContext) {
|
|
152
|
-
const mode = sourceContext.policy
|
|
158
|
+
const mode = sourceContext.policy.getRuleMode(Rule.CMD_INJECTION_SEMANTIC_DANGEROUS_PATHS);
|
|
153
159
|
|
|
154
160
|
if (mode == OFF) return;
|
|
155
161
|
|
|
@@ -161,7 +167,7 @@ module.exports = function(core) {
|
|
|
161
167
|
};
|
|
162
168
|
|
|
163
169
|
semanticAnalysis.handleCmdInjectionSemanticChainedCommands = function(sourceContext, sinkContext) {
|
|
164
|
-
const mode = sourceContext.policy
|
|
170
|
+
const mode = sourceContext.policy.getRuleMode(Rule.CMD_INJECTION_SEMANTIC_CHAINED_COMMANDS);
|
|
165
171
|
|
|
166
172
|
if (mode == OFF) return;
|
|
167
173
|
|
|
@@ -173,38 +179,33 @@ module.exports = function(core) {
|
|
|
173
179
|
};
|
|
174
180
|
|
|
175
181
|
semanticAnalysis.handleCommandInjectionCommandBackdoors = function(sourceContext, sinkContext) {
|
|
176
|
-
const mode = sourceContext.policy
|
|
182
|
+
const mode = sourceContext.policy.getRuleMode(Rule.CMD_INJECTION_COMMAND_BACKDOORS);
|
|
177
183
|
|
|
178
184
|
if (mode == OFF) return;
|
|
179
|
-
|
|
180
185
|
const finding = findBackdoorInjection(sourceContext, sinkContext.value);
|
|
181
186
|
|
|
182
187
|
if (finding) {
|
|
183
|
-
handleResult(sourceContext, sinkContext, Rule.CMD_INJECTION_COMMAND_BACKDOORS, mode
|
|
188
|
+
handleResult(sourceContext, sinkContext, Rule.CMD_INJECTION_COMMAND_BACKDOORS, mode);
|
|
184
189
|
}
|
|
185
190
|
};
|
|
186
191
|
|
|
187
192
|
semanticAnalysis.handlePathTraversalFileSecurityBypass = function(sourceContext, sinkContext) {
|
|
188
|
-
const mode = sourceContext.policy
|
|
193
|
+
const mode = sourceContext.policy.getRuleMode(Rule.PATH_TRAVERSAL_SEMANTIC_FILE_SECURITY_BYPASS);
|
|
189
194
|
|
|
190
195
|
if (mode == OFF) return;
|
|
191
196
|
|
|
192
197
|
if (agentLib.isDangerousPath(sinkContext.value, true)) {
|
|
193
|
-
handleResult(sourceContext, sinkContext, Rule.PATH_TRAVERSAL_SEMANTIC_FILE_SECURITY_BYPASS, mode
|
|
194
|
-
exploitMetadata: [{ sinkContext, path: sinkContext.value }]
|
|
195
|
-
});
|
|
198
|
+
handleResult(sourceContext, sinkContext, Rule.PATH_TRAVERSAL_SEMANTIC_FILE_SECURITY_BYPASS, mode);
|
|
196
199
|
}
|
|
197
200
|
};
|
|
198
201
|
|
|
199
202
|
semanticAnalysis.handleXXE = function (sourceContext, sinkContext) {
|
|
200
|
-
const mode = sourceContext.policy
|
|
203
|
+
const mode = sourceContext.policy.getRuleMode(Rule.XXE);
|
|
201
204
|
if (mode == OFF) return;
|
|
202
205
|
|
|
203
206
|
const findings = findExternalEntities(sinkContext.value);
|
|
204
207
|
if (findings.entities.length) {
|
|
205
|
-
handleResult(sourceContext, sinkContext, Rule.XXE, mode,
|
|
206
|
-
exploitMetadata: [{ sinkContext, ...findings }],
|
|
207
|
-
});
|
|
208
|
+
handleResult(sourceContext, sinkContext, Rule.XXE, mode, findings);
|
|
208
209
|
}
|
|
209
210
|
};
|
|
210
211
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/protect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.68.0",
|
|
4
4
|
"description": "Contrast service providing framework-agnostic Protect support",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
"types": "lib/index.d.ts",
|
|
15
15
|
"engines": {
|
|
16
16
|
"npm": ">=6.13.7 <7 || >= 8.3.1",
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">= 18.7.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "bash ../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@contrast/agent-lib": "^9.1.0",
|
|
24
|
-
"@contrast/common": "1.
|
|
25
|
-
"@contrast/config": "1.
|
|
26
|
-
"@contrast/core": "1.
|
|
27
|
-
"@contrast/dep-hooks": "1.
|
|
28
|
-
"@contrast/esm-hooks": "2.
|
|
29
|
-
"@contrast/instrumentation": "1.
|
|
30
|
-
"@contrast/logger": "1.
|
|
31
|
-
"@contrast/patcher": "1.
|
|
32
|
-
"@contrast/rewriter": "1.
|
|
33
|
-
"@contrast/scopes": "1.
|
|
24
|
+
"@contrast/common": "1.37.0",
|
|
25
|
+
"@contrast/config": "1.52.1",
|
|
26
|
+
"@contrast/core": "1.57.1",
|
|
27
|
+
"@contrast/dep-hooks": "1.26.1",
|
|
28
|
+
"@contrast/esm-hooks": "2.32.0",
|
|
29
|
+
"@contrast/instrumentation": "1.36.1",
|
|
30
|
+
"@contrast/logger": "1.30.1",
|
|
31
|
+
"@contrast/patcher": "1.29.1",
|
|
32
|
+
"@contrast/rewriter": "1.34.0",
|
|
33
|
+
"@contrast/scopes": "1.27.1",
|
|
34
34
|
"async-hook-domain": "^4.0.1",
|
|
35
35
|
"ipaddr.js": "^2.0.1",
|
|
36
36
|
"on-finished": "^2.4.1",
|
|
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.default = init;
|
|
20
21
|
const file_1 = __importDefault(require("./reporters/file"));
|
|
21
22
|
const contrast_ui_1 = __importDefault(require("./reporters/contrast-ui"));
|
|
22
23
|
const security_logger_1 = __importDefault(require("./reporters/security-logger"));
|
|
@@ -51,5 +52,4 @@ function init(core, options = DEFAULT_OPTIONS) {
|
|
|
51
52
|
}
|
|
52
53
|
return core.reporter;
|
|
53
54
|
}
|
|
54
|
-
exports.default = init;
|
|
55
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Core } from '../../../base';
|
|
2
|
-
import {
|
|
2
|
+
import { ContrastUIReporter } from '../../types';
|
|
3
3
|
import NgEndpoint from '../ng-endpoint';
|
|
4
|
+
import { Translations } from './translations';
|
|
4
5
|
export default class ApplicationActivity extends NgEndpoint {
|
|
5
|
-
|
|
6
|
+
translations: Translations;
|
|
6
7
|
lastUpdate: number;
|
|
7
8
|
userAgentSet: Set<string>;
|
|
9
|
+
attackersMap: Map<string, any>;
|
|
8
10
|
constructor(core: Core, uiReporter: ContrastUIReporter);
|
|
9
11
|
put(): Promise<void>;
|
|
10
12
|
}
|
|
@@ -23,30 +23,30 @@ const translations_1 = require("./translations");
|
|
|
23
23
|
class ApplicationActivity extends ng_endpoint_1.default {
|
|
24
24
|
constructor(core, uiReporter) {
|
|
25
25
|
super(core, { ...uiReporter, url: '/api/ng/activity/application' });
|
|
26
|
-
this.defendPayload = [];
|
|
27
|
-
this.defendPayload = [];
|
|
28
26
|
this.lastUpdate = 0;
|
|
29
27
|
this.userAgentSet = new Set();
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
this.attackersMap = new Map();
|
|
29
|
+
this.translations = new translations_1.Translations(core);
|
|
30
|
+
uiReporter.subscribeWithLock(common_1.Event.PROTECT_FINDING, (eventArg) => {
|
|
31
|
+
// validate before passing to accumulator helpers
|
|
32
|
+
if (!eventArg.store.sourceInfo?.ip)
|
|
32
33
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.
|
|
34
|
+
try {
|
|
35
|
+
this.translations.accumulateUserAgent(this.userAgentSet, eventArg);
|
|
36
|
+
this.translations.accumulateFinding(this.attackersMap, eventArg);
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
catch (err) {
|
|
39
|
+
core.logger.error({ err }, 'unable to accumulate protect finding');
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
async put() {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
this.defendPayload = [];
|
|
44
|
+
const attackers = Array.from(this.attackersMap.values());
|
|
45
|
+
this.attackersMap.clear();
|
|
46
46
|
const browsers = Array.from(this.userAgentSet.values());
|
|
47
47
|
this.userAgentSet.clear();
|
|
48
|
-
this.lastUpdate += config.agent.polling.app_activity_ms;
|
|
49
|
-
const resp = await client.put(url, {
|
|
48
|
+
this.lastUpdate += this.core.config.agent.polling.app_activity_ms;
|
|
49
|
+
const resp = await this.client.put(this.url, {
|
|
50
50
|
inventory: { browsers },
|
|
51
51
|
defend: { attackers },
|
|
52
52
|
lastUpdate: this.lastUpdate,
|