shield360 1.1.0 → 1.2.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 +330 -3
- package/dist/__tests__/build-info.test.js +8 -1
- package/dist/__tests__/build-info.test.js.map +1 -1
- package/dist/__tests__/code-location.test.js +1 -1
- package/dist/__tests__/destination.test.js +15 -0
- package/dist/__tests__/destination.test.js.map +1 -1
- package/dist/__tests__/masking.test.d.ts +1 -0
- package/dist/__tests__/masking.test.js +66 -0
- package/dist/__tests__/masking.test.js.map +1 -0
- package/dist/__tests__/register.e2e.test.d.ts +1 -0
- package/dist/__tests__/register.e2e.test.js +279 -0
- package/dist/__tests__/register.e2e.test.js.map +1 -0
- package/dist/__tests__/register.test.js +60 -0
- package/dist/__tests__/register.test.js.map +1 -1
- package/dist/agents/__tests__/agents.test.d.ts +1 -0
- package/dist/agents/__tests__/agents.test.js +529 -0
- package/dist/agents/__tests__/agents.test.js.map +1 -0
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.js +25 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/passport.d.ts +92 -0
- package/dist/agents/passport.js +301 -0
- package/dist/agents/passport.js.map +1 -0
- package/dist/agents/policy.d.ts +24 -0
- package/dist/agents/policy.js +93 -0
- package/dist/agents/policy.js.map +1 -0
- package/dist/agents/replay.d.ts +20 -0
- package/dist/agents/replay.js +47 -0
- package/dist/agents/replay.js.map +1 -0
- package/dist/agents/report.d.ts +30 -0
- package/dist/agents/report.js +93 -0
- package/dist/agents/report.js.map +1 -0
- package/dist/agents/types.d.ts +148 -0
- package/dist/agents/types.js +37 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/agents/verifier.d.ts +33 -0
- package/dist/agents/verifier.js +276 -0
- package/dist/agents/verifier.js.map +1 -0
- package/dist/ai-security/__tests__/bench.test.d.ts +1 -0
- package/dist/ai-security/__tests__/bench.test.js +50 -0
- package/dist/ai-security/__tests__/bench.test.js.map +1 -0
- package/dist/ai-security/__tests__/checks.test.d.ts +1 -0
- package/dist/ai-security/__tests__/checks.test.js +248 -0
- package/dist/ai-security/__tests__/checks.test.js.map +1 -0
- package/dist/ai-security/__tests__/config.test.d.ts +1 -0
- package/dist/ai-security/__tests__/config.test.js +164 -0
- package/dist/ai-security/__tests__/config.test.js.map +1 -0
- package/dist/ai-security/__tests__/detection.test.d.ts +1 -0
- package/dist/ai-security/__tests__/detection.test.js +114 -0
- package/dist/ai-security/__tests__/detection.test.js.map +1 -0
- package/dist/ai-security/__tests__/fixtures.d.ts +8 -0
- package/dist/ai-security/__tests__/fixtures.js +30 -0
- package/dist/ai-security/__tests__/fixtures.js.map +1 -0
- package/dist/ai-security/__tests__/hooks.test.d.ts +1 -0
- package/dist/ai-security/__tests__/hooks.test.js +174 -0
- package/dist/ai-security/__tests__/hooks.test.js.map +1 -0
- package/dist/ai-security/__tests__/stream.test.d.ts +1 -0
- package/dist/ai-security/__tests__/stream.test.js +85 -0
- package/dist/ai-security/__tests__/stream.test.js.map +1 -0
- package/dist/ai-security/config.d.ts +94 -0
- package/dist/ai-security/config.js +241 -0
- package/dist/ai-security/config.js.map +1 -0
- package/dist/ai-security/context.d.ts +45 -0
- package/dist/ai-security/context.js +108 -0
- package/dist/ai-security/context.js.map +1 -0
- package/dist/ai-security/custom-kinds.d.ts +23 -0
- package/dist/ai-security/custom-kinds.js +97 -0
- package/dist/ai-security/custom-kinds.js.map +1 -0
- package/dist/ai-security/events.d.ts +77 -0
- package/dist/ai-security/events.js +153 -0
- package/dist/ai-security/events.js.map +1 -0
- package/dist/ai-security/hooks.d.ts +48 -0
- package/dist/ai-security/hooks.js +461 -0
- package/dist/ai-security/hooks.js.map +1 -0
- package/dist/ai-security/index.d.ts +209 -0
- package/dist/ai-security/index.js +587 -0
- package/dist/ai-security/index.js.map +1 -0
- package/dist/ai-security/injection-rules.json +1024 -0
- package/dist/ai-security/injection.d.ts +46 -0
- package/dist/ai-security/injection.js +635 -0
- package/dist/ai-security/injection.js.map +1 -0
- package/dist/ai-security/jailbreak.d.ts +38 -0
- package/dist/ai-security/jailbreak.js +73 -0
- package/dist/ai-security/jailbreak.js.map +1 -0
- package/dist/ai-security/limits.d.ts +84 -0
- package/dist/ai-security/limits.js +195 -0
- package/dist/ai-security/limits.js.map +1 -0
- package/dist/ai-security/mcp.d.ts +82 -0
- package/dist/ai-security/mcp.js +150 -0
- package/dist/ai-security/mcp.js.map +1 -0
- package/dist/ai-security/output.d.ts +107 -0
- package/dist/ai-security/output.js +390 -0
- package/dist/ai-security/output.js.map +1 -0
- package/dist/ai-security/policy.d.ts +125 -0
- package/dist/ai-security/policy.js +196 -0
- package/dist/ai-security/policy.js.map +1 -0
- package/dist/ai-security/rag.d.ts +70 -0
- package/dist/ai-security/rag.js +174 -0
- package/dist/ai-security/rag.js.map +1 -0
- package/dist/ai-security/tool-rules.json +203 -0
- package/dist/ai-security/tools.d.ts +46 -0
- package/dist/ai-security/tools.js +62 -0
- package/dist/ai-security/tools.js.map +1 -0
- package/dist/budgets/__tests__/budgets.test.d.ts +1 -0
- package/dist/budgets/__tests__/budgets.test.js +134 -0
- package/dist/budgets/__tests__/budgets.test.js.map +1 -0
- package/dist/budgets/auto.d.ts +25 -0
- package/dist/budgets/auto.js +63 -0
- package/dist/budgets/auto.js.map +1 -0
- package/dist/budgets/index.d.ts +110 -0
- package/dist/budgets/index.js +239 -0
- package/dist/budgets/index.js.map +1 -0
- package/dist/customer/__tests__/customer.test.d.ts +1 -0
- package/dist/customer/__tests__/customer.test.js +155 -0
- package/dist/customer/__tests__/customer.test.js.map +1 -0
- package/dist/customer/index.d.ts +48 -0
- package/dist/customer/index.js +132 -0
- package/dist/customer/index.js.map +1 -0
- package/dist/destination.d.ts +14 -0
- package/dist/destination.js +16 -0
- package/dist/destination.js.map +1 -1
- package/dist/feedback/__tests__/feedback.test.d.ts +1 -0
- package/dist/feedback/__tests__/feedback.test.js +80 -0
- package/dist/feedback/__tests__/feedback.test.js.map +1 -0
- package/dist/feedback/index.d.ts +48 -0
- package/dist/feedback/index.js +97 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/flags/__tests__/flags.test.d.ts +1 -0
- package/dist/flags/__tests__/flags.test.js +301 -0
- package/dist/flags/__tests__/flags.test.js.map +1 -0
- package/dist/flags/client.d.ts +131 -0
- package/dist/flags/client.js +301 -0
- package/dist/flags/client.js.map +1 -0
- package/dist/flags/engine.d.ts +200 -0
- package/dist/flags/engine.js +677 -0
- package/dist/flags/engine.js.map +1 -0
- package/dist/flags/index.d.ts +4 -0
- package/dist/flags/index.js +16 -0
- package/dist/flags/index.js.map +1 -0
- package/dist/guard/__tests__/findings.test.js +1 -1
- package/dist/guard/__tests__/report.test.js +67 -0
- package/dist/guard/__tests__/report.test.js.map +1 -1
- package/dist/guard/heartbeat.d.ts +34 -0
- package/dist/guard/heartbeat.js +83 -0
- package/dist/guard/heartbeat.js.map +1 -0
- package/dist/guard/integration.d.ts +9 -0
- package/dist/guard/integration.js +4 -2
- package/dist/guard/integration.js.map +1 -1
- package/dist/guard/report.d.ts +24 -1
- package/dist/guard/report.js +67 -18
- package/dist/guard/report.js.map +1 -1
- package/dist/index.d.ts +88 -0
- package/dist/index.js +203 -2
- package/dist/index.js.map +1 -1
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js +1 -1
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js.map +1 -1
- package/dist/instrumentation/anthropic/wrapper.js +4 -0
- package/dist/instrumentation/anthropic/wrapper.js.map +1 -1
- package/dist/instrumentation/openai/wrapper.js +6 -0
- package/dist/instrumentation/openai/wrapper.js.map +1 -1
- package/dist/masking.d.ts +42 -0
- package/dist/masking.js +197 -0
- package/dist/masking.js.map +1 -0
- package/dist/otel/__tests__/app-logs-safety.test.d.ts +1 -0
- package/dist/otel/__tests__/app-logs-safety.test.js +129 -0
- package/dist/otel/__tests__/app-logs-safety.test.js.map +1 -0
- package/dist/otel/__tests__/app-logs.test.d.ts +1 -0
- package/dist/otel/__tests__/app-logs.test.js +269 -0
- package/dist/otel/__tests__/app-logs.test.js.map +1 -0
- package/dist/otel/__tests__/log-auto.test.d.ts +1 -0
- package/dist/otel/__tests__/log-auto.test.js +125 -0
- package/dist/otel/__tests__/log-auto.test.js.map +1 -0
- package/dist/otel/__tests__/log-bridges.test.d.ts +1 -0
- package/dist/otel/__tests__/log-bridges.test.js +170 -0
- package/dist/otel/__tests__/log-bridges.test.js.map +1 -0
- package/dist/otel/__tests__/system-metrics.test.d.ts +1 -0
- package/dist/otel/__tests__/system-metrics.test.js +79 -0
- package/dist/otel/__tests__/system-metrics.test.js.map +1 -0
- package/dist/otel/app-logs.d.ts +80 -0
- package/dist/otel/app-logs.js +195 -0
- package/dist/otel/app-logs.js.map +1 -0
- package/dist/otel/build-info.d.ts +2 -1
- package/dist/otel/build-info.js +3 -2
- package/dist/otel/build-info.js.map +1 -1
- package/dist/otel/events.d.ts +1 -0
- package/dist/otel/events.js +22 -13
- package/dist/otel/events.js.map +1 -1
- package/dist/otel/log-auto.d.ts +44 -0
- package/dist/otel/log-auto.js +200 -0
- package/dist/otel/log-auto.js.map +1 -0
- package/dist/otel/log-bridges.d.ts +54 -0
- package/dist/otel/log-bridges.js +307 -0
- package/dist/otel/log-bridges.js.map +1 -0
- package/dist/otel/metrics.js +1 -1
- package/dist/otel/metrics.js.map +1 -1
- package/dist/otel/system-metrics.d.ts +39 -0
- package/dist/otel/system-metrics.js +166 -0
- package/dist/otel/system-metrics.js.map +1 -0
- package/dist/otel/tracing.js +6 -2
- package/dist/otel/tracing.js.map +1 -1
- package/dist/protect/__tests__/protect.test.js +4 -0
- package/dist/protect/__tests__/protect.test.js.map +1 -1
- package/dist/protect/index.js +9 -4
- package/dist/protect/index.js.map +1 -1
- package/dist/rasp/__tests__/auto-http.test.d.ts +1 -0
- package/dist/rasp/__tests__/auto-http.test.js +136 -0
- package/dist/rasp/__tests__/auto-http.test.js.map +1 -0
- package/dist/rasp/__tests__/baseline.test.d.ts +1 -0
- package/dist/rasp/__tests__/baseline.test.js +86 -0
- package/dist/rasp/__tests__/baseline.test.js.map +1 -0
- package/dist/rasp/__tests__/benign-corpus.test.d.ts +1 -0
- package/dist/rasp/__tests__/benign-corpus.test.js +68 -0
- package/dist/rasp/__tests__/benign-corpus.test.js.map +1 -0
- package/dist/rasp/__tests__/capture-context.test.d.ts +1 -0
- package/dist/rasp/__tests__/capture-context.test.js +135 -0
- package/dist/rasp/__tests__/capture-context.test.js.map +1 -0
- package/dist/rasp/__tests__/code-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/code-hook.test.js +218 -0
- package/dist/rasp/__tests__/code-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/config-client.test.d.ts +1 -0
- package/dist/rasp/__tests__/config-client.test.js +283 -0
- package/dist/rasp/__tests__/config-client.test.js.map +1 -0
- package/dist/rasp/__tests__/corpus.d.ts +13 -0
- package/dist/rasp/__tests__/corpus.js +111 -0
- package/dist/rasp/__tests__/corpus.js.map +1 -0
- package/dist/rasp/__tests__/custom-rules.test.d.ts +1 -0
- package/dist/rasp/__tests__/custom-rules.test.js +276 -0
- package/dist/rasp/__tests__/custom-rules.test.js.map +1 -0
- package/dist/rasp/__tests__/db-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/db-hook.test.js +438 -0
- package/dist/rasp/__tests__/db-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/deception.test.d.ts +1 -0
- package/dist/rasp/__tests__/deception.test.js +567 -0
- package/dist/rasp/__tests__/deception.test.js.map +1 -0
- package/dist/rasp/__tests__/detect.test.d.ts +1 -0
- package/dist/rasp/__tests__/detect.test.js +276 -0
- package/dist/rasp/__tests__/detect.test.js.map +1 -0
- package/dist/rasp/__tests__/esm-exports.test.d.ts +1 -0
- package/dist/rasp/__tests__/esm-exports.test.js +20 -0
- package/dist/rasp/__tests__/esm-exports.test.js.map +1 -0
- package/dist/rasp/__tests__/fs-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/fs-hook.test.js +241 -0
- package/dist/rasp/__tests__/fs-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/hook-contracts.test.d.ts +1 -0
- package/dist/rasp/__tests__/hook-contracts.test.js +201 -0
- package/dist/rasp/__tests__/hook-contracts.test.js.map +1 -0
- package/dist/rasp/__tests__/hook-kit.d.ts +42 -0
- package/dist/rasp/__tests__/hook-kit.js +139 -0
- package/dist/rasp/__tests__/hook-kit.js.map +1 -0
- package/dist/rasp/__tests__/http-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/http-hook.test.js +250 -0
- package/dist/rasp/__tests__/http-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/iast.test.d.ts +1 -0
- package/dist/rasp/__tests__/iast.test.js +361 -0
- package/dist/rasp/__tests__/iast.test.js.map +1 -0
- package/dist/rasp/__tests__/include-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/include-hook.test.js +122 -0
- package/dist/rasp/__tests__/include-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/middleware.test.d.ts +1 -0
- package/dist/rasp/__tests__/middleware.test.js +302 -0
- package/dist/rasp/__tests__/middleware.test.js.map +1 -0
- package/dist/rasp/__tests__/process-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/process-hook.test.js +238 -0
- package/dist/rasp/__tests__/process-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/reporter.test.d.ts +1 -0
- package/dist/rasp/__tests__/reporter.test.js +114 -0
- package/dist/rasp/__tests__/reporter.test.js.map +1 -0
- package/dist/rasp/__tests__/route.test.d.ts +1 -0
- package/dist/rasp/__tests__/route.test.js +46 -0
- package/dist/rasp/__tests__/route.test.js.map +1 -0
- package/dist/rasp/__tests__/rule-expr.test.d.ts +1 -0
- package/dist/rasp/__tests__/rule-expr.test.js +151 -0
- package/dist/rasp/__tests__/rule-expr.test.js.map +1 -0
- package/dist/rasp/__tests__/rule-phases.test.d.ts +1 -0
- package/dist/rasp/__tests__/rule-phases.test.js +271 -0
- package/dist/rasp/__tests__/rule-phases.test.js.map +1 -0
- package/dist/rasp/__tests__/sinks-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/sinks-hook.test.js +177 -0
- package/dist/rasp/__tests__/sinks-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/targets.test.d.ts +1 -0
- package/dist/rasp/__tests__/targets.test.js +82 -0
- package/dist/rasp/__tests__/targets.test.js.map +1 -0
- package/dist/rasp/__tests__/template-hook.test.d.ts +1 -0
- package/dist/rasp/__tests__/template-hook.test.js +254 -0
- package/dist/rasp/__tests__/template-hook.test.js.map +1 -0
- package/dist/rasp/__tests__/upload.test.d.ts +1 -0
- package/dist/rasp/__tests__/upload.test.js +81 -0
- package/dist/rasp/__tests__/upload.test.js.map +1 -0
- package/dist/rasp/__tests__/vpatch-engine.test.d.ts +1 -0
- package/dist/rasp/__tests__/vpatch-engine.test.js +177 -0
- package/dist/rasp/__tests__/vpatch-engine.test.js.map +1 -0
- package/dist/rasp/auto-http.d.ts +6 -0
- package/dist/rasp/auto-http.js +194 -0
- package/dist/rasp/auto-http.js.map +1 -0
- package/dist/rasp/baseline.d.ts +35 -0
- package/dist/rasp/baseline.js +91 -0
- package/dist/rasp/baseline.js.map +1 -0
- package/dist/rasp/capture.d.ts +76 -0
- package/dist/rasp/capture.js +304 -0
- package/dist/rasp/capture.js.map +1 -0
- package/dist/rasp/config-client.d.ts +122 -0
- package/dist/rasp/config-client.js +337 -0
- package/dist/rasp/config-client.js.map +1 -0
- package/dist/rasp/context.d.ts +65 -0
- package/dist/rasp/context.js +68 -0
- package/dist/rasp/context.js.map +1 -0
- package/dist/rasp/custom-rules.d.ts +68 -0
- package/dist/rasp/custom-rules.js +222 -0
- package/dist/rasp/custom-rules.js.map +1 -0
- package/dist/rasp/data/default-rules.json +199 -0
- package/dist/rasp/data/default-sinks.json +4 -0
- package/dist/rasp/data/dnslog-domains.json +11 -0
- package/dist/rasp/deception.d.ts +70 -0
- package/dist/rasp/deception.js +220 -0
- package/dist/rasp/deception.js.map +1 -0
- package/dist/rasp/detect.d.ts +68 -0
- package/dist/rasp/detect.js +671 -0
- package/dist/rasp/detect.js.map +1 -0
- package/dist/rasp/engine.d.ts +107 -0
- package/dist/rasp/engine.js +330 -0
- package/dist/rasp/engine.js.map +1 -0
- package/dist/rasp/hooks/code.d.ts +20 -0
- package/dist/rasp/hooks/code.js +334 -0
- package/dist/rasp/hooks/code.js.map +1 -0
- package/dist/rasp/hooks/db.d.ts +48 -0
- package/dist/rasp/hooks/db.js +322 -0
- package/dist/rasp/hooks/db.js.map +1 -0
- package/dist/rasp/hooks/esm.d.ts +7 -0
- package/dist/rasp/hooks/esm.js +18 -0
- package/dist/rasp/hooks/esm.js.map +1 -0
- package/dist/rasp/hooks/fs.d.ts +3 -0
- package/dist/rasp/hooks/fs.js +206 -0
- package/dist/rasp/hooks/fs.js.map +1 -0
- package/dist/rasp/hooks/http.d.ts +4 -0
- package/dist/rasp/hooks/http.js +213 -0
- package/dist/rasp/hooks/http.js.map +1 -0
- package/dist/rasp/hooks/include.d.ts +9 -0
- package/dist/rasp/hooks/include.js +79 -0
- package/dist/rasp/hooks/include.js.map +1 -0
- package/dist/rasp/hooks/marks.d.ts +2 -0
- package/dist/rasp/hooks/marks.js +16 -0
- package/dist/rasp/hooks/marks.js.map +1 -0
- package/dist/rasp/hooks/process.d.ts +22 -0
- package/dist/rasp/hooks/process.js +191 -0
- package/dist/rasp/hooks/process.js.map +1 -0
- package/dist/rasp/hooks/sinks.d.ts +54 -0
- package/dist/rasp/hooks/sinks.js +329 -0
- package/dist/rasp/hooks/sinks.js.map +1 -0
- package/dist/rasp/hooks/template.d.ts +21 -0
- package/dist/rasp/hooks/template.js +152 -0
- package/dist/rasp/hooks/template.js.map +1 -0
- package/dist/rasp/iast-rules.d.ts +82 -0
- package/dist/rasp/iast-rules.js +240 -0
- package/dist/rasp/iast-rules.js.map +1 -0
- package/dist/rasp/iast-scope.d.ts +29 -0
- package/dist/rasp/iast-scope.js +54 -0
- package/dist/rasp/iast-scope.js.map +1 -0
- package/dist/rasp/iast.d.ts +81 -0
- package/dist/rasp/iast.js +272 -0
- package/dist/rasp/iast.js.map +1 -0
- package/dist/rasp/index.d.ts +52 -0
- package/dist/rasp/index.js +280 -0
- package/dist/rasp/index.js.map +1 -0
- package/dist/rasp/lexers.d.ts +32 -0
- package/dist/rasp/lexers.js +444 -0
- package/dist/rasp/lexers.js.map +1 -0
- package/dist/rasp/middleware.d.ts +155 -0
- package/dist/rasp/middleware.js +568 -0
- package/dist/rasp/middleware.js.map +1 -0
- package/dist/rasp/model-output.d.ts +14 -0
- package/dist/rasp/model-output.js +107 -0
- package/dist/rasp/model-output.js.map +1 -0
- package/dist/rasp/normalize.d.ts +23 -0
- package/dist/rasp/normalize.js +140 -0
- package/dist/rasp/normalize.js.map +1 -0
- package/dist/rasp/reporter.d.ts +60 -0
- package/dist/rasp/reporter.js +230 -0
- package/dist/rasp/reporter.js.map +1 -0
- package/dist/rasp/rule-expr.d.ts +236 -0
- package/dist/rasp/rule-expr.js +1253 -0
- package/dist/rasp/rule-expr.js.map +1 -0
- package/dist/rasp/template.d.ts +53 -0
- package/dist/rasp/template.js +336 -0
- package/dist/rasp/template.js.map +1 -0
- package/dist/rasp/types.d.ts +110 -0
- package/dist/rasp/types.js +51 -0
- package/dist/rasp/types.js.map +1 -0
- package/dist/rasp/vpatch.d.ts +55 -0
- package/dist/rasp/vpatch.js +120 -0
- package/dist/rasp/vpatch.js.map +1 -0
- package/dist/register.js +52 -11
- package/dist/register.js.map +1 -1
- package/dist/semantic-convention.d.ts +2 -0
- package/dist/semantic-convention.js +5 -0
- package/dist/semantic-convention.js.map +1 -1
- package/dist/types.d.ts +77 -1
- package/dist/zero-code.d.ts +8 -0
- package/dist/zero-code.js +38 -0
- package/dist/zero-code.js.map +1 -0
- package/package.json +18 -2
package/README.md
CHANGED
|
@@ -181,6 +181,48 @@ If you want to use Shield360's Observability Dashboard to monitor LLM usage—li
|
|
|
181
181
|
If you're sending metrics and traces to other observability tools, take a look at our [Connections Guide](https://github.com/ThinkfleetAI/shield360-js/blob/main/docs/destinations/overview.mdx) to start using a pre-built dashboard we have created for these tools.
|
|
182
182
|
|
|
183
183
|
|
|
184
|
+
## Zero-code setup
|
|
185
|
+
|
|
186
|
+
Turn on Shield360, telemetry and runtime protection (RASP), without changing or rebuilding the app. Install the package next to the app and preload `shield360/register`; everything is configured with environment variables.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npm install shield360
|
|
190
|
+
|
|
191
|
+
export OTEL_SERVICE_NAME=orders-api
|
|
192
|
+
export SHIELD360_URL=https://app.shield360.ai
|
|
193
|
+
export SHIELD360_API_KEY=... # from Settings > API keys
|
|
194
|
+
export SHIELD360_RASP=monitor # or block; leave unset for telemetry only
|
|
195
|
+
export SHIELD360_CONFIG_PUBLIC_KEY='{"kty":"OKP",...}' # Runtime protection settings
|
|
196
|
+
|
|
197
|
+
node --require shield360/register app.js # CommonJS
|
|
198
|
+
node --import shield360/register app.mjs # ES modules
|
|
199
|
+
NODE_OPTIONS="--require shield360/register" npm start
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
What the preload does, before the app's first line runs:
|
|
203
|
+
|
|
204
|
+
- Calls `Shield360.init()` with the settings from the environment (`OTEL_SERVICE_NAME`, `OTEL_DEPLOYMENT_ENVIRONMENT`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_RESOURCE_ATTRIBUTES`, `SHIELD360_URL`, `SHIELD360_API_KEY`, `SHIELD360_DISABLED_INSTRUMENTORS` and the other `SHIELD360_*` variables `init()` reads).
|
|
205
|
+
- With `SHIELD360_RASP=monitor|block`, installs the RASP sink hooks before the app takes its own references to `child_process`, `fs` and the database drivers, and captures every request served by an `http` or `https` server (Express, Fastify, Koa, Nest and raw `http`), so no middleware is needed. Adding `raspExpress()` or another framework middleware as well is fine: it takes over the request with its richer view and nothing is reported twice.
|
|
206
|
+
- Registers the OpenTelemetry ESM loader hook (`module.register`, Node.js 18.19 / 20.6 and later), so instrumentations also patch packages the app loads with `import`. Set `SHIELD360_ESM_HOOK=off` to leave it out.
|
|
207
|
+
|
|
208
|
+
Rules it keeps:
|
|
209
|
+
|
|
210
|
+
- **Fail open.** If Shield360 cannot start, it prints one warning and the app starts without it.
|
|
211
|
+
- **No double start.** If the app also calls `Shield360.init()` itself, that call does nothing (one log line says so); the environment settings stay in force.
|
|
212
|
+
|
|
213
|
+
Limits:
|
|
214
|
+
|
|
215
|
+
- In block mode without framework middleware, a virtual patch that matches the request answers 403 before the app sees it, and so does a block in a raw `http` handler, synchronous or `async` (a block after an `await` is answered, not left as an unhandled rejection). Frameworks catch errors from their route handlers themselves, so a block raised at a sink inside an Express, Koa or Fastify handler gets the framework's error response (a 500 in Express) unless that framework's RASP middleware or error handler is added.
|
|
216
|
+
- `NODE_OPTIONS` is inherited by child Node.js processes, which start Shield360 too. Use `node --require` on the app's command when that is not wanted.
|
|
217
|
+
- Bundled apps (esbuild, webpack, `ncc`) and single-executable apps inline their dependencies, so instrumentations that patch packages by name do not see them. The RASP hooks on Node's built-in modules still apply. Keep instrumented packages external, such as the database driver (`external: ['pg']` in esbuild, installed beside the bundle), or call `Shield360.init()` in code.
|
|
218
|
+
- `NODE_OPTIONS="--require shield360/register"` also works for ES module apps. Node runs the preload again in its module-hooks thread, and the preload does nothing there.
|
|
219
|
+
- Packages imported as ES modules are patched only through the loader hook; with `SHIELD360_ESM_HOOK=off`, only CommonJS loads are instrumented.
|
|
220
|
+
|
|
221
|
+
| Variable | Default | Meaning |
|
|
222
|
+
|---|---|---|
|
|
223
|
+
| `SHIELD360_RASP` | unset (off) | `monitor` or `block` turns RASP on; `off` always wins. |
|
|
224
|
+
| `SHIELD360_ESM_HOOK` | on | `off` skips the ES module loader hook. New for the zero-code entry. |
|
|
225
|
+
|
|
184
226
|
## Configuration
|
|
185
227
|
|
|
186
228
|
### Observability - `Shield360.init()`
|
|
@@ -202,9 +244,9 @@ Below is a detailed overview of the configuration options available, allowing yo
|
|
|
202
244
|
| `collectGpuStats` | Flag to enable or disable GPU metrics collection (NVIDIA via `nvidia-smi`, AMD via `rocm-smi`). | `false` | No |
|
|
203
245
|
| `captureCodeLocation` | Adds the calling function, file and line to GenAI spans. Also `SHIELD360_CAPTURE_CODE_LOCATION=false`. | `true` | No |
|
|
204
246
|
| `codeRoot` | Directory stripped from reported file paths. Also `SHIELD360_CODE_ROOT`. | git root, then working directory | No |
|
|
205
|
-
| `serviceVersion` | Release recorded as the `service.version` resource attribute. Also `SHIELD360_SERVICE_VERSION`. | `undefined` | No |
|
|
247
|
+
| `serviceVersion` | Release recorded as the `service.version` resource attribute. Also `SHIELD360_SERVICE_VERSION` or `SHIELD360_RELEASE`. | `undefined` | No |
|
|
206
248
|
|
|
207
|
-
> **Message content is off by default.** Prompt and completion text is recorded only when you pass `captureMessageContent: true` (or set `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`). Even then, Shield360 stores it only if your
|
|
249
|
+
> **Message content is off by default.** Prompt and completion text is recorded only when you pass `captureMessageContent: true` (or set `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`). Even then, Shield360 stores it only if your organization's [Data retention](https://shield360.ai) setting allows it. Before this release the default was on.
|
|
208
250
|
|
|
209
251
|
### Code location and build attributes
|
|
210
252
|
|
|
@@ -222,13 +264,41 @@ At startup Shield360 also adds these resource attributes, so costs and traces ca
|
|
|
222
264
|
|
|
223
265
|
| Attribute | Sources, first match wins |
|
|
224
266
|
| --- | --- |
|
|
225
|
-
| `service.version` | `serviceVersion`, `SHIELD360_SERVICE_VERSION`, `OTEL_SERVICE_VERSION`, `OTEL_RESOURCE_ATTRIBUTES` |
|
|
267
|
+
| `service.version` | `serviceVersion`, `SHIELD360_SERVICE_VERSION`, `SHIELD360_RELEASE`, `OTEL_SERVICE_VERSION`, `OTEL_RESOURCE_ATTRIBUTES` |
|
|
226
268
|
| `vcs.ref.head.revision` | `SHIELD360_GIT_COMMIT`, `OTEL_RESOURCE_ATTRIBUTES`, CI variables |
|
|
227
269
|
| `vcs.repository.url.full` | `SHIELD360_GIT_REPOSITORY_URL`, `OTEL_RESOURCE_ATTRIBUTES`, CI variables |
|
|
228
270
|
| `vcs.ref.head.name` | `SHIELD360_GIT_BRANCH`, `OTEL_RESOURCE_ATTRIBUTES`, CI variables |
|
|
229
271
|
|
|
230
272
|
CI variables are read from GitHub Actions, GitLab CI, Vercel, Netlify, Render, Railway, Heroku, AWS CodeBuild, Buildkite, CircleCI, Bitbucket Pipelines, Azure Pipelines and Jenkins. An explicit `OTEL_RESOURCE_ATTRIBUTES` value beats CI auto-detection. Values from different providers are never mixed. Commit SHAs that are not 7 to 64 hex characters are dropped, and repository URLs are reduced to `https://host/owner/repo` with any credentials removed.
|
|
231
273
|
|
|
274
|
+
Shield360 groups an application's calls by release (Telemetry → Releases) and compares each release with the one before it. With no release set, the commit the SDK detected is used.
|
|
275
|
+
|
|
276
|
+
### User feedback - `Shield360.feedback()`
|
|
277
|
+
|
|
278
|
+
Send what one of your users thought of an AI response, against the trace that produced it. Call it from your server with the environment's API key, never from a browser. It never throws; it resolves to `false` when the rating was not accepted.
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
const traceId = Shield360.getCurrentTraceId(); // keep this with the response
|
|
282
|
+
|
|
283
|
+
// later, when the user rates it
|
|
284
|
+
await Shield360.feedback({ traceId, score: 1 }); // thumbs up (-1 is thumbs down)
|
|
285
|
+
await Shield360.feedback({ traceId, score: 4, comment: 'Close, but missed the date' }); // stars 1-5
|
|
286
|
+
await Shield360.feedback({ traceId, score: 1, scale: 'stars' }); // one star
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
| Option | Description |
|
|
290
|
+
| --- | --- |
|
|
291
|
+
| `score` | `1` or `-1` (thumbs), or `1` to `5` (stars). |
|
|
292
|
+
| `traceId` | The trace rated. Defaults to the active span's trace. |
|
|
293
|
+
| `spanId` | The span rated, when it was one call in the trace. Optional |
|
|
294
|
+
| `comment` | What the user wrote. Kept only when your organization's Data retention setting stores end users' free text, with secrets and personal data masked. Optional |
|
|
295
|
+
| `scale` | `'thumbs'` or `'stars'`. Optional |
|
|
296
|
+
| `userId`, `tenantId` | Your end user and their tenant. Kept only as a keyed hash. Optional |
|
|
297
|
+
| `metadata` | A flat object of up to 20 short values. Optional |
|
|
298
|
+
| `feedbackId` | Your id for the rating; sending it again replaces the earlier one. Optional |
|
|
299
|
+
|
|
300
|
+
Ratings show on the trace and under Telemetry → Feedback, by release and by feature flag variant.
|
|
301
|
+
|
|
232
302
|
### Shield360 Prompt Hub - `Shield360.getPrompt()`
|
|
233
303
|
|
|
234
304
|
Below are the parameters for use with the SDK for Shield360 Prompt Hub for prompt management:
|
|
@@ -320,6 +390,263 @@ Shield360.logScore({ name: 'quality', value: 0.85, metadata: { reviewer: 'human'
|
|
|
320
390
|
Shield360.logScore({ name: 'category', value: 'accurate' });
|
|
321
391
|
```
|
|
322
392
|
|
|
393
|
+
### Agent passports - `shield360/agents`
|
|
394
|
+
|
|
395
|
+
Check the AI agents that call your API or MCP server. A calling agent sends a Shield360 **agent passport** in the `Shield360-Agent` header: a short-lived signed token that says who the agent is, which organization runs it and, when it acts for a person, that it does. The verifier checks it offline against the issuer's published keys, applies your policy and can report each result to your Shield360 project's inbound decision log. A passport never grants access by itself: your own API keys, OAuth tokens and permissions still decide what the call may do.
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
import { agentVerifier, AGENT_HEADER } from 'shield360/agents';
|
|
399
|
+
|
|
400
|
+
const verifier = agentVerifier({
|
|
401
|
+
audience: 'api.example.com', // your API host or https origin (or several)
|
|
402
|
+
// issuers: ['https://app.shield360.ai'], // default
|
|
403
|
+
policy: { mode: 'observe' }, // local policy, merged over the defaults
|
|
404
|
+
policyFrom: { apiKey: process.env.SHIELD360_INBOUND_API_KEY! }, // follow the console policy (cached 60 s)
|
|
405
|
+
report: { apiKey: process.env.SHIELD360_INBOUND_API_KEY! }, // inbound decision log (batched, never blocks)
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const result = await verifier.check(request, { route: '/v1/jobs', method: 'POST' });
|
|
409
|
+
// result.status: 'verified' | 'absent' | 'invalid'
|
|
410
|
+
// result.decision: 'allow' | 'deny'; result.blocked: deny in enforce mode
|
|
411
|
+
// result.agent: id, name and, when the issuer sends them, status, environment, risk, owner, reviewedAt, enrolledAt
|
|
412
|
+
// result.operator, result.scopes
|
|
413
|
+
// result.onBehalfOf: { id (a pairwise id), domain, assurance: 'delegated' | 'named' | 'unverified', mandate? }
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
`check` accepts a Fetch `Request`, a Node `IncomingMessage`, a `Headers` object or header record, or the passport string, and never throws. The API key is sent as `Authorization: Bearer <key>`; `baseUrl` defaults to `SHIELD360_URL` or `https://app.shield360.ai`.
|
|
417
|
+
|
|
418
|
+
| Policy field | Default | Meaning |
|
|
419
|
+
|--------------|---------|---------|
|
|
420
|
+
| `mode` | `observe` | `observe` never blocks and reports what `enforce` would do. |
|
|
421
|
+
| `requireAgent` | `false` | A call without a passport is denied (reason `absent`). |
|
|
422
|
+
| `operators` | `[]` | Allowed operator ids or verified domains; empty allows any verified operator. |
|
|
423
|
+
| `requireOnBehalfOf` | `false` | The passport must say the agent acts for a person. |
|
|
424
|
+
| `minAssurance` | `none` | The weakest on-behalf-of assurance accepted: `unverified`, `named` or `delegated` (strongest). A passport without a person, or with weaker assurance, is denied (reason `assurance_too_low`). A person without a stated assurance counts as `named`. |
|
|
425
|
+
| `online` | `false` | Also ask the issuer, on every call, whether the passport is still good (kill switch, revoked token). Pass `{ online: true }` to `check` for single sensitive operations. |
|
|
426
|
+
|
|
427
|
+
Reason codes, in the order they are checked: `malformed`, `unsupported_alg`, `untrusted_issuer`, `unknown_key`, `bad_signature`, `expired`, `not_yet_valid`, `lifetime_too_long`, `wrong_audience`, `replayed`, `revoked`, `unknown_passport`, then the policy's `absent`, `operator_not_allowed`, `on_behalf_of_required`, `assurance_too_low`. An online check can keep a passport valid but lower its assurance (for example `reason: 'mandate_revoked'`); the result then carries the lower assurance and no mandate. An unreachable issuer on an online check is `issuer_unreachable` and does not deny unless `onlineFailure: 'deny'`.
|
|
428
|
+
|
|
429
|
+
Each passport is accepted once. The default replay store is in memory, per process; with several instances pass a shared one:
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
const replay = { seen: async (jti: string, expiresAtMs: number) => (await redis.set(`passport:${jti}`, '1', { NX: true, PXAT: expiresAtMs })) === null };
|
|
433
|
+
agentVerifier({ audience: 'api.example.com', replay });
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
#### Express
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
app.use(verifier.middleware()); // sets req.shield360Agent; answers 403 { error: 'agent_not_allowed', reason } only when blocked
|
|
440
|
+
app.get('/v1/jobs', (req, res) => {
|
|
441
|
+
const agent = (req as { shield360Agent?: AgentCheck }).shield360Agent; // import type { AgentCheck } from 'shield360/agents'
|
|
442
|
+
res.json({ agent: agent?.agent });
|
|
443
|
+
});
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
#### Next.js route handlers and other Fetch servers
|
|
447
|
+
|
|
448
|
+
```typescript
|
|
449
|
+
export async function POST(request: Request) {
|
|
450
|
+
const agent = await verifier.check(request, { route: '/api/jobs', method: 'POST' });
|
|
451
|
+
if (agent.blocked) return Response.json({ error: 'agent_not_allowed', reason: agent.reason }, { status: 403 });
|
|
452
|
+
// ... your own authentication and authorization still apply
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Call `await verifier.close()` on shutdown to send queued reports.
|
|
457
|
+
|
|
458
|
+
## Application logs
|
|
459
|
+
|
|
460
|
+
Off by default. Set `SHIELD360_CAPTURE_LOGS=true` (or the init option) to send the application's own log records to Shield360, on the same endpoint and key as traces. `SHIELD360_LOG_LEVEL` sets the lowest level sent (`info` by default; `trace`, `debug`, `info`, `warn`, `error`, `fatal`). Records carry the active trace and span ids, `service.name` and `deployment.environment`; credentials and opaque tokens in messages and attributes are masked before they leave the process; at most 500 records a second per bridge are sent, in batches, and a failure to send never reaches the application.
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
import Shield360 from 'shield360';
|
|
464
|
+
|
|
465
|
+
Shield360.init({ captureLogs: true, logLevel: 'info' }); // or SHIELD360_CAPTURE_LOGS=true
|
|
466
|
+
|
|
467
|
+
console.warn('cache miss', { key: 'k' }); // console output is copied (still printed)
|
|
468
|
+
const log = Shield360.logger('checkout'); // or a logger of your own
|
|
469
|
+
log.info('order placed', { 'order.id': 'o-1' });
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
With application logs on, `init()` bridges these with no code changes:
|
|
473
|
+
|
|
474
|
+
- **console**: `console.debug`, `log`, `info`, `warn` and `error` are copied as well as printed. `Shield360.releaseConsole()` stops this.
|
|
475
|
+
- **winston** (3.x): every `winston.createLogger()` also gets the Shield360 transport, and the logger's own transports are kept.
|
|
476
|
+
- **pino** (7 to 10): every `pino()` logger writes to its own destination and to Shield360 through `pino.multistream`.
|
|
477
|
+
|
|
478
|
+
**Loggers that write lines themselves.** Some apps have their own logger that writes JSON lines straight to `process.stdout` and `process.stderr`, which none of the bridges above see. For them, set `SHIELD360_CAPTURE_STDIO=true` as well (or `captureStdio: true`). Every line written to stdout and stderr is then copied, and the output is unchanged:
|
|
479
|
+
|
|
480
|
+
- a JSON line keeps its level (a name or a pino number), `msg` or `message` as the body, `err` or `error` as `exception.*`, and its other fields as attributes;
|
|
481
|
+
- a plain line is `info` on stdout and `error` on stderr;
|
|
482
|
+
- a line split across writes is joined first.
|
|
483
|
+
|
|
484
|
+
The scope is `stdout` or `stderr`. It replaces the console, winston and pino bridges, which write to the same streams, so each line is sent once. `Shield360.releaseStdio()` stops it.
|
|
485
|
+
|
|
486
|
+
The winston and pino bridges hook `require` the way OpenTelemetry's instrumentations do, so create those loggers after `init()`. For ES modules, or for loggers created earlier, add the bridge yourself:
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import pino from 'pino';
|
|
490
|
+
import winston from 'winston';
|
|
491
|
+
import Transport from 'winston-transport';
|
|
492
|
+
|
|
493
|
+
const p = pino({}, pino.multistream([{ stream: process.stdout }, { stream: Shield360.pinoStream() }]));
|
|
494
|
+
const Shield360Transport = Shield360.winstonTransport(Transport);
|
|
495
|
+
const w = winston.createLogger({ transports: [new winston.transports.Console(), new Shield360Transport()] });
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
The record's scope is the logger name (`console`, `winston`, `pino`, or the name you give). Other attributes:
|
|
499
|
+
|
|
500
|
+
- `code.function.name`, `code.file.path` and `code.line.number` for the call site, unless `captureCodeLocation` is off;
|
|
501
|
+
- `exception.*` for an `Error`;
|
|
502
|
+
- your fields.
|
|
503
|
+
|
|
504
|
+
The SDK's own scopes (`shield360`, `opentelemetry`) and the telemetry pipeline's own messages are never sent. Masking follows the contract every Shield360 SDK shares (`sdk/rasp/README.md`, "Masking"). Credential pairs (`password=…`, `"api_key": "…"`, `Authorization: Bearer …`), bearer credentials and opaque tokens (keys, hashes, base64, JWTs, UUIDs) are masked. So is the whole value of a field named like a credential (`password`, `x-api-key`, `sessionId`), with lists and maps masked item by item. Readable identifiers survive: class names, package and file paths, and stack frames.
|
|
505
|
+
|
|
506
|
+
## Budget check
|
|
507
|
+
|
|
508
|
+
Ask Shield360 whether this app may spend on a model call. App budgets (Costs → Budgets → App, by service name) and whole-project budgets with enforcement rules apply. Uses `shield360Url`, `shield360ApiKey` and `applicationName` from `init()`.
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
const check = await Shield360.budgets.check({ model: 'gpt-4o', estimatedCostUsd: 0.02 });
|
|
512
|
+
if (!check.allowed) throw new Error(check.reason);
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
`check()` never throws, reuses a decision for its ttl while the calls checked with it fit in its headroom, and fails open unless `failClosed` is set (or `SHIELD360_BUDGET_FAIL_CLOSED=1`). Pass `budgetCheck: true` to `init()` (or set `SHIELD360_BUDGET_CHECK=1`) to check before every call to a supported provider; a blocked call throws `BudgetExceededError`.
|
|
516
|
+
|
|
517
|
+
## Guard reports and heartbeat
|
|
518
|
+
|
|
519
|
+
When `init` is given `guards` and a Shield360 URL and API key (`shield360Url` / `shield360ApiKey`, or `SHIELD360_URL` / `SHIELD360_API_KEY`), the SDK reports to Shield360's `/api/guard/events`:
|
|
520
|
+
|
|
521
|
+
- **Guard decisions:** every decision other than allow (which guard, what it did, the kind of data found). Never the text that was checked.
|
|
522
|
+
- **A heartbeat:** once at start and then about every 5 minutes (jittered), the app's service name, each guard kind's mode (`off`, `warn` or `block`), whether prompt-injection checks are on, and the SDK's name and version. No text, host or user. Shield360 uses it to show that the app's guards are on even when they had nothing to stop, for example for the [Secured by Shield360 badge](https://shield360.ai).
|
|
523
|
+
|
|
524
|
+
Both go through the same background queue, never throw and never delay a call. Turn the heartbeat off with `guardHeartbeat: false` in `init`, or `SHIELD360_GUARD_HEARTBEAT=false`.
|
|
525
|
+
|
|
526
|
+
## Runtime protection (RASP)
|
|
527
|
+
|
|
528
|
+
Off by default. When on, the SDK keeps the untrusted input of the request it is serving (query, route params, body, cookies, and the `user-agent`, `referer` and `x-forwarded-for` headers), plus the model output its LLM instrumentation sees, in memory for that request only. The contract every Shield360 SDK follows is [`sdk/rasp/README.md`](../rasp/README.md).
|
|
529
|
+
|
|
530
|
+
### Turn it on
|
|
531
|
+
|
|
532
|
+
```typescript
|
|
533
|
+
import Shield360, { raspExpress, raspExpressErrorHandler } from 'shield360';
|
|
534
|
+
|
|
535
|
+
Shield360.init({
|
|
536
|
+
applicationName: 'orders-api',
|
|
537
|
+
shield360Url: process.env.SHIELD360_URL,
|
|
538
|
+
shield360ApiKey: process.env.SHIELD360_API_KEY,
|
|
539
|
+
rasp: { enabled: true, configPublicKey: process.env.SHIELD360_CONFIG_PUBLIC_KEY },
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
app.use(express.json());
|
|
543
|
+
app.use(raspExpress()); // after the body parsers
|
|
544
|
+
// ...routes...
|
|
545
|
+
app.use(raspExpressErrorHandler());
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Or set `SHIELD360_RASP=monitor` (or `block`) without changing code. `SHIELD360_RASP=off` always wins. To add it without any code at all, middleware included, see [Zero-code setup](#zero-code-setup).
|
|
549
|
+
|
|
550
|
+
| Framework | Use |
|
|
551
|
+
|---|---|
|
|
552
|
+
| Express 4/5 | `app.use(raspExpress())`, and `raspExpressErrorHandler()` last |
|
|
553
|
+
| Fastify | `fastify.register(raspFastify)` (applies to every route) |
|
|
554
|
+
| Koa | `app.use(raspKoa())` |
|
|
555
|
+
| Node `http` | `http.createServer(raspHttp(handler))`; after reading the body yourself, call `recordRequestBody(body, contentType)` |
|
|
556
|
+
| Next.js route handlers (Node.js runtime) | `export const POST = withRasp(async (request) => { ... })` |
|
|
557
|
+
|
|
558
|
+
Custom request rules run in a head phase and a body phase (see "When rules run" in [`sdk/rasp/README.md`](../rasp/README.md)). A request without a body (no `Content-Length` or `Transfer-Encoding`, or `Content-Length: 0`; for Fastify also any `GET` or `HEAD`, whose body Fastify never parses; for Next.js, a request with no body stream) has a known, empty body, so its body phase runs at once. The body stays unknown, and its body phase waits, until a parser sets `req.body` (Express, Koa, raw `http`), the handler calls `recordRequestBody` (raw `http`), or Fastify's `preHandler` sees the parsed body. It never becomes known when no parser reads it, for Fastify multipart without `attachFieldsToBody`, or for a Next.js body already read before `withRasp`.
|
|
559
|
+
|
|
560
|
+
Options (`rasp: { ... }`): `mode` (`monitor` by default, or `block`, `off`), `attacks` (a mode per attack type), `allow` (`commands`, `outboundHosts`, `fileRoots`), `modelOutput` (default `true`), `remote` (default `true`), `configPublicKey`, `allowUnpinnedConfig`, `cacheDir`, `components` (default `true`). `Shield360.disableRasp()` is the runtime kill switch.
|
|
561
|
+
|
|
562
|
+
### Pin the config key
|
|
563
|
+
|
|
564
|
+
With a Shield360 URL and API key, the SDK polls the app's signed settings (`GET /api/rasp/config`). It trusts them only when they verify against the key you pin. Copy the environment's public key from the app's **Runtime protection** settings in Shield360 into `configPublicKey` or `SHIELD360_CONFIG_PUBLIC_KEY`, as a JWK, a JWKS (`{"keys":[...]}`, so a key rotation can list the old and new key), or the bare base64url `x`.
|
|
565
|
+
|
|
566
|
+
- The keys in the config response are never trusted on their own.
|
|
567
|
+
- With no pinned key, the SDK does not fetch the signed config. It runs its built-in defaults in monitor mode (a local `block` is lowered to `monitor`) and logs one warning.
|
|
568
|
+
- Trust on first use is for development only: `allowUnpinnedConfig: true` or `SHIELD360_CONFIG_TOFU=dev` pins the first key the server sends. Both are ignored when `NODE_ENV` or `ENVIRONMENT` is `production`.
|
|
569
|
+
|
|
570
|
+
The last verified config is cached (OS temp dir, `shield360-rasp/`) and verified again when loaded.
|
|
571
|
+
|
|
572
|
+
### What this release covers
|
|
573
|
+
|
|
574
|
+
- Request capture for the frameworks above, and model output (OpenAI chat and Responses, Anthropic messages) recorded as untrusted input.
|
|
575
|
+
- The detection engine (SQL token structure, path containment, address class, deserialization and eval taint, XML external entities, reflected XSS that is never blocked). These are pure functions that later sink hooks call.
|
|
576
|
+
- Virtual patches: the built-in rules in [`sdk/rasp/rules/default-rules.json`](../rasp/rules/default-rules.json) are checked against each request before the handler. A blocked request gets a `403` with `{"error","attack","rule","event"}`.
|
|
577
|
+
- `child_process`: `exec`, `execSync`, `spawn`, `spawnSync`, `execFile`, `execFileSync` and `fork` are checked before the process starts, for command injection (shell command lines and `sh -c` scripts), an executable taken from the request, a shell or downloader started during a request (`shell_spawn`, unless listed in `allow.commands`), and a download piped into a shell. `util.promisify(exec)` is checked too. Initialise Shield360 before loading the app's modules: a function copied out of `child_process` before then (`const { exec } = require('child_process')`) is not checked.
|
|
578
|
+
- `fs` and `fs.promises`: reads, opens, writes, appends, deletes, renames (both paths), copies (source and target), directory listings and read/write streams are checked before the call for path traversal (`../` from the request, an absolute path from the request, NUL bytes, paths outside `allow.fileRoots`, well-known secret files) and script writes (`file_write`). A blocked promise call rejects; a blocked callback or sync call throws. File descriptors are not checked.
|
|
579
|
+
- Events (`shield360.rasp.event`, folded and capped at 100 a minute) and a report of the app's package names and versions, sent to Shield360 with the guard reports. Events name the location of an input (`query.id`), never its value.
|
|
580
|
+
|
|
581
|
+
Outbound HTTP: `http`/`https` `request` and `get`, and the global `fetch`, are checked before anything is sent for SSRF from request or model input (internal, metadata, obfuscated and out-of-band hosts, unsafe schemes) and, when `allow.outboundHosts` is set, for hosts outside it (the Shield360 URL and OTLP endpoint are always allowed). `http`/`https` check again at the connection's own DNS lookup, so a name that resolves to an internal address is refused (DNS rebinding). `fetch` resolves the name once before the call, and its own connection may resolve again.
|
|
582
|
+
|
|
583
|
+
Databases: SQL text sent through `pg`, `mysql2`, `mysql`, `sqlite3`, `better-sqlite3`, `mssql`, `tedious`, `oracledb` and `ibm_db` is checked for SQL injection before the driver sends it (structural, per dialect; bound parameters are never part of the text, so parameterised queries pass), and MongoDB filter, update, replacement and pipeline documents (`mongodb` `Collection` methods) for operators that came from the request (`nosql_injection`). Drivers are hooked when the app loads them, including ones loaded before `init`; the SDK's own database tracing keeps working alongside.
|
|
584
|
+
|
|
585
|
+
| Database | Driver and methods | Dialect |
|
|
586
|
+
|---|---|---|
|
|
587
|
+
| SQL Server | `mssql` `Request.query`, `batch`, `execute` (on the base Request the drivers share), `PreparedStatement.prepare`; `tedious` `Connection.execSql`, `execSqlBatch`, `prepare` (the Request's SQL text). A query `mssql` checked is not checked again in the `tedious` call it makes. | `mssql` |
|
|
588
|
+
| Oracle | `oracledb` `Connection.execute`, `executeMany`, `queryStream` (not checked again in the `execute` it runs) | `oracle` |
|
|
589
|
+
| Db2 | `ibm_db` `Database.query`, `querySync`, `queryResult`, `queryResultSync` (and `queryStream` through it), `prepare`, `prepareSync` (string or `{ sql }`) | `db2` |
|
|
590
|
+
|
|
591
|
+
Code, deserialization and XML: `vm` (`runInThisContext`, `runInNewContext`, `runInContext`, `compileFunction`, `new vm.Script`) and the `Function` constructor are checked for code built from request or model input (`code_injection`); `node-serialize` `unserialize`, `funcster` `deepDeserialize` and `js-yaml` `load`/`loadAll` with a schema that can build functions for tainted data (`deserialization`); and `libxmljs`/`libxmljs2` `parseXml` for external entities (`xxe`, by whether the parser resolves them). `eval` is not hooked: replacing it would break direct `eval` in the app (code relying on the caller's scope, such as webpack's eval source maps).
|
|
592
|
+
|
|
593
|
+
Responses: HTML responses (`Content-Type` containing `html`, up to 1 MiB) are checked for request input reflected verbatim (`xss`, monitor only: it never blocks or changes the response).
|
|
594
|
+
|
|
595
|
+
Sink rules: the signed config can name further library functions to check with any of the checks above (for example a driver's raw query method as a SQL sink), as data, without an SDK release. They report only unless a rule says `block` and the attack type is in block mode. See "Sink rules" in [`sdk/rasp/README.md`](../rasp/README.md).
|
|
596
|
+
|
|
597
|
+
Uploads: file names of multipart uploads (raw bodies, or multer's `req.file` / `req.files` with `raspExpress`) are request input, and an upload named like a script (`.php`, `.jsp`, `.sh`, `.exe`…) is reported (`file_write.upload`; blocks when `file_write` blocks). A later write named after the upload is caught by `file_write.script`.
|
|
598
|
+
|
|
599
|
+
Module loading: `require` (and functions from `module.createRequire`) is checked during a request for a module name taken whole from input, or a path from input inside the specifier (`code_injection`, rule `code.include`). Dynamic `import()` is not covered.
|
|
600
|
+
|
|
601
|
+
Security baseline: once per process, shortly after start, RASP reports risky set-up as `baseline` events (report only): TLS checks off, a debugger in production, development mode under a production environment, running as root, an unpinned config key in production, and a Node.js line past its end of life. See "Security baseline" in [`sdk/rasp/README.md`](../rasp/README.md).
|
|
602
|
+
|
|
603
|
+
Deception (decoy paths): off unless the app's **Runtime protection** settings in Shield360 list decoys, paths no real user requests such as `/wp-admin` (the signed config's `deception` block; there is no local way to define them). The middleware checks every request against them first, before anything else. A request for a decoy never reaches your handlers: it gets the 404 your app gives an unknown path (Express's default `Cannot GET /path` page, or `raspExpress({ notFound })` for your own page; Fastify's `reply.callNotFound()`; Koa's `Not Found`; an empty 404 for Next.js route handlers; a plain-text `404 Not Found` for raw `http`), and its client address (the one custom rules see as `request.ip`) is marked suspicious for the configured time. Later requests from that address are reported as `deception.suspicious`; with the decoys' action `block` they get the `403` block response, with `monitor` they go on to the app. Without a pinned key, `block` is lowered to `monitor`, and `attacks.deception: off` turns deception off. The zero-code capture answers decoys itself (plain-text `404 Not Found`, socket peer address) only for a plain `http` listener. For an Express, Koa or Fastify app (Nest included) it leaves deception to the framework's adapter, which knows the trusted client address and the app's own 404, so add `raspExpress()`, `raspKoa()` or `raspFastify` for decoys there. Marks are held in memory per process (at most 10,000 addresses; when full, expired marks go first, then the mark closest to expiring): replicas and cluster workers do not share them. Next.js route handlers have no client address, so a decoy hit there marks nothing. See "Deception" in [`sdk/rasp/README.md`](../rasp/README.md).
|
|
604
|
+
|
|
605
|
+
RASP fails open everywhere: the only error it raises on purpose is `RaspBlockedError`.
|
|
606
|
+
|
|
607
|
+
## Cost per end customer
|
|
608
|
+
|
|
609
|
+
Building a SaaS product on AI? Tag each call with your own customer (and, optionally, the end user inside it) and Shield360 shows cost and margin per end customer. Every span started while a customer is in effect gets `shield360.customer.tenant_id` and `shield360.customer.user_id`, whichever instrumentation started it.
|
|
610
|
+
|
|
611
|
+
```typescript
|
|
612
|
+
import Shield360 from 'shield360';
|
|
613
|
+
|
|
614
|
+
// A process-wide default, e.g. in a single-tenant worker. null clears it.
|
|
615
|
+
Shield360.setCustomer({ tenantId: 'acme' });
|
|
616
|
+
|
|
617
|
+
// Per request: wins over the default, follows async work, and nests.
|
|
618
|
+
await Shield360.withCustomer({ tenantId: req.tenantId, userId: req.userId }, async () => {
|
|
619
|
+
await openai.chat.completions.create({ model: 'gpt-4o', messages });
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
Shield360.getCustomer(); // the customer in effect here, or null
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
Ids may be strings or numbers; they are trimmed and must be 1–256 characters with no control characters. Invalid ids are dropped silently (never thrown, never logged), and a `userId` without a valid `tenantId` is dropped too. A span that already carries `shield360.customer.tenant_id` is left as it is. If you pass your own `tracer` to `init()`, add `CustomerSpanProcessor` to your provider yourself.
|
|
626
|
+
|
|
627
|
+
The SDK sends ids as given and never hashes them: user ids are stored only as a keyed hash on Shield360's side; tenant ids are kept as given unless the organisation opts to hash them.
|
|
628
|
+
|
|
629
|
+
## AI app security
|
|
630
|
+
|
|
631
|
+
`init({ aiSecurity: true })` turns on checks on the app's own AI traffic, mapped to the OWASP Top 10 for LLM Applications (2025). Every check reports by default and changes nothing; enforcing is set per check (in code, or per app in Shield360 under the app's **Security** tab), and every check fails open. Events carry kinds, masked tokens and keyed fingerprints, never the checked text.
|
|
632
|
+
|
|
633
|
+
```typescript
|
|
634
|
+
Shield360.init({ applicationName: 'support-bot', aiSecurity: { policy: { output: { mode: 'enforce' } } } });
|
|
635
|
+
|
|
636
|
+
const refund = Shield360.aiSecurity.defineTool({
|
|
637
|
+
name: 'refund_order',
|
|
638
|
+
permissions: { roles: ['support_lead'] }, // checked for the end user before it runs
|
|
639
|
+
execute: async ({ orderId }) => refundOrder(orderId),
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
await Shield360.aiSecurity.withEndUser({ tenantId: 'acme', userId: 'u-42', roles: ['agent'] }, async () => {
|
|
643
|
+
const page = Shield360.aiSecurity.scanContext(fetchedHtml, { source: 'document' }); // indirect injection
|
|
644
|
+
const answer = Shield360.aiSecurity.scanOutput(modelText, { systemPrompt }); // PII, secrets, leaks
|
|
645
|
+
});
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
With `aiSecurity` on, OpenAI, Anthropic, LangChain retrievers and tools, LlamaIndex retrievers and the MCP client are checked automatically (tool results, user turns, answers and streams, retrieved chunks, MCP tool lists). Checks: `scanContext`, `checkPrompt`, `scanOutput` / `streamScanner`, `withCanary`, `defineTool` / `authorizeTool`, `checkLimits` / `recordUsage`, `checkMcpTools`, `checkRetrieval`. The platform's policy is an Ed25519-signed JWS fetched every minute in the background. It is applied only when it verifies under a key you pin: `configPublicKey` (a JWK, PEM or JWKS) or `SHIELD360_CONFIG_PUBLIC_KEY`; copy the environment's key from the app's Security tab. Without a pin the checks run in monitor mode with the policy from code. `allowUnpinnedConfig: true` trusts the first key seen, for development only.
|
|
649
|
+
|
|
323
650
|
## 🌱 Contributing
|
|
324
651
|
|
|
325
652
|
Whether it's big or small, we love contributions 💚. Check out our [Contribution guide](https://github.com/ThinkfleetAI/shield360-js#readme) to get started
|
|
@@ -135,7 +135,7 @@ describe('sanitisers', () => {
|
|
|
135
135
|
['git://github.com/acme/api', 'https://github.com/acme/api'],
|
|
136
136
|
['http://git.local:8080/acme/api/?q=1#x', 'http://git.local:8080/acme/api'],
|
|
137
137
|
['HTTPS://GitHub.com/acme/api/', 'https://github.com/acme/api'],
|
|
138
|
-
])('
|
|
138
|
+
])('normalizes repository URL %p', (input, expected) => {
|
|
139
139
|
expect((0, build_info_1.sanitiseRepositoryUrl)(input)).toBe(expected);
|
|
140
140
|
});
|
|
141
141
|
it.each(['/home/bob/repo', 'file:///repo', 'ftp://host/repo', 'not a url', 'https://github.com/', ''])('drops repository URL %p', (input) => {
|
|
@@ -186,4 +186,11 @@ describe('Shield360.init resource', () => {
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
});
|
|
189
|
+
describe('SHIELD360_RELEASE', () => {
|
|
190
|
+
it('names the release when SHIELD360_SERVICE_VERSION is not set, and beats OTel env', () => {
|
|
191
|
+
expect((0, build_info_1.resolveBuildAttributes)({}, { SHIELD360_RELEASE: '2026.10.29', OTEL_SERVICE_VERSION: '9.9.9' })[build_info_1.ATTR_SERVICE_VERSION]).toBe('2026.10.29');
|
|
192
|
+
expect((0, build_info_1.resolveBuildAttributes)({}, { SHIELD360_RELEASE: 'r1', SHIELD360_SERVICE_VERSION: 'v2' })[build_info_1.ATTR_SERVICE_VERSION]).toBe('v2');
|
|
193
|
+
expect((0, build_info_1.resolveBuildAttributes)({ serviceVersion: 'opt' }, { SHIELD360_RELEASE: 'r1' })[build_info_1.ATTR_SERVICE_VERSION]).toBe('opt');
|
|
194
|
+
});
|
|
195
|
+
});
|
|
189
196
|
//# sourceMappingURL=build-info.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-info.test.js","sourceRoot":"","sources":["../../src/__tests__/build-info.test.ts"],"names":[],"mappings":";;AAAA,mDAU4B;AAE5B,MAAM,GAAG,GAAG,0CAA0C,CAAC;AACvD,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAE9B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,IAAA,mCAAsB,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,GAAG,GAAG;YACV,yBAAyB,EAAE,OAAO;YAClC,oBAAoB,EAAE,GAAG;YACzB,4BAA4B,EAAE,6BAA6B;YAC3D,oBAAoB,EAAE,SAAS;YAC/B,UAAU,EAAE,0CAA0C;YACtD,iBAAiB,EAAE,YAAY;YAC/B,eAAe,EAAE,MAAM;YACvB,oBAAoB,EAAE,OAAO;SAC9B,CAAC;QACF,MAAM,CAAC,IAAA,mCAAsB,EAAC,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;YACvE,CAAC,iCAAoB,CAAC,EAAE,OAAO;YAC/B,CAAC,8BAAiB,CAAC,EAAE,GAAG;YACxB,CAAC,oCAAuB,CAAC,EAAE,6BAA6B;YACxD,CAAC,8BAAiB,CAAC,EAAE,SAAS;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,IAAA,mCAAsB,EAAC,EAAE,EAAE,GAAG,CAAC,CAAC,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CAAC,CAAC,iCAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3H,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -55,7 +55,7 @@ describe('CodeLocationSpanProcessor', () => {
|
|
|
55
55
|
expect(attrs[code_location_1.ATTR_CODE_FUNCTION_NAME]).toBeUndefined();
|
|
56
56
|
expect(attrs[code_location_1.ATTR_CODE_LINE_NUMBER]).toBeUndefined();
|
|
57
57
|
});
|
|
58
|
-
it('
|
|
58
|
+
it('recognizes instrumentations that set the operation after creation', () => {
|
|
59
59
|
provider.getTracer('@shield360/instrumentation-langchain').startSpan('chain').end();
|
|
60
60
|
const attrs = exporter.getFinishedSpans()[0].attributes;
|
|
61
61
|
expect(attrs[code_location_1.ATTR_CODE_FILE_PATH]).toBe(THIS_FILE);
|
|
@@ -73,4 +73,19 @@ describe('parseOtlpHeaders', () => {
|
|
|
73
73
|
expect((0, destination_1.parseOtlpHeaders)(undefined)).toEqual({});
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
+
describe('consoleFallbackAllowed', () => {
|
|
77
|
+
it('prints to the console only when nothing at all was configured', () => {
|
|
78
|
+
expect((0, destination_1.consoleFallbackAllowed)({})).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
it('never with half a Shield360 destination: nothing is sent instead', () => {
|
|
81
|
+
expect((0, destination_1.consoleFallbackAllowed)({ shield360Url: 'https://app.shield360.ai' })).toBe(false);
|
|
82
|
+
expect((0, destination_1.consoleFallbackAllowed)({ shield360ApiKey: 'k' })).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
it('never while stdout and stderr are captured as logs, which would feed the output back in', () => {
|
|
85
|
+
expect((0, destination_1.consoleFallbackAllowed)({ captureStdio: true })).toBe(false);
|
|
86
|
+
});
|
|
87
|
+
it('is irrelevant with a destination', () => {
|
|
88
|
+
expect((0, destination_1.consoleFallbackAllowed)({ otlpEndpoint: 'http://collector:4318' })).toBe(false);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
76
91
|
//# sourceMappingURL=destination.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destination.test.js","sourceRoot":"","sources":["../../src/__tests__/destination.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"destination.test.js","sourceRoot":"","sources":["../../src/__tests__/destination.test.ts"],"names":[],"mappings":";;AAAA,gDAA2G;AAE3G;;;;;;;GAOG;AACH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,GAAG,IAAA,gCAAkB,EAAC;YAC3B,YAAY,EAAE,0BAA0B;YACxC,eAAe,EAAE,KAAK;SACvB,CAAC,CAAC;QACH,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,2BAA2B,yBAAW,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,GAAG,IAAA,gCAAkB,EAAC,EAAE,YAAY,EAAE,2BAA2B,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;QAClG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,2BAA2B,yBAAW,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,GAAG,IAAA,gCAAkB,EAAC;YAC3B,YAAY,EAAE,uBAAuB;YACrC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/B,YAAY,EAAE,0BAA0B;YACxC,eAAe,EAAE,GAAG;SACrB,CAAC,CAAC;QAC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CAAC;IAEH,EAAE,CAAC,yFAAyF,EAAE,GAAG,EAAE;QACjG,MAAM,CAAC,IAAA,oCAAsB,EAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,IAAA,oCAAsB,EAAC,EAAE,YAAY,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs_1 = require("fs");
|
|
37
|
+
const path_1 = require("path");
|
|
38
|
+
const masking = __importStar(require("../masking"));
|
|
39
|
+
const engine_1 = require("../rasp/engine");
|
|
40
|
+
function load() {
|
|
41
|
+
for (const candidate of [(0, path_1.join)(__dirname, '../../../rasp/testdata/masking.json'), (0, path_1.join)(__dirname, '../../rasp/testdata/masking.json')]) {
|
|
42
|
+
if ((0, fs_1.existsSync)(candidate))
|
|
43
|
+
return JSON.parse((0, fs_1.readFileSync)(candidate, 'utf8'));
|
|
44
|
+
}
|
|
45
|
+
throw new Error('sdk/rasp/testdata/masking.json not found');
|
|
46
|
+
}
|
|
47
|
+
const cases = load();
|
|
48
|
+
const m = masking;
|
|
49
|
+
describe('masking contract', () => {
|
|
50
|
+
it.each(cases.text.map((c) => [c.name, c]))('text: %s', (_name, c) => {
|
|
51
|
+
expect(m.maskSecrets(c.in)).toBe(c.out);
|
|
52
|
+
});
|
|
53
|
+
it.each(cases.limited.map((c) => [c.name, c]))('limited: %s', (_name, c) => {
|
|
54
|
+
expect(m.maskText(c.in, c.limit)).toBe(c.out);
|
|
55
|
+
});
|
|
56
|
+
it.each(cases.keys.map((c) => [c.key, c]))('key: %s', (_name, c) => {
|
|
57
|
+
expect(m.isSensitiveKey(c.key)).toBe(c.sensitive);
|
|
58
|
+
});
|
|
59
|
+
it.each(cases.values.map((c) => [c.key, c]))('value: %s', (_name, c) => {
|
|
60
|
+
expect(m.maskValue(c.key, c.value, 4096)).toEqual(c.out);
|
|
61
|
+
});
|
|
62
|
+
it.each(cases.snippets.map((c) => [c.in.slice(0, 20), c]))('snippet: %s', (_name, c) => {
|
|
63
|
+
expect((0, engine_1.maskSnippet)(c.in)).toBe(c.out);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=masking.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masking.test.js","sourceRoot":"","sources":["../../src/__tests__/masking.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA8C;AAC9C,+BAA4B;AAC5B,oDAAsC;AACtC,2CAA6C;AAc7C,SAAS,IAAI;IACX,KAAK,MAAM,SAAS,IAAI,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,qCAAqC,CAAC,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,EAAE,CAAC;QACtI,IAAI,IAAA,eAAU,EAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,SAAS,EAAE,MAAM,CAAC,CAAU,CAAC;IACzF,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;AACrB,MAAM,CAAC,GAAG,OAAqE,CAAC;AAEhF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAU,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC5E,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,C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