@vorionsys/platform-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +88 -0
- package/dist/a2a/attestation.d.ts +145 -0
- package/dist/a2a/attestation.d.ts.map +1 -0
- package/dist/a2a/attestation.js +353 -0
- package/dist/a2a/attestation.js.map +1 -0
- package/dist/a2a/chain-of-trust.d.ts +143 -0
- package/dist/a2a/chain-of-trust.d.ts.map +1 -0
- package/dist/a2a/chain-of-trust.js +422 -0
- package/dist/a2a/chain-of-trust.js.map +1 -0
- package/dist/a2a/index.d.ts +15 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +23 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/openapi.d.ts +22 -0
- package/dist/a2a/openapi.d.ts.map +1 -0
- package/dist/a2a/openapi.js +1133 -0
- package/dist/a2a/openapi.js.map +1 -0
- package/dist/a2a/router.d.ts +167 -0
- package/dist/a2a/router.d.ts.map +1 -0
- package/dist/a2a/router.js +454 -0
- package/dist/a2a/router.js.map +1 -0
- package/dist/a2a/routes.d.ts +11 -0
- package/dist/a2a/routes.d.ts.map +1 -0
- package/dist/a2a/routes.js +442 -0
- package/dist/a2a/routes.js.map +1 -0
- package/dist/a2a/trust-negotiation.d.ts +119 -0
- package/dist/a2a/trust-negotiation.d.ts.map +1 -0
- package/dist/a2a/trust-negotiation.js +425 -0
- package/dist/a2a/trust-negotiation.js.map +1 -0
- package/dist/a2a/types.d.ts +413 -0
- package/dist/a2a/types.d.ts.map +1 -0
- package/dist/a2a/types.js +38 -0
- package/dist/a2a/types.js.map +1 -0
- package/dist/agent-registry/a3i-cache.d.ts +113 -0
- package/dist/agent-registry/a3i-cache.d.ts.map +1 -0
- package/dist/agent-registry/a3i-cache.js +305 -0
- package/dist/agent-registry/a3i-cache.js.map +1 -0
- package/dist/agent-registry/index.d.ts +14 -0
- package/dist/agent-registry/index.d.ts.map +1 -0
- package/dist/agent-registry/index.js +17 -0
- package/dist/agent-registry/index.js.map +1 -0
- package/dist/agent-registry/openapi.d.ts +23 -0
- package/dist/agent-registry/openapi.d.ts.map +1 -0
- package/dist/agent-registry/openapi.js +1377 -0
- package/dist/agent-registry/openapi.js.map +1 -0
- package/dist/agent-registry/routes.d.ts +10 -0
- package/dist/agent-registry/routes.d.ts.map +1 -0
- package/dist/agent-registry/routes.js +485 -0
- package/dist/agent-registry/routes.js.map +1 -0
- package/dist/agent-registry/service.d.ts +159 -0
- package/dist/agent-registry/service.d.ts.map +1 -0
- package/dist/agent-registry/service.js +652 -0
- package/dist/agent-registry/service.js.map +1 -0
- package/dist/agent-registry/tenant-service.d.ts +104 -0
- package/dist/agent-registry/tenant-service.d.ts.map +1 -0
- package/dist/agent-registry/tenant-service.js +313 -0
- package/dist/agent-registry/tenant-service.js.map +1 -0
- package/dist/api/auth.d.ts +55 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +322 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/errors.d.ts +146 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +464 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +19 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/middleware/api-key-enforcement.d.ts +131 -0
- package/dist/api/middleware/api-key-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/api-key-enforcement.js +674 -0
- package/dist/api/middleware/api-key-enforcement.js.map +1 -0
- package/dist/api/middleware/audit.d.ts +151 -0
- package/dist/api/middleware/audit.d.ts.map +1 -0
- package/dist/api/middleware/audit.js +384 -0
- package/dist/api/middleware/audit.js.map +1 -0
- package/dist/api/middleware/dpop-enforcement.d.ts +176 -0
- package/dist/api/middleware/dpop-enforcement.d.ts.map +1 -0
- package/dist/api/middleware/dpop-enforcement.js +596 -0
- package/dist/api/middleware/dpop-enforcement.js.map +1 -0
- package/dist/api/middleware/index.d.ts +24 -0
- package/dist/api/middleware/index.d.ts.map +1 -0
- package/dist/api/middleware/index.js +43 -0
- package/dist/api/middleware/index.js.map +1 -0
- package/dist/api/middleware/metrics.d.ts +41 -0
- package/dist/api/middleware/metrics.d.ts.map +1 -0
- package/dist/api/middleware/metrics.js +150 -0
- package/dist/api/middleware/metrics.js.map +1 -0
- package/dist/api/middleware/rate-limits.d.ts +224 -0
- package/dist/api/middleware/rate-limits.d.ts.map +1 -0
- package/dist/api/middleware/rate-limits.js +686 -0
- package/dist/api/middleware/rate-limits.js.map +1 -0
- package/dist/api/middleware/rateLimit.d.ts +165 -0
- package/dist/api/middleware/rateLimit.d.ts.map +1 -0
- package/dist/api/middleware/rateLimit.js +477 -0
- package/dist/api/middleware/rateLimit.js.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts +279 -0
- package/dist/api/middleware/redis-rate-limiter.d.ts.map +1 -0
- package/dist/api/middleware/redis-rate-limiter.js +1074 -0
- package/dist/api/middleware/redis-rate-limiter.js.map +1 -0
- package/dist/api/middleware/security-headers.d.ts +248 -0
- package/dist/api/middleware/security-headers.d.ts.map +1 -0
- package/dist/api/middleware/security-headers.js +410 -0
- package/dist/api/middleware/security-headers.js.map +1 -0
- package/dist/api/middleware/security.d.ts +156 -0
- package/dist/api/middleware/security.d.ts.map +1 -0
- package/dist/api/middleware/security.js +412 -0
- package/dist/api/middleware/security.js.map +1 -0
- package/dist/api/middleware/validation.d.ts +132 -0
- package/dist/api/middleware/validation.d.ts.map +1 -0
- package/dist/api/middleware/validation.js +363 -0
- package/dist/api/middleware/validation.js.map +1 -0
- package/dist/api/middleware/webhook-verify.d.ts +130 -0
- package/dist/api/middleware/webhook-verify.d.ts.map +1 -0
- package/dist/api/middleware/webhook-verify.js +366 -0
- package/dist/api/middleware/webhook-verify.js.map +1 -0
- package/dist/api/rate-limit.d.ts +115 -0
- package/dist/api/rate-limit.d.ts.map +1 -0
- package/dist/api/rate-limit.js +335 -0
- package/dist/api/rate-limit.js.map +1 -0
- package/dist/api/server.d.ts +37 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +2086 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/validation.d.ts +243 -0
- package/dist/api/validation.d.ts.map +1 -0
- package/dist/api/validation.js +247 -0
- package/dist/api/validation.js.map +1 -0
- package/dist/audit/compliance-reporter.d.ts +271 -0
- package/dist/audit/compliance-reporter.d.ts.map +1 -0
- package/dist/audit/compliance-reporter.js +587 -0
- package/dist/audit/compliance-reporter.js.map +1 -0
- package/dist/audit/db-store.d.ts +689 -0
- package/dist/audit/db-store.d.ts.map +1 -0
- package/dist/audit/db-store.js +589 -0
- package/dist/audit/db-store.js.map +1 -0
- package/dist/audit/event-schema.d.ts +605 -0
- package/dist/audit/event-schema.d.ts.map +1 -0
- package/dist/audit/event-schema.js +566 -0
- package/dist/audit/event-schema.js.map +1 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +44 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/security-events.d.ts +1624 -0
- package/dist/audit/security-events.d.ts.map +1 -0
- package/dist/audit/security-events.js +775 -0
- package/dist/audit/security-events.js.map +1 -0
- package/dist/audit/security-logger.d.ts +288 -0
- package/dist/audit/security-logger.d.ts.map +1 -0
- package/dist/audit/security-logger.js +820 -0
- package/dist/audit/security-logger.js.map +1 -0
- package/dist/audit/service.d.ts +206 -0
- package/dist/audit/service.d.ts.map +1 -0
- package/dist/audit/service.js +756 -0
- package/dist/audit/service.js.map +1 -0
- package/dist/audit/siem/elastic.d.ts +94 -0
- package/dist/audit/siem/elastic.d.ts.map +1 -0
- package/dist/audit/siem/elastic.js +412 -0
- package/dist/audit/siem/elastic.js.map +1 -0
- package/dist/audit/siem/index.d.ts +179 -0
- package/dist/audit/siem/index.d.ts.map +1 -0
- package/dist/audit/siem/index.js +368 -0
- package/dist/audit/siem/index.js.map +1 -0
- package/dist/audit/siem/loki.d.ts +100 -0
- package/dist/audit/siem/loki.d.ts.map +1 -0
- package/dist/audit/siem/loki.js +406 -0
- package/dist/audit/siem/loki.js.map +1 -0
- package/dist/audit/siem/splunk.d.ts +91 -0
- package/dist/audit/siem/splunk.d.ts.map +1 -0
- package/dist/audit/siem/splunk.js +375 -0
- package/dist/audit/siem/splunk.js.map +1 -0
- package/dist/audit/siem/types.d.ts +547 -0
- package/dist/audit/siem/types.d.ts.map +1 -0
- package/dist/audit/siem/types.js +270 -0
- package/dist/audit/siem/types.js.map +1 -0
- package/dist/audit/types.d.ts +410 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +130 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/mfa/index.d.ts +9 -0
- package/dist/auth/mfa/index.d.ts.map +1 -0
- package/dist/auth/mfa/index.js +9 -0
- package/dist/auth/mfa/index.js.map +1 -0
- package/dist/auth/mfa/totp.d.ts +222 -0
- package/dist/auth/mfa/totp.d.ts.map +1 -0
- package/dist/auth/mfa/totp.js +329 -0
- package/dist/auth/mfa/totp.js.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts +197 -0
- package/dist/auth/piv-cac/card-removal-handler.d.ts.map +1 -0
- package/dist/auth/piv-cac/card-removal-handler.js +560 -0
- package/dist/auth/piv-cac/card-removal-handler.js.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts +117 -0
- package/dist/auth/piv-cac/certificate-auth.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-auth.js +727 -0
- package/dist/auth/piv-cac/certificate-auth.js.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts +141 -0
- package/dist/auth/piv-cac/certificate-mapper.d.ts.map +1 -0
- package/dist/auth/piv-cac/certificate-mapper.js +569 -0
- package/dist/auth/piv-cac/certificate-mapper.js.map +1 -0
- package/dist/auth/piv-cac/crl-validator.d.ts +195 -0
- package/dist/auth/piv-cac/crl-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/crl-validator.js +824 -0
- package/dist/auth/piv-cac/crl-validator.js.map +1 -0
- package/dist/auth/piv-cac/index.d.ts +72 -0
- package/dist/auth/piv-cac/index.d.ts.map +1 -0
- package/dist/auth/piv-cac/index.js +172 -0
- package/dist/auth/piv-cac/index.js.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts +183 -0
- package/dist/auth/piv-cac/ocsp-validator.d.ts.map +1 -0
- package/dist/auth/piv-cac/ocsp-validator.js +657 -0
- package/dist/auth/piv-cac/ocsp-validator.js.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts +95 -0
- package/dist/auth/piv-cac/piv-middleware.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-middleware.js +524 -0
- package/dist/auth/piv-cac/piv-middleware.js.map +1 -0
- package/dist/auth/piv-cac/piv-routes.d.ts +29 -0
- package/dist/auth/piv-cac/piv-routes.d.ts.map +1 -0
- package/dist/auth/piv-cac/piv-routes.js +534 -0
- package/dist/auth/piv-cac/piv-routes.js.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts +280 -0
- package/dist/auth/piv-cac/pkcs11-provider.d.ts.map +1 -0
- package/dist/auth/piv-cac/pkcs11-provider.js +535 -0
- package/dist/auth/piv-cac/pkcs11-provider.js.map +1 -0
- package/dist/auth/piv-cac/types.d.ts +4098 -0
- package/dist/auth/piv-cac/types.d.ts.map +1 -0
- package/dist/auth/piv-cac/types.js +495 -0
- package/dist/auth/piv-cac/types.js.map +1 -0
- package/dist/basis/evaluator.d.ts +72 -0
- package/dist/basis/evaluator.d.ts.map +1 -0
- package/dist/basis/evaluator.js +275 -0
- package/dist/basis/evaluator.js.map +1 -0
- package/dist/basis/expression-evaluator.d.ts +77 -0
- package/dist/basis/expression-evaluator.d.ts.map +1 -0
- package/dist/basis/expression-evaluator.js +826 -0
- package/dist/basis/expression-evaluator.js.map +1 -0
- package/dist/basis/index.d.ts +13 -0
- package/dist/basis/index.d.ts.map +1 -0
- package/dist/basis/index.js +13 -0
- package/dist/basis/index.js.map +1 -0
- package/dist/basis/parser.d.ts +376 -0
- package/dist/basis/parser.d.ts.map +1 -0
- package/dist/basis/parser.js +178 -0
- package/dist/basis/parser.js.map +1 -0
- package/dist/basis/types.d.ts +115 -0
- package/dist/basis/types.d.ts.map +1 -0
- package/dist/basis/types.js +5 -0
- package/dist/basis/types.js.map +1 -0
- package/dist/car-extensions/aci-string-extensions.d.ts +10 -0
- package/dist/car-extensions/aci-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/aci-string-extensions.js +24 -0
- package/dist/car-extensions/aci-string-extensions.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts +88 -0
- package/dist/car-extensions/builtin-extensions/audit.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/audit.js +445 -0
- package/dist/car-extensions/builtin-extensions/audit.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts +32 -0
- package/dist/car-extensions/builtin-extensions/governance.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/governance.js +534 -0
- package/dist/car-extensions/builtin-extensions/governance.js.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts +43 -0
- package/dist/car-extensions/builtin-extensions/monitoring.d.ts.map +1 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js +416 -0
- package/dist/car-extensions/builtin-extensions/monitoring.js.map +1 -0
- package/dist/car-extensions/car-string-extensions.d.ts +355 -0
- package/dist/car-extensions/car-string-extensions.d.ts.map +1 -0
- package/dist/car-extensions/car-string-extensions.js +473 -0
- package/dist/car-extensions/car-string-extensions.js.map +1 -0
- package/dist/car-extensions/executor.d.ts +208 -0
- package/dist/car-extensions/executor.d.ts.map +1 -0
- package/dist/car-extensions/executor.js +789 -0
- package/dist/car-extensions/executor.js.map +1 -0
- package/dist/car-extensions/index.d.ts +94 -0
- package/dist/car-extensions/index.d.ts.map +1 -0
- package/dist/car-extensions/index.js +159 -0
- package/dist/car-extensions/index.js.map +1 -0
- package/dist/car-extensions/registry.d.ts +217 -0
- package/dist/car-extensions/registry.d.ts.map +1 -0
- package/dist/car-extensions/registry.js +450 -0
- package/dist/car-extensions/registry.js.map +1 -0
- package/dist/car-extensions/service.d.ts +220 -0
- package/dist/car-extensions/service.d.ts.map +1 -0
- package/dist/car-extensions/service.js +486 -0
- package/dist/car-extensions/service.js.map +1 -0
- package/dist/car-extensions/types.d.ts +2269 -0
- package/dist/car-extensions/types.d.ts.map +1 -0
- package/dist/car-extensions/types.js +389 -0
- package/dist/car-extensions/types.js.map +1 -0
- package/dist/cognigate/index.d.ts +192 -0
- package/dist/cognigate/index.d.ts.map +1 -0
- package/dist/cognigate/index.js +435 -0
- package/dist/cognigate/index.js.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts +166 -0
- package/dist/cognigate/sandbox/capability-broker.d.ts.map +1 -0
- package/dist/cognigate/sandbox/capability-broker.js +461 -0
- package/dist/cognigate/sandbox/capability-broker.js.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts +139 -0
- package/dist/cognigate/sandbox/filesystem-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/filesystem-policy.js +426 -0
- package/dist/cognigate/sandbox/filesystem-policy.js.map +1 -0
- package/dist/cognigate/sandbox/index.d.ts +17 -0
- package/dist/cognigate/sandbox/index.d.ts.map +1 -0
- package/dist/cognigate/sandbox/index.js +24 -0
- package/dist/cognigate/sandbox/index.js.map +1 -0
- package/dist/cognigate/sandbox/network-policy.d.ts +126 -0
- package/dist/cognigate/sandbox/network-policy.d.ts.map +1 -0
- package/dist/cognigate/sandbox/network-policy.js +382 -0
- package/dist/cognigate/sandbox/network-policy.js.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts +70 -0
- package/dist/cognigate/sandbox/sandbox-service.d.ts.map +1 -0
- package/dist/cognigate/sandbox/sandbox-service.js +472 -0
- package/dist/cognigate/sandbox/sandbox-service.js.map +1 -0
- package/dist/cognigate/sandbox/types.d.ts +376 -0
- package/dist/cognigate/sandbox/types.d.ts.map +1 -0
- package/dist/cognigate/sandbox/types.js +179 -0
- package/dist/cognigate/sandbox/types.js.map +1 -0
- package/dist/common/adapters/index.d.ts +34 -0
- package/dist/common/adapters/index.d.ts.map +1 -0
- package/dist/common/adapters/index.js +46 -0
- package/dist/common/adapters/index.js.map +1 -0
- package/dist/common/adapters/memory-cache.d.ts +91 -0
- package/dist/common/adapters/memory-cache.d.ts.map +1 -0
- package/dist/common/adapters/memory-cache.js +201 -0
- package/dist/common/adapters/memory-cache.js.map +1 -0
- package/dist/common/adapters/memory-lock.d.ts +75 -0
- package/dist/common/adapters/memory-lock.d.ts.map +1 -0
- package/dist/common/adapters/memory-lock.js +219 -0
- package/dist/common/adapters/memory-lock.js.map +1 -0
- package/dist/common/adapters/memory-queue.d.ts +64 -0
- package/dist/common/adapters/memory-queue.d.ts.map +1 -0
- package/dist/common/adapters/memory-queue.js +233 -0
- package/dist/common/adapters/memory-queue.js.map +1 -0
- package/dist/common/adapters/memory-ratelimit.d.ts +78 -0
- package/dist/common/adapters/memory-ratelimit.d.ts.map +1 -0
- package/dist/common/adapters/memory-ratelimit.js +196 -0
- package/dist/common/adapters/memory-ratelimit.js.map +1 -0
- package/dist/common/adapters/memory-session.d.ts +105 -0
- package/dist/common/adapters/memory-session.d.ts.map +1 -0
- package/dist/common/adapters/memory-session.js +302 -0
- package/dist/common/adapters/memory-session.js.map +1 -0
- package/dist/common/adapters/provider.d.ts +47 -0
- package/dist/common/adapters/provider.d.ts.map +1 -0
- package/dist/common/adapters/provider.js +347 -0
- package/dist/common/adapters/provider.js.map +1 -0
- package/dist/common/adapters/types.d.ts +247 -0
- package/dist/common/adapters/types.d.ts.map +1 -0
- package/dist/common/adapters/types.js +11 -0
- package/dist/common/adapters/types.js.map +1 -0
- package/dist/common/alerts.d.ts +57 -0
- package/dist/common/alerts.d.ts.map +1 -0
- package/dist/common/alerts.js +216 -0
- package/dist/common/alerts.js.map +1 -0
- package/dist/common/authorization.d.ts +137 -0
- package/dist/common/authorization.d.ts.map +1 -0
- package/dist/common/authorization.js +270 -0
- package/dist/common/authorization.js.map +1 -0
- package/dist/common/canonical-bridge.d.ts +153 -0
- package/dist/common/canonical-bridge.d.ts.map +1 -0
- package/dist/common/canonical-bridge.js +236 -0
- package/dist/common/canonical-bridge.js.map +1 -0
- package/dist/common/canonical-json.d.ts +64 -0
- package/dist/common/canonical-json.d.ts.map +1 -0
- package/dist/common/canonical-json.js +95 -0
- package/dist/common/canonical-json.js.map +1 -0
- package/dist/common/circuit-breaker.d.ts +320 -0
- package/dist/common/circuit-breaker.d.ts.map +1 -0
- package/dist/common/circuit-breaker.js +887 -0
- package/dist/common/circuit-breaker.js.map +1 -0
- package/dist/common/config.d.ts +2053 -0
- package/dist/common/config.d.ts.map +1 -0
- package/dist/common/config.js +1314 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/contracts/index.d.ts +2 -0
- package/dist/common/contracts/index.d.ts.map +1 -0
- package/dist/common/contracts/index.js +2 -0
- package/dist/common/contracts/index.js.map +1 -0
- package/dist/common/contracts/output.d.ts +81 -0
- package/dist/common/contracts/output.d.ts.map +1 -0
- package/dist/common/contracts/output.js +38 -0
- package/dist/common/contracts/output.js.map +1 -0
- package/dist/common/crypto-utils.d.ts +103 -0
- package/dist/common/crypto-utils.d.ts.map +1 -0
- package/dist/common/crypto-utils.js +275 -0
- package/dist/common/crypto-utils.js.map +1 -0
- package/dist/common/crypto.d.ts +70 -0
- package/dist/common/crypto.d.ts.map +1 -0
- package/dist/common/crypto.js +201 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/database-resilience.d.ts +156 -0
- package/dist/common/database-resilience.d.ts.map +1 -0
- package/dist/common/database-resilience.js +269 -0
- package/dist/common/database-resilience.js.map +1 -0
- package/dist/common/db-metrics.d.ts +90 -0
- package/dist/common/db-metrics.d.ts.map +1 -0
- package/dist/common/db-metrics.js +219 -0
- package/dist/common/db-metrics.js.map +1 -0
- package/dist/common/db-pool.d.ts +307 -0
- package/dist/common/db-pool.d.ts.map +1 -0
- package/dist/common/db-pool.js +879 -0
- package/dist/common/db-pool.js.map +1 -0
- package/dist/common/db.d.ts +105 -0
- package/dist/common/db.d.ts.map +1 -0
- package/dist/common/db.js +216 -0
- package/dist/common/db.js.map +1 -0
- package/dist/common/debug-auth-middleware.d.ts +111 -0
- package/dist/common/debug-auth-middleware.d.ts.map +1 -0
- package/dist/common/debug-auth-middleware.js +285 -0
- package/dist/common/debug-auth-middleware.js.map +1 -0
- package/dist/common/di.d.ts +202 -0
- package/dist/common/di.d.ts.map +1 -0
- package/dist/common/di.js +219 -0
- package/dist/common/di.js.map +1 -0
- package/dist/common/encryption.d.ts +233 -0
- package/dist/common/encryption.d.ts.map +1 -0
- package/dist/common/encryption.js +527 -0
- package/dist/common/encryption.js.map +1 -0
- package/dist/common/error-sanitizer.d.ts +67 -0
- package/dist/common/error-sanitizer.d.ts.map +1 -0
- package/dist/common/error-sanitizer.js +298 -0
- package/dist/common/error-sanitizer.js.map +1 -0
- package/dist/common/errors.d.ts +229 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +349 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/expression/evaluator.d.ts +58 -0
- package/dist/common/expression/evaluator.d.ts.map +1 -0
- package/dist/common/expression/evaluator.js +326 -0
- package/dist/common/expression/evaluator.js.map +1 -0
- package/dist/common/expression/index.d.ts +180 -0
- package/dist/common/expression/index.d.ts.map +1 -0
- package/dist/common/expression/index.js +198 -0
- package/dist/common/expression/index.js.map +1 -0
- package/dist/common/expression/lexer.d.ts +69 -0
- package/dist/common/expression/lexer.d.ts.map +1 -0
- package/dist/common/expression/lexer.js +255 -0
- package/dist/common/expression/lexer.js.map +1 -0
- package/dist/common/expression/parser.d.ts +133 -0
- package/dist/common/expression/parser.d.ts.map +1 -0
- package/dist/common/expression/parser.js +293 -0
- package/dist/common/expression/parser.js.map +1 -0
- package/dist/common/group-membership.d.ts +119 -0
- package/dist/common/group-membership.d.ts.map +1 -0
- package/dist/common/group-membership.js +250 -0
- package/dist/common/group-membership.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +15 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/leader-election.d.ts +40 -0
- package/dist/common/leader-election.d.ts.map +1 -0
- package/dist/common/leader-election.js +232 -0
- package/dist/common/leader-election.js.map +1 -0
- package/dist/common/lock.d.ts +77 -0
- package/dist/common/lock.d.ts.map +1 -0
- package/dist/common/lock.js +167 -0
- package/dist/common/lock.js.map +1 -0
- package/dist/common/logger.d.ts +19 -0
- package/dist/common/logger.d.ts.map +1 -0
- package/dist/common/logger.js +80 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/metrics-registry.d.ts +48 -0
- package/dist/common/metrics-registry.d.ts.map +1 -0
- package/dist/common/metrics-registry.js +77 -0
- package/dist/common/metrics-registry.js.map +1 -0
- package/dist/common/metrics.d.ts +204 -0
- package/dist/common/metrics.d.ts.map +1 -0
- package/dist/common/metrics.js +497 -0
- package/dist/common/metrics.js.map +1 -0
- package/dist/common/operation-tracker.d.ts +137 -0
- package/dist/common/operation-tracker.d.ts.map +1 -0
- package/dist/common/operation-tracker.js +366 -0
- package/dist/common/operation-tracker.js.map +1 -0
- package/dist/common/provenance/chain.d.ts +54 -0
- package/dist/common/provenance/chain.d.ts.map +1 -0
- package/dist/common/provenance/chain.js +252 -0
- package/dist/common/provenance/chain.js.map +1 -0
- package/dist/common/provenance/index.d.ts +14 -0
- package/dist/common/provenance/index.d.ts.map +1 -0
- package/dist/common/provenance/index.js +19 -0
- package/dist/common/provenance/index.js.map +1 -0
- package/dist/common/provenance/query.d.ts +111 -0
- package/dist/common/provenance/query.d.ts.map +1 -0
- package/dist/common/provenance/query.js +310 -0
- package/dist/common/provenance/query.js.map +1 -0
- package/dist/common/provenance/storage.d.ts +297 -0
- package/dist/common/provenance/storage.d.ts.map +1 -0
- package/dist/common/provenance/storage.js +436 -0
- package/dist/common/provenance/storage.js.map +1 -0
- package/dist/common/provenance/tracker.d.ts +57 -0
- package/dist/common/provenance/tracker.d.ts.map +1 -0
- package/dist/common/provenance/tracker.js +209 -0
- package/dist/common/provenance/tracker.js.map +1 -0
- package/dist/common/provenance/types.d.ts +146 -0
- package/dist/common/provenance/types.d.ts.map +1 -0
- package/dist/common/provenance/types.js +10 -0
- package/dist/common/provenance/types.js.map +1 -0
- package/dist/common/random.d.ts +84 -0
- package/dist/common/random.d.ts.map +1 -0
- package/dist/common/random.js +130 -0
- package/dist/common/random.js.map +1 -0
- package/dist/common/redaction.d.ts +49 -0
- package/dist/common/redaction.d.ts.map +1 -0
- package/dist/common/redaction.js +217 -0
- package/dist/common/redaction.js.map +1 -0
- package/dist/common/redis-cluster.d.ts +538 -0
- package/dist/common/redis-cluster.d.ts.map +1 -0
- package/dist/common/redis-cluster.js +1539 -0
- package/dist/common/redis-cluster.js.map +1 -0
- package/dist/common/redis-resilience.d.ts +270 -0
- package/dist/common/redis-resilience.d.ts.map +1 -0
- package/dist/common/redis-resilience.js +586 -0
- package/dist/common/redis-resilience.js.map +1 -0
- package/dist/common/redis.d.ts +19 -0
- package/dist/common/redis.d.ts.map +1 -0
- package/dist/common/redis.js +73 -0
- package/dist/common/redis.js.map +1 -0
- package/dist/common/safe-json.d.ts +246 -0
- package/dist/common/safe-json.d.ts.map +1 -0
- package/dist/common/safe-json.js +442 -0
- package/dist/common/safe-json.js.map +1 -0
- package/dist/common/secret-generator.d.ts +142 -0
- package/dist/common/secret-generator.d.ts.map +1 -0
- package/dist/common/secret-generator.js +286 -0
- package/dist/common/secret-generator.js.map +1 -0
- package/dist/common/secure-fetch.d.ts +182 -0
- package/dist/common/secure-fetch.d.ts.map +1 -0
- package/dist/common/secure-fetch.js +657 -0
- package/dist/common/secure-fetch.js.map +1 -0
- package/dist/common/security-mode.d.ts +151 -0
- package/dist/common/security-mode.d.ts.map +1 -0
- package/dist/common/security-mode.js +482 -0
- package/dist/common/security-mode.js.map +1 -0
- package/dist/common/telemetry/index.d.ts +82 -0
- package/dist/common/telemetry/index.d.ts.map +1 -0
- package/dist/common/telemetry/index.js +198 -0
- package/dist/common/telemetry/index.js.map +1 -0
- package/dist/common/telemetry/instrumentation.d.ts +167 -0
- package/dist/common/telemetry/instrumentation.d.ts.map +1 -0
- package/dist/common/telemetry/instrumentation.js +492 -0
- package/dist/common/telemetry/instrumentation.js.map +1 -0
- package/dist/common/telemetry/metrics-bridge.d.ts +227 -0
- package/dist/common/telemetry/metrics-bridge.d.ts.map +1 -0
- package/dist/common/telemetry/metrics-bridge.js +437 -0
- package/dist/common/telemetry/metrics-bridge.js.map +1 -0
- package/dist/common/telemetry/middleware.d.ts +114 -0
- package/dist/common/telemetry/middleware.d.ts.map +1 -0
- package/dist/common/telemetry/middleware.js +353 -0
- package/dist/common/telemetry/middleware.js.map +1 -0
- package/dist/common/telemetry/propagation.d.ts +221 -0
- package/dist/common/telemetry/propagation.d.ts.map +1 -0
- package/dist/common/telemetry/propagation.js +409 -0
- package/dist/common/telemetry/propagation.js.map +1 -0
- package/dist/common/telemetry/spans.d.ts +295 -0
- package/dist/common/telemetry/spans.d.ts.map +1 -0
- package/dist/common/telemetry/spans.js +439 -0
- package/dist/common/telemetry/spans.js.map +1 -0
- package/dist/common/telemetry/tracer.d.ts +155 -0
- package/dist/common/telemetry/tracer.d.ts.map +1 -0
- package/dist/common/telemetry/tracer.js +343 -0
- package/dist/common/telemetry/tracer.js.map +1 -0
- package/dist/common/telemetry.d.ts +15 -0
- package/dist/common/telemetry.d.ts.map +1 -0
- package/dist/common/telemetry.js +61 -0
- package/dist/common/telemetry.js.map +1 -0
- package/dist/common/tenant-context.d.ts +253 -0
- package/dist/common/tenant-context.d.ts.map +1 -0
- package/dist/common/tenant-context.js +259 -0
- package/dist/common/tenant-context.js.map +1 -0
- package/dist/common/tenant-verification.d.ts +86 -0
- package/dist/common/tenant-verification.d.ts.map +1 -0
- package/dist/common/tenant-verification.js +184 -0
- package/dist/common/tenant-verification.js.map +1 -0
- package/dist/common/timeout.d.ts +40 -0
- package/dist/common/timeout.d.ts.map +1 -0
- package/dist/common/timeout.js +82 -0
- package/dist/common/timeout.js.map +1 -0
- package/dist/common/token-revocation.d.ts +44 -0
- package/dist/common/token-revocation.d.ts.map +1 -0
- package/dist/common/token-revocation.js +169 -0
- package/dist/common/token-revocation.js.map +1 -0
- package/dist/common/trace.d.ts +149 -0
- package/dist/common/trace.d.ts.map +1 -0
- package/dist/common/trace.js +328 -0
- package/dist/common/trace.js.map +1 -0
- package/dist/common/trust-cache.d.ts +263 -0
- package/dist/common/trust-cache.d.ts.map +1 -0
- package/dist/common/trust-cache.js +670 -0
- package/dist/common/trust-cache.js.map +1 -0
- package/dist/common/types.d.ts +351 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +55 -0
- package/dist/common/types.js.map +1 -0
- package/dist/common/validation.d.ts +113 -0
- package/dist/common/validation.d.ts.map +1 -0
- package/dist/common/validation.js +221 -0
- package/dist/common/validation.js.map +1 -0
- package/dist/db/client.d.ts +72 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +110 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/index.d.ts +9 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +9 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema/merkle.d.ts +475 -0
- package/dist/db/schema/merkle.d.ts.map +1 -0
- package/dist/db/schema/merkle.js +100 -0
- package/dist/db/schema/merkle.js.map +1 -0
- package/dist/db/schema/proofs.d.ts +412 -0
- package/dist/db/schema/proofs.d.ts.map +1 -0
- package/dist/db/schema/proofs.js +63 -0
- package/dist/db/schema/proofs.js.map +1 -0
- package/dist/enforce/adapters.d.ts +73 -0
- package/dist/enforce/adapters.d.ts.map +1 -0
- package/dist/enforce/adapters.js +293 -0
- package/dist/enforce/adapters.js.map +1 -0
- package/dist/enforce/index.d.ts +213 -0
- package/dist/enforce/index.d.ts.map +1 -0
- package/dist/enforce/index.js +630 -0
- package/dist/enforce/index.js.map +1 -0
- package/dist/enforce/repository.d.ts +203 -0
- package/dist/enforce/repository.d.ts.map +1 -0
- package/dist/enforce/repository.js +359 -0
- package/dist/enforce/repository.js.map +1 -0
- package/dist/enforce/schema.d.ts +1198 -0
- package/dist/enforce/schema.d.ts.map +1 -0
- package/dist/enforce/schema.js +257 -0
- package/dist/enforce/schema.js.map +1 -0
- package/dist/friction/index.d.ts +235 -0
- package/dist/friction/index.d.ts.map +1 -0
- package/dist/friction/index.js +636 -0
- package/dist/friction/index.js.map +1 -0
- package/dist/friction/openapi.d.ts +23 -0
- package/dist/friction/openapi.d.ts.map +1 -0
- package/dist/friction/openapi.js +883 -0
- package/dist/friction/openapi.js.map +1 -0
- package/dist/friction/routes.d.ts +14 -0
- package/dist/friction/routes.d.ts.map +1 -0
- package/dist/friction/routes.js +206 -0
- package/dist/friction/routes.js.map +1 -0
- package/dist/governance/engine.d.ts +158 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +248 -0
- package/dist/governance/engine.js.map +1 -0
- package/dist/governance/evaluator.d.ts +106 -0
- package/dist/governance/evaluator.d.ts.map +1 -0
- package/dist/governance/evaluator.js +277 -0
- package/dist/governance/evaluator.js.map +1 -0
- package/dist/governance/index.d.ts +11 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +14 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/policy.d.ts +152 -0
- package/dist/governance/policy.d.ts.map +1 -0
- package/dist/governance/policy.js +152 -0
- package/dist/governance/policy.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/intent/adapters.d.ts +101 -0
- package/dist/intent/adapters.d.ts.map +1 -0
- package/dist/intent/adapters.js +250 -0
- package/dist/intent/adapters.js.map +1 -0
- package/dist/intent/audit.d.ts +119 -0
- package/dist/intent/audit.d.ts.map +1 -0
- package/dist/intent/audit.js +463 -0
- package/dist/intent/audit.js.map +1 -0
- package/dist/intent/classifier/index.d.ts +121 -0
- package/dist/intent/classifier/index.d.ts.map +1 -0
- package/dist/intent/classifier/index.js +232 -0
- package/dist/intent/classifier/index.js.map +1 -0
- package/dist/intent/classifier/patterns.d.ts +129 -0
- package/dist/intent/classifier/patterns.d.ts.map +1 -0
- package/dist/intent/classifier/patterns.js +471 -0
- package/dist/intent/classifier/patterns.js.map +1 -0
- package/dist/intent/classifier/risk.d.ts +177 -0
- package/dist/intent/classifier/risk.d.ts.map +1 -0
- package/dist/intent/classifier/risk.js +335 -0
- package/dist/intent/classifier/risk.js.map +1 -0
- package/dist/intent/cleanup.d.ts +24 -0
- package/dist/intent/cleanup.d.ts.map +1 -0
- package/dist/intent/cleanup.js +104 -0
- package/dist/intent/cleanup.js.map +1 -0
- package/dist/intent/consent.d.ts +238 -0
- package/dist/intent/consent.d.ts.map +1 -0
- package/dist/intent/consent.js +427 -0
- package/dist/intent/consent.js.map +1 -0
- package/dist/intent/escalation.d.ts +284 -0
- package/dist/intent/escalation.d.ts.map +1 -0
- package/dist/intent/escalation.js +618 -0
- package/dist/intent/escalation.js.map +1 -0
- package/dist/intent/gdpr-rate-limiter.d.ts +170 -0
- package/dist/intent/gdpr-rate-limiter.d.ts.map +1 -0
- package/dist/intent/gdpr-rate-limiter.js +385 -0
- package/dist/intent/gdpr-rate-limiter.js.map +1 -0
- package/dist/intent/gdpr.d.ts +323 -0
- package/dist/intent/gdpr.d.ts.map +1 -0
- package/dist/intent/gdpr.js +1013 -0
- package/dist/intent/gdpr.js.map +1 -0
- package/dist/intent/health.d.ts +214 -0
- package/dist/intent/health.d.ts.map +1 -0
- package/dist/intent/health.js +526 -0
- package/dist/intent/health.js.map +1 -0
- package/dist/intent/index.d.ts +565 -0
- package/dist/intent/index.d.ts.map +1 -0
- package/dist/intent/index.js +756 -0
- package/dist/intent/index.js.map +1 -0
- package/dist/intent/metrics.d.ts +399 -0
- package/dist/intent/metrics.d.ts.map +1 -0
- package/dist/intent/metrics.js +886 -0
- package/dist/intent/metrics.js.map +1 -0
- package/dist/intent/openapi.d.ts +22 -0
- package/dist/intent/openapi.d.ts.map +1 -0
- package/dist/intent/openapi.js +1674 -0
- package/dist/intent/openapi.js.map +1 -0
- package/dist/intent/planner/dependency.d.ts +78 -0
- package/dist/intent/planner/dependency.d.ts.map +1 -0
- package/dist/intent/planner/dependency.js +334 -0
- package/dist/intent/planner/dependency.js.map +1 -0
- package/dist/intent/planner/index.d.ts +130 -0
- package/dist/intent/planner/index.d.ts.map +1 -0
- package/dist/intent/planner/index.js +372 -0
- package/dist/intent/planner/index.js.map +1 -0
- package/dist/intent/planner/rollback.d.ts +92 -0
- package/dist/intent/planner/rollback.d.ts.map +1 -0
- package/dist/intent/planner/rollback.js +326 -0
- package/dist/intent/planner/rollback.js.map +1 -0
- package/dist/intent/planner/templates.d.ts +81 -0
- package/dist/intent/planner/templates.d.ts.map +1 -0
- package/dist/intent/planner/templates.js +560 -0
- package/dist/intent/planner/templates.js.map +1 -0
- package/dist/intent/planner/types.d.ts +38 -0
- package/dist/intent/planner/types.d.ts.map +1 -0
- package/dist/intent/planner/types.js +10 -0
- package/dist/intent/planner/types.js.map +1 -0
- package/dist/intent/queue.d.ts +150 -0
- package/dist/intent/queue.d.ts.map +1 -0
- package/dist/intent/queue.js +339 -0
- package/dist/intent/queue.js.map +1 -0
- package/dist/intent/queues.d.ts +176 -0
- package/dist/intent/queues.d.ts.map +1 -0
- package/dist/intent/queues.js +1393 -0
- package/dist/intent/queues.js.map +1 -0
- package/dist/intent/ratelimit.d.ts +147 -0
- package/dist/intent/ratelimit.d.ts.map +1 -0
- package/dist/intent/ratelimit.js +301 -0
- package/dist/intent/ratelimit.js.map +1 -0
- package/dist/intent/replay/comparator.d.ts +73 -0
- package/dist/intent/replay/comparator.d.ts.map +1 -0
- package/dist/intent/replay/comparator.js +320 -0
- package/dist/intent/replay/comparator.js.map +1 -0
- package/dist/intent/replay/index.d.ts +104 -0
- package/dist/intent/replay/index.d.ts.map +1 -0
- package/dist/intent/replay/index.js +487 -0
- package/dist/intent/replay/index.js.map +1 -0
- package/dist/intent/replay/simulator.d.ts +184 -0
- package/dist/intent/replay/simulator.d.ts.map +1 -0
- package/dist/intent/replay/simulator.js +512 -0
- package/dist/intent/replay/simulator.js.map +1 -0
- package/dist/intent/replay/snapshot.d.ts +149 -0
- package/dist/intent/replay/snapshot.d.ts.map +1 -0
- package/dist/intent/replay/snapshot.js +245 -0
- package/dist/intent/replay/snapshot.js.map +1 -0
- package/dist/intent/replay/types.d.ts +143 -0
- package/dist/intent/replay/types.d.ts.map +1 -0
- package/dist/intent/replay/types.js +10 -0
- package/dist/intent/replay/types.js.map +1 -0
- package/dist/intent/repository.d.ts +198 -0
- package/dist/intent/repository.d.ts.map +1 -0
- package/dist/intent/repository.js +538 -0
- package/dist/intent/repository.js.map +1 -0
- package/dist/intent/response-middleware.d.ts +156 -0
- package/dist/intent/response-middleware.d.ts.map +1 -0
- package/dist/intent/response-middleware.js +346 -0
- package/dist/intent/response-middleware.js.map +1 -0
- package/dist/intent/response.d.ts +267 -0
- package/dist/intent/response.d.ts.map +1 -0
- package/dist/intent/response.js +402 -0
- package/dist/intent/response.js.map +1 -0
- package/dist/intent/routes.d.ts +35 -0
- package/dist/intent/routes.d.ts.map +1 -0
- package/dist/intent/routes.js +1023 -0
- package/dist/intent/routes.js.map +1 -0
- package/dist/intent/scheduler.d.ts +45 -0
- package/dist/intent/scheduler.d.ts.map +1 -0
- package/dist/intent/scheduler.js +221 -0
- package/dist/intent/scheduler.js.map +1 -0
- package/dist/intent/schema.d.ts +3817 -0
- package/dist/intent/schema.d.ts.map +1 -0
- package/dist/intent/schema.js +631 -0
- package/dist/intent/schema.js.map +1 -0
- package/dist/intent/shutdown.d.ts +145 -0
- package/dist/intent/shutdown.d.ts.map +1 -0
- package/dist/intent/shutdown.js +468 -0
- package/dist/intent/shutdown.js.map +1 -0
- package/dist/intent/state-machine.d.ts +111 -0
- package/dist/intent/state-machine.d.ts.map +1 -0
- package/dist/intent/state-machine.js +242 -0
- package/dist/intent/state-machine.js.map +1 -0
- package/dist/intent/tracing.d.ts +152 -0
- package/dist/intent/tracing.d.ts.map +1 -0
- package/dist/intent/tracing.js +658 -0
- package/dist/intent/tracing.js.map +1 -0
- package/dist/intent/types.d.ts +188 -0
- package/dist/intent/types.d.ts.map +1 -0
- package/dist/intent/types.js +25 -0
- package/dist/intent/types.js.map +1 -0
- package/dist/intent/webhooks/delivery-repository.d.ts +80 -0
- package/dist/intent/webhooks/delivery-repository.d.ts.map +1 -0
- package/dist/intent/webhooks/delivery-repository.js +251 -0
- package/dist/intent/webhooks/delivery-repository.js.map +1 -0
- package/dist/intent/webhooks/dns-pinning.d.ts +30 -0
- package/dist/intent/webhooks/dns-pinning.d.ts.map +1 -0
- package/dist/intent/webhooks/dns-pinning.js +69 -0
- package/dist/intent/webhooks/dns-pinning.js.map +1 -0
- package/dist/intent/webhooks/index.d.ts +14 -0
- package/dist/intent/webhooks/index.d.ts.map +1 -0
- package/dist/intent/webhooks/index.js +17 -0
- package/dist/intent/webhooks/index.js.map +1 -0
- package/dist/intent/webhooks/signature.d.ts +47 -0
- package/dist/intent/webhooks/signature.d.ts.map +1 -0
- package/dist/intent/webhooks/signature.js +80 -0
- package/dist/intent/webhooks/signature.js.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts +29 -0
- package/dist/intent/webhooks/ssrf-protection.d.ts.map +1 -0
- package/dist/intent/webhooks/ssrf-protection.js +161 -0
- package/dist/intent/webhooks/ssrf-protection.js.map +1 -0
- package/dist/intent/webhooks/types.d.ts +132 -0
- package/dist/intent/webhooks/types.d.ts.map +1 -0
- package/dist/intent/webhooks/types.js +14 -0
- package/dist/intent/webhooks/types.js.map +1 -0
- package/dist/intent/webhooks.d.ts +618 -0
- package/dist/intent/webhooks.d.ts.map +1 -0
- package/dist/intent/webhooks.js +1836 -0
- package/dist/intent/webhooks.js.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts +18 -0
- package/dist/intent-gateway/ai-act-classifier.d.ts.map +1 -0
- package/dist/intent-gateway/ai-act-classifier.js +296 -0
- package/dist/intent-gateway/ai-act-classifier.js.map +1 -0
- package/dist/intent-gateway/index.d.ts +43 -0
- package/dist/intent-gateway/index.d.ts.map +1 -0
- package/dist/intent-gateway/index.js +236 -0
- package/dist/intent-gateway/index.js.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts +19 -0
- package/dist/intent-gateway/jurisdiction-resolver.d.ts.map +1 -0
- package/dist/intent-gateway/jurisdiction-resolver.js +236 -0
- package/dist/intent-gateway/jurisdiction-resolver.js.map +1 -0
- package/dist/intent-gateway/policy-composer.d.ts +27 -0
- package/dist/intent-gateway/policy-composer.d.ts.map +1 -0
- package/dist/intent-gateway/policy-composer.js +418 -0
- package/dist/intent-gateway/policy-composer.js.map +1 -0
- package/dist/intent-gateway/regime-selector.d.ts +26 -0
- package/dist/intent-gateway/regime-selector.d.ts.map +1 -0
- package/dist/intent-gateway/regime-selector.js +185 -0
- package/dist/intent-gateway/regime-selector.js.map +1 -0
- package/dist/intent-gateway/types.d.ts +103 -0
- package/dist/intent-gateway/types.d.ts.map +1 -0
- package/dist/intent-gateway/types.js +85 -0
- package/dist/intent-gateway/types.js.map +1 -0
- package/dist/observability/alerts.d.ts +136 -0
- package/dist/observability/alerts.d.ts.map +1 -0
- package/dist/observability/alerts.js +485 -0
- package/dist/observability/alerts.js.map +1 -0
- package/dist/observability/health.d.ts +102 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +415 -0
- package/dist/observability/health.js.map +1 -0
- package/dist/observability/index.d.ts +29 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +72 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/logging.d.ts +90 -0
- package/dist/observability/logging.d.ts.map +1 -0
- package/dist/observability/logging.js +260 -0
- package/dist/observability/logging.js.map +1 -0
- package/dist/observability/metrics.d.ts +226 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +527 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/tracing.d.ts +120 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +285 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/persistence/audit.d.ts +169 -0
- package/dist/persistence/audit.d.ts.map +1 -0
- package/dist/persistence/audit.js +342 -0
- package/dist/persistence/audit.js.map +1 -0
- package/dist/persistence/index.d.ts +13 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +15 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/repository.d.ts +192 -0
- package/dist/persistence/repository.d.ts.map +1 -0
- package/dist/persistence/repository.js +223 -0
- package/dist/persistence/repository.js.map +1 -0
- package/dist/policy/diff.d.ts +88 -0
- package/dist/policy/diff.d.ts.map +1 -0
- package/dist/policy/diff.js +325 -0
- package/dist/policy/diff.js.map +1 -0
- package/dist/policy/distributed-cache.d.ts +205 -0
- package/dist/policy/distributed-cache.d.ts.map +1 -0
- package/dist/policy/distributed-cache.js +683 -0
- package/dist/policy/distributed-cache.js.map +1 -0
- package/dist/policy/evaluator.d.ts +102 -0
- package/dist/policy/evaluator.d.ts.map +1 -0
- package/dist/policy/evaluator.js +648 -0
- package/dist/policy/evaluator.js.map +1 -0
- package/dist/policy/index.d.ts +24 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +27 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/loader.d.ts +63 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +176 -0
- package/dist/policy/loader.js.map +1 -0
- package/dist/policy/service.d.ts +240 -0
- package/dist/policy/service.d.ts.map +1 -0
- package/dist/policy/service.js +1032 -0
- package/dist/policy/service.js.map +1 -0
- package/dist/policy/types.d.ts +220 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +36 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/policy/visual-builder/index.d.ts +201 -0
- package/dist/policy/visual-builder/index.d.ts.map +1 -0
- package/dist/policy/visual-builder/index.js +727 -0
- package/dist/policy/visual-builder/index.js.map +1 -0
- package/dist/policy/visual-builder/inheritance.d.ts +151 -0
- package/dist/policy/visual-builder/inheritance.d.ts.map +1 -0
- package/dist/policy/visual-builder/inheritance.js +314 -0
- package/dist/policy/visual-builder/inheritance.js.map +1 -0
- package/dist/policy/visual-builder/propagation.d.ts +146 -0
- package/dist/policy/visual-builder/propagation.d.ts.map +1 -0
- package/dist/policy/visual-builder/propagation.js +299 -0
- package/dist/policy/visual-builder/propagation.js.map +1 -0
- package/dist/policy/visual-builder/routes.d.ts +14 -0
- package/dist/policy/visual-builder/routes.d.ts.map +1 -0
- package/dist/policy/visual-builder/routes.js +528 -0
- package/dist/policy/visual-builder/routes.js.map +1 -0
- package/dist/policy/visual-builder/simulator.d.ts +161 -0
- package/dist/policy/visual-builder/simulator.d.ts.map +1 -0
- package/dist/policy/visual-builder/simulator.js +413 -0
- package/dist/policy/visual-builder/simulator.js.map +1 -0
- package/dist/policy/visual-builder/templates.d.ts +119 -0
- package/dist/policy/visual-builder/templates.d.ts.map +1 -0
- package/dist/policy/visual-builder/templates.js +627 -0
- package/dist/policy/visual-builder/templates.js.map +1 -0
- package/dist/proof/chain/index.d.ts +271 -0
- package/dist/proof/chain/index.d.ts.map +1 -0
- package/dist/proof/chain/index.js +483 -0
- package/dist/proof/chain/index.js.map +1 -0
- package/dist/proof/index.d.ts +206 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +597 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/proof/merkle-service.d.ts +194 -0
- package/dist/proof/merkle-service.d.ts.map +1 -0
- package/dist/proof/merkle-service.js +463 -0
- package/dist/proof/merkle-service.js.map +1 -0
- package/dist/proof/merkle.d.ts +118 -0
- package/dist/proof/merkle.d.ts.map +1 -0
- package/dist/proof/merkle.js +265 -0
- package/dist/proof/merkle.js.map +1 -0
- package/dist/security/ai-governance/access-policy.d.ts +197 -0
- package/dist/security/ai-governance/access-policy.d.ts.map +1 -0
- package/dist/security/ai-governance/access-policy.js +522 -0
- package/dist/security/ai-governance/access-policy.js.map +1 -0
- package/dist/security/ai-governance/audit-trail.d.ts +241 -0
- package/dist/security/ai-governance/audit-trail.d.ts.map +1 -0
- package/dist/security/ai-governance/audit-trail.js +645 -0
- package/dist/security/ai-governance/audit-trail.js.map +1 -0
- package/dist/security/ai-governance/bias-detection.d.ts +221 -0
- package/dist/security/ai-governance/bias-detection.d.ts.map +1 -0
- package/dist/security/ai-governance/bias-detection.js +615 -0
- package/dist/security/ai-governance/bias-detection.js.map +1 -0
- package/dist/security/ai-governance/index.d.ts +92 -0
- package/dist/security/ai-governance/index.d.ts.map +1 -0
- package/dist/security/ai-governance/index.js +184 -0
- package/dist/security/ai-governance/index.js.map +1 -0
- package/dist/security/ai-governance/middleware.d.ts +110 -0
- package/dist/security/ai-governance/middleware.d.ts.map +1 -0
- package/dist/security/ai-governance/middleware.js +359 -0
- package/dist/security/ai-governance/middleware.js.map +1 -0
- package/dist/security/ai-governance/model-registry.d.ts +229 -0
- package/dist/security/ai-governance/model-registry.d.ts.map +1 -0
- package/dist/security/ai-governance/model-registry.js +535 -0
- package/dist/security/ai-governance/model-registry.js.map +1 -0
- package/dist/security/ai-governance/output-filter.d.ts +150 -0
- package/dist/security/ai-governance/output-filter.d.ts.map +1 -0
- package/dist/security/ai-governance/output-filter.js +561 -0
- package/dist/security/ai-governance/output-filter.js.map +1 -0
- package/dist/security/ai-governance/prompt-injection.d.ts +153 -0
- package/dist/security/ai-governance/prompt-injection.d.ts.map +1 -0
- package/dist/security/ai-governance/prompt-injection.js +614 -0
- package/dist/security/ai-governance/prompt-injection.js.map +1 -0
- package/dist/security/ai-governance/rate-limiter.d.ts +156 -0
- package/dist/security/ai-governance/rate-limiter.d.ts.map +1 -0
- package/dist/security/ai-governance/rate-limiter.js +541 -0
- package/dist/security/ai-governance/rate-limiter.js.map +1 -0
- package/dist/security/ai-governance/types.d.ts +594 -0
- package/dist/security/ai-governance/types.d.ts.map +1 -0
- package/dist/security/ai-governance/types.js +6 -0
- package/dist/security/ai-governance/types.js.map +1 -0
- package/dist/security/alerting/channels/base.d.ts +91 -0
- package/dist/security/alerting/channels/base.d.ts.map +1 -0
- package/dist/security/alerting/channels/base.js +128 -0
- package/dist/security/alerting/channels/base.js.map +1 -0
- package/dist/security/alerting/channels/email.d.ts +92 -0
- package/dist/security/alerting/channels/email.d.ts.map +1 -0
- package/dist/security/alerting/channels/email.js +418 -0
- package/dist/security/alerting/channels/email.js.map +1 -0
- package/dist/security/alerting/channels/http-base.d.ts +86 -0
- package/dist/security/alerting/channels/http-base.d.ts.map +1 -0
- package/dist/security/alerting/channels/http-base.js +133 -0
- package/dist/security/alerting/channels/http-base.js.map +1 -0
- package/dist/security/alerting/channels/index.d.ts +30 -0
- package/dist/security/alerting/channels/index.d.ts.map +1 -0
- package/dist/security/alerting/channels/index.js +22 -0
- package/dist/security/alerting/channels/index.js.map +1 -0
- package/dist/security/alerting/channels/pagerduty.d.ts +70 -0
- package/dist/security/alerting/channels/pagerduty.d.ts.map +1 -0
- package/dist/security/alerting/channels/pagerduty.js +248 -0
- package/dist/security/alerting/channels/pagerduty.js.map +1 -0
- package/dist/security/alerting/channels/slack.d.ts +55 -0
- package/dist/security/alerting/channels/slack.d.ts.map +1 -0
- package/dist/security/alerting/channels/slack.js +215 -0
- package/dist/security/alerting/channels/slack.js.map +1 -0
- package/dist/security/alerting/channels/sns.d.ts +87 -0
- package/dist/security/alerting/channels/sns.d.ts.map +1 -0
- package/dist/security/alerting/channels/sns.js +251 -0
- package/dist/security/alerting/channels/sns.js.map +1 -0
- package/dist/security/alerting/channels/webhook.d.ts +92 -0
- package/dist/security/alerting/channels/webhook.d.ts.map +1 -0
- package/dist/security/alerting/channels/webhook.js +203 -0
- package/dist/security/alerting/channels/webhook.js.map +1 -0
- package/dist/security/alerting/detector.d.ts +217 -0
- package/dist/security/alerting/detector.d.ts.map +1 -0
- package/dist/security/alerting/detector.js +725 -0
- package/dist/security/alerting/detector.js.map +1 -0
- package/dist/security/alerting/index.d.ts +57 -0
- package/dist/security/alerting/index.d.ts.map +1 -0
- package/dist/security/alerting/index.js +214 -0
- package/dist/security/alerting/index.js.map +1 -0
- package/dist/security/alerting/service.d.ts +190 -0
- package/dist/security/alerting/service.d.ts.map +1 -0
- package/dist/security/alerting/service.js +815 -0
- package/dist/security/alerting/service.js.map +1 -0
- package/dist/security/alerting/types.d.ts +2165 -0
- package/dist/security/alerting/types.d.ts.map +1 -0
- package/dist/security/alerting/types.js +278 -0
- package/dist/security/alerting/types.js.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts +198 -0
- package/dist/security/anomaly/detectors/account-compromise.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/account-compromise.js +815 -0
- package/dist/security/anomaly/detectors/account-compromise.js.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts +175 -0
- package/dist/security/anomaly/detectors/data-exfiltration.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js +733 -0
- package/dist/security/anomaly/detectors/data-exfiltration.js.map +1 -0
- package/dist/security/anomaly/detectors/geographic.d.ts +100 -0
- package/dist/security/anomaly/detectors/geographic.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/geographic.js +348 -0
- package/dist/security/anomaly/detectors/geographic.js.map +1 -0
- package/dist/security/anomaly/detectors/index.d.ts +86 -0
- package/dist/security/anomaly/detectors/index.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/index.js +118 -0
- package/dist/security/anomaly/detectors/index.js.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts +168 -0
- package/dist/security/anomaly/detectors/lateral-movement.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/lateral-movement.js +795 -0
- package/dist/security/anomaly/detectors/lateral-movement.js.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts +177 -0
- package/dist/security/anomaly/detectors/privilege-escalation.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js +741 -0
- package/dist/security/anomaly/detectors/privilege-escalation.js.map +1 -0
- package/dist/security/anomaly/detectors/temporal.d.ts +71 -0
- package/dist/security/anomaly/detectors/temporal.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/temporal.js +398 -0
- package/dist/security/anomaly/detectors/temporal.js.map +1 -0
- package/dist/security/anomaly/detectors/volume.d.ts +97 -0
- package/dist/security/anomaly/detectors/volume.d.ts.map +1 -0
- package/dist/security/anomaly/detectors/volume.js +424 -0
- package/dist/security/anomaly/detectors/volume.js.map +1 -0
- package/dist/security/anomaly/index.d.ts +128 -0
- package/dist/security/anomaly/index.d.ts.map +1 -0
- package/dist/security/anomaly/index.js +378 -0
- package/dist/security/anomaly/index.js.map +1 -0
- package/dist/security/anomaly/types.d.ts +1209 -0
- package/dist/security/anomaly/types.d.ts.map +1 -0
- package/dist/security/anomaly/types.js +193 -0
- package/dist/security/anomaly/types.js.map +1 -0
- package/dist/security/api-keys/cache.d.ts +255 -0
- package/dist/security/api-keys/cache.d.ts.map +1 -0
- package/dist/security/api-keys/cache.js +595 -0
- package/dist/security/api-keys/cache.js.map +1 -0
- package/dist/security/api-keys/db-store.d.ts +150 -0
- package/dist/security/api-keys/db-store.d.ts.map +1 -0
- package/dist/security/api-keys/db-store.js +694 -0
- package/dist/security/api-keys/db-store.js.map +1 -0
- package/dist/security/api-keys/index.d.ts +29 -0
- package/dist/security/api-keys/index.d.ts.map +1 -0
- package/dist/security/api-keys/index.js +81 -0
- package/dist/security/api-keys/index.js.map +1 -0
- package/dist/security/api-keys/middleware.d.ts +164 -0
- package/dist/security/api-keys/middleware.d.ts.map +1 -0
- package/dist/security/api-keys/middleware.js +392 -0
- package/dist/security/api-keys/middleware.js.map +1 -0
- package/dist/security/api-keys/service.d.ts +226 -0
- package/dist/security/api-keys/service.d.ts.map +1 -0
- package/dist/security/api-keys/service.js +861 -0
- package/dist/security/api-keys/service.js.map +1 -0
- package/dist/security/api-keys/store.d.ts +241 -0
- package/dist/security/api-keys/store.d.ts.map +1 -0
- package/dist/security/api-keys/store.js +360 -0
- package/dist/security/api-keys/store.js.map +1 -0
- package/dist/security/api-keys/types.d.ts +718 -0
- package/dist/security/api-keys/types.d.ts.map +1 -0
- package/dist/security/api-keys/types.js +162 -0
- package/dist/security/api-keys/types.js.map +1 -0
- package/dist/security/brute-force.d.ts +390 -0
- package/dist/security/brute-force.d.ts.map +1 -0
- package/dist/security/brute-force.js +677 -0
- package/dist/security/brute-force.js.map +1 -0
- package/dist/security/config-validator.d.ts +152 -0
- package/dist/security/config-validator.d.ts.map +1 -0
- package/dist/security/config-validator.js +667 -0
- package/dist/security/config-validator.js.map +1 -0
- package/dist/security/crypto/fips-mode.d.ts +726 -0
- package/dist/security/crypto/fips-mode.d.ts.map +1 -0
- package/dist/security/crypto/fips-mode.js +1297 -0
- package/dist/security/crypto/fips-mode.js.map +1 -0
- package/dist/security/crypto/index.d.ts +203 -0
- package/dist/security/crypto/index.d.ts.map +1 -0
- package/dist/security/crypto/index.js +293 -0
- package/dist/security/crypto/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts +125 -0
- package/dist/security/crypto/post-quantum/benchmark.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/benchmark.js +530 -0
- package/dist/security/crypto/post-quantum/benchmark.js.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts +146 -0
- package/dist/security/crypto/post-quantum/dilithium.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/dilithium.js +662 -0
- package/dist/security/crypto/post-quantum/dilithium.js.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts +267 -0
- package/dist/security/crypto/post-quantum/hybrid.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/hybrid.js +457 -0
- package/dist/security/crypto/post-quantum/hybrid.js.map +1 -0
- package/dist/security/crypto/post-quantum/index.d.ts +166 -0
- package/dist/security/crypto/post-quantum/index.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/index.js +236 -0
- package/dist/security/crypto/post-quantum/index.js.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts +131 -0
- package/dist/security/crypto/post-quantum/kyber.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/kyber.js +640 -0
- package/dist/security/crypto/post-quantum/kyber.js.map +1 -0
- package/dist/security/crypto/post-quantum/migration.d.ts +230 -0
- package/dist/security/crypto/post-quantum/migration.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/migration.js +563 -0
- package/dist/security/crypto/post-quantum/migration.js.map +1 -0
- package/dist/security/crypto/post-quantum/types.d.ts +1056 -0
- package/dist/security/crypto/post-quantum/types.d.ts.map +1 -0
- package/dist/security/crypto/post-quantum/types.js +350 -0
- package/dist/security/crypto/post-quantum/types.js.map +1 -0
- package/dist/security/crypto/shamir/comparison.d.ts +128 -0
- package/dist/security/crypto/shamir/comparison.d.ts.map +1 -0
- package/dist/security/crypto/shamir/comparison.js +423 -0
- package/dist/security/crypto/shamir/comparison.js.map +1 -0
- package/dist/security/crypto/shamir/index.d.ts +76 -0
- package/dist/security/crypto/shamir/index.d.ts.map +1 -0
- package/dist/security/crypto/shamir/index.js +155 -0
- package/dist/security/crypto/shamir/index.js.map +1 -0
- package/dist/security/crypto/shamir/proofs.d.ts +259 -0
- package/dist/security/crypto/shamir/proofs.d.ts.map +1 -0
- package/dist/security/crypto/shamir/proofs.js +605 -0
- package/dist/security/crypto/shamir/proofs.js.map +1 -0
- package/dist/security/crypto/shamir/property-tests.d.ts +104 -0
- package/dist/security/crypto/shamir/property-tests.d.ts.map +1 -0
- package/dist/security/crypto/shamir/property-tests.js +480 -0
- package/dist/security/crypto/shamir/property-tests.js.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts +97 -0
- package/dist/security/crypto/shamir/security-analysis.d.ts.map +1 -0
- package/dist/security/crypto/shamir/security-analysis.js +503 -0
- package/dist/security/crypto/shamir/security-analysis.js.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts +116 -0
- package/dist/security/crypto/shamir/test-vectors.d.ts.map +1 -0
- package/dist/security/crypto/shamir/test-vectors.js +377 -0
- package/dist/security/crypto/shamir/test-vectors.js.map +1 -0
- package/dist/security/crypto/shamir/types.d.ts +281 -0
- package/dist/security/crypto/shamir/types.d.ts.map +1 -0
- package/dist/security/crypto/shamir/types.js +82 -0
- package/dist/security/crypto/shamir/types.js.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts +170 -0
- package/dist/security/crypto/shamir/verified-shamir.d.ts.map +1 -0
- package/dist/security/crypto/shamir/verified-shamir.js +624 -0
- package/dist/security/crypto/shamir/verified-shamir.js.map +1 -0
- package/dist/security/csrf.d.ts +215 -0
- package/dist/security/csrf.d.ts.map +1 -0
- package/dist/security/csrf.js +467 -0
- package/dist/security/csrf.js.map +1 -0
- package/dist/security/distributed-state.d.ts +331 -0
- package/dist/security/distributed-state.d.ts.map +1 -0
- package/dist/security/distributed-state.js +768 -0
- package/dist/security/distributed-state.js.map +1 -0
- package/dist/security/dlp/index.d.ts +27 -0
- package/dist/security/dlp/index.d.ts.map +1 -0
- package/dist/security/dlp/index.js +54 -0
- package/dist/security/dlp/index.js.map +1 -0
- package/dist/security/dlp/scanner.d.ts +451 -0
- package/dist/security/dlp/scanner.d.ts.map +1 -0
- package/dist/security/dlp/scanner.js +1241 -0
- package/dist/security/dlp/scanner.js.map +1 -0
- package/dist/security/dpop.d.ts +260 -0
- package/dist/security/dpop.d.ts.map +1 -0
- package/dist/security/dpop.js +1058 -0
- package/dist/security/dpop.js.map +1 -0
- package/dist/security/encryption/decorators.d.ts +263 -0
- package/dist/security/encryption/decorators.d.ts.map +1 -0
- package/dist/security/encryption/decorators.js +359 -0
- package/dist/security/encryption/decorators.js.map +1 -0
- package/dist/security/encryption/index.d.ts +83 -0
- package/dist/security/encryption/index.d.ts.map +1 -0
- package/dist/security/encryption/index.js +140 -0
- package/dist/security/encryption/index.js.map +1 -0
- package/dist/security/encryption/key-provider.d.ts +335 -0
- package/dist/security/encryption/key-provider.d.ts.map +1 -0
- package/dist/security/encryption/key-provider.js +853 -0
- package/dist/security/encryption/key-provider.js.map +1 -0
- package/dist/security/encryption/middleware.d.ts +279 -0
- package/dist/security/encryption/middleware.d.ts.map +1 -0
- package/dist/security/encryption/middleware.js +493 -0
- package/dist/security/encryption/middleware.js.map +1 -0
- package/dist/security/encryption/service.d.ts +164 -0
- package/dist/security/encryption/service.d.ts.map +1 -0
- package/dist/security/encryption/service.js +623 -0
- package/dist/security/encryption/service.js.map +1 -0
- package/dist/security/encryption/types.d.ts +745 -0
- package/dist/security/encryption/types.d.ts.map +1 -0
- package/dist/security/encryption/types.js +229 -0
- package/dist/security/encryption/types.js.map +1 -0
- package/dist/security/error-sanitizer.d.ts +329 -0
- package/dist/security/error-sanitizer.d.ts.map +1 -0
- package/dist/security/error-sanitizer.js +700 -0
- package/dist/security/error-sanitizer.js.map +1 -0
- package/dist/security/fingerprint-service.d.ts +139 -0
- package/dist/security/fingerprint-service.d.ts.map +1 -0
- package/dist/security/fingerprint-service.js +240 -0
- package/dist/security/fingerprint-service.js.map +1 -0
- package/dist/security/headers/csp.d.ts +270 -0
- package/dist/security/headers/csp.d.ts.map +1 -0
- package/dist/security/headers/csp.js +655 -0
- package/dist/security/headers/csp.js.map +1 -0
- package/dist/security/headers/hsts.d.ts +161 -0
- package/dist/security/headers/hsts.d.ts.map +1 -0
- package/dist/security/headers/hsts.js +346 -0
- package/dist/security/headers/hsts.js.map +1 -0
- package/dist/security/headers/index.d.ts +47 -0
- package/dist/security/headers/index.d.ts.map +1 -0
- package/dist/security/headers/index.js +110 -0
- package/dist/security/headers/index.js.map +1 -0
- package/dist/security/headers/middleware.d.ts +70 -0
- package/dist/security/headers/middleware.d.ts.map +1 -0
- package/dist/security/headers/middleware.js +549 -0
- package/dist/security/headers/middleware.js.map +1 -0
- package/dist/security/headers/permissions-policy.d.ts +189 -0
- package/dist/security/headers/permissions-policy.d.ts.map +1 -0
- package/dist/security/headers/permissions-policy.js +508 -0
- package/dist/security/headers/permissions-policy.js.map +1 -0
- package/dist/security/headers/types.d.ts +1570 -0
- package/dist/security/headers/types.d.ts.map +1 -0
- package/dist/security/headers/types.js +281 -0
- package/dist/security/headers/types.js.map +1 -0
- package/dist/security/headers/validator.d.ts +36 -0
- package/dist/security/headers/validator.d.ts.map +1 -0
- package/dist/security/headers/validator.js +616 -0
- package/dist/security/headers/validator.js.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts +157 -0
- package/dist/security/hsm/aws-cloudhsm.d.ts.map +1 -0
- package/dist/security/hsm/aws-cloudhsm.js +712 -0
- package/dist/security/hsm/aws-cloudhsm.js.map +1 -0
- package/dist/security/hsm/azure-hsm.d.ts +174 -0
- package/dist/security/hsm/azure-hsm.d.ts.map +1 -0
- package/dist/security/hsm/azure-hsm.js +792 -0
- package/dist/security/hsm/azure-hsm.js.map +1 -0
- package/dist/security/hsm/gcp-hsm.d.ts +184 -0
- package/dist/security/hsm/gcp-hsm.d.ts.map +1 -0
- package/dist/security/hsm/gcp-hsm.js +817 -0
- package/dist/security/hsm/gcp-hsm.js.map +1 -0
- package/dist/security/hsm/hsm-service.d.ts +264 -0
- package/dist/security/hsm/hsm-service.d.ts.map +1 -0
- package/dist/security/hsm/hsm-service.js +772 -0
- package/dist/security/hsm/hsm-service.js.map +1 -0
- package/dist/security/hsm/index.d.ts +248 -0
- package/dist/security/hsm/index.d.ts.map +1 -0
- package/dist/security/hsm/index.js +329 -0
- package/dist/security/hsm/index.js.map +1 -0
- package/dist/security/hsm/key-ceremony.d.ts +214 -0
- package/dist/security/hsm/key-ceremony.d.ts.map +1 -0
- package/dist/security/hsm/key-ceremony.js +636 -0
- package/dist/security/hsm/key-ceremony.js.map +1 -0
- package/dist/security/hsm/key-operations.d.ts +218 -0
- package/dist/security/hsm/key-operations.d.ts.map +1 -0
- package/dist/security/hsm/key-operations.js +625 -0
- package/dist/security/hsm/key-operations.js.map +1 -0
- package/dist/security/hsm/local-softHSM.d.ts +122 -0
- package/dist/security/hsm/local-softHSM.d.ts.map +1 -0
- package/dist/security/hsm/local-softHSM.js +786 -0
- package/dist/security/hsm/local-softHSM.js.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts +386 -0
- package/dist/security/hsm/pkcs11-wrapper.d.ts.map +1 -0
- package/dist/security/hsm/pkcs11-wrapper.js +1149 -0
- package/dist/security/hsm/pkcs11-wrapper.js.map +1 -0
- package/dist/security/hsm/provider.d.ts +333 -0
- package/dist/security/hsm/provider.d.ts.map +1 -0
- package/dist/security/hsm/provider.js +264 -0
- package/dist/security/hsm/provider.js.map +1 -0
- package/dist/security/hsm/thales-luna.d.ts +209 -0
- package/dist/security/hsm/thales-luna.d.ts.map +1 -0
- package/dist/security/hsm/thales-luna.js +820 -0
- package/dist/security/hsm/thales-luna.js.map +1 -0
- package/dist/security/incident/actions/block-ip.d.ts +82 -0
- package/dist/security/incident/actions/block-ip.d.ts.map +1 -0
- package/dist/security/incident/actions/block-ip.js +454 -0
- package/dist/security/incident/actions/block-ip.js.map +1 -0
- package/dist/security/incident/actions/collect-evidence.d.ts +93 -0
- package/dist/security/incident/actions/collect-evidence.d.ts.map +1 -0
- package/dist/security/incident/actions/collect-evidence.js +449 -0
- package/dist/security/incident/actions/collect-evidence.js.map +1 -0
- package/dist/security/incident/actions/index.d.ts +39 -0
- package/dist/security/incident/actions/index.d.ts.map +1 -0
- package/dist/security/incident/actions/index.js +52 -0
- package/dist/security/incident/actions/index.js.map +1 -0
- package/dist/security/incident/actions/isolate-system.d.ts +61 -0
- package/dist/security/incident/actions/isolate-system.d.ts.map +1 -0
- package/dist/security/incident/actions/isolate-system.js +369 -0
- package/dist/security/incident/actions/isolate-system.js.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts +70 -0
- package/dist/security/incident/actions/notify-stakeholders.d.ts.map +1 -0
- package/dist/security/incident/actions/notify-stakeholders.js +377 -0
- package/dist/security/incident/actions/notify-stakeholders.js.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts +75 -0
- package/dist/security/incident/actions/revoke-credentials.d.ts.map +1 -0
- package/dist/security/incident/actions/revoke-credentials.js +320 -0
- package/dist/security/incident/actions/revoke-credentials.js.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts +88 -0
- package/dist/security/incident/actions/scale-monitoring.d.ts.map +1 -0
- package/dist/security/incident/actions/scale-monitoring.js +473 -0
- package/dist/security/incident/actions/scale-monitoring.js.map +1 -0
- package/dist/security/incident/executor.d.ts +128 -0
- package/dist/security/incident/executor.d.ts.map +1 -0
- package/dist/security/incident/executor.js +695 -0
- package/dist/security/incident/executor.js.map +1 -0
- package/dist/security/incident/index.d.ts +220 -0
- package/dist/security/incident/index.d.ts.map +1 -0
- package/dist/security/incident/index.js +1284 -0
- package/dist/security/incident/index.js.map +1 -0
- package/dist/security/incident/notification.d.ts +68 -0
- package/dist/security/incident/notification.d.ts.map +1 -0
- package/dist/security/incident/notification.js +512 -0
- package/dist/security/incident/notification.js.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts +13 -0
- package/dist/security/incident/playbooks/account-compromise.d.ts.map +1 -0
- package/dist/security/incident/playbooks/account-compromise.js +379 -0
- package/dist/security/incident/playbooks/account-compromise.js.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts +17 -0
- package/dist/security/incident/playbooks/configuration-error.d.ts.map +1 -0
- package/dist/security/incident/playbooks/configuration-error.js +340 -0
- package/dist/security/incident/playbooks/configuration-error.js.map +1 -0
- package/dist/security/incident/playbooks/data-breach.d.ts +13 -0
- package/dist/security/incident/playbooks/data-breach.d.ts.map +1 -0
- package/dist/security/incident/playbooks/data-breach.js +394 -0
- package/dist/security/incident/playbooks/data-breach.js.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts +13 -0
- package/dist/security/incident/playbooks/denial-of-service.d.ts.map +1 -0
- package/dist/security/incident/playbooks/denial-of-service.js +540 -0
- package/dist/security/incident/playbooks/denial-of-service.js.map +1 -0
- package/dist/security/incident/playbooks/index.d.ts +36 -0
- package/dist/security/incident/playbooks/index.d.ts.map +1 -0
- package/dist/security/incident/playbooks/index.js +56 -0
- package/dist/security/incident/playbooks/index.js.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts +18 -0
- package/dist/security/incident/playbooks/insider-threat.d.ts.map +1 -0
- package/dist/security/incident/playbooks/insider-threat.js +600 -0
- package/dist/security/incident/playbooks/insider-threat.js.map +1 -0
- package/dist/security/incident/playbooks/malware.d.ts +13 -0
- package/dist/security/incident/playbooks/malware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/malware.js +515 -0
- package/dist/security/incident/playbooks/malware.js.map +1 -0
- package/dist/security/incident/playbooks/ransomware.d.ts +14 -0
- package/dist/security/incident/playbooks/ransomware.d.ts.map +1 -0
- package/dist/security/incident/playbooks/ransomware.js +693 -0
- package/dist/security/incident/playbooks/ransomware.js.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts +13 -0
- package/dist/security/incident/playbooks/unauthorized-access.d.ts.map +1 -0
- package/dist/security/incident/playbooks/unauthorized-access.js +412 -0
- package/dist/security/incident/playbooks/unauthorized-access.js.map +1 -0
- package/dist/security/incident/triggers.d.ts +120 -0
- package/dist/security/incident/triggers.d.ts.map +1 -0
- package/dist/security/incident/triggers.js +708 -0
- package/dist/security/incident/triggers.js.map +1 -0
- package/dist/security/incident/types.d.ts +1517 -0
- package/dist/security/incident/types.d.ts.map +1 -0
- package/dist/security/incident/types.js +222 -0
- package/dist/security/incident/types.js.map +1 -0
- package/dist/security/index.d.ts +59 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +295 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/injection-detector.d.ts +510 -0
- package/dist/security/injection-detector.d.ts.map +1 -0
- package/dist/security/injection-detector.js +1325 -0
- package/dist/security/injection-detector.js.map +1 -0
- package/dist/security/introspection.d.ts +137 -0
- package/dist/security/introspection.d.ts.map +1 -0
- package/dist/security/introspection.js +451 -0
- package/dist/security/introspection.js.map +1 -0
- package/dist/security/key-rotation.d.ts +213 -0
- package/dist/security/key-rotation.d.ts.map +1 -0
- package/dist/security/key-rotation.js +530 -0
- package/dist/security/key-rotation.js.map +1 -0
- package/dist/security/kms/aws-kms.d.ts +152 -0
- package/dist/security/kms/aws-kms.d.ts.map +1 -0
- package/dist/security/kms/aws-kms.js +808 -0
- package/dist/security/kms/aws-kms.js.map +1 -0
- package/dist/security/kms/index.d.ts +165 -0
- package/dist/security/kms/index.d.ts.map +1 -0
- package/dist/security/kms/index.js +351 -0
- package/dist/security/kms/index.js.map +1 -0
- package/dist/security/kms/local.d.ts +127 -0
- package/dist/security/kms/local.d.ts.map +1 -0
- package/dist/security/kms/local.js +682 -0
- package/dist/security/kms/local.js.map +1 -0
- package/dist/security/kms/types.d.ts +1000 -0
- package/dist/security/kms/types.d.ts.map +1 -0
- package/dist/security/kms/types.js +167 -0
- package/dist/security/kms/types.js.map +1 -0
- package/dist/security/kms/vault.d.ts +165 -0
- package/dist/security/kms/vault.d.ts.map +1 -0
- package/dist/security/kms/vault.js +820 -0
- package/dist/security/kms/vault.js.map +1 -0
- package/dist/security/mfa/index.d.ts +17 -0
- package/dist/security/mfa/index.d.ts.map +1 -0
- package/dist/security/mfa/index.js +37 -0
- package/dist/security/mfa/index.js.map +1 -0
- package/dist/security/mfa/mfa-middleware.d.ts +74 -0
- package/dist/security/mfa/mfa-middleware.d.ts.map +1 -0
- package/dist/security/mfa/mfa-middleware.js +244 -0
- package/dist/security/mfa/mfa-middleware.js.map +1 -0
- package/dist/security/mfa/mfa-service.d.ts +115 -0
- package/dist/security/mfa/mfa-service.d.ts.map +1 -0
- package/dist/security/mfa/mfa-service.js +509 -0
- package/dist/security/mfa/mfa-service.js.map +1 -0
- package/dist/security/mfa/mfa-store.d.ts +615 -0
- package/dist/security/mfa/mfa-store.d.ts.map +1 -0
- package/dist/security/mfa/mfa-store.js +431 -0
- package/dist/security/mfa/mfa-store.js.map +1 -0
- package/dist/security/mfa/types.d.ts +417 -0
- package/dist/security/mfa/types.d.ts.map +1 -0
- package/dist/security/mfa/types.js +123 -0
- package/dist/security/mfa/types.js.map +1 -0
- package/dist/security/middleware.d.ts +179 -0
- package/dist/security/middleware.d.ts.map +1 -0
- package/dist/security/middleware.js +534 -0
- package/dist/security/middleware.js.map +1 -0
- package/dist/security/pairwise-did.d.ts +157 -0
- package/dist/security/pairwise-did.d.ts.map +1 -0
- package/dist/security/pairwise-did.js +450 -0
- package/dist/security/pairwise-did.js.map +1 -0
- package/dist/security/pam/break-glass.d.ts +776 -0
- package/dist/security/pam/break-glass.d.ts.map +1 -0
- package/dist/security/pam/break-glass.js +1137 -0
- package/dist/security/pam/break-glass.js.map +1 -0
- package/dist/security/pam/index.d.ts +120 -0
- package/dist/security/pam/index.d.ts.map +1 -0
- package/dist/security/pam/index.js +179 -0
- package/dist/security/pam/index.js.map +1 -0
- package/dist/security/pam/jit-access.d.ts +482 -0
- package/dist/security/pam/jit-access.d.ts.map +1 -0
- package/dist/security/pam/jit-access.js +1030 -0
- package/dist/security/pam/jit-access.js.map +1 -0
- package/dist/security/pam/session-recording.d.ts +1007 -0
- package/dist/security/pam/session-recording.d.ts.map +1 -0
- package/dist/security/pam/session-recording.js +1047 -0
- package/dist/security/pam/session-recording.js.map +1 -0
- package/dist/security/password-hashing.d.ts +199 -0
- package/dist/security/password-hashing.d.ts.map +1 -0
- package/dist/security/password-hashing.js +366 -0
- package/dist/security/password-hashing.js.map +1 -0
- package/dist/security/password-policy.d.ts +304 -0
- package/dist/security/password-policy.d.ts.map +1 -0
- package/dist/security/password-policy.js +730 -0
- package/dist/security/password-policy.js.map +1 -0
- package/dist/security/pkce.d.ts +269 -0
- package/dist/security/pkce.d.ts.map +1 -0
- package/dist/security/pkce.js +408 -0
- package/dist/security/pkce.js.map +1 -0
- package/dist/security/policy-engine/built-in-policies.d.ts +90 -0
- package/dist/security/policy-engine/built-in-policies.d.ts.map +1 -0
- package/dist/security/policy-engine/built-in-policies.js +627 -0
- package/dist/security/policy-engine/built-in-policies.js.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts +129 -0
- package/dist/security/policy-engine/condition-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/condition-evaluator.js +647 -0
- package/dist/security/policy-engine/condition-evaluator.js.map +1 -0
- package/dist/security/policy-engine/engine.d.ts +200 -0
- package/dist/security/policy-engine/engine.d.ts.map +1 -0
- package/dist/security/policy-engine/engine.js +752 -0
- package/dist/security/policy-engine/engine.js.map +1 -0
- package/dist/security/policy-engine/index.d.ts +58 -0
- package/dist/security/policy-engine/index.d.ts.map +1 -0
- package/dist/security/policy-engine/index.js +80 -0
- package/dist/security/policy-engine/index.js.map +1 -0
- package/dist/security/policy-engine/middleware.d.ts +77 -0
- package/dist/security/policy-engine/middleware.d.ts.map +1 -0
- package/dist/security/policy-engine/middleware.js +375 -0
- package/dist/security/policy-engine/middleware.js.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts +140 -0
- package/dist/security/policy-engine/rule-evaluator.d.ts.map +1 -0
- package/dist/security/policy-engine/rule-evaluator.js +593 -0
- package/dist/security/policy-engine/rule-evaluator.js.map +1 -0
- package/dist/security/policy-engine/types.d.ts +2855 -0
- package/dist/security/policy-engine/types.d.ts.map +1 -0
- package/dist/security/policy-engine/types.js +443 -0
- package/dist/security/policy-engine/types.js.map +1 -0
- package/dist/security/rbac/index.d.ts +317 -0
- package/dist/security/rbac/index.d.ts.map +1 -0
- package/dist/security/rbac/index.js +618 -0
- package/dist/security/rbac/index.js.map +1 -0
- package/dist/security/rbac/permissions.d.ts +305 -0
- package/dist/security/rbac/permissions.d.ts.map +1 -0
- package/dist/security/rbac/permissions.js +947 -0
- package/dist/security/rbac/permissions.js.map +1 -0
- package/dist/security/rbac/policy-engine.d.ts +542 -0
- package/dist/security/rbac/policy-engine.d.ts.map +1 -0
- package/dist/security/rbac/policy-engine.js +1244 -0
- package/dist/security/rbac/policy-engine.js.map +1 -0
- package/dist/security/rbac/roles.d.ts +478 -0
- package/dist/security/rbac/roles.d.ts.map +1 -0
- package/dist/security/rbac/roles.js +363 -0
- package/dist/security/rbac/roles.js.map +1 -0
- package/dist/security/refresh-token.d.ts +305 -0
- package/dist/security/refresh-token.d.ts.map +1 -0
- package/dist/security/refresh-token.js +674 -0
- package/dist/security/refresh-token.js.map +1 -0
- package/dist/security/request-integrity.d.ts +289 -0
- package/dist/security/request-integrity.d.ts.map +1 -0
- package/dist/security/request-integrity.js +663 -0
- package/dist/security/request-integrity.js.map +1 -0
- package/dist/security/revocation-check.d.ts +188 -0
- package/dist/security/revocation-check.d.ts.map +1 -0
- package/dist/security/revocation-check.js +606 -0
- package/dist/security/revocation-check.js.map +1 -0
- package/dist/security/revocation.d.ts +191 -0
- package/dist/security/revocation.d.ts.map +1 -0
- package/dist/security/revocation.js +522 -0
- package/dist/security/revocation.js.map +1 -0
- package/dist/security/secrets-rotation.d.ts +501 -0
- package/dist/security/secrets-rotation.d.ts.map +1 -0
- package/dist/security/secrets-rotation.js +934 -0
- package/dist/security/secrets-rotation.js.map +1 -0
- package/dist/security/secure-memory.d.ts +325 -0
- package/dist/security/secure-memory.d.ts.map +1 -0
- package/dist/security/secure-memory.js +595 -0
- package/dist/security/secure-memory.js.map +1 -0
- package/dist/security/security-service.d.ts +186 -0
- package/dist/security/security-service.d.ts.map +1 -0
- package/dist/security/security-service.js +531 -0
- package/dist/security/security-service.js.map +1 -0
- package/dist/security/service-auth/index.d.ts +20 -0
- package/dist/security/service-auth/index.d.ts.map +1 -0
- package/dist/security/service-auth/index.js +61 -0
- package/dist/security/service-auth/index.js.map +1 -0
- package/dist/security/service-auth/service-account.d.ts +357 -0
- package/dist/security/service-auth/service-account.d.ts.map +1 -0
- package/dist/security/service-auth/service-account.js +475 -0
- package/dist/security/service-auth/service-account.js.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts +174 -0
- package/dist/security/service-auth/service-auth-middleware.d.ts.map +1 -0
- package/dist/security/service-auth/service-auth-middleware.js +461 -0
- package/dist/security/service-auth/service-auth-middleware.js.map +1 -0
- package/dist/security/service-auth/service-token.d.ts +391 -0
- package/dist/security/service-auth/service-token.d.ts.map +1 -0
- package/dist/security/service-auth/service-token.js +472 -0
- package/dist/security/service-auth/service-token.js.map +1 -0
- package/dist/security/session-manager.d.ts +177 -0
- package/dist/security/session-manager.d.ts.map +1 -0
- package/dist/security/session-manager.js +353 -0
- package/dist/security/session-manager.js.map +1 -0
- package/dist/security/session-store.d.ts +205 -0
- package/dist/security/session-store.d.ts.map +1 -0
- package/dist/security/session-store.js +581 -0
- package/dist/security/session-store.js.map +1 -0
- package/dist/security/siem/connector.d.ts +147 -0
- package/dist/security/siem/connector.d.ts.map +1 -0
- package/dist/security/siem/connector.js +254 -0
- package/dist/security/siem/connector.js.map +1 -0
- package/dist/security/siem/datadog.d.ts +81 -0
- package/dist/security/siem/datadog.d.ts.map +1 -0
- package/dist/security/siem/datadog.js +362 -0
- package/dist/security/siem/datadog.js.map +1 -0
- package/dist/security/siem/elastic.d.ts +83 -0
- package/dist/security/siem/elastic.d.ts.map +1 -0
- package/dist/security/siem/elastic.js +514 -0
- package/dist/security/siem/elastic.js.map +1 -0
- package/dist/security/siem/enrichment.d.ts +133 -0
- package/dist/security/siem/enrichment.d.ts.map +1 -0
- package/dist/security/siem/enrichment.js +434 -0
- package/dist/security/siem/enrichment.js.map +1 -0
- package/dist/security/siem/formatter.d.ts +118 -0
- package/dist/security/siem/formatter.d.ts.map +1 -0
- package/dist/security/siem/formatter.js +381 -0
- package/dist/security/siem/formatter.js.map +1 -0
- package/dist/security/siem/hooks.d.ts +107 -0
- package/dist/security/siem/hooks.d.ts.map +1 -0
- package/dist/security/siem/hooks.js +459 -0
- package/dist/security/siem/hooks.js.map +1 -0
- package/dist/security/siem/index.d.ts +83 -0
- package/dist/security/siem/index.d.ts.map +1 -0
- package/dist/security/siem/index.js +95 -0
- package/dist/security/siem/index.js.map +1 -0
- package/dist/security/siem/service.d.ts +153 -0
- package/dist/security/siem/service.d.ts.map +1 -0
- package/dist/security/siem/service.js +615 -0
- package/dist/security/siem/service.js.map +1 -0
- package/dist/security/siem/splunk.d.ts +76 -0
- package/dist/security/siem/splunk.d.ts.map +1 -0
- package/dist/security/siem/splunk.js +283 -0
- package/dist/security/siem/splunk.js.map +1 -0
- package/dist/security/siem/types.d.ts +1980 -0
- package/dist/security/siem/types.d.ts.map +1 -0
- package/dist/security/siem/types.js +268 -0
- package/dist/security/siem/types.js.map +1 -0
- package/dist/security/tee-production.d.ts +157 -0
- package/dist/security/tee-production.d.ts.map +1 -0
- package/dist/security/tee-production.js +792 -0
- package/dist/security/tee-production.js.map +1 -0
- package/dist/security/tee.d.ts +182 -0
- package/dist/security/tee.d.ts.map +1 -0
- package/dist/security/tee.js +1031 -0
- package/dist/security/tee.js.map +1 -0
- package/dist/security/threat-intel/bot-detection.d.ts +275 -0
- package/dist/security/threat-intel/bot-detection.d.ts.map +1 -0
- package/dist/security/threat-intel/bot-detection.js +890 -0
- package/dist/security/threat-intel/bot-detection.js.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts +368 -0
- package/dist/security/threat-intel/credential-stuffing.d.ts.map +1 -0
- package/dist/security/threat-intel/credential-stuffing.js +957 -0
- package/dist/security/threat-intel/credential-stuffing.js.map +1 -0
- package/dist/security/threat-intel/index.d.ts +10 -0
- package/dist/security/threat-intel/index.d.ts.map +1 -0
- package/dist/security/threat-intel/index.js +18 -0
- package/dist/security/threat-intel/index.js.map +1 -0
- package/dist/security/threat-intel/ip-reputation.d.ts +323 -0
- package/dist/security/threat-intel/ip-reputation.d.ts.map +1 -0
- package/dist/security/threat-intel/ip-reputation.js +923 -0
- package/dist/security/threat-intel/ip-reputation.js.map +1 -0
- package/dist/security/token-lifecycle.d.ts +272 -0
- package/dist/security/token-lifecycle.d.ts.map +1 -0
- package/dist/security/token-lifecycle.js +732 -0
- package/dist/security/token-lifecycle.js.map +1 -0
- package/dist/security/token-lifetime.d.ts +206 -0
- package/dist/security/token-lifetime.d.ts.map +1 -0
- package/dist/security/token-lifetime.js +388 -0
- package/dist/security/token-lifetime.js.map +1 -0
- package/dist/security/trust-oracle/alerts.d.ts +202 -0
- package/dist/security/trust-oracle/alerts.d.ts.map +1 -0
- package/dist/security/trust-oracle/alerts.js +763 -0
- package/dist/security/trust-oracle/alerts.js.map +1 -0
- package/dist/security/trust-oracle/api.d.ts +116 -0
- package/dist/security/trust-oracle/api.d.ts.map +1 -0
- package/dist/security/trust-oracle/api.js +721 -0
- package/dist/security/trust-oracle/api.js.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts +105 -0
- package/dist/security/trust-oracle/continuous-monitoring.d.ts.map +1 -0
- package/dist/security/trust-oracle/continuous-monitoring.js +696 -0
- package/dist/security/trust-oracle/continuous-monitoring.js.map +1 -0
- package/dist/security/trust-oracle/data-sources.d.ts +126 -0
- package/dist/security/trust-oracle/data-sources.d.ts.map +1 -0
- package/dist/security/trust-oracle/data-sources.js +867 -0
- package/dist/security/trust-oracle/data-sources.js.map +1 -0
- package/dist/security/trust-oracle/index.d.ts +79 -0
- package/dist/security/trust-oracle/index.d.ts.map +1 -0
- package/dist/security/trust-oracle/index.js +206 -0
- package/dist/security/trust-oracle/index.js.map +1 -0
- package/dist/security/trust-oracle/oracle.d.ts +125 -0
- package/dist/security/trust-oracle/oracle.d.ts.map +1 -0
- package/dist/security/trust-oracle/oracle.js +489 -0
- package/dist/security/trust-oracle/oracle.js.map +1 -0
- package/dist/security/trust-oracle/reporting.d.ts +145 -0
- package/dist/security/trust-oracle/reporting.d.ts.map +1 -0
- package/dist/security/trust-oracle/reporting.js +1098 -0
- package/dist/security/trust-oracle/reporting.js.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts +207 -0
- package/dist/security/trust-oracle/risk-scorer.d.ts.map +1 -0
- package/dist/security/trust-oracle/risk-scorer.js +1033 -0
- package/dist/security/trust-oracle/risk-scorer.js.map +1 -0
- package/dist/security/trust-oracle/types.d.ts +444 -0
- package/dist/security/trust-oracle/types.d.ts.map +1 -0
- package/dist/security/trust-oracle/types.js +6 -0
- package/dist/security/trust-oracle/types.js.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts +228 -0
- package/dist/security/trust-oracle/vendor-registry.d.ts.map +1 -0
- package/dist/security/trust-oracle/vendor-registry.js +727 -0
- package/dist/security/trust-oracle/vendor-registry.js.map +1 -0
- package/dist/security/types.d.ts +1777 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +388 -0
- package/dist/security/types.js.map +1 -0
- package/dist/security/webauthn/index.d.ts +47 -0
- package/dist/security/webauthn/index.d.ts.map +1 -0
- package/dist/security/webauthn/index.js +48 -0
- package/dist/security/webauthn/index.js.map +1 -0
- package/dist/security/webauthn/middleware.d.ts +109 -0
- package/dist/security/webauthn/middleware.d.ts.map +1 -0
- package/dist/security/webauthn/middleware.js +629 -0
- package/dist/security/webauthn/middleware.js.map +1 -0
- package/dist/security/webauthn/service.d.ts +179 -0
- package/dist/security/webauthn/service.d.ts.map +1 -0
- package/dist/security/webauthn/service.js +758 -0
- package/dist/security/webauthn/service.js.map +1 -0
- package/dist/security/webauthn/store.d.ts +240 -0
- package/dist/security/webauthn/store.d.ts.map +1 -0
- package/dist/security/webauthn/store.js +505 -0
- package/dist/security/webauthn/store.js.map +1 -0
- package/dist/security/webauthn/types.d.ts +678 -0
- package/dist/security/webauthn/types.d.ts.map +1 -0
- package/dist/security/webauthn/types.js +176 -0
- package/dist/security/webauthn/types.js.map +1 -0
- package/dist/security/zkp/circuits.d.ts +296 -0
- package/dist/security/zkp/circuits.d.ts.map +1 -0
- package/dist/security/zkp/circuits.js +771 -0
- package/dist/security/zkp/circuits.js.map +1 -0
- package/dist/security/zkp/commitment.d.ts +319 -0
- package/dist/security/zkp/commitment.d.ts.map +1 -0
- package/dist/security/zkp/commitment.js +591 -0
- package/dist/security/zkp/commitment.js.map +1 -0
- package/dist/security/zkp/compliance.d.ts +251 -0
- package/dist/security/zkp/compliance.d.ts.map +1 -0
- package/dist/security/zkp/compliance.js +734 -0
- package/dist/security/zkp/compliance.js.map +1 -0
- package/dist/security/zkp/index.d.ts +184 -0
- package/dist/security/zkp/index.d.ts.map +1 -0
- package/dist/security/zkp/index.js +285 -0
- package/dist/security/zkp/index.js.map +1 -0
- package/dist/security/zkp/integration.d.ts +289 -0
- package/dist/security/zkp/integration.d.ts.map +1 -0
- package/dist/security/zkp/integration.js +571 -0
- package/dist/security/zkp/integration.js.map +1 -0
- package/dist/security/zkp/prover.d.ts +158 -0
- package/dist/security/zkp/prover.d.ts.map +1 -0
- package/dist/security/zkp/prover.js +465 -0
- package/dist/security/zkp/prover.js.map +1 -0
- package/dist/security/zkp/snark-utils.d.ts +321 -0
- package/dist/security/zkp/snark-utils.d.ts.map +1 -0
- package/dist/security/zkp/snark-utils.js +640 -0
- package/dist/security/zkp/snark-utils.js.map +1 -0
- package/dist/security/zkp/types.d.ts +1192 -0
- package/dist/security/zkp/types.d.ts.map +1 -0
- package/dist/security/zkp/types.js +264 -0
- package/dist/security/zkp/types.js.map +1 -0
- package/dist/security/zkp/verifier.d.ts +111 -0
- package/dist/security/zkp/verifier.d.ts.map +1 -0
- package/dist/security/zkp/verifier.js +554 -0
- package/dist/security/zkp/verifier.js.map +1 -0
- package/dist/semantic-governance/context-validator.d.ts +158 -0
- package/dist/semantic-governance/context-validator.d.ts.map +1 -0
- package/dist/semantic-governance/context-validator.js +598 -0
- package/dist/semantic-governance/context-validator.js.map +1 -0
- package/dist/semantic-governance/credential-manager.d.ts +156 -0
- package/dist/semantic-governance/credential-manager.d.ts.map +1 -0
- package/dist/semantic-governance/credential-manager.js +438 -0
- package/dist/semantic-governance/credential-manager.js.map +1 -0
- package/dist/semantic-governance/dual-channel.d.ts +138 -0
- package/dist/semantic-governance/dual-channel.d.ts.map +1 -0
- package/dist/semantic-governance/dual-channel.js +333 -0
- package/dist/semantic-governance/dual-channel.js.map +1 -0
- package/dist/semantic-governance/index.d.ts +107 -0
- package/dist/semantic-governance/index.d.ts.map +1 -0
- package/dist/semantic-governance/index.js +141 -0
- package/dist/semantic-governance/index.js.map +1 -0
- package/dist/semantic-governance/inference-validator.d.ts +114 -0
- package/dist/semantic-governance/inference-validator.d.ts.map +1 -0
- package/dist/semantic-governance/inference-validator.js +390 -0
- package/dist/semantic-governance/inference-validator.js.map +1 -0
- package/dist/semantic-governance/instruction-validator.d.ts +146 -0
- package/dist/semantic-governance/instruction-validator.d.ts.map +1 -0
- package/dist/semantic-governance/instruction-validator.js +363 -0
- package/dist/semantic-governance/instruction-validator.js.map +1 -0
- package/dist/semantic-governance/integration.d.ts +253 -0
- package/dist/semantic-governance/integration.d.ts.map +1 -0
- package/dist/semantic-governance/integration.js +658 -0
- package/dist/semantic-governance/integration.js.map +1 -0
- package/dist/semantic-governance/output-validator.d.ts +135 -0
- package/dist/semantic-governance/output-validator.d.ts.map +1 -0
- package/dist/semantic-governance/output-validator.js +448 -0
- package/dist/semantic-governance/output-validator.js.map +1 -0
- package/dist/semantic-governance/service.d.ts +120 -0
- package/dist/semantic-governance/service.d.ts.map +1 -0
- package/dist/semantic-governance/service.js +527 -0
- package/dist/semantic-governance/service.js.map +1 -0
- package/dist/semantic-governance/types.d.ts +3925 -0
- package/dist/semantic-governance/types.d.ts.map +1 -0
- package/dist/semantic-governance/types.js +471 -0
- package/dist/semantic-governance/types.js.map +1 -0
- package/dist/trust-engine/car-integration.d.ts +263 -0
- package/dist/trust-engine/car-integration.d.ts.map +1 -0
- package/dist/trust-engine/car-integration.js +320 -0
- package/dist/trust-engine/car-integration.js.map +1 -0
- package/dist/trust-engine/context.d.ts +198 -0
- package/dist/trust-engine/context.d.ts.map +1 -0
- package/dist/trust-engine/context.js +308 -0
- package/dist/trust-engine/context.js.map +1 -0
- package/dist/trust-engine/diminishing-returns.d.ts +123 -0
- package/dist/trust-engine/diminishing-returns.d.ts.map +1 -0
- package/dist/trust-engine/diminishing-returns.js +197 -0
- package/dist/trust-engine/diminishing-returns.js.map +1 -0
- package/dist/trust-engine/index.d.ts +433 -0
- package/dist/trust-engine/index.d.ts.map +1 -0
- package/dist/trust-engine/index.js +1241 -0
- package/dist/trust-engine/index.js.map +1 -0
- package/dist/trust-engine/observability.d.ts +175 -0
- package/dist/trust-engine/observability.d.ts.map +1 -0
- package/dist/trust-engine/observability.js +246 -0
- package/dist/trust-engine/observability.js.map +1 -0
- package/dist/trust-engine/signal-diversity.d.ts +130 -0
- package/dist/trust-engine/signal-diversity.d.ts.map +1 -0
- package/dist/trust-engine/signal-diversity.js +238 -0
- package/dist/trust-engine/signal-diversity.js.map +1 -0
- package/dist/versioning/deprecation.d.ts +65 -0
- package/dist/versioning/deprecation.d.ts.map +1 -0
- package/dist/versioning/deprecation.js +199 -0
- package/dist/versioning/deprecation.js.map +1 -0
- package/dist/versioning/index.d.ts +46 -0
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +76 -0
- package/dist/versioning/index.js.map +1 -0
- package/dist/versioning/semver.d.ts +116 -0
- package/dist/versioning/semver.d.ts.map +1 -0
- package/dist/versioning/semver.js +321 -0
- package/dist/versioning/semver.js.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1,1325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injection Detection System
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive detection and prevention of injection attacks including:
|
|
5
|
+
* - SQL Injection
|
|
6
|
+
* - Cross-Site Scripting (XSS)
|
|
7
|
+
* - Command Injection
|
|
8
|
+
* - Template Injection
|
|
9
|
+
* - Path Traversal
|
|
10
|
+
* - LDAP Injection
|
|
11
|
+
* - XML Injection (XXE)
|
|
12
|
+
* - NoSQL Injection
|
|
13
|
+
*
|
|
14
|
+
* Provides configurable detection, allowlisting, and Fastify middleware integration.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import fp from 'fastify-plugin';
|
|
19
|
+
import { createLogger } from '../common/logger.js';
|
|
20
|
+
import { ValidationError } from '../common/validation.js';
|
|
21
|
+
const logger = createLogger({ component: 'injection-detector' });
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// Enums and Constants
|
|
24
|
+
// =============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Types of injection attacks that can be detected
|
|
27
|
+
*/
|
|
28
|
+
export var InjectionType;
|
|
29
|
+
(function (InjectionType) {
|
|
30
|
+
/** SQL Injection - attacks targeting SQL databases */
|
|
31
|
+
InjectionType["SQL"] = "SQL";
|
|
32
|
+
/** Cross-Site Scripting - malicious script injection */
|
|
33
|
+
InjectionType["XSS"] = "XSS";
|
|
34
|
+
/** Command Injection - OS command execution */
|
|
35
|
+
InjectionType["COMMAND"] = "COMMAND";
|
|
36
|
+
/** Template Injection - server-side template manipulation */
|
|
37
|
+
InjectionType["TEMPLATE"] = "TEMPLATE";
|
|
38
|
+
/** Path Traversal - unauthorized file system access */
|
|
39
|
+
InjectionType["PATH_TRAVERSAL"] = "PATH_TRAVERSAL";
|
|
40
|
+
/** LDAP Injection - directory service attacks */
|
|
41
|
+
InjectionType["LDAP"] = "LDAP";
|
|
42
|
+
/** XML Injection - XML External Entity attacks */
|
|
43
|
+
InjectionType["XML"] = "XML";
|
|
44
|
+
/** NoSQL Injection - attacks targeting NoSQL databases */
|
|
45
|
+
InjectionType["NOSQL"] = "NOSQL";
|
|
46
|
+
})(InjectionType || (InjectionType = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Context in which input is being checked.
|
|
49
|
+
* Different contexts have different risk profiles and require different patterns.
|
|
50
|
+
*/
|
|
51
|
+
export var InputContext;
|
|
52
|
+
(function (InputContext) {
|
|
53
|
+
/** URL query parameters */
|
|
54
|
+
InputContext["URL_PARAM"] = "URL_PARAM";
|
|
55
|
+
/** Request body (JSON, form data, etc.) */
|
|
56
|
+
InputContext["BODY"] = "BODY";
|
|
57
|
+
/** HTTP headers */
|
|
58
|
+
InputContext["HEADER"] = "HEADER";
|
|
59
|
+
/** Path segment in URL */
|
|
60
|
+
InputContext["PATH"] = "PATH";
|
|
61
|
+
/** Generic/unknown context (most restrictive) */
|
|
62
|
+
InputContext["GENERIC"] = "GENERIC";
|
|
63
|
+
})(InputContext || (InputContext = {}));
|
|
64
|
+
/**
|
|
65
|
+
* Sensitivity level for detection.
|
|
66
|
+
* Higher levels are more aggressive but may have more false positives.
|
|
67
|
+
*/
|
|
68
|
+
export var SensitivityLevel;
|
|
69
|
+
(function (SensitivityLevel) {
|
|
70
|
+
/** Low sensitivity - only detect clear attack patterns */
|
|
71
|
+
SensitivityLevel["LOW"] = "LOW";
|
|
72
|
+
/** Medium sensitivity - balanced detection (default) */
|
|
73
|
+
SensitivityLevel["MEDIUM"] = "MEDIUM";
|
|
74
|
+
/** High sensitivity - aggressive detection, may have false positives */
|
|
75
|
+
SensitivityLevel["HIGH"] = "HIGH";
|
|
76
|
+
})(SensitivityLevel || (SensitivityLevel = {}));
|
|
77
|
+
/**
|
|
78
|
+
* Comprehensive regex patterns for detecting various injection attacks.
|
|
79
|
+
* Patterns are designed to minimize false positives while catching common attack vectors.
|
|
80
|
+
*/
|
|
81
|
+
export const INJECTION_PATTERNS = {
|
|
82
|
+
[InjectionType.SQL]: [
|
|
83
|
+
// Basic SQL keywords with word boundaries
|
|
84
|
+
/\b(SELECT|INSERT|UPDATE|DELETE|DROP|TRUNCATE|ALTER|CREATE|REPLACE)\s+/i,
|
|
85
|
+
// UNION-based injection
|
|
86
|
+
/\bUNION\s+(ALL\s+)?SELECT\b/i,
|
|
87
|
+
// Boolean-based blind injection
|
|
88
|
+
/\bOR\s+['"]?\d+['"]?\s*=\s*['"]?\d+['"]?/i,
|
|
89
|
+
/\bAND\s+['"]?\d+['"]?\s*=\s*['"]?\d+['"]?/i,
|
|
90
|
+
/\bOR\s+['"][^'"]+['"]\s*=\s*['"][^'"]+['"]/i,
|
|
91
|
+
// Classic OR 1=1 patterns
|
|
92
|
+
/'\s*OR\s*'?\d+'?\s*=\s*'?\d+/i,
|
|
93
|
+
/"\s*OR\s*"?\d+"?\s*=\s*"?\d+/i,
|
|
94
|
+
// SQL comment injection
|
|
95
|
+
/--\s*$/m,
|
|
96
|
+
/\/\*[\s\S]*?\*\//,
|
|
97
|
+
/#\s*$/m,
|
|
98
|
+
// Stacked queries
|
|
99
|
+
/;\s*(SELECT|INSERT|UPDATE|DELETE|DROP|TRUNCATE|ALTER|CREATE)\b/i,
|
|
100
|
+
// EXEC/EXECUTE for stored procedures
|
|
101
|
+
/\bEXEC(UTE)?\s+/i,
|
|
102
|
+
// System table access
|
|
103
|
+
/\b(INFORMATION_SCHEMA|SYS\.|SYSOBJECTS|SYSCOLUMNS)\b/i,
|
|
104
|
+
// Time-based blind injection
|
|
105
|
+
/\bWAITFOR\s+DELAY\b/i,
|
|
106
|
+
/\bSLEEP\s*\(/i,
|
|
107
|
+
/\bBENCHMARK\s*\(/i,
|
|
108
|
+
// Database specific functions
|
|
109
|
+
/\b(LOAD_FILE|INTO\s+OUTFILE|INTO\s+DUMPFILE)\b/i,
|
|
110
|
+
// Hex encoding bypass
|
|
111
|
+
/0x[0-9a-fA-F]+/,
|
|
112
|
+
// CHAR function bypass
|
|
113
|
+
/\bCHAR\s*\(\s*\d+/i,
|
|
114
|
+
// Database version detection
|
|
115
|
+
/@@(VERSION|SERVERNAME|LANGUAGE)/i,
|
|
116
|
+
],
|
|
117
|
+
[InjectionType.XSS]: [
|
|
118
|
+
// Script tags
|
|
119
|
+
/<script[^>]*>[\s\S]*?<\/script>/i,
|
|
120
|
+
/<script[^>]*>/i,
|
|
121
|
+
// Event handlers
|
|
122
|
+
/\bon\w+\s*=/i,
|
|
123
|
+
// JavaScript protocol
|
|
124
|
+
/javascript\s*:/i,
|
|
125
|
+
/vbscript\s*:/i,
|
|
126
|
+
/data\s*:\s*text\/html/i,
|
|
127
|
+
// HTML injection
|
|
128
|
+
/<\s*(iframe|frame|frameset|embed|object|applet|meta|link|style|base|form|input|button|textarea|img)[^>]*>/i,
|
|
129
|
+
// SVG-based XSS
|
|
130
|
+
/<\s*svg[^>]*\s+on\w+\s*=/i,
|
|
131
|
+
/<\s*svg[^>]*>[\s\S]*?<\s*script/i,
|
|
132
|
+
// Expression injection (IE)
|
|
133
|
+
/expression\s*\(/i,
|
|
134
|
+
// URL-based XSS
|
|
135
|
+
/url\s*\(\s*['"]?\s*javascript/i,
|
|
136
|
+
// CDATA injection
|
|
137
|
+
/<!\[CDATA\[/i,
|
|
138
|
+
// HTML entity encoded script
|
|
139
|
+
/&#x?[0-9a-fA-F]+;/,
|
|
140
|
+
// Backslash escaping
|
|
141
|
+
/\\x[0-9a-fA-F]{2}/,
|
|
142
|
+
/\\u[0-9a-fA-F]{4}/,
|
|
143
|
+
// DOM manipulation
|
|
144
|
+
/document\s*\.\s*(cookie|domain|write|location)/i,
|
|
145
|
+
/window\s*\.\s*(location|open|eval)/i,
|
|
146
|
+
// innerHTML/outerHTML
|
|
147
|
+
/\.\s*(innerHTML|outerHTML|insertAdjacentHTML)\s*=/i,
|
|
148
|
+
// eval and similar
|
|
149
|
+
/\b(eval|setTimeout|setInterval|Function)\s*\(/i,
|
|
150
|
+
// Template literal injection
|
|
151
|
+
/\$\{[^}]*document[^}]*\}/i,
|
|
152
|
+
],
|
|
153
|
+
[InjectionType.COMMAND]: [
|
|
154
|
+
// Backtick command substitution (always dangerous)
|
|
155
|
+
/`[^`]+`/,
|
|
156
|
+
// $() command substitution with actual command content
|
|
157
|
+
/\$\([^)]+\)/,
|
|
158
|
+
// Path to shell executables
|
|
159
|
+
/\/bin\/(ba)?sh/,
|
|
160
|
+
/\/usr\/bin\/(ba)?sh/,
|
|
161
|
+
/\/usr\/local\/bin\/(ba)?sh/,
|
|
162
|
+
// Null byte injection (for path truncation)
|
|
163
|
+
/\x00/,
|
|
164
|
+
/%00/,
|
|
165
|
+
// Chained command execution patterns (semicolon followed by command)
|
|
166
|
+
/;\s*(rm|mv|cp|chmod|chown|kill|pkill|wget|curl|nc|netcat|bash|sh|zsh|perl|python|ruby|php|node|cat|ls|echo|env|export)\b/i,
|
|
167
|
+
// Pipe to dangerous commands
|
|
168
|
+
/\|\s*(bash|sh|zsh|perl|python|ruby|php|nc|netcat|cat|tee)\b/i,
|
|
169
|
+
// && or || followed by dangerous commands
|
|
170
|
+
/[&|]{2}\s*(rm|mv|cp|chmod|chown|kill|pkill|wget|curl|nc|netcat|bash|sh|zsh|perl|python|ruby|php)\b/i,
|
|
171
|
+
// Command substitution with dangerous commands
|
|
172
|
+
/\$\((rm|cat|wget|curl|nc|bash|sh|python|perl|ruby|php)[^)]*\)/i,
|
|
173
|
+
// Redirection to/from sensitive paths
|
|
174
|
+
/[<>]\s*\/etc\//,
|
|
175
|
+
/[<>]\s*\/proc\//,
|
|
176
|
+
/[<>]\s*\/dev\//,
|
|
177
|
+
// Environment variable manipulation for injection
|
|
178
|
+
/\$\{[^}]*[;`|&][^}]*\}/,
|
|
179
|
+
// Dangerous command with absolute path
|
|
180
|
+
/\/\S*(rm|wget|curl|nc|bash|sh|python|perl|ruby|php)\s+/,
|
|
181
|
+
],
|
|
182
|
+
[InjectionType.TEMPLATE]: [
|
|
183
|
+
// Jinja2/Twig/Django
|
|
184
|
+
/\{\{[\s\S]*?\}\}/,
|
|
185
|
+
/\{%[\s\S]*?%\}/,
|
|
186
|
+
// EJS/ERB
|
|
187
|
+
/<%[\s\S]*?%>/,
|
|
188
|
+
// JavaScript template literals with expressions
|
|
189
|
+
/\$\{[^}]+\}/,
|
|
190
|
+
// Pug/Jade
|
|
191
|
+
/!\{[\s\S]*?\}/,
|
|
192
|
+
/#{[^}]+}/,
|
|
193
|
+
// Freemarker
|
|
194
|
+
/\$\{[^}]+\}/,
|
|
195
|
+
/<#[\s\S]*?>/,
|
|
196
|
+
// Thymeleaf
|
|
197
|
+
/th:[a-z]+\s*=/i,
|
|
198
|
+
// Velocity
|
|
199
|
+
/#(set|if|foreach|include|parse)\s*\(/i,
|
|
200
|
+
/\$[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*/,
|
|
201
|
+
// Smarty
|
|
202
|
+
/\{\$[^}]+\}/,
|
|
203
|
+
// Mustache/Handlebars
|
|
204
|
+
/\{\{\{[\s\S]*?\}\}\}/,
|
|
205
|
+
/\{\{#[\s\S]*?\}\}/,
|
|
206
|
+
/\{\{>[\s\S]*?\}\}/,
|
|
207
|
+
// SSTI common payloads
|
|
208
|
+
/\{\{.*__(class|mro|subclasses|init|globals|builtins)__.*\}\}/i,
|
|
209
|
+
/\{\{.*config.*\}\}/i,
|
|
210
|
+
/\{\{.*request.*\}\}/i,
|
|
211
|
+
],
|
|
212
|
+
[InjectionType.PATH_TRAVERSAL]: [
|
|
213
|
+
// Basic traversal patterns
|
|
214
|
+
/\.\.\//,
|
|
215
|
+
/\.\.\\/,
|
|
216
|
+
// URL encoded
|
|
217
|
+
/%2e%2e[%2f%5c]/i,
|
|
218
|
+
/%252e%252e[%252f%255c]/i,
|
|
219
|
+
// Double URL encoded
|
|
220
|
+
/\.\.%2f/i,
|
|
221
|
+
/\.\.%5c/i,
|
|
222
|
+
// Unicode/overlong UTF-8 encoding
|
|
223
|
+
/%c0%ae%c0%ae[%c0%af%5c]/i,
|
|
224
|
+
/%c0%2e%c0%2e[%c0%af%5c]/i,
|
|
225
|
+
// Null byte injection
|
|
226
|
+
/%00/,
|
|
227
|
+
/\x00/,
|
|
228
|
+
// Absolute path references
|
|
229
|
+
/^\/etc\//,
|
|
230
|
+
/^\/proc\//,
|
|
231
|
+
/^\/var\//,
|
|
232
|
+
/^c:\\/i,
|
|
233
|
+
/^[a-z]:\\/i,
|
|
234
|
+
// Common sensitive files
|
|
235
|
+
/(passwd|shadow|hosts|\.htaccess|web\.config|\.env|\.git)/i,
|
|
236
|
+
// Windows specific
|
|
237
|
+
/\.\.[\\\/]+windows[\\\/]+/i,
|
|
238
|
+
/\.\.[\\\/]+system32[\\\/]+/i,
|
|
239
|
+
],
|
|
240
|
+
[InjectionType.LDAP]: [
|
|
241
|
+
// Parentheses (LDAP filter syntax)
|
|
242
|
+
/[()]/,
|
|
243
|
+
// Asterisk wildcard
|
|
244
|
+
/\*/,
|
|
245
|
+
// Backslash (escape character)
|
|
246
|
+
/\\/,
|
|
247
|
+
// Null byte
|
|
248
|
+
/\x00/,
|
|
249
|
+
/%00/,
|
|
250
|
+
// NUL character variations
|
|
251
|
+
/\\00/,
|
|
252
|
+
// LDAP operators
|
|
253
|
+
/[|&!]/,
|
|
254
|
+
// Common LDAP injection patterns
|
|
255
|
+
/\)\s*\(/,
|
|
256
|
+
/\(\|/,
|
|
257
|
+
/\(&/,
|
|
258
|
+
/\(!/,
|
|
259
|
+
// LDAP special characters
|
|
260
|
+
/[<>=~]/,
|
|
261
|
+
// DN injection
|
|
262
|
+
/\bou\s*=/i,
|
|
263
|
+
/\bdc\s*=/i,
|
|
264
|
+
/\bcn\s*=/i,
|
|
265
|
+
/\buid\s*=/i,
|
|
266
|
+
],
|
|
267
|
+
[InjectionType.XML]: [
|
|
268
|
+
// DOCTYPE declaration (XXE vector)
|
|
269
|
+
/<!DOCTYPE\s+/i,
|
|
270
|
+
// ENTITY declaration (XXE)
|
|
271
|
+
/<!ENTITY\s+/i,
|
|
272
|
+
// SYSTEM keyword (XXE)
|
|
273
|
+
/\bSYSTEM\s+["']/i,
|
|
274
|
+
// PUBLIC keyword
|
|
275
|
+
/\bPUBLIC\s+["']/i,
|
|
276
|
+
// Parameter entity
|
|
277
|
+
/%\s*[a-zA-Z_][a-zA-Z0-9_]*\s*;/,
|
|
278
|
+
// CDATA sections
|
|
279
|
+
/<!\[CDATA\[/i,
|
|
280
|
+
// XML declaration with encoding
|
|
281
|
+
/<\?xml[^>]*encoding\s*=/i,
|
|
282
|
+
// Comment injection
|
|
283
|
+
/<!--[\s\S]*?-->/,
|
|
284
|
+
// Processing instructions
|
|
285
|
+
/<\?[^>]+\?>/,
|
|
286
|
+
// NOTATION declaration
|
|
287
|
+
/<!NOTATION\s+/i,
|
|
288
|
+
// ATTLIST declaration
|
|
289
|
+
/<!ATTLIST\s+/i,
|
|
290
|
+
// ELEMENT declaration
|
|
291
|
+
/<!ELEMENT\s+/i,
|
|
292
|
+
// External DTD reference
|
|
293
|
+
/file:\/\//i,
|
|
294
|
+
/php:\/\//i,
|
|
295
|
+
/expect:\/\//i,
|
|
296
|
+
/data:\/\//i,
|
|
297
|
+
],
|
|
298
|
+
[InjectionType.NOSQL]: [
|
|
299
|
+
// MongoDB operators
|
|
300
|
+
/\$where\b/i,
|
|
301
|
+
/\$regex\b/i,
|
|
302
|
+
/\$gt\b/i,
|
|
303
|
+
/\$gte\b/i,
|
|
304
|
+
/\$lt\b/i,
|
|
305
|
+
/\$lte\b/i,
|
|
306
|
+
/\$ne\b/i,
|
|
307
|
+
/\$nin\b/i,
|
|
308
|
+
/\$in\b/i,
|
|
309
|
+
/\$or\b/i,
|
|
310
|
+
/\$and\b/i,
|
|
311
|
+
/\$not\b/i,
|
|
312
|
+
/\$nor\b/i,
|
|
313
|
+
/\$exists\b/i,
|
|
314
|
+
/\$type\b/i,
|
|
315
|
+
/\$mod\b/i,
|
|
316
|
+
/\$text\b/i,
|
|
317
|
+
/\$search\b/i,
|
|
318
|
+
/\$all\b/i,
|
|
319
|
+
/\$elemMatch\b/i,
|
|
320
|
+
/\$size\b/i,
|
|
321
|
+
/\$slice\b/i,
|
|
322
|
+
/\$comment\b/i,
|
|
323
|
+
// MongoDB mapReduce
|
|
324
|
+
/mapReduce\s*:/i,
|
|
325
|
+
/\$function\b/i,
|
|
326
|
+
// CouchDB
|
|
327
|
+
/_all_docs\b/i,
|
|
328
|
+
/_design\//i,
|
|
329
|
+
// JavaScript execution
|
|
330
|
+
/function\s*\(/i,
|
|
331
|
+
// Object notation injection
|
|
332
|
+
/\[\s*['"][^'"]+['"]\s*\]/,
|
|
333
|
+
// Prototype pollution
|
|
334
|
+
/__proto__\b/,
|
|
335
|
+
/constructor\s*\[/,
|
|
336
|
+
/prototype\s*\[/,
|
|
337
|
+
],
|
|
338
|
+
};
|
|
339
|
+
// =============================================================================
|
|
340
|
+
// Context-Aware Patterns
|
|
341
|
+
// =============================================================================
|
|
342
|
+
/**
|
|
343
|
+
* Context-specific patterns that are only checked in certain contexts.
|
|
344
|
+
* This reduces false positives by not applying overly broad patterns everywhere.
|
|
345
|
+
*/
|
|
346
|
+
export const CONTEXT_SPECIFIC_PATTERNS = {
|
|
347
|
+
[InputContext.URL_PARAM]: {
|
|
348
|
+
// URL params are more likely to contain special chars, so we're less strict
|
|
349
|
+
[InjectionType.COMMAND]: [
|
|
350
|
+
// Only check for clear command injection in URL params
|
|
351
|
+
/`[^`]+`/,
|
|
352
|
+
/\$\([^)]+\)/,
|
|
353
|
+
/;\s*(rm|cat|wget|curl|bash|sh)\b/i,
|
|
354
|
+
],
|
|
355
|
+
[InjectionType.SQL]: [
|
|
356
|
+
// SQL injection in URL params
|
|
357
|
+
/\bUNION\s+(ALL\s+)?SELECT\b/i,
|
|
358
|
+
/'\s*OR\s*'?\d+'?\s*=\s*'?\d+/i,
|
|
359
|
+
/--\s*$/m,
|
|
360
|
+
],
|
|
361
|
+
},
|
|
362
|
+
[InputContext.BODY]: {
|
|
363
|
+
// Request body can have legitimate JSON with special chars
|
|
364
|
+
[InjectionType.COMMAND]: [
|
|
365
|
+
// Command injection patterns for body
|
|
366
|
+
/`[^`]+`/,
|
|
367
|
+
/\$\([^)]+\)/,
|
|
368
|
+
/\/bin\/(ba)?sh/,
|
|
369
|
+
/;\s*(rm|wget|curl|bash|sh)\b/i,
|
|
370
|
+
],
|
|
371
|
+
[InjectionType.NOSQL]: [
|
|
372
|
+
// NoSQL operators that are suspicious in body but not always attacks
|
|
373
|
+
/\$where\b/i,
|
|
374
|
+
/\$function\b/i,
|
|
375
|
+
/__proto__\b/,
|
|
376
|
+
/constructor\s*\[/,
|
|
377
|
+
/prototype\s*\[/,
|
|
378
|
+
],
|
|
379
|
+
},
|
|
380
|
+
[InputContext.HEADER]: {
|
|
381
|
+
// Headers have specific attack vectors
|
|
382
|
+
[InjectionType.XSS]: [
|
|
383
|
+
// XSS in headers is less common but possible
|
|
384
|
+
/<script[^>]*>/i,
|
|
385
|
+
/javascript\s*:/i,
|
|
386
|
+
],
|
|
387
|
+
[InjectionType.COMMAND]: [
|
|
388
|
+
// Command injection via headers (e.g., User-Agent)
|
|
389
|
+
/`[^`]+`/,
|
|
390
|
+
/\$\([^)]+\)/,
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
[InputContext.PATH]: {
|
|
394
|
+
// Path segments need path traversal checks primarily
|
|
395
|
+
[InjectionType.PATH_TRAVERSAL]: [
|
|
396
|
+
/\.\.\//,
|
|
397
|
+
/\.\.\\/,
|
|
398
|
+
/%2e%2e[%2f%5c]/i,
|
|
399
|
+
/%00/,
|
|
400
|
+
/\x00/,
|
|
401
|
+
],
|
|
402
|
+
},
|
|
403
|
+
[InputContext.GENERIC]: {
|
|
404
|
+
// Generic context uses all patterns
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Sensitivity-based pattern filtering.
|
|
409
|
+
* Maps sensitivity levels to which pattern indices to use.
|
|
410
|
+
*/
|
|
411
|
+
export const SENSITIVITY_CONFIG = {
|
|
412
|
+
[SensitivityLevel.LOW]: {
|
|
413
|
+
skipPatternsByType: {
|
|
414
|
+
// Skip overly broad patterns at low sensitivity
|
|
415
|
+
[InjectionType.COMMAND]: [0, 1, 2, 3, 4, 5, 6, 7], // Skip most, keep only severe
|
|
416
|
+
[InjectionType.TEMPLATE]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], // Skip most template patterns
|
|
417
|
+
[InjectionType.NOSQL]: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], // Skip operator checks
|
|
418
|
+
},
|
|
419
|
+
checkRareTypes: false,
|
|
420
|
+
minMatchLength: 5,
|
|
421
|
+
},
|
|
422
|
+
[SensitivityLevel.MEDIUM]: {
|
|
423
|
+
skipPatternsByType: {
|
|
424
|
+
// Balanced approach
|
|
425
|
+
[InjectionType.COMMAND]: [6, 7], // Skip less dangerous command patterns
|
|
426
|
+
[InjectionType.NOSQL]: [7, 8, 9, 10, 11, 12, 13], // Skip common operators
|
|
427
|
+
},
|
|
428
|
+
checkRareTypes: true,
|
|
429
|
+
minMatchLength: 3,
|
|
430
|
+
},
|
|
431
|
+
[SensitivityLevel.HIGH]: {
|
|
432
|
+
skipPatternsByType: {}, // Check all patterns
|
|
433
|
+
checkRareTypes: true,
|
|
434
|
+
minMatchLength: 1,
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* Default safe patterns that should be allowed in specific contexts.
|
|
439
|
+
* These are patterns that commonly appear in legitimate data but match
|
|
440
|
+
* injection detection patterns.
|
|
441
|
+
*/
|
|
442
|
+
export const DEFAULT_SAFE_PATTERNS = [
|
|
443
|
+
// JSON body operators (used in APIs, not attacks)
|
|
444
|
+
{
|
|
445
|
+
pattern: /^\$[a-z]+$/i,
|
|
446
|
+
contexts: [InputContext.BODY],
|
|
447
|
+
description: 'Simple MongoDB-style operator in isolation',
|
|
448
|
+
},
|
|
449
|
+
// GraphQL operators
|
|
450
|
+
{
|
|
451
|
+
pattern: /^(query|mutation|subscription)\s*\{/i,
|
|
452
|
+
contexts: [InputContext.BODY],
|
|
453
|
+
description: 'GraphQL query start',
|
|
454
|
+
},
|
|
455
|
+
// SQL-like keywords in field names or descriptions
|
|
456
|
+
{
|
|
457
|
+
pattern: /^(select|update|delete)_[a-z_]+$/i,
|
|
458
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM],
|
|
459
|
+
description: 'SQL keyword as field name prefix',
|
|
460
|
+
},
|
|
461
|
+
// Common URL patterns with special chars
|
|
462
|
+
{
|
|
463
|
+
pattern: /^https?:\/\/[^\s]+$/,
|
|
464
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM],
|
|
465
|
+
description: 'Valid URL format',
|
|
466
|
+
},
|
|
467
|
+
// Version strings (e.g., "1.0.0-beta")
|
|
468
|
+
{
|
|
469
|
+
pattern: /^\d+\.\d+\.\d+(-[a-z0-9]+)?$/i,
|
|
470
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM, InputContext.HEADER],
|
|
471
|
+
description: 'Semantic version string',
|
|
472
|
+
},
|
|
473
|
+
// Date/time strings with separators
|
|
474
|
+
{
|
|
475
|
+
pattern: /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/,
|
|
476
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM],
|
|
477
|
+
description: 'ISO date/time format',
|
|
478
|
+
},
|
|
479
|
+
// Email addresses (may contain + and other chars)
|
|
480
|
+
{
|
|
481
|
+
pattern: /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i,
|
|
482
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM],
|
|
483
|
+
description: 'Email address format',
|
|
484
|
+
},
|
|
485
|
+
// Base64 encoded strings (may look like injection)
|
|
486
|
+
{
|
|
487
|
+
pattern: /^[A-Za-z0-9+/]+=*$/,
|
|
488
|
+
contexts: [InputContext.BODY, InputContext.HEADER],
|
|
489
|
+
description: 'Base64 encoded data',
|
|
490
|
+
},
|
|
491
|
+
// UUIDs
|
|
492
|
+
{
|
|
493
|
+
pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
|
|
494
|
+
contexts: [InputContext.BODY, InputContext.URL_PARAM, InputContext.PATH],
|
|
495
|
+
description: 'UUID format',
|
|
496
|
+
},
|
|
497
|
+
// JSON pointer paths (used in PATCH operations)
|
|
498
|
+
{
|
|
499
|
+
pattern: /^\/[a-z0-9_/-]+$/i,
|
|
500
|
+
contexts: [InputContext.BODY],
|
|
501
|
+
description: 'JSON pointer path',
|
|
502
|
+
},
|
|
503
|
+
// Content-Type with charset
|
|
504
|
+
{
|
|
505
|
+
pattern: /^[a-z]+\/[a-z0-9.+-]+;\s*charset=[a-z0-9-]+$/i,
|
|
506
|
+
contexts: [InputContext.HEADER],
|
|
507
|
+
description: 'Content-Type header value',
|
|
508
|
+
},
|
|
509
|
+
// Authorization Bearer token
|
|
510
|
+
{
|
|
511
|
+
pattern: /^Bearer\s+[A-Za-z0-9._-]+$/,
|
|
512
|
+
contexts: [InputContext.HEADER],
|
|
513
|
+
description: 'Bearer token format',
|
|
514
|
+
},
|
|
515
|
+
];
|
|
516
|
+
// =============================================================================
|
|
517
|
+
// Default Configuration
|
|
518
|
+
// =============================================================================
|
|
519
|
+
/**
|
|
520
|
+
* Default injection detector configuration with all detections enabled
|
|
521
|
+
*/
|
|
522
|
+
export const DEFAULT_INJECTION_DETECTOR_CONFIG = {
|
|
523
|
+
enableSQLDetection: true,
|
|
524
|
+
enableXSSDetection: true,
|
|
525
|
+
enableCommandDetection: true,
|
|
526
|
+
enableTemplateDetection: true,
|
|
527
|
+
enablePathTraversalDetection: true,
|
|
528
|
+
enableLDAPDetection: true,
|
|
529
|
+
enableXMLDetection: true,
|
|
530
|
+
enableNoSQLDetection: true,
|
|
531
|
+
customPatterns: [],
|
|
532
|
+
allowlist: [],
|
|
533
|
+
logDetections: true,
|
|
534
|
+
blockOnDetection: true,
|
|
535
|
+
sensitivity: SensitivityLevel.MEDIUM,
|
|
536
|
+
contextAware: true,
|
|
537
|
+
customSafePatterns: [],
|
|
538
|
+
};
|
|
539
|
+
// =============================================================================
|
|
540
|
+
// InjectionDetector Class
|
|
541
|
+
// =============================================================================
|
|
542
|
+
/**
|
|
543
|
+
* Injection attack detector with comprehensive pattern matching
|
|
544
|
+
*
|
|
545
|
+
* Provides detection, sanitization, and allowlisting capabilities for
|
|
546
|
+
* protecting against various injection attack vectors.
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* const detector = new InjectionDetector({
|
|
551
|
+
* enableSQLDetection: true,
|
|
552
|
+
* enableXSSDetection: true,
|
|
553
|
+
* logDetections: true,
|
|
554
|
+
* });
|
|
555
|
+
*
|
|
556
|
+
* const result = detector.detect("SELECT * FROM users WHERE id = '1' OR '1'='1'");
|
|
557
|
+
* if (result.detected) {
|
|
558
|
+
* console.log('Injection detected:', result.types);
|
|
559
|
+
* }
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
export class InjectionDetector {
|
|
563
|
+
config;
|
|
564
|
+
allowlistPatterns;
|
|
565
|
+
safePatterns;
|
|
566
|
+
sensitivityConfig;
|
|
567
|
+
/**
|
|
568
|
+
* Create a new InjectionDetector instance
|
|
569
|
+
*
|
|
570
|
+
* @param config - Configuration options (merged with defaults)
|
|
571
|
+
*/
|
|
572
|
+
constructor(config = {}) {
|
|
573
|
+
this.config = { ...DEFAULT_INJECTION_DETECTOR_CONFIG, ...config };
|
|
574
|
+
// Compile allowlist patterns for efficient matching
|
|
575
|
+
this.allowlistPatterns = this.config.allowlist.map((pattern) => {
|
|
576
|
+
// Escape special regex characters and create exact match pattern
|
|
577
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
578
|
+
return new RegExp(`^${escaped}$`, 'i');
|
|
579
|
+
});
|
|
580
|
+
// Build safe patterns list
|
|
581
|
+
this.safePatterns = [
|
|
582
|
+
...DEFAULT_SAFE_PATTERNS,
|
|
583
|
+
...(this.config.customSafePatterns ?? []),
|
|
584
|
+
];
|
|
585
|
+
// Get sensitivity configuration
|
|
586
|
+
this.sensitivityConfig = SENSITIVITY_CONFIG[this.config.sensitivity ?? SensitivityLevel.MEDIUM];
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Check if input matches a safe pattern for the given context
|
|
590
|
+
*
|
|
591
|
+
* @param input - The input to check
|
|
592
|
+
* @param context - The input context
|
|
593
|
+
* @returns true if the input matches a safe pattern
|
|
594
|
+
*/
|
|
595
|
+
matchesSafePattern(input, context) {
|
|
596
|
+
for (const safe of this.safePatterns) {
|
|
597
|
+
if (safe.contexts.includes(context) && safe.pattern.test(input)) {
|
|
598
|
+
return true;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return false;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Get patterns to use for a specific injection type and context
|
|
605
|
+
*
|
|
606
|
+
* @param type - The injection type
|
|
607
|
+
* @param context - The input context
|
|
608
|
+
* @returns Array of patterns to check
|
|
609
|
+
*/
|
|
610
|
+
getPatternsForContext(type, context) {
|
|
611
|
+
const basePatterns = INJECTION_PATTERNS[type];
|
|
612
|
+
// If context-aware detection is disabled, use base patterns
|
|
613
|
+
if (!this.config.contextAware) {
|
|
614
|
+
return this.filterByNensitivity(basePatterns, type);
|
|
615
|
+
}
|
|
616
|
+
// Check if we have context-specific patterns
|
|
617
|
+
const contextPatterns = CONTEXT_SPECIFIC_PATTERNS[context]?.[type];
|
|
618
|
+
// For generic context or if no specific patterns, use base patterns
|
|
619
|
+
if (context === InputContext.GENERIC || !contextPatterns) {
|
|
620
|
+
return this.filterByNensitivity(basePatterns, type);
|
|
621
|
+
}
|
|
622
|
+
// Use context-specific patterns which are more targeted
|
|
623
|
+
return contextPatterns;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Filter patterns based on sensitivity level
|
|
627
|
+
*/
|
|
628
|
+
filterByNensitivity(patterns, type) {
|
|
629
|
+
const skipIndices = this.sensitivityConfig.skipPatternsByType[type] ?? [];
|
|
630
|
+
if (skipIndices.length === 0) {
|
|
631
|
+
return patterns;
|
|
632
|
+
}
|
|
633
|
+
return patterns.filter((_, index) => !skipIndices.includes(index));
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Detect injection attacks in an input string
|
|
637
|
+
*
|
|
638
|
+
* Checks the input against all enabled detection patterns and returns
|
|
639
|
+
* detailed information about any matches found.
|
|
640
|
+
*
|
|
641
|
+
* @param input - The string to analyze for injection patterns
|
|
642
|
+
* @param context - The context in which the input was received (optional)
|
|
643
|
+
* @returns Detection result with matched types and patterns
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
* ```typescript
|
|
647
|
+
* const result = detector.detect("<script>alert('xss')</script>");
|
|
648
|
+
* // result.detected === true
|
|
649
|
+
* // result.types includes InjectionType.XSS
|
|
650
|
+
*
|
|
651
|
+
* // With context-aware detection
|
|
652
|
+
* const bodyResult = detector.detect(jsonBody, InputContext.BODY);
|
|
653
|
+
* ```
|
|
654
|
+
*/
|
|
655
|
+
detect(input, context = InputContext.GENERIC) {
|
|
656
|
+
// Check if input is allowlisted
|
|
657
|
+
if (this.isAllowlisted(input)) {
|
|
658
|
+
return {
|
|
659
|
+
detected: false,
|
|
660
|
+
types: [],
|
|
661
|
+
patterns: [],
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
// Check if input matches a known safe pattern for this context
|
|
665
|
+
if (this.config.contextAware && this.matchesSafePattern(input, context)) {
|
|
666
|
+
return {
|
|
667
|
+
detected: false,
|
|
668
|
+
types: [],
|
|
669
|
+
patterns: [],
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
// Check minimum match length
|
|
673
|
+
if (input.length < this.sensitivityConfig.minMatchLength) {
|
|
674
|
+
return {
|
|
675
|
+
detected: false,
|
|
676
|
+
types: [],
|
|
677
|
+
patterns: [],
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
const detectedTypes = [];
|
|
681
|
+
const matchedPatterns = [];
|
|
682
|
+
// Check each enabled detection type
|
|
683
|
+
const detectionChecks = [
|
|
684
|
+
{
|
|
685
|
+
enabled: this.config.enableSQLDetection,
|
|
686
|
+
type: InjectionType.SQL,
|
|
687
|
+
patterns: this.getPatternsForContext(InjectionType.SQL, context),
|
|
688
|
+
isRareType: false,
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
enabled: this.config.enableXSSDetection,
|
|
692
|
+
type: InjectionType.XSS,
|
|
693
|
+
patterns: this.getPatternsForContext(InjectionType.XSS, context),
|
|
694
|
+
isRareType: false,
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
enabled: this.config.enableCommandDetection,
|
|
698
|
+
type: InjectionType.COMMAND,
|
|
699
|
+
patterns: this.getPatternsForContext(InjectionType.COMMAND, context),
|
|
700
|
+
isRareType: false,
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
enabled: this.config.enableTemplateDetection,
|
|
704
|
+
type: InjectionType.TEMPLATE,
|
|
705
|
+
patterns: this.getPatternsForContext(InjectionType.TEMPLATE, context),
|
|
706
|
+
isRareType: true,
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
enabled: this.config.enablePathTraversalDetection,
|
|
710
|
+
type: InjectionType.PATH_TRAVERSAL,
|
|
711
|
+
patterns: this.getPatternsForContext(InjectionType.PATH_TRAVERSAL, context),
|
|
712
|
+
isRareType: false,
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
enabled: this.config.enableLDAPDetection,
|
|
716
|
+
type: InjectionType.LDAP,
|
|
717
|
+
patterns: this.getPatternsForContext(InjectionType.LDAP, context),
|
|
718
|
+
isRareType: true,
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
enabled: this.config.enableXMLDetection,
|
|
722
|
+
type: InjectionType.XML,
|
|
723
|
+
patterns: this.getPatternsForContext(InjectionType.XML, context),
|
|
724
|
+
isRareType: true,
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
enabled: this.config.enableNoSQLDetection,
|
|
728
|
+
type: InjectionType.NOSQL,
|
|
729
|
+
patterns: this.getPatternsForContext(InjectionType.NOSQL, context),
|
|
730
|
+
isRareType: false,
|
|
731
|
+
},
|
|
732
|
+
];
|
|
733
|
+
for (const check of detectionChecks) {
|
|
734
|
+
if (!check.enabled)
|
|
735
|
+
continue;
|
|
736
|
+
// Skip rare types at low sensitivity
|
|
737
|
+
if (check.isRareType && !this.sensitivityConfig.checkRareTypes) {
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
for (const pattern of check.patterns) {
|
|
741
|
+
if (pattern.test(input)) {
|
|
742
|
+
if (!detectedTypes.includes(check.type)) {
|
|
743
|
+
detectedTypes.push(check.type);
|
|
744
|
+
}
|
|
745
|
+
matchedPatterns.push(pattern.toString());
|
|
746
|
+
break; // One match per type is enough
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
// Check custom patterns
|
|
751
|
+
for (const pattern of this.config.customPatterns) {
|
|
752
|
+
if (pattern.test(input)) {
|
|
753
|
+
matchedPatterns.push(`custom:${pattern.toString()}`);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
const detected = detectedTypes.length > 0 || matchedPatterns.length > detectedTypes.length;
|
|
757
|
+
const result = {
|
|
758
|
+
detected,
|
|
759
|
+
types: detectedTypes,
|
|
760
|
+
patterns: matchedPatterns,
|
|
761
|
+
};
|
|
762
|
+
if (detected) {
|
|
763
|
+
result.originalInput = input;
|
|
764
|
+
result.detectedAt = new Date().toISOString();
|
|
765
|
+
if (this.config.logDetections) {
|
|
766
|
+
logger.warn({
|
|
767
|
+
types: detectedTypes,
|
|
768
|
+
patternCount: matchedPatterns.length,
|
|
769
|
+
inputLength: input.length,
|
|
770
|
+
inputPreview: input.substring(0, 100),
|
|
771
|
+
}, 'Injection attack detected');
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
return result;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Detect injection attacks in all string values of an object
|
|
778
|
+
*
|
|
779
|
+
* Recursively traverses an object and checks all string values for
|
|
780
|
+
* injection patterns. Returns a map of field paths to detection results.
|
|
781
|
+
*
|
|
782
|
+
* @param obj - The object to analyze
|
|
783
|
+
* @param context - The input context for detection
|
|
784
|
+
* @param prefix - Internal prefix for tracking nested paths
|
|
785
|
+
* @returns Map of field paths to their detection results
|
|
786
|
+
*
|
|
787
|
+
* @example
|
|
788
|
+
* ```typescript
|
|
789
|
+
* const results = detector.detectInObject({
|
|
790
|
+
* username: "admin",
|
|
791
|
+
* query: "SELECT * FROM users",
|
|
792
|
+
* nested: { field: "<script>xss</script>" }
|
|
793
|
+
* }, InputContext.BODY);
|
|
794
|
+
*
|
|
795
|
+
* for (const [field, result] of results) {
|
|
796
|
+
* if (result.detected) {
|
|
797
|
+
* console.log(`Injection in ${field}:`, result.types);
|
|
798
|
+
* }
|
|
799
|
+
* }
|
|
800
|
+
* ```
|
|
801
|
+
*/
|
|
802
|
+
detectInObject(obj, context = InputContext.BODY, prefix = '') {
|
|
803
|
+
const results = new Map();
|
|
804
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
805
|
+
const fieldPath = prefix ? `${prefix}.${key}` : key;
|
|
806
|
+
if (typeof value === 'string') {
|
|
807
|
+
const result = this.detect(value, context);
|
|
808
|
+
if (result.detected) {
|
|
809
|
+
results.set(fieldPath, result);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
else if (Array.isArray(value)) {
|
|
813
|
+
value.forEach((item, index) => {
|
|
814
|
+
if (typeof item === 'string') {
|
|
815
|
+
const result = this.detect(item, context);
|
|
816
|
+
if (result.detected) {
|
|
817
|
+
results.set(`${fieldPath}[${index}]`, result);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
else if (typeof item === 'object' && item !== null) {
|
|
821
|
+
const nestedResults = this.detectInObject(item, context, `${fieldPath}[${index}]`);
|
|
822
|
+
for (const [nestedPath, nestedResult] of nestedResults) {
|
|
823
|
+
results.set(nestedPath, nestedResult);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
else if (typeof value === 'object' && value !== null) {
|
|
829
|
+
const nestedResults = this.detectInObject(value, context, fieldPath);
|
|
830
|
+
for (const [nestedPath, nestedResult] of nestedResults) {
|
|
831
|
+
results.set(nestedPath, nestedResult);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return results;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Sanitize an input string by removing or escaping dangerous patterns
|
|
839
|
+
*
|
|
840
|
+
* Applies multiple sanitization techniques to neutralize potential
|
|
841
|
+
* injection attacks while preserving legitimate content where possible.
|
|
842
|
+
*
|
|
843
|
+
* @param input - The string to sanitize
|
|
844
|
+
* @returns Sanitized string
|
|
845
|
+
*
|
|
846
|
+
* @example
|
|
847
|
+
* ```typescript
|
|
848
|
+
* const sanitized = detector.sanitize("<script>alert('xss')</script>Hello");
|
|
849
|
+
* // sanitized === "<script>alert('xss')</script>Hello"
|
|
850
|
+
* ```
|
|
851
|
+
*/
|
|
852
|
+
sanitize(input) {
|
|
853
|
+
let sanitized = input;
|
|
854
|
+
// Remove null bytes
|
|
855
|
+
sanitized = sanitized.replace(/\x00/g, '');
|
|
856
|
+
sanitized = sanitized.replace(/%00/g, '');
|
|
857
|
+
// Remove control characters (except newlines and tabs)
|
|
858
|
+
sanitized = sanitized.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '');
|
|
859
|
+
// HTML entity encode special characters (XSS prevention)
|
|
860
|
+
sanitized = sanitized
|
|
861
|
+
.replace(/&/g, '&')
|
|
862
|
+
.replace(/</g, '<')
|
|
863
|
+
.replace(/>/g, '>')
|
|
864
|
+
.replace(/"/g, '"')
|
|
865
|
+
.replace(/'/g, ''')
|
|
866
|
+
.replace(/\//g, '/');
|
|
867
|
+
// Remove SQL comments
|
|
868
|
+
sanitized = sanitized.replace(/--/g, '');
|
|
869
|
+
sanitized = sanitized.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
870
|
+
// Remove backticks (command injection)
|
|
871
|
+
sanitized = sanitized.replace(/`/g, '');
|
|
872
|
+
// Remove shell metacharacters
|
|
873
|
+
sanitized = sanitized.replace(/[;&|]/g, '');
|
|
874
|
+
// Normalize path separators and remove traversal patterns
|
|
875
|
+
sanitized = sanitized.replace(/\.\.\//g, '');
|
|
876
|
+
sanitized = sanitized.replace(/\.\.\\/g, '');
|
|
877
|
+
// Remove template syntax
|
|
878
|
+
sanitized = sanitized.replace(/\{\{/g, '{ {');
|
|
879
|
+
sanitized = sanitized.replace(/\}\}/g, '} }');
|
|
880
|
+
sanitized = sanitized.replace(/<%/g, '<%');
|
|
881
|
+
sanitized = sanitized.replace(/%>/g, '%>');
|
|
882
|
+
// Remove LDAP special characters
|
|
883
|
+
sanitized = sanitized.replace(/[()\\*]/g, '');
|
|
884
|
+
// Normalize unicode to NFC form
|
|
885
|
+
sanitized = sanitized.normalize('NFC');
|
|
886
|
+
// Trim whitespace
|
|
887
|
+
sanitized = sanitized.trim();
|
|
888
|
+
return sanitized;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Check if an input string is in the allowlist
|
|
892
|
+
*
|
|
893
|
+
* Allowlisted strings bypass injection detection entirely.
|
|
894
|
+
* Use sparingly for known-safe patterns.
|
|
895
|
+
*
|
|
896
|
+
* @param input - The string to check
|
|
897
|
+
* @returns True if the string is allowlisted
|
|
898
|
+
*
|
|
899
|
+
* @example
|
|
900
|
+
* ```typescript
|
|
901
|
+
* const detector = new InjectionDetector({
|
|
902
|
+
* allowlist: ['SELECT count(*) FROM users']
|
|
903
|
+
* });
|
|
904
|
+
*
|
|
905
|
+
* detector.isAllowlisted('SELECT count(*) FROM users'); // true
|
|
906
|
+
* detector.isAllowlisted('SELECT * FROM users'); // false
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
isAllowlisted(input) {
|
|
910
|
+
return this.allowlistPatterns.some((pattern) => pattern.test(input));
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Add a pattern to the allowlist at runtime
|
|
914
|
+
*
|
|
915
|
+
* @param pattern - The pattern string to allowlist
|
|
916
|
+
*/
|
|
917
|
+
addToAllowlist(pattern) {
|
|
918
|
+
this.config.allowlist.push(pattern);
|
|
919
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
920
|
+
this.allowlistPatterns.push(new RegExp(`^${escaped}$`, 'i'));
|
|
921
|
+
logger.debug({ pattern }, 'Added pattern to allowlist');
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Add a custom detection pattern at runtime
|
|
925
|
+
*
|
|
926
|
+
* @param pattern - The regex pattern to add
|
|
927
|
+
*/
|
|
928
|
+
addCustomPattern(pattern) {
|
|
929
|
+
this.config.customPatterns.push(pattern);
|
|
930
|
+
logger.debug({ pattern: pattern.toString() }, 'Added custom detection pattern');
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Get the current configuration
|
|
934
|
+
*
|
|
935
|
+
* @returns Current detector configuration
|
|
936
|
+
*/
|
|
937
|
+
getConfig() {
|
|
938
|
+
return { ...this.config };
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Update configuration at runtime
|
|
942
|
+
*
|
|
943
|
+
* @param updates - Partial configuration updates
|
|
944
|
+
*/
|
|
945
|
+
updateConfig(updates) {
|
|
946
|
+
this.config = { ...this.config, ...updates };
|
|
947
|
+
if (updates.allowlist) {
|
|
948
|
+
this.allowlistPatterns = this.config.allowlist.map((pattern) => {
|
|
949
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
950
|
+
return new RegExp(`^${escaped}$`, 'i');
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
logger.debug({ updates: Object.keys(updates) }, 'Updated injection detector config');
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
// =============================================================================
|
|
957
|
+
// Error Classes
|
|
958
|
+
// =============================================================================
|
|
959
|
+
/**
|
|
960
|
+
* Error thrown when an injection attack is detected
|
|
961
|
+
*/
|
|
962
|
+
export class InjectionDetectedError extends ValidationError {
|
|
963
|
+
/** Types of injections detected */
|
|
964
|
+
injectionTypes;
|
|
965
|
+
/** Detection result details */
|
|
966
|
+
detectionResult;
|
|
967
|
+
constructor(message, detectionResult, field) {
|
|
968
|
+
super(message, 'INJECTION_DETECTED', field);
|
|
969
|
+
this.name = 'InjectionDetectedError';
|
|
970
|
+
this.injectionTypes = detectionResult.types;
|
|
971
|
+
this.detectionResult = detectionResult;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Create a Fastify middleware for injection detection
|
|
976
|
+
*
|
|
977
|
+
* Automatically checks request query parameters, body, and headers
|
|
978
|
+
* for injection attacks based on configuration.
|
|
979
|
+
*
|
|
980
|
+
* @param options - Middleware configuration options
|
|
981
|
+
* @returns Fastify preHandler hook function
|
|
982
|
+
*
|
|
983
|
+
* @example
|
|
984
|
+
* ```typescript
|
|
985
|
+
* import Fastify from 'fastify';
|
|
986
|
+
* import { createInjectionDetectionMiddleware } from './injection-detector.js';
|
|
987
|
+
*
|
|
988
|
+
* const fastify = Fastify();
|
|
989
|
+
*
|
|
990
|
+
* fastify.addHook('preHandler', createInjectionDetectionMiddleware({
|
|
991
|
+
* config: {
|
|
992
|
+
* enableSQLDetection: true,
|
|
993
|
+
* enableXSSDetection: true,
|
|
994
|
+
* logDetections: true,
|
|
995
|
+
* blockOnDetection: true,
|
|
996
|
+
* },
|
|
997
|
+
* skipPaths: ['/health', '/metrics'],
|
|
998
|
+
* checkQuery: true,
|
|
999
|
+
* checkBody: true,
|
|
1000
|
+
* checkHeaders: false,
|
|
1001
|
+
* }));
|
|
1002
|
+
* ```
|
|
1003
|
+
*/
|
|
1004
|
+
export function createInjectionDetectionMiddleware(options = {}) {
|
|
1005
|
+
const detector = new InjectionDetector(options.config);
|
|
1006
|
+
const skipPaths = new Set(options.skipPaths ?? []);
|
|
1007
|
+
const skipMethods = new Set((options.skipMethods ?? []).map((m) => m.toUpperCase()));
|
|
1008
|
+
const skipHeaders = new Set((options.skipHeaders ?? [
|
|
1009
|
+
'host',
|
|
1010
|
+
'connection',
|
|
1011
|
+
'content-length',
|
|
1012
|
+
'content-type',
|
|
1013
|
+
'accept',
|
|
1014
|
+
'accept-encoding',
|
|
1015
|
+
'accept-language',
|
|
1016
|
+
'user-agent',
|
|
1017
|
+
'authorization',
|
|
1018
|
+
'cookie',
|
|
1019
|
+
'cache-control',
|
|
1020
|
+
'pragma',
|
|
1021
|
+
'origin',
|
|
1022
|
+
'referer',
|
|
1023
|
+
'sec-fetch-dest',
|
|
1024
|
+
'sec-fetch-mode',
|
|
1025
|
+
'sec-fetch-site',
|
|
1026
|
+
'sec-ch-ua',
|
|
1027
|
+
'sec-ch-ua-mobile',
|
|
1028
|
+
'sec-ch-ua-platform',
|
|
1029
|
+
]).map((h) => h.toLowerCase()));
|
|
1030
|
+
const checkQuery = options.checkQuery ?? true;
|
|
1031
|
+
const checkBody = options.checkBody ?? true;
|
|
1032
|
+
const checkHeaders = options.checkHeaders ?? false;
|
|
1033
|
+
const errorResponse = options.errorResponse ?? {
|
|
1034
|
+
statusCode: 400,
|
|
1035
|
+
code: 'INJECTION_DETECTED',
|
|
1036
|
+
message: 'Potentially malicious input detected',
|
|
1037
|
+
};
|
|
1038
|
+
return async (request, reply) => {
|
|
1039
|
+
// Skip configured paths
|
|
1040
|
+
const routeUrl = request.routeOptions?.url;
|
|
1041
|
+
if (skipPaths.has(request.url) || (routeUrl && skipPaths.has(routeUrl))) {
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
// Skip configured methods
|
|
1045
|
+
if (skipMethods.has(request.method)) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const detections = [];
|
|
1049
|
+
// Check query parameters with URL_PARAM context
|
|
1050
|
+
if (checkQuery && request.query) {
|
|
1051
|
+
const queryObj = request.query;
|
|
1052
|
+
const queryResults = detector.detectInObject(queryObj, InputContext.URL_PARAM);
|
|
1053
|
+
for (const [field, result] of queryResults) {
|
|
1054
|
+
detections.push({ location: 'query', field, result });
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
// Check request body with BODY context
|
|
1058
|
+
if (checkBody && request.body) {
|
|
1059
|
+
if (typeof request.body === 'string') {
|
|
1060
|
+
const result = detector.detect(request.body, InputContext.BODY);
|
|
1061
|
+
if (result.detected) {
|
|
1062
|
+
detections.push({ location: 'body', field: 'body', result });
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
else if (typeof request.body === 'object' && request.body !== null) {
|
|
1066
|
+
const bodyResults = detector.detectInObject(request.body, InputContext.BODY);
|
|
1067
|
+
for (const [field, result] of bodyResults) {
|
|
1068
|
+
detections.push({ location: 'body', field, result });
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
// Check headers with HEADER context
|
|
1073
|
+
if (checkHeaders && request.headers) {
|
|
1074
|
+
for (const [headerName, headerValue] of Object.entries(request.headers)) {
|
|
1075
|
+
if (skipHeaders.has(headerName.toLowerCase())) {
|
|
1076
|
+
continue;
|
|
1077
|
+
}
|
|
1078
|
+
const values = Array.isArray(headerValue)
|
|
1079
|
+
? headerValue
|
|
1080
|
+
: [headerValue];
|
|
1081
|
+
for (const value of values) {
|
|
1082
|
+
if (typeof value === 'string') {
|
|
1083
|
+
const result = detector.detect(value, InputContext.HEADER);
|
|
1084
|
+
if (result.detected) {
|
|
1085
|
+
detections.push({
|
|
1086
|
+
location: 'header',
|
|
1087
|
+
field: headerName,
|
|
1088
|
+
result,
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
// Handle detections
|
|
1096
|
+
if (detections.length > 0) {
|
|
1097
|
+
const config = detector.getConfig();
|
|
1098
|
+
if (config.logDetections) {
|
|
1099
|
+
logger.warn({
|
|
1100
|
+
requestId: request.id,
|
|
1101
|
+
method: request.method,
|
|
1102
|
+
url: request.url,
|
|
1103
|
+
detectionCount: detections.length,
|
|
1104
|
+
detections: detections.map((d) => ({
|
|
1105
|
+
location: d.location,
|
|
1106
|
+
field: d.field,
|
|
1107
|
+
types: d.result.types,
|
|
1108
|
+
})),
|
|
1109
|
+
}, 'Injection attack detected in request');
|
|
1110
|
+
}
|
|
1111
|
+
if (config.blockOnDetection) {
|
|
1112
|
+
return reply.status(errorResponse.statusCode).send({
|
|
1113
|
+
error: {
|
|
1114
|
+
code: errorResponse.code,
|
|
1115
|
+
message: errorResponse.message,
|
|
1116
|
+
details: detections.map((d) => ({
|
|
1117
|
+
location: d.location,
|
|
1118
|
+
field: d.field,
|
|
1119
|
+
types: d.result.types,
|
|
1120
|
+
})),
|
|
1121
|
+
},
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Fastify plugin callback for injection detection
|
|
1129
|
+
*/
|
|
1130
|
+
const injectionDetectionPluginCallback = (fastify, options, done) => {
|
|
1131
|
+
try {
|
|
1132
|
+
// Create detector instance
|
|
1133
|
+
const detector = new InjectionDetector(options.config);
|
|
1134
|
+
// Optionally decorate fastify instance with detector
|
|
1135
|
+
if (options.decorateRequest !== false) {
|
|
1136
|
+
fastify.decorate('injectionDetector', detector);
|
|
1137
|
+
}
|
|
1138
|
+
// Register the middleware
|
|
1139
|
+
fastify.addHook('preHandler', createInjectionDetectionMiddleware(options));
|
|
1140
|
+
logger.info({
|
|
1141
|
+
skipPaths: options.skipPaths?.length ?? 0,
|
|
1142
|
+
checkQuery: options.checkQuery ?? true,
|
|
1143
|
+
checkBody: options.checkBody ?? true,
|
|
1144
|
+
checkHeaders: options.checkHeaders ?? false,
|
|
1145
|
+
blockOnDetection: options.config?.blockOnDetection ?? true,
|
|
1146
|
+
}, 'Injection detection plugin registered');
|
|
1147
|
+
done();
|
|
1148
|
+
}
|
|
1149
|
+
catch (error) {
|
|
1150
|
+
done(error instanceof Error ? error : new Error(String(error)));
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
/**
|
|
1154
|
+
* Fastify plugin for comprehensive injection detection
|
|
1155
|
+
*
|
|
1156
|
+
* Provides automatic injection detection on all routes with
|
|
1157
|
+
* configurable options.
|
|
1158
|
+
*
|
|
1159
|
+
* @example
|
|
1160
|
+
* ```typescript
|
|
1161
|
+
* import Fastify from 'fastify';
|
|
1162
|
+
* import { injectionDetectionPlugin } from './injection-detector.js';
|
|
1163
|
+
*
|
|
1164
|
+
* const fastify = Fastify();
|
|
1165
|
+
*
|
|
1166
|
+
* await fastify.register(injectionDetectionPlugin, {
|
|
1167
|
+
* config: {
|
|
1168
|
+
* enableSQLDetection: true,
|
|
1169
|
+
* enableXSSDetection: true,
|
|
1170
|
+
* blockOnDetection: true,
|
|
1171
|
+
* },
|
|
1172
|
+
* skipPaths: ['/health', '/metrics'],
|
|
1173
|
+
* });
|
|
1174
|
+
* ```
|
|
1175
|
+
*/
|
|
1176
|
+
export const injectionDetectionPlugin = fp(injectionDetectionPluginCallback, {
|
|
1177
|
+
name: 'vorion-injection-detection',
|
|
1178
|
+
fastify: '5.x',
|
|
1179
|
+
});
|
|
1180
|
+
// =============================================================================
|
|
1181
|
+
// Utility Functions
|
|
1182
|
+
// =============================================================================
|
|
1183
|
+
/**
|
|
1184
|
+
* Create a pre-configured detector for SQL-only detection
|
|
1185
|
+
*
|
|
1186
|
+
* @returns InjectionDetector configured for SQL injection only
|
|
1187
|
+
*/
|
|
1188
|
+
export function createSQLInjectionDetector() {
|
|
1189
|
+
return new InjectionDetector({
|
|
1190
|
+
enableSQLDetection: true,
|
|
1191
|
+
enableXSSDetection: false,
|
|
1192
|
+
enableCommandDetection: false,
|
|
1193
|
+
enableTemplateDetection: false,
|
|
1194
|
+
enablePathTraversalDetection: false,
|
|
1195
|
+
enableLDAPDetection: false,
|
|
1196
|
+
enableXMLDetection: false,
|
|
1197
|
+
enableNoSQLDetection: false,
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Create a pre-configured detector for XSS-only detection
|
|
1202
|
+
*
|
|
1203
|
+
* @returns InjectionDetector configured for XSS detection only
|
|
1204
|
+
*/
|
|
1205
|
+
export function createXSSDetector() {
|
|
1206
|
+
return new InjectionDetector({
|
|
1207
|
+
enableSQLDetection: false,
|
|
1208
|
+
enableXSSDetection: true,
|
|
1209
|
+
enableCommandDetection: false,
|
|
1210
|
+
enableTemplateDetection: false,
|
|
1211
|
+
enablePathTraversalDetection: false,
|
|
1212
|
+
enableLDAPDetection: false,
|
|
1213
|
+
enableXMLDetection: false,
|
|
1214
|
+
enableNoSQLDetection: false,
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Create a pre-configured detector for API security (SQL, NoSQL, Command)
|
|
1219
|
+
*
|
|
1220
|
+
* @returns InjectionDetector configured for common API attack vectors
|
|
1221
|
+
*/
|
|
1222
|
+
export function createAPISecurityDetector() {
|
|
1223
|
+
return new InjectionDetector({
|
|
1224
|
+
enableSQLDetection: true,
|
|
1225
|
+
enableXSSDetection: false,
|
|
1226
|
+
enableCommandDetection: true,
|
|
1227
|
+
enableTemplateDetection: true,
|
|
1228
|
+
enablePathTraversalDetection: true,
|
|
1229
|
+
enableLDAPDetection: false,
|
|
1230
|
+
enableXMLDetection: true,
|
|
1231
|
+
enableNoSQLDetection: true,
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Quick check function for ad-hoc injection detection
|
|
1236
|
+
*
|
|
1237
|
+
* @param input - String to check
|
|
1238
|
+
* @param types - Specific injection types to check (default: all)
|
|
1239
|
+
* @returns True if any injection patterns are detected
|
|
1240
|
+
*
|
|
1241
|
+
* @example
|
|
1242
|
+
* ```typescript
|
|
1243
|
+
* if (hasInjection(userInput, [InjectionType.SQL, InjectionType.XSS])) {
|
|
1244
|
+
* throw new Error('Invalid input');
|
|
1245
|
+
* }
|
|
1246
|
+
* ```
|
|
1247
|
+
*/
|
|
1248
|
+
export function hasInjection(input, types) {
|
|
1249
|
+
const typesToCheck = types ?? Object.values(InjectionType);
|
|
1250
|
+
for (const type of typesToCheck) {
|
|
1251
|
+
const patterns = INJECTION_PATTERNS[type];
|
|
1252
|
+
for (const pattern of patterns) {
|
|
1253
|
+
if (pattern.test(input)) {
|
|
1254
|
+
return true;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
return false;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Quick sanitize function for ad-hoc input sanitization
|
|
1262
|
+
*
|
|
1263
|
+
* @param input - String to sanitize
|
|
1264
|
+
* @returns Sanitized string
|
|
1265
|
+
*/
|
|
1266
|
+
export function sanitizeInput(input) {
|
|
1267
|
+
const detector = new InjectionDetector();
|
|
1268
|
+
return detector.sanitize(input);
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Create a detector with low sensitivity (fewer false positives)
|
|
1272
|
+
*
|
|
1273
|
+
* Low sensitivity is suitable for environments where legitimate data
|
|
1274
|
+
* may contain patterns that look like injection (e.g., code snippets,
|
|
1275
|
+
* documentation, or technical data).
|
|
1276
|
+
*
|
|
1277
|
+
* @returns InjectionDetector with low sensitivity
|
|
1278
|
+
*/
|
|
1279
|
+
export function createLowSensitivityDetector() {
|
|
1280
|
+
return new InjectionDetector({
|
|
1281
|
+
sensitivity: SensitivityLevel.LOW,
|
|
1282
|
+
contextAware: true,
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Create a detector with high sensitivity (more aggressive detection)
|
|
1287
|
+
*
|
|
1288
|
+
* High sensitivity is suitable for environments where security is
|
|
1289
|
+
* paramount and false positives are acceptable (e.g., user registration,
|
|
1290
|
+
* public-facing forms, or untrusted input).
|
|
1291
|
+
*
|
|
1292
|
+
* @returns InjectionDetector with high sensitivity
|
|
1293
|
+
*/
|
|
1294
|
+
export function createHighSensitivityDetector() {
|
|
1295
|
+
return new InjectionDetector({
|
|
1296
|
+
sensitivity: SensitivityLevel.HIGH,
|
|
1297
|
+
contextAware: true,
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Create a context-aware detector with custom safe patterns
|
|
1302
|
+
*
|
|
1303
|
+
* @param safePatterns - Additional patterns to treat as safe
|
|
1304
|
+
* @param sensitivity - Detection sensitivity level
|
|
1305
|
+
* @returns Configured InjectionDetector
|
|
1306
|
+
*
|
|
1307
|
+
* @example
|
|
1308
|
+
* ```typescript
|
|
1309
|
+
* const detector = createContextAwareDetector([
|
|
1310
|
+
* {
|
|
1311
|
+
* pattern: /^my-app-\d+$/,
|
|
1312
|
+
* contexts: [InputContext.BODY, InputContext.URL_PARAM],
|
|
1313
|
+
* description: 'Application ID format',
|
|
1314
|
+
* },
|
|
1315
|
+
* ], SensitivityLevel.MEDIUM);
|
|
1316
|
+
* ```
|
|
1317
|
+
*/
|
|
1318
|
+
export function createContextAwareDetector(safePatterns = [], sensitivity = SensitivityLevel.MEDIUM) {
|
|
1319
|
+
return new InjectionDetector({
|
|
1320
|
+
sensitivity,
|
|
1321
|
+
contextAware: true,
|
|
1322
|
+
customSafePatterns: safePatterns,
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
//# sourceMappingURL=injection-detector.js.map
|