@oculum/scanner 1.0.9 → 1.0.11
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/dist/baseline/diff.d.ts +32 -0
- package/dist/baseline/diff.d.ts.map +1 -0
- package/dist/baseline/diff.js +119 -0
- package/dist/baseline/diff.js.map +1 -0
- package/dist/baseline/index.d.ts +9 -0
- package/dist/baseline/index.d.ts.map +1 -0
- package/dist/baseline/index.js +19 -0
- package/dist/baseline/index.js.map +1 -0
- package/dist/baseline/manager.d.ts +67 -0
- package/dist/baseline/manager.d.ts.map +1 -0
- package/dist/baseline/manager.js +180 -0
- package/dist/baseline/manager.js.map +1 -0
- package/dist/baseline/types.d.ts +91 -0
- package/dist/baseline/types.d.ts.map +1 -0
- package/dist/baseline/types.js +12 -0
- package/dist/baseline/types.js.map +1 -0
- package/dist/formatters/cli-terminal.d.ts +38 -0
- package/dist/formatters/cli-terminal.d.ts.map +1 -1
- package/dist/formatters/cli-terminal.js +365 -42
- package/dist/formatters/cli-terminal.js.map +1 -1
- package/dist/formatters/github-comment.d.ts +1 -1
- package/dist/formatters/github-comment.d.ts.map +1 -1
- package/dist/formatters/github-comment.js +75 -11
- package/dist/formatters/github-comment.js.map +1 -1
- package/dist/formatters/index.d.ts +1 -1
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +4 -1
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -16
- package/dist/index.js.map +1 -1
- package/dist/layer1/config-audit.d.ts.map +1 -1
- package/dist/layer1/config-audit.js +20 -3
- package/dist/layer1/config-audit.js.map +1 -1
- package/dist/layer1/config-mcp-audit.d.ts +20 -0
- package/dist/layer1/config-mcp-audit.d.ts.map +1 -0
- package/dist/layer1/config-mcp-audit.js +239 -0
- package/dist/layer1/config-mcp-audit.js.map +1 -0
- package/dist/layer1/index.d.ts +1 -0
- package/dist/layer1/index.d.ts.map +1 -1
- package/dist/layer1/index.js +9 -1
- package/dist/layer1/index.js.map +1 -1
- package/dist/layer2/ai-agent-tools.d.ts.map +1 -1
- package/dist/layer2/ai-agent-tools.js +303 -0
- package/dist/layer2/ai-agent-tools.js.map +1 -1
- package/dist/layer2/ai-endpoint-protection.d.ts.map +1 -1
- package/dist/layer2/ai-endpoint-protection.js +17 -3
- package/dist/layer2/ai-endpoint-protection.js.map +1 -1
- package/dist/layer2/ai-execution-sinks.d.ts.map +1 -1
- package/dist/layer2/ai-execution-sinks.js +462 -12
- package/dist/layer2/ai-execution-sinks.js.map +1 -1
- package/dist/layer2/ai-fingerprinting.d.ts.map +1 -1
- package/dist/layer2/ai-fingerprinting.js +3 -0
- package/dist/layer2/ai-fingerprinting.js.map +1 -1
- package/dist/layer2/ai-mcp-security.d.ts +17 -0
- package/dist/layer2/ai-mcp-security.d.ts.map +1 -0
- package/dist/layer2/ai-mcp-security.js +679 -0
- package/dist/layer2/ai-mcp-security.js.map +1 -0
- package/dist/layer2/ai-package-hallucination.d.ts +19 -0
- package/dist/layer2/ai-package-hallucination.d.ts.map +1 -0
- package/dist/layer2/ai-package-hallucination.js +696 -0
- package/dist/layer2/ai-package-hallucination.js.map +1 -0
- package/dist/layer2/ai-prompt-hygiene.d.ts.map +1 -1
- package/dist/layer2/ai-prompt-hygiene.js +495 -9
- package/dist/layer2/ai-prompt-hygiene.js.map +1 -1
- package/dist/layer2/ai-rag-safety.d.ts.map +1 -1
- package/dist/layer2/ai-rag-safety.js +372 -1
- package/dist/layer2/ai-rag-safety.js.map +1 -1
- package/dist/layer2/auth-antipatterns.d.ts.map +1 -1
- package/dist/layer2/auth-antipatterns.js +4 -0
- package/dist/layer2/auth-antipatterns.js.map +1 -1
- package/dist/layer2/byok-patterns.d.ts.map +1 -1
- package/dist/layer2/byok-patterns.js +3 -0
- package/dist/layer2/byok-patterns.js.map +1 -1
- package/dist/layer2/dangerous-functions/child-process.d.ts +16 -0
- package/dist/layer2/dangerous-functions/child-process.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/child-process.js +74 -0
- package/dist/layer2/dangerous-functions/child-process.js.map +1 -0
- package/dist/layer2/dangerous-functions/dom-xss.d.ts +29 -0
- package/dist/layer2/dangerous-functions/dom-xss.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/dom-xss.js +179 -0
- package/dist/layer2/dangerous-functions/dom-xss.js.map +1 -0
- package/dist/layer2/dangerous-functions/index.d.ts +13 -0
- package/dist/layer2/dangerous-functions/index.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/index.js +621 -0
- package/dist/layer2/dangerous-functions/index.js.map +1 -0
- package/dist/layer2/dangerous-functions/json-parse.d.ts +31 -0
- package/dist/layer2/dangerous-functions/json-parse.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/json-parse.js +319 -0
- package/dist/layer2/dangerous-functions/json-parse.js.map +1 -0
- package/dist/layer2/dangerous-functions/math-random.d.ts +61 -0
- package/dist/layer2/dangerous-functions/math-random.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/math-random.js +459 -0
- package/dist/layer2/dangerous-functions/math-random.js.map +1 -0
- package/dist/layer2/dangerous-functions/patterns.d.ts +21 -0
- package/dist/layer2/dangerous-functions/patterns.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/patterns.js +161 -0
- package/dist/layer2/dangerous-functions/patterns.js.map +1 -0
- package/dist/layer2/dangerous-functions/request-validation.d.ts +13 -0
- package/dist/layer2/dangerous-functions/request-validation.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/request-validation.js +119 -0
- package/dist/layer2/dangerous-functions/request-validation.js.map +1 -0
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts +23 -0
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/utils/control-flow.js +149 -0
- package/dist/layer2/dangerous-functions/utils/control-flow.js.map +1 -0
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts +31 -0
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/utils/helpers.js +124 -0
- package/dist/layer2/dangerous-functions/utils/helpers.js.map +1 -0
- package/dist/layer2/dangerous-functions/utils/index.d.ts +9 -0
- package/dist/layer2/dangerous-functions/utils/index.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/utils/index.js +23 -0
- package/dist/layer2/dangerous-functions/utils/index.js.map +1 -0
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts +22 -0
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts.map +1 -0
- package/dist/layer2/dangerous-functions/utils/schema-validation.js +89 -0
- package/dist/layer2/dangerous-functions/utils/schema-validation.js.map +1 -0
- package/dist/layer2/data-exposure.d.ts.map +1 -1
- package/dist/layer2/data-exposure.js +3 -0
- package/dist/layer2/data-exposure.js.map +1 -1
- package/dist/layer2/framework-checks.d.ts.map +1 -1
- package/dist/layer2/framework-checks.js +3 -0
- package/dist/layer2/framework-checks.js.map +1 -1
- package/dist/layer2/index.d.ts +3 -0
- package/dist/layer2/index.d.ts.map +1 -1
- package/dist/layer2/index.js +61 -2
- package/dist/layer2/index.js.map +1 -1
- package/dist/layer2/logic-gates.d.ts.map +1 -1
- package/dist/layer2/logic-gates.js +4 -0
- package/dist/layer2/logic-gates.js.map +1 -1
- package/dist/layer2/model-supply-chain.d.ts +20 -0
- package/dist/layer2/model-supply-chain.d.ts.map +1 -0
- package/dist/layer2/model-supply-chain.js +376 -0
- package/dist/layer2/model-supply-chain.js.map +1 -0
- package/dist/layer2/risky-imports.d.ts.map +1 -1
- package/dist/layer2/risky-imports.js +4 -0
- package/dist/layer2/risky-imports.js.map +1 -1
- package/dist/layer2/variables.d.ts.map +1 -1
- package/dist/layer2/variables.js +4 -0
- package/dist/layer2/variables.js.map +1 -1
- package/dist/layer3/anthropic/auto-dismiss.d.ts +24 -0
- package/dist/layer3/anthropic/auto-dismiss.d.ts.map +1 -0
- package/dist/layer3/anthropic/auto-dismiss.js +188 -0
- package/dist/layer3/anthropic/auto-dismiss.js.map +1 -0
- package/dist/layer3/anthropic/clients.d.ts +44 -0
- package/dist/layer3/anthropic/clients.d.ts.map +1 -0
- package/dist/layer3/anthropic/clients.js +81 -0
- package/dist/layer3/anthropic/clients.js.map +1 -0
- package/dist/layer3/anthropic/index.d.ts +41 -0
- package/dist/layer3/anthropic/index.d.ts.map +1 -0
- package/dist/layer3/anthropic/index.js +141 -0
- package/dist/layer3/anthropic/index.js.map +1 -0
- package/dist/layer3/anthropic/prompts/index.d.ts +8 -0
- package/dist/layer3/anthropic/prompts/index.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/index.js +14 -0
- package/dist/layer3/anthropic/prompts/index.js.map +1 -0
- package/dist/layer3/anthropic/prompts/semantic-analysis.d.ts +15 -0
- package/dist/layer3/anthropic/prompts/semantic-analysis.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/semantic-analysis.js +169 -0
- package/dist/layer3/anthropic/prompts/semantic-analysis.js.map +1 -0
- package/dist/layer3/anthropic/prompts/validation.d.ts +12 -0
- package/dist/layer3/anthropic/prompts/validation.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/validation.js +421 -0
- package/dist/layer3/anthropic/prompts/validation.js.map +1 -0
- package/dist/layer3/anthropic/providers/anthropic.d.ts +21 -0
- package/dist/layer3/anthropic/providers/anthropic.d.ts.map +1 -0
- package/dist/layer3/anthropic/providers/anthropic.js +266 -0
- package/dist/layer3/anthropic/providers/anthropic.js.map +1 -0
- package/dist/layer3/anthropic/providers/index.d.ts +8 -0
- package/dist/layer3/anthropic/providers/index.d.ts.map +1 -0
- package/dist/layer3/anthropic/providers/index.js +15 -0
- package/dist/layer3/anthropic/providers/index.js.map +1 -0
- package/dist/layer3/anthropic/providers/openai.d.ts +18 -0
- package/dist/layer3/anthropic/providers/openai.d.ts.map +1 -0
- package/dist/layer3/anthropic/providers/openai.js +340 -0
- package/dist/layer3/anthropic/providers/openai.js.map +1 -0
- package/dist/layer3/anthropic/request-builder.d.ts +20 -0
- package/dist/layer3/anthropic/request-builder.d.ts.map +1 -0
- package/dist/layer3/anthropic/request-builder.js +134 -0
- package/dist/layer3/anthropic/request-builder.js.map +1 -0
- package/dist/layer3/anthropic/types.d.ts +88 -0
- package/dist/layer3/anthropic/types.d.ts.map +1 -0
- package/dist/layer3/anthropic/types.js +38 -0
- package/dist/layer3/anthropic/types.js.map +1 -0
- package/dist/layer3/anthropic/utils/index.d.ts +9 -0
- package/dist/layer3/anthropic/utils/index.d.ts.map +1 -0
- package/dist/layer3/anthropic/utils/index.js +24 -0
- package/dist/layer3/anthropic/utils/index.js.map +1 -0
- package/dist/layer3/anthropic/utils/path-helpers.d.ts +21 -0
- package/dist/layer3/anthropic/utils/path-helpers.d.ts.map +1 -0
- package/dist/layer3/anthropic/utils/path-helpers.js +69 -0
- package/dist/layer3/anthropic/utils/path-helpers.js.map +1 -0
- package/dist/layer3/anthropic/utils/response-parser.d.ts +40 -0
- package/dist/layer3/anthropic/utils/response-parser.d.ts.map +1 -0
- package/dist/layer3/anthropic/utils/response-parser.js +285 -0
- package/dist/layer3/anthropic/utils/response-parser.js.map +1 -0
- package/dist/layer3/anthropic/utils/retry.d.ts +15 -0
- package/dist/layer3/anthropic/utils/retry.d.ts.map +1 -0
- package/dist/layer3/anthropic/utils/retry.js +62 -0
- package/dist/layer3/anthropic/utils/retry.js.map +1 -0
- package/dist/layer3/index.d.ts +1 -0
- package/dist/layer3/index.d.ts.map +1 -1
- package/dist/layer3/index.js +16 -6
- package/dist/layer3/index.js.map +1 -1
- package/dist/layer3/osv-check.d.ts +75 -0
- package/dist/layer3/osv-check.d.ts.map +1 -0
- package/dist/layer3/osv-check.js +308 -0
- package/dist/layer3/osv-check.js.map +1 -0
- package/dist/rules/framework-fixes.d.ts +48 -0
- package/dist/rules/framework-fixes.d.ts.map +1 -0
- package/dist/rules/framework-fixes.js +439 -0
- package/dist/rules/framework-fixes.js.map +1 -0
- package/dist/rules/index.d.ts +8 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +18 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/metadata.d.ts +43 -0
- package/dist/rules/metadata.d.ts.map +1 -0
- package/dist/rules/metadata.js +734 -0
- package/dist/rules/metadata.js.map +1 -0
- package/dist/suppression/config-loader.d.ts +74 -0
- package/dist/suppression/config-loader.d.ts.map +1 -0
- package/dist/suppression/config-loader.js +424 -0
- package/dist/suppression/config-loader.js.map +1 -0
- package/dist/suppression/hash.d.ts +48 -0
- package/dist/suppression/hash.d.ts.map +1 -0
- package/dist/suppression/hash.js +88 -0
- package/dist/suppression/hash.js.map +1 -0
- package/dist/suppression/index.d.ts +11 -0
- package/dist/suppression/index.d.ts.map +1 -0
- package/dist/suppression/index.js +39 -0
- package/dist/suppression/index.js.map +1 -0
- package/dist/suppression/inline-parser.d.ts +39 -0
- package/dist/suppression/inline-parser.d.ts.map +1 -0
- package/dist/suppression/inline-parser.js +218 -0
- package/dist/suppression/inline-parser.js.map +1 -0
- package/dist/suppression/manager.d.ts +94 -0
- package/dist/suppression/manager.d.ts.map +1 -0
- package/dist/suppression/manager.js +292 -0
- package/dist/suppression/manager.js.map +1 -0
- package/dist/suppression/types.d.ts +151 -0
- package/dist/suppression/types.d.ts.map +1 -0
- package/dist/suppression/types.js +28 -0
- package/dist/suppression/types.js.map +1 -0
- package/dist/tiers.d.ts +1 -1
- package/dist/tiers.d.ts.map +1 -1
- package/dist/tiers.js +27 -0
- package/dist/tiers.js.map +1 -1
- package/dist/types.d.ts +62 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/context-helpers.d.ts +4 -0
- package/dist/utils/context-helpers.d.ts.map +1 -1
- package/dist/utils/context-helpers.js +13 -9
- package/dist/utils/context-helpers.js.map +1 -1
- package/package.json +4 -2
- package/src/__tests__/benchmark/fixtures/layer1/mcp-config-audit.json +31 -0
- package/src/__tests__/benchmark/fixtures/layer2/ai-execution-sinks.ts +1489 -82
- package/src/__tests__/benchmark/fixtures/layer2/ai-mcp-security.ts +495 -0
- package/src/__tests__/benchmark/fixtures/layer2/ai-package-hallucination.ts +255 -0
- package/src/__tests__/benchmark/fixtures/layer2/ai-prompt-hygiene.ts +300 -1
- package/src/__tests__/benchmark/fixtures/layer2/ai-rag-safety.ts +139 -0
- package/src/__tests__/benchmark/fixtures/layer2/byok-patterns.ts +7 -0
- package/src/__tests__/benchmark/fixtures/layer2/data-exposure.ts +63 -0
- package/src/__tests__/benchmark/fixtures/layer2/excessive-agency.ts +221 -0
- package/src/__tests__/benchmark/fixtures/layer2/index.ts +18 -0
- package/src/__tests__/benchmark/fixtures/layer2/model-supply-chain.ts +204 -0
- package/src/__tests__/benchmark/fixtures/layer2/phase1-enhancements.ts +157 -0
- package/src/__tests__/snapshots/__snapshots__/anthropic-validation-refactor.test.ts.snap +758 -0
- package/src/__tests__/snapshots/__snapshots__/dangerous-functions-refactor.test.ts.snap +503 -0
- package/src/__tests__/snapshots/anthropic-validation-refactor.test.ts +321 -0
- package/src/__tests__/snapshots/dangerous-functions-refactor.test.ts +439 -0
- package/src/baseline/__tests__/diff.test.ts +261 -0
- package/src/baseline/__tests__/manager.test.ts +225 -0
- package/src/baseline/diff.ts +135 -0
- package/src/baseline/index.ts +29 -0
- package/src/baseline/manager.ts +230 -0
- package/src/baseline/types.ts +97 -0
- package/src/formatters/cli-terminal.ts +444 -41
- package/src/formatters/github-comment.ts +79 -11
- package/src/formatters/index.ts +4 -0
- package/src/index.ts +197 -14
- package/src/layer1/config-audit.ts +24 -3
- package/src/layer1/config-mcp-audit.ts +276 -0
- package/src/layer1/index.ts +16 -6
- package/src/layer2/ai-agent-tools.ts +336 -0
- package/src/layer2/ai-endpoint-protection.ts +16 -3
- package/src/layer2/ai-execution-sinks.ts +516 -12
- package/src/layer2/ai-fingerprinting.ts +5 -1
- package/src/layer2/ai-mcp-security.ts +730 -0
- package/src/layer2/ai-package-hallucination.ts +791 -0
- package/src/layer2/ai-prompt-hygiene.ts +547 -9
- package/src/layer2/ai-rag-safety.ts +382 -3
- package/src/layer2/auth-antipatterns.ts +5 -0
- package/src/layer2/byok-patterns.ts +5 -1
- package/src/layer2/dangerous-functions/child-process.ts +98 -0
- package/src/layer2/dangerous-functions/dom-xss.ts +220 -0
- package/src/layer2/dangerous-functions/index.ts +949 -0
- package/src/layer2/dangerous-functions/json-parse.ts +385 -0
- package/src/layer2/dangerous-functions/math-random.ts +537 -0
- package/src/layer2/dangerous-functions/patterns.ts +174 -0
- package/src/layer2/dangerous-functions/request-validation.ts +145 -0
- package/src/layer2/dangerous-functions/utils/control-flow.ts +162 -0
- package/src/layer2/dangerous-functions/utils/helpers.ts +170 -0
- package/src/layer2/dangerous-functions/utils/index.ts +25 -0
- package/src/layer2/dangerous-functions/utils/schema-validation.ts +91 -0
- package/src/layer2/data-exposure.ts +5 -1
- package/src/layer2/framework-checks.ts +5 -0
- package/src/layer2/index.ts +63 -1
- package/src/layer2/logic-gates.ts +5 -0
- package/src/layer2/model-supply-chain.ts +456 -0
- package/src/layer2/risky-imports.ts +5 -0
- package/src/layer2/variables.ts +5 -0
- package/src/layer3/__tests__/osv-check.test.ts +384 -0
- package/src/layer3/anthropic/auto-dismiss.ts +212 -0
- package/src/layer3/anthropic/clients.ts +84 -0
- package/src/layer3/anthropic/index.ts +170 -0
- package/src/layer3/anthropic/prompts/index.ts +14 -0
- package/src/layer3/anthropic/prompts/semantic-analysis.ts +173 -0
- package/src/layer3/anthropic/prompts/validation.ts +419 -0
- package/src/layer3/anthropic/providers/anthropic.ts +310 -0
- package/src/layer3/anthropic/providers/index.ts +8 -0
- package/src/layer3/anthropic/providers/openai.ts +384 -0
- package/src/layer3/anthropic/request-builder.ts +150 -0
- package/src/layer3/anthropic/types.ts +148 -0
- package/src/layer3/anthropic/utils/index.ts +26 -0
- package/src/layer3/anthropic/utils/path-helpers.ts +68 -0
- package/src/layer3/anthropic/utils/response-parser.ts +322 -0
- package/src/layer3/anthropic/utils/retry.ts +75 -0
- package/src/layer3/index.ts +18 -5
- package/src/layer3/osv-check.ts +420 -0
- package/src/rules/__tests__/framework-fixes.test.ts +689 -0
- package/src/rules/__tests__/metadata.test.ts +218 -0
- package/src/rules/framework-fixes.ts +470 -0
- package/src/rules/index.ts +21 -0
- package/src/rules/metadata.ts +831 -0
- package/src/suppression/__tests__/config-loader.test.ts +382 -0
- package/src/suppression/__tests__/hash.test.ts +166 -0
- package/src/suppression/__tests__/inline-parser.test.ts +212 -0
- package/src/suppression/__tests__/manager.test.ts +415 -0
- package/src/suppression/config-loader.ts +462 -0
- package/src/suppression/hash.ts +95 -0
- package/src/suppression/index.ts +51 -0
- package/src/suppression/inline-parser.ts +273 -0
- package/src/suppression/manager.ts +379 -0
- package/src/suppression/types.ts +174 -0
- package/src/tiers.ts +36 -0
- package/src/types.ts +90 -0
- package/src/utils/context-helpers.ts +13 -9
- package/dist/layer2/dangerous-functions.d.ts +0 -7
- package/dist/layer2/dangerous-functions.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions.js +0 -1701
- package/dist/layer2/dangerous-functions.js.map +0 -1
- package/dist/layer3/anthropic.d.ts +0 -87
- package/dist/layer3/anthropic.d.ts.map +0 -1
- package/dist/layer3/anthropic.js +0 -1948
- package/dist/layer3/anthropic.js.map +0 -1
- package/dist/layer3/openai.d.ts +0 -25
- package/dist/layer3/openai.d.ts.map +0 -1
- package/dist/layer3/openai.js +0 -238
- package/dist/layer3/openai.js.map +0 -1
- package/src/layer2/dangerous-functions.ts +0 -1940
- package/src/layer3/anthropic.ts +0 -2257
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Suppression Manager
|
|
4
|
+
* Central class for managing all suppression logic
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SuppressionManager = void 0;
|
|
8
|
+
const minimatch_1 = require("minimatch");
|
|
9
|
+
const config_loader_1 = require("./config-loader");
|
|
10
|
+
const inline_parser_1 = require("./inline-parser");
|
|
11
|
+
const hash_1 = require("./hash");
|
|
12
|
+
/**
|
|
13
|
+
* SuppressionManager handles all suppression logic
|
|
14
|
+
*
|
|
15
|
+
* Priority order for suppressions:
|
|
16
|
+
* 1. Inline comment suppressions (highest priority)
|
|
17
|
+
* 2. Config file finding suppressions (by hash)
|
|
18
|
+
* 3. Config file rule suppressions (by category)
|
|
19
|
+
*/
|
|
20
|
+
class SuppressionManager {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
// Cache for inline suppressions by file path
|
|
23
|
+
this.inlineSuppressionCache = new Map();
|
|
24
|
+
this.projectPath = options.projectPath;
|
|
25
|
+
this.includeExpired = options.includeExpired ?? false;
|
|
26
|
+
if (options.config) {
|
|
27
|
+
this.config = options.config;
|
|
28
|
+
this.configPath = undefined;
|
|
29
|
+
this.configErrors = [];
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const result = (0, config_loader_1.loadSuppressionConfig)(options.projectPath);
|
|
33
|
+
this.config = result.config;
|
|
34
|
+
this.configPath = result.configPath;
|
|
35
|
+
this.configErrors = result.errors;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get configuration errors (if any)
|
|
40
|
+
*/
|
|
41
|
+
getConfigErrors() {
|
|
42
|
+
return this.configErrors;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the path to the config file (if found)
|
|
46
|
+
*/
|
|
47
|
+
getConfigPath() {
|
|
48
|
+
return this.configPath;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if a file path should be ignored entirely
|
|
52
|
+
*/
|
|
53
|
+
isPathIgnored(filePath) {
|
|
54
|
+
if (!this.config.ignore || this.config.ignore.length === 0) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const normalizedPath = (0, hash_1.normalizePathForHash)(filePath);
|
|
58
|
+
return this.config.ignore.some(pattern => (0, minimatch_1.minimatch)(normalizedPath, pattern, { dot: true }));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse inline suppressions for a file
|
|
62
|
+
*/
|
|
63
|
+
getInlineSuppressions(filePath, content) {
|
|
64
|
+
// Check cache first
|
|
65
|
+
const cached = this.inlineSuppressionCache.get(filePath);
|
|
66
|
+
if (cached) {
|
|
67
|
+
return cached;
|
|
68
|
+
}
|
|
69
|
+
// Parse and cache
|
|
70
|
+
const suppressions = (0, inline_parser_1.parseInlineSuppressions)(content);
|
|
71
|
+
this.inlineSuppressionCache.set(filePath, suppressions);
|
|
72
|
+
return suppressions;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if a finding is suppressed
|
|
76
|
+
*
|
|
77
|
+
* Priority:
|
|
78
|
+
* 1. Inline comment (highest)
|
|
79
|
+
* 2. Config finding suppression (by hash)
|
|
80
|
+
* 3. Config rule suppression (by category)
|
|
81
|
+
*/
|
|
82
|
+
isFindingSuppressed(finding, fileContent) {
|
|
83
|
+
const hash = (0, hash_1.computeFindingHash)(finding);
|
|
84
|
+
const normalizedPath = (0, hash_1.normalizePathForHash)(finding.filePath);
|
|
85
|
+
// 1. Check inline suppressions (if file content provided)
|
|
86
|
+
if (fileContent) {
|
|
87
|
+
const inlineSuppressions = this.getInlineSuppressions(finding.filePath, fileContent);
|
|
88
|
+
const inlineSuppression = (0, inline_parser_1.isLineSuppressed)(inlineSuppressions, finding.lineNumber, finding.category);
|
|
89
|
+
if (inlineSuppression) {
|
|
90
|
+
return {
|
|
91
|
+
suppressed: true,
|
|
92
|
+
match: {
|
|
93
|
+
type: 'inline',
|
|
94
|
+
reason: inlineSuppression.reason,
|
|
95
|
+
},
|
|
96
|
+
hash,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// 2. Check config finding suppressions (by hash)
|
|
101
|
+
const findingSuppressions = this.config.suppressions?.findings || [];
|
|
102
|
+
const findingSuppression = findingSuppressions.find(s => s.hash === hash);
|
|
103
|
+
if (findingSuppression) {
|
|
104
|
+
const expired = (0, config_loader_1.isExpired)(findingSuppression.expires);
|
|
105
|
+
if (expired && !this.includeExpired) {
|
|
106
|
+
// Expired - not suppressed
|
|
107
|
+
return {
|
|
108
|
+
suppressed: false,
|
|
109
|
+
match: {
|
|
110
|
+
type: 'config-finding',
|
|
111
|
+
reason: findingSuppression.reason,
|
|
112
|
+
expires: findingSuppression.expires,
|
|
113
|
+
expired: true,
|
|
114
|
+
},
|
|
115
|
+
hash,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
suppressed: true,
|
|
120
|
+
match: {
|
|
121
|
+
type: 'config-finding',
|
|
122
|
+
reason: findingSuppression.reason,
|
|
123
|
+
expires: findingSuppression.expires,
|
|
124
|
+
expired,
|
|
125
|
+
},
|
|
126
|
+
hash,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// 3. Check config rule suppressions (by category)
|
|
130
|
+
const ruleSuppressions = this.config.suppressions?.rules || [];
|
|
131
|
+
const ruleSuppression = ruleSuppressions.find(s => {
|
|
132
|
+
// Must match category
|
|
133
|
+
if (s.category !== finding.category) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
// If paths specified, must match one of them
|
|
137
|
+
if (s.paths && s.paths.length > 0) {
|
|
138
|
+
const matchesPath = s.paths.some(pattern => (0, minimatch_1.minimatch)(normalizedPath, pattern, { dot: true }));
|
|
139
|
+
if (!matchesPath) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
});
|
|
145
|
+
if (ruleSuppression) {
|
|
146
|
+
const expired = (0, config_loader_1.isExpired)(ruleSuppression.expires);
|
|
147
|
+
if (expired && !this.includeExpired) {
|
|
148
|
+
// Expired - not suppressed
|
|
149
|
+
return {
|
|
150
|
+
suppressed: false,
|
|
151
|
+
match: {
|
|
152
|
+
type: 'config-rule',
|
|
153
|
+
reason: ruleSuppression.reason,
|
|
154
|
+
expires: ruleSuppression.expires,
|
|
155
|
+
expired: true,
|
|
156
|
+
},
|
|
157
|
+
hash,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
suppressed: true,
|
|
162
|
+
match: {
|
|
163
|
+
type: 'config-rule',
|
|
164
|
+
reason: ruleSuppression.reason,
|
|
165
|
+
expires: ruleSuppression.expires,
|
|
166
|
+
expired,
|
|
167
|
+
},
|
|
168
|
+
hash,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
// Not suppressed
|
|
172
|
+
return {
|
|
173
|
+
suppressed: false,
|
|
174
|
+
hash,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Apply suppressions to a list of findings
|
|
179
|
+
*/
|
|
180
|
+
applySuppressions(findings, files) {
|
|
181
|
+
// Build file content lookup
|
|
182
|
+
const fileContentMap = new Map();
|
|
183
|
+
for (const file of files) {
|
|
184
|
+
fileContentMap.set((0, hash_1.normalizePathForHash)(file.path), file.content);
|
|
185
|
+
}
|
|
186
|
+
const passed = [];
|
|
187
|
+
const suppressed = [];
|
|
188
|
+
let expiredCount = 0;
|
|
189
|
+
const stats = {
|
|
190
|
+
total: findings.length,
|
|
191
|
+
inlineSuppressed: 0,
|
|
192
|
+
configFindingSuppressed: 0,
|
|
193
|
+
configRuleSuppressed: 0,
|
|
194
|
+
expired: 0,
|
|
195
|
+
};
|
|
196
|
+
for (const finding of findings) {
|
|
197
|
+
// Get file content for inline suppression checking
|
|
198
|
+
const normalizedPath = (0, hash_1.normalizePathForHash)(finding.filePath);
|
|
199
|
+
const fileContent = fileContentMap.get(normalizedPath);
|
|
200
|
+
const result = this.isFindingSuppressed(finding, fileContent);
|
|
201
|
+
if (result.suppressed) {
|
|
202
|
+
suppressed.push({
|
|
203
|
+
vulnerability: {
|
|
204
|
+
id: finding.id,
|
|
205
|
+
filePath: finding.filePath,
|
|
206
|
+
lineNumber: finding.lineNumber,
|
|
207
|
+
category: finding.category,
|
|
208
|
+
severity: finding.severity,
|
|
209
|
+
title: finding.title,
|
|
210
|
+
},
|
|
211
|
+
suppression: {
|
|
212
|
+
type: result.match.type,
|
|
213
|
+
reason: result.match.reason,
|
|
214
|
+
expires: result.match.expires,
|
|
215
|
+
hash: result.hash,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
// Update stats
|
|
219
|
+
switch (result.match.type) {
|
|
220
|
+
case 'inline':
|
|
221
|
+
stats.inlineSuppressed++;
|
|
222
|
+
break;
|
|
223
|
+
case 'config-finding':
|
|
224
|
+
stats.configFindingSuppressed++;
|
|
225
|
+
break;
|
|
226
|
+
case 'config-rule':
|
|
227
|
+
stats.configRuleSuppressed++;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
passed.push(finding);
|
|
233
|
+
// Track expired suppressions
|
|
234
|
+
if (result.match?.expired) {
|
|
235
|
+
expiredCount++;
|
|
236
|
+
stats.expired++;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
findings: passed,
|
|
242
|
+
suppressed,
|
|
243
|
+
expiredSuppressions: expiredCount,
|
|
244
|
+
stats,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get all suppressions from config
|
|
249
|
+
*/
|
|
250
|
+
getAllSuppressions() {
|
|
251
|
+
return {
|
|
252
|
+
rules: this.config.suppressions?.rules || [],
|
|
253
|
+
findings: this.config.suppressions?.findings || [],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Get ignore patterns from config
|
|
258
|
+
*/
|
|
259
|
+
getIgnorePatterns() {
|
|
260
|
+
return this.config.ignore || [];
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Check if suppression system is active (has any suppressions)
|
|
264
|
+
*/
|
|
265
|
+
hasSuppressions() {
|
|
266
|
+
const rules = this.config.suppressions?.rules || [];
|
|
267
|
+
const findings = this.config.suppressions?.findings || [];
|
|
268
|
+
const ignore = this.config.ignore || [];
|
|
269
|
+
return rules.length > 0 || findings.length > 0 || ignore.length > 0;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get summary of suppression configuration
|
|
273
|
+
*/
|
|
274
|
+
getSummary() {
|
|
275
|
+
return {
|
|
276
|
+
configPath: this.configPath,
|
|
277
|
+
ruleCount: this.config.suppressions?.rules?.length || 0,
|
|
278
|
+
findingCount: this.config.suppressions?.findings?.length || 0,
|
|
279
|
+
ignorePatternCount: this.config.ignore?.length || 0,
|
|
280
|
+
hasErrors: this.configErrors.length > 0,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Clear the inline suppression cache
|
|
285
|
+
* (useful if files have been modified)
|
|
286
|
+
*/
|
|
287
|
+
clearCache() {
|
|
288
|
+
this.inlineSuppressionCache.clear();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
exports.SuppressionManager = SuppressionManager;
|
|
292
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/suppression/manager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAqC;AAWrC,mDAAkE;AAClE,mDAA2E;AAC3E,iCAAiE;AAcjE;;;;;;;GAOG;AACH,MAAa,kBAAkB;IAU7B,YAAY,OAAkC;QAH9C,6CAA6C;QACrC,2BAAsB,GAAgD,IAAI,GAAG,EAAE,CAAA;QAGrF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,KAAK,CAAA;QAErD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,GAAG,OA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IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;SACxC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAA;IACrC,CAAC;CACF;AAlVD,gDAkVC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suppression System Types
|
|
3
|
+
* Defines types for the finding suppression/ignore system
|
|
4
|
+
*/
|
|
5
|
+
import type { VulnerabilityCategory, VulnerabilitySeverity } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Suppression configuration file structure
|
|
8
|
+
* Supports .oculum.yaml, .oculum.yml, oculum.config.json, .oculumrc
|
|
9
|
+
*/
|
|
10
|
+
export interface SuppressionConfig {
|
|
11
|
+
/** Config schema version */
|
|
12
|
+
version: 1;
|
|
13
|
+
/** Suppression rules */
|
|
14
|
+
suppressions?: {
|
|
15
|
+
/** Rule-based suppressions (by category) */
|
|
16
|
+
rules?: RuleSuppression[];
|
|
17
|
+
/** Finding-based suppressions (by hash) */
|
|
18
|
+
findings?: FindingSuppression[];
|
|
19
|
+
};
|
|
20
|
+
/** Path patterns to ignore entirely (glob format) */
|
|
21
|
+
ignore?: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Suppress all findings of a specific category/rule
|
|
25
|
+
*/
|
|
26
|
+
export interface RuleSuppression {
|
|
27
|
+
/** Category to suppress (e.g., 'high_entropy_string') */
|
|
28
|
+
category: VulnerabilityCategory;
|
|
29
|
+
/** Reason for suppression (required for audit trail) */
|
|
30
|
+
reason: string;
|
|
31
|
+
/** Optional: Only suppress in specific files (glob patterns) */
|
|
32
|
+
paths?: string[];
|
|
33
|
+
/** Optional: Expiration date (ISO 8601 format) */
|
|
34
|
+
expires?: string;
|
|
35
|
+
/** Optional: Who added this suppression */
|
|
36
|
+
suppressedBy?: string;
|
|
37
|
+
/** Optional: When this was added (ISO 8601 format) */
|
|
38
|
+
suppressedAt?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Suppress a specific finding by its hash
|
|
42
|
+
*/
|
|
43
|
+
export interface FindingSuppression {
|
|
44
|
+
/** Finding hash (computed from file path, content, and category) */
|
|
45
|
+
hash: string;
|
|
46
|
+
/** File path where the finding was detected */
|
|
47
|
+
file: string;
|
|
48
|
+
/** Line number (for reference, not used in matching) */
|
|
49
|
+
line?: number;
|
|
50
|
+
/** Reason for suppression (required for audit trail) */
|
|
51
|
+
reason: string;
|
|
52
|
+
/** Optional: Expiration date (ISO 8601 format) */
|
|
53
|
+
expires?: string;
|
|
54
|
+
/** Optional: Who added this suppression */
|
|
55
|
+
suppressedBy?: string;
|
|
56
|
+
/** Optional: When this was added (ISO 8601 format) */
|
|
57
|
+
suppressedAt?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Inline suppression from code comments
|
|
61
|
+
*/
|
|
62
|
+
export interface InlineSuppression {
|
|
63
|
+
/** Line number this suppression applies to */
|
|
64
|
+
lineNumber: number;
|
|
65
|
+
/** Type of inline suppression */
|
|
66
|
+
type: 'next-line' | 'same-line' | 'block-start' | 'block-end';
|
|
67
|
+
/** Reason from the comment */
|
|
68
|
+
reason: string;
|
|
69
|
+
/** Optional: Specific rule/category to suppress */
|
|
70
|
+
ruleId?: VulnerabilityCategory;
|
|
71
|
+
/** Original comment text */
|
|
72
|
+
commentText: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Result of checking if a finding is suppressed
|
|
76
|
+
*/
|
|
77
|
+
export interface SuppressionMatch {
|
|
78
|
+
/** Whether the finding is suppressed */
|
|
79
|
+
suppressed: boolean;
|
|
80
|
+
/** The matching suppression (if any) */
|
|
81
|
+
match?: {
|
|
82
|
+
/** Type of suppression that matched */
|
|
83
|
+
type: 'inline' | 'config-finding' | 'config-rule';
|
|
84
|
+
/** Reason for suppression */
|
|
85
|
+
reason: string;
|
|
86
|
+
/** Expiration date (if any) */
|
|
87
|
+
expires?: string;
|
|
88
|
+
/** Whether the suppression is expired */
|
|
89
|
+
expired?: boolean;
|
|
90
|
+
};
|
|
91
|
+
/** Hash of the finding (always computed) */
|
|
92
|
+
hash: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Suppressed vulnerability with metadata
|
|
96
|
+
*/
|
|
97
|
+
export interface SuppressedVulnerability {
|
|
98
|
+
/** The original vulnerability */
|
|
99
|
+
vulnerability: {
|
|
100
|
+
id: string;
|
|
101
|
+
filePath: string;
|
|
102
|
+
lineNumber: number;
|
|
103
|
+
category: VulnerabilityCategory;
|
|
104
|
+
severity: VulnerabilitySeverity;
|
|
105
|
+
title: string;
|
|
106
|
+
};
|
|
107
|
+
/** Suppression details */
|
|
108
|
+
suppression: {
|
|
109
|
+
/** Type of suppression that matched */
|
|
110
|
+
type: 'inline' | 'config-finding' | 'config-rule';
|
|
111
|
+
/** Reason for suppression */
|
|
112
|
+
reason: string;
|
|
113
|
+
/** Expiration date (if any) */
|
|
114
|
+
expires?: string;
|
|
115
|
+
/** Finding hash */
|
|
116
|
+
hash: string;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Result of applying suppressions to findings
|
|
121
|
+
*/
|
|
122
|
+
export interface SuppressionResult {
|
|
123
|
+
/** Findings that passed through (not suppressed) */
|
|
124
|
+
findings: import('../types').Vulnerability[];
|
|
125
|
+
/** Findings that were suppressed */
|
|
126
|
+
suppressed: SuppressedVulnerability[];
|
|
127
|
+
/** Count of expired suppressions (findings reappear) */
|
|
128
|
+
expiredSuppressions: number;
|
|
129
|
+
/** Statistics */
|
|
130
|
+
stats: {
|
|
131
|
+
/** Total findings before suppression */
|
|
132
|
+
total: number;
|
|
133
|
+
/** Findings suppressed by inline comments */
|
|
134
|
+
inlineSuppressed: number;
|
|
135
|
+
/** Findings suppressed by config (finding hash) */
|
|
136
|
+
configFindingSuppressed: number;
|
|
137
|
+
/** Findings suppressed by config (rule) */
|
|
138
|
+
configRuleSuppressed: number;
|
|
139
|
+
/** Findings that would have been suppressed but suppression expired */
|
|
140
|
+
expired: number;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Suppression configuration file names (in order of priority)
|
|
145
|
+
*/
|
|
146
|
+
export declare const SUPPRESSION_CONFIG_FILES: readonly [".oculum.yaml", ".oculum.yml", "oculum.config.json", ".oculumrc"];
|
|
147
|
+
/**
|
|
148
|
+
* Default suppression config (empty)
|
|
149
|
+
*/
|
|
150
|
+
export declare const DEFAULT_SUPPRESSION_CONFIG: SuppressionConfig;
|
|
151
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/suppression/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5E;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,OAAO,EAAE,CAAC,CAAA;IAEV,wBAAwB;IACxB,YAAY,CAAC,EAAE;QACb,4CAA4C;QAC5C,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;QACzB,2CAA2C;QAC3C,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAA;KAChC,CAAA;IAED,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sDAAsD;IACtD,YAAY,CAAC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AAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,qBAAqB,CAAA;QAC/B,QAAQ,EAAE,qBAAqB,CAAA;QAC/B,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,0BAA0B;IAC1B,WAAW,EAAE;QACX,uCAAuC;QACvC,IAAI,EAAE,QAAQ,GAAG,gBAAgB,GAAG,aAAa,CAAA;QACjD,6BAA6B;QAC7B,MAAM,EAAE,MAAM,CAAA;QACd,+BAA+B;QAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,mBAAmB;QACnB,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,EAAE,OAAO,UAAU,EAAE,aAAa,EAAE,CAAA;IAC5C,oCAAoC;IACpC,UAAU,EAAE,uBAAuB,EAAE,CAAA;IACrC,wDAAwD;IACxD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB;IACjB,KAAK,EAAE;QACL,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,6CAA6C;QAC7C,gBAAgB,EAAE,MAAM,CAAA;QACxB,mDAAmD;QACnD,uBAAuB,EAAE,MAAM,CAAA;QAC/B,2CAA2C;QAC3C,oBAAoB,EAAE,MAAM,CAAA;QAC5B,uEAAuE;QACvE,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,6EAK3B,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAOxC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Suppression System Types
|
|
4
|
+
* Defines types for the finding suppression/ignore system
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DEFAULT_SUPPRESSION_CONFIG = exports.SUPPRESSION_CONFIG_FILES = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Suppression configuration file names (in order of priority)
|
|
10
|
+
*/
|
|
11
|
+
exports.SUPPRESSION_CONFIG_FILES = [
|
|
12
|
+
'.oculum.yaml',
|
|
13
|
+
'.oculum.yml',
|
|
14
|
+
'oculum.config.json',
|
|
15
|
+
'.oculumrc',
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Default suppression config (empty)
|
|
19
|
+
*/
|
|
20
|
+
exports.DEFAULT_SUPPRESSION_CONFIG = {
|
|
21
|
+
version: 1,
|
|
22
|
+
suppressions: {
|
|
23
|
+
rules: [],
|
|
24
|
+
findings: [],
|
|
25
|
+
},
|
|
26
|
+
ignore: [],
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/suppression/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsJH;;GAEG;AACU,QAAA,wBAAwB,GAAG;IACtC,cAAc;IACd,aAAa;IACb,oBAAoB;IACpB,WAAW;CACH,CAAA;AAEV;;GAEG;AACU,QAAA,0BAA0B,GAAsB;IAC3D,OAAO,EAAE,CAAC;IACV,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE;KACb;IACD,MAAM,EAAE,EAAE;CACX,CAAA"}
|
package/dist/tiers.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const LAYER1_CATEGORY_TO_DETECTOR: Partial<Record<VulnerabilityCa
|
|
|
56
56
|
/**
|
|
57
57
|
* Layer 2 detector names (internal identifiers matching detector function names)
|
|
58
58
|
*/
|
|
59
|
-
export type Layer2DetectorName = 'dangerous_functions' | 'byok_patterns' | 'ai_execution_sinks' | 'ai_agent_tools' | 'auth_antipatterns' | 'data_exposure' | 'ai_fingerprinting' | 'ai_prompt_hygiene' | 'logic_gates' | 'variables' | 'risky_imports' | 'framework_checks' | 'ai_rag_safety' | 'ai_endpoint_protection' | 'ai_schema_validation';
|
|
59
|
+
export type Layer2DetectorName = 'dangerous_functions' | 'byok_patterns' | 'ai_execution_sinks' | 'ai_agent_tools' | 'auth_antipatterns' | 'data_exposure' | 'ai_fingerprinting' | 'ai_prompt_hygiene' | 'logic_gates' | 'variables' | 'risky_imports' | 'framework_checks' | 'ai_rag_safety' | 'ai_endpoint_protection' | 'ai_schema_validation' | 'ai_package_hallucination' | 'ai_mcp_security' | 'model_supply_chain';
|
|
60
60
|
/**
|
|
61
61
|
* Layer 2 tier assignments
|
|
62
62
|
*
|
package/dist/tiers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../src/tiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,aAAa,GAAG,cAAc,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB;AAMD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,SAAS,GACT,cAAc,GACd,YAAY,GACZ,aAAa,CAAA;AAEjB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAQ1E,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CASlG,CAAA;AAMD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,eAA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MAAM,qBAAqB,EAAE,MAAM,CAAC,kBAAkB,EAAE,YAAY,CA6B1E,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CA2DlG,CAAA;AAMD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GACf,YAAY,CAoBd;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,YAAY,CAEhF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,YAAY,CAEhF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GACpC,OAAO,CAYT;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GACpC,OAAO,CAUT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,eAAe,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,GAC5E,SAAS,CAaX;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAExD"}
|
package/dist/tiers.js
CHANGED
|
@@ -100,6 +100,11 @@ exports.LAYER2_DETECTOR_TIERS = {
|
|
|
100
100
|
ai_rag_safety: 'core', // Tier A - Cross-tenant data access is critical
|
|
101
101
|
ai_endpoint_protection: 'core', // Tier A - Cost abuse / API exposure has clear signals
|
|
102
102
|
ai_schema_validation: 'ai_assisted', // Tier B - Context-dependent, benefits from AI validation
|
|
103
|
+
// AI Detection Roadmap Phase 1
|
|
104
|
+
ai_package_hallucination: 'core', // Tier A - Supply chain attacks are critical
|
|
105
|
+
ai_mcp_security: 'core', // Tier A - MCP tool security is critical for AI agents
|
|
106
|
+
// AI Detection Roadmap Phase 2
|
|
107
|
+
model_supply_chain: 'core', // Tier A - Model supply chain risks are critical (RCE)
|
|
103
108
|
};
|
|
104
109
|
/**
|
|
105
110
|
* Mapping from vulnerability category to Layer 2 detector name
|
|
@@ -142,6 +147,28 @@ exports.LAYER2_CATEGORY_TO_DETECTOR = {
|
|
|
142
147
|
ai_rag_exfiltration: 'ai_rag_safety',
|
|
143
148
|
ai_endpoint_unprotected: 'ai_endpoint_protection',
|
|
144
149
|
ai_schema_mismatch: 'ai_schema_validation',
|
|
150
|
+
// AI Detection Roadmap Phase 1 categories
|
|
151
|
+
ai_package_hallucination: 'ai_package_hallucination',
|
|
152
|
+
ai_rag_corpus_poisoning: 'ai_rag_safety', // Extended RAG detector
|
|
153
|
+
ai_rag_pii_leakage: 'ai_rag_safety', // Extended RAG detector
|
|
154
|
+
ai_mcp_tool_poisoning: 'ai_mcp_security',
|
|
155
|
+
ai_mcp_credential_issue: 'ai_mcp_security',
|
|
156
|
+
ai_mcp_confused_deputy: 'ai_mcp_security',
|
|
157
|
+
// Phase 1 Enhancement Backlog categories
|
|
158
|
+
ai_mcp_description_injection: 'ai_mcp_security',
|
|
159
|
+
ai_mcp_server_shadowing: 'ai_mcp_security',
|
|
160
|
+
ai_mcp_config_secrets: 'ai_mcp_security', // Note: Layer 1 detector, but core tier
|
|
161
|
+
ai_mcp_config_permissions: 'ai_mcp_security', // Note: Layer 1 detector
|
|
162
|
+
ai_rag_query_injection: 'ai_rag_safety',
|
|
163
|
+
ai_rag_embedding_poisoning: 'ai_rag_safety',
|
|
164
|
+
ai_rag_chunk_injection: 'ai_rag_safety',
|
|
165
|
+
ai_package_typosquat: 'ai_package_hallucination',
|
|
166
|
+
ai_package_malicious: 'ai_package_hallucination',
|
|
167
|
+
// AI Detection Roadmap Phase 2 categories
|
|
168
|
+
ai_unsafe_model_load: 'model_supply_chain',
|
|
169
|
+
ai_unverified_model: 'model_supply_chain',
|
|
170
|
+
ai_unsafe_finetuning: 'model_supply_chain',
|
|
171
|
+
ai_excessive_agency: 'ai_agent_tools', // Extended in ai-agent-tools.ts
|
|
145
172
|
};
|
|
146
173
|
// ============================================================================
|
|
147
174
|
// Tier Lookup Helpers
|
package/dist/tiers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiers.js","sourceRoot":"","sources":["../src/tiers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;
|
|
1
|
+
{"version":3,"file":"tiers.js","sourceRoot":"","sources":["../src/tiers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAgPH,gDAuBC;AAKD,sDAEC;AAKD,sDAEC;AAKD,oDAeC;AAKD,oDAaC;AAKD,4CAeC;AAKD,0CAEC;AAhTD;;;;;;;;;;;;;;;GAeG;AACU,QAAA,qBAAqB,GAA6C;IAC7E,aAAa,EAAE,MAAM;IACrB,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,aAAa;IAC3B,UAAU,EAAE,aAAa,EAAG,4CAA4C;IACxE,WAAW,EAAE,cAAc;CAC5B,CAAA;AAED;;;GAGG;AACU,QAAA,2BAA2B,GAA+D;IACrG,gBAAgB,EAAE,eAAe;IACjC,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,gBAAgB;IAC/B,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,YAAY;IAC5B,UAAU,EAAE,aAAa,EAAG,0CAA0C;CACvE,CAAA;AAgCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,qBAAqB,GAA6C;IAC7E,iCAAiC;IACjC,mBA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