@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,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suppression System Types
|
|
3
|
+
* Defines types for the finding suppression/ignore system
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { VulnerabilityCategory, VulnerabilitySeverity } from '../types'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Suppression configuration file structure
|
|
10
|
+
* Supports .oculum.yaml, .oculum.yml, oculum.config.json, .oculumrc
|
|
11
|
+
*/
|
|
12
|
+
export interface SuppressionConfig {
|
|
13
|
+
/** Config schema version */
|
|
14
|
+
version: 1
|
|
15
|
+
|
|
16
|
+
/** Suppression rules */
|
|
17
|
+
suppressions?: {
|
|
18
|
+
/** Rule-based suppressions (by category) */
|
|
19
|
+
rules?: RuleSuppression[]
|
|
20
|
+
/** Finding-based suppressions (by hash) */
|
|
21
|
+
findings?: FindingSuppression[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Path patterns to ignore entirely (glob format) */
|
|
25
|
+
ignore?: string[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Suppress all findings of a specific category/rule
|
|
30
|
+
*/
|
|
31
|
+
export interface RuleSuppression {
|
|
32
|
+
/** Category to suppress (e.g., 'high_entropy_string') */
|
|
33
|
+
category: VulnerabilityCategory
|
|
34
|
+
/** Reason for suppression (required for audit trail) */
|
|
35
|
+
reason: string
|
|
36
|
+
/** Optional: Only suppress in specific files (glob patterns) */
|
|
37
|
+
paths?: string[]
|
|
38
|
+
/** Optional: Expiration date (ISO 8601 format) */
|
|
39
|
+
expires?: string
|
|
40
|
+
/** Optional: Who added this suppression */
|
|
41
|
+
suppressedBy?: string
|
|
42
|
+
/** Optional: When this was added (ISO 8601 format) */
|
|
43
|
+
suppressedAt?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Suppress a specific finding by its hash
|
|
48
|
+
*/
|
|
49
|
+
export interface FindingSuppression {
|
|
50
|
+
/** Finding hash (computed from file path, content, and category) */
|
|
51
|
+
hash: string
|
|
52
|
+
/** File path where the finding was detected */
|
|
53
|
+
file: string
|
|
54
|
+
/** Line number (for reference, not used in matching) */
|
|
55
|
+
line?: number
|
|
56
|
+
/** Reason for suppression (required for audit trail) */
|
|
57
|
+
reason: string
|
|
58
|
+
/** Optional: Expiration date (ISO 8601 format) */
|
|
59
|
+
expires?: string
|
|
60
|
+
/** Optional: Who added this suppression */
|
|
61
|
+
suppressedBy?: string
|
|
62
|
+
/** Optional: When this was added (ISO 8601 format) */
|
|
63
|
+
suppressedAt?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Inline suppression from code comments
|
|
68
|
+
*/
|
|
69
|
+
export interface InlineSuppression {
|
|
70
|
+
/** Line number this suppression applies to */
|
|
71
|
+
lineNumber: number
|
|
72
|
+
/** Type of inline suppression */
|
|
73
|
+
type: 'next-line' | 'same-line' | 'block-start' | 'block-end'
|
|
74
|
+
/** Reason from the comment */
|
|
75
|
+
reason: string
|
|
76
|
+
/** Optional: Specific rule/category to suppress */
|
|
77
|
+
ruleId?: VulnerabilityCategory
|
|
78
|
+
/** Original comment text */
|
|
79
|
+
commentText: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Result of checking if a finding is suppressed
|
|
84
|
+
*/
|
|
85
|
+
export interface SuppressionMatch {
|
|
86
|
+
/** Whether the finding is suppressed */
|
|
87
|
+
suppressed: boolean
|
|
88
|
+
/** The matching suppression (if any) */
|
|
89
|
+
match?: {
|
|
90
|
+
/** Type of suppression that matched */
|
|
91
|
+
type: 'inline' | 'config-finding' | 'config-rule'
|
|
92
|
+
/** Reason for suppression */
|
|
93
|
+
reason: string
|
|
94
|
+
/** Expiration date (if any) */
|
|
95
|
+
expires?: string
|
|
96
|
+
/** Whether the suppression is expired */
|
|
97
|
+
expired?: boolean
|
|
98
|
+
}
|
|
99
|
+
/** Hash of the finding (always computed) */
|
|
100
|
+
hash: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Suppressed vulnerability with metadata
|
|
105
|
+
*/
|
|
106
|
+
export interface SuppressedVulnerability {
|
|
107
|
+
/** The original vulnerability */
|
|
108
|
+
vulnerability: {
|
|
109
|
+
id: string
|
|
110
|
+
filePath: string
|
|
111
|
+
lineNumber: number
|
|
112
|
+
category: VulnerabilityCategory
|
|
113
|
+
severity: VulnerabilitySeverity
|
|
114
|
+
title: string
|
|
115
|
+
}
|
|
116
|
+
/** Suppression details */
|
|
117
|
+
suppression: {
|
|
118
|
+
/** Type of suppression that matched */
|
|
119
|
+
type: 'inline' | 'config-finding' | 'config-rule'
|
|
120
|
+
/** Reason for suppression */
|
|
121
|
+
reason: string
|
|
122
|
+
/** Expiration date (if any) */
|
|
123
|
+
expires?: string
|
|
124
|
+
/** Finding hash */
|
|
125
|
+
hash: string
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Result of applying suppressions to findings
|
|
131
|
+
*/
|
|
132
|
+
export interface SuppressionResult {
|
|
133
|
+
/** Findings that passed through (not suppressed) */
|
|
134
|
+
findings: import('../types').Vulnerability[]
|
|
135
|
+
/** Findings that were suppressed */
|
|
136
|
+
suppressed: SuppressedVulnerability[]
|
|
137
|
+
/** Count of expired suppressions (findings reappear) */
|
|
138
|
+
expiredSuppressions: number
|
|
139
|
+
/** Statistics */
|
|
140
|
+
stats: {
|
|
141
|
+
/** Total findings before suppression */
|
|
142
|
+
total: number
|
|
143
|
+
/** Findings suppressed by inline comments */
|
|
144
|
+
inlineSuppressed: number
|
|
145
|
+
/** Findings suppressed by config (finding hash) */
|
|
146
|
+
configFindingSuppressed: number
|
|
147
|
+
/** Findings suppressed by config (rule) */
|
|
148
|
+
configRuleSuppressed: number
|
|
149
|
+
/** Findings that would have been suppressed but suppression expired */
|
|
150
|
+
expired: number
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Suppression configuration file names (in order of priority)
|
|
156
|
+
*/
|
|
157
|
+
export const SUPPRESSION_CONFIG_FILES = [
|
|
158
|
+
'.oculum.yaml',
|
|
159
|
+
'.oculum.yml',
|
|
160
|
+
'oculum.config.json',
|
|
161
|
+
'.oculumrc',
|
|
162
|
+
] as const
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Default suppression config (empty)
|
|
166
|
+
*/
|
|
167
|
+
export const DEFAULT_SUPPRESSION_CONFIG: SuppressionConfig = {
|
|
168
|
+
version: 1,
|
|
169
|
+
suppressions: {
|
|
170
|
+
rules: [],
|
|
171
|
+
findings: [],
|
|
172
|
+
},
|
|
173
|
+
ignore: [],
|
|
174
|
+
}
|
package/src/tiers.ts
CHANGED
|
@@ -112,6 +112,11 @@ export type Layer2DetectorName =
|
|
|
112
112
|
| 'ai_rag_safety' // ai-rag-safety.ts - RAG data exfiltration
|
|
113
113
|
| 'ai_endpoint_protection' // ai-endpoint-protection.ts - Unprotected AI endpoints
|
|
114
114
|
| 'ai_schema_validation' // ai-schema-validation.ts - Schema mismatch
|
|
115
|
+
// AI Detection Roadmap Phase 1
|
|
116
|
+
| 'ai_package_hallucination' // ai-package-hallucination.ts - Hallucinated packages
|
|
117
|
+
| 'ai_mcp_security' // ai-mcp-security.ts - MCP tool security
|
|
118
|
+
// AI Detection Roadmap Phase 2
|
|
119
|
+
| 'model_supply_chain' // model-supply-chain.ts - Model loading/finetuning risks
|
|
115
120
|
|
|
116
121
|
/**
|
|
117
122
|
* Layer 2 tier assignments
|
|
@@ -157,6 +162,12 @@ export const LAYER2_DETECTOR_TIERS: Record<Layer2DetectorName, DetectorTier> = {
|
|
|
157
162
|
ai_rag_safety: 'core', // Tier A - Cross-tenant data access is critical
|
|
158
163
|
ai_endpoint_protection: 'core', // Tier A - Cost abuse / API exposure has clear signals
|
|
159
164
|
ai_schema_validation: 'ai_assisted', // Tier B - Context-dependent, benefits from AI validation
|
|
165
|
+
|
|
166
|
+
// AI Detection Roadmap Phase 1
|
|
167
|
+
ai_package_hallucination: 'core', // Tier A - Supply chain attacks are critical
|
|
168
|
+
ai_mcp_security: 'core', // Tier A - MCP tool security is critical for AI agents
|
|
169
|
+
// AI Detection Roadmap Phase 2
|
|
170
|
+
model_supply_chain: 'core', // Tier A - Model supply chain risks are critical (RCE)
|
|
160
171
|
}
|
|
161
172
|
|
|
162
173
|
/**
|
|
@@ -204,6 +215,31 @@ export const LAYER2_CATEGORY_TO_DETECTOR: Partial<Record<VulnerabilityCategory,
|
|
|
204
215
|
ai_rag_exfiltration: 'ai_rag_safety',
|
|
205
216
|
ai_endpoint_unprotected: 'ai_endpoint_protection',
|
|
206
217
|
ai_schema_mismatch: 'ai_schema_validation',
|
|
218
|
+
|
|
219
|
+
// AI Detection Roadmap Phase 1 categories
|
|
220
|
+
ai_package_hallucination: 'ai_package_hallucination',
|
|
221
|
+
ai_rag_corpus_poisoning: 'ai_rag_safety', // Extended RAG detector
|
|
222
|
+
ai_rag_pii_leakage: 'ai_rag_safety', // Extended RAG detector
|
|
223
|
+
ai_mcp_tool_poisoning: 'ai_mcp_security',
|
|
224
|
+
ai_mcp_credential_issue: 'ai_mcp_security',
|
|
225
|
+
ai_mcp_confused_deputy: 'ai_mcp_security',
|
|
226
|
+
|
|
227
|
+
// Phase 1 Enhancement Backlog categories
|
|
228
|
+
ai_mcp_description_injection: 'ai_mcp_security',
|
|
229
|
+
ai_mcp_server_shadowing: 'ai_mcp_security',
|
|
230
|
+
ai_mcp_config_secrets: 'ai_mcp_security', // Note: Layer 1 detector, but core tier
|
|
231
|
+
ai_mcp_config_permissions: 'ai_mcp_security', // Note: Layer 1 detector
|
|
232
|
+
ai_rag_query_injection: 'ai_rag_safety',
|
|
233
|
+
ai_rag_embedding_poisoning: 'ai_rag_safety',
|
|
234
|
+
ai_rag_chunk_injection: 'ai_rag_safety',
|
|
235
|
+
ai_package_typosquat: 'ai_package_hallucination',
|
|
236
|
+
ai_package_malicious: 'ai_package_hallucination',
|
|
237
|
+
|
|
238
|
+
// AI Detection Roadmap Phase 2 categories
|
|
239
|
+
ai_unsafe_model_load: 'model_supply_chain',
|
|
240
|
+
ai_unverified_model: 'model_supply_chain',
|
|
241
|
+
ai_unsafe_finetuning: 'model_supply_chain',
|
|
242
|
+
ai_excessive_agency: 'ai_agent_tools', // Extended in ai-agent-tools.ts
|
|
207
243
|
}
|
|
208
244
|
|
|
209
245
|
// ============================================================================
|
package/src/types.ts
CHANGED
|
@@ -32,6 +32,28 @@ export type VulnerabilityCategory =
|
|
|
32
32
|
| 'ai_rag_exfiltration' // M5: RAG data leakage - cross-tenant retrieval, raw context exposure
|
|
33
33
|
| 'ai_endpoint_unprotected' // M5: AI endpoints without auth/rate limiting
|
|
34
34
|
| 'ai_schema_mismatch' // M5: Missing schema validation on AI-generated outputs
|
|
35
|
+
// AI Detection Roadmap Phase 1
|
|
36
|
+
| 'ai_package_hallucination' // P0: AI-hallucinated/fake package names in dependencies
|
|
37
|
+
| 'ai_rag_corpus_poisoning' // P1: User uploads directly embedded without sanitization
|
|
38
|
+
| 'ai_rag_pii_leakage' // P1: PII fields exposed in RAG retrieval responses
|
|
39
|
+
| 'ai_mcp_tool_poisoning' // P1: MCP tool with unvalidated external content
|
|
40
|
+
| 'ai_mcp_credential_issue' // P1: MCP credentials in parameters/responses
|
|
41
|
+
| 'ai_mcp_confused_deputy' // P1: MCP operations without user context
|
|
42
|
+
// Phase 1 Enhancement Backlog
|
|
43
|
+
| 'ai_mcp_description_injection' // Prompt injection in MCP tool descriptions
|
|
44
|
+
| 'ai_mcp_server_shadowing' // Cross-server tool shadowing attacks
|
|
45
|
+
| 'ai_mcp_config_secrets' // Secrets in MCP config files
|
|
46
|
+
| 'ai_mcp_config_permissions' // Overpermissive MCP settings
|
|
47
|
+
| 'ai_rag_query_injection' // Query manipulation in RAG systems
|
|
48
|
+
| 'ai_rag_embedding_poisoning' // Adversarial embedding attacks
|
|
49
|
+
| 'ai_rag_chunk_injection' // Chunk boundary exploitation
|
|
50
|
+
| 'ai_package_typosquat' // Typosquatting attacks on packages
|
|
51
|
+
| 'ai_package_malicious' // Known malicious/vulnerable package
|
|
52
|
+
// AI Detection Roadmap Phase 2
|
|
53
|
+
| 'ai_unsafe_model_load' // Pickle/torch.load RCE risks
|
|
54
|
+
| 'ai_unverified_model' // Model loaded without integrity verification
|
|
55
|
+
| 'ai_unsafe_finetuning' // Training on unvalidated data
|
|
56
|
+
| 'ai_excessive_agency' // Unbounded agent autonomy risks
|
|
35
57
|
|
|
36
58
|
export type ValidationStatus = 'confirmed' | 'downgraded' | 'dismissed' | 'not_validated'
|
|
37
59
|
|
|
@@ -54,6 +76,13 @@ export interface Vulnerability {
|
|
|
54
76
|
validationStatus?: ValidationStatus // outcome of AI validation
|
|
55
77
|
validationNotes?: string // e.g., "Route protected by Clerk middleware"
|
|
56
78
|
originalSeverity?: VulnerabilitySeverity // For downgraded findings, the original severity
|
|
79
|
+
|
|
80
|
+
// Actionable output fields (PRO-82)
|
|
81
|
+
impact?: string // Why this matters (business impact) - from metadata registry or AI
|
|
82
|
+
evidence?: string // What triggered this finding
|
|
83
|
+
fixSteps?: string[] // Step-by-step fix instructions
|
|
84
|
+
references?: string[] // OWASP/CWE documentation links
|
|
85
|
+
aiEnhanced?: boolean // True if AI provided custom impact/fix beyond registry defaults
|
|
57
86
|
}
|
|
58
87
|
|
|
59
88
|
/**
|
|
@@ -130,6 +159,28 @@ export interface SeverityCounts {
|
|
|
130
159
|
// Category counts keyed by VulnerabilityCategory
|
|
131
160
|
export type CategoryCounts = Partial<Record<VulnerabilityCategory, number>>
|
|
132
161
|
|
|
162
|
+
/** Summary of a suppressed vulnerability (for --show-suppressed output) */
|
|
163
|
+
export interface SuppressedVulnerabilitySummary {
|
|
164
|
+
/** Finding hash */
|
|
165
|
+
hash: string
|
|
166
|
+
/** File path */
|
|
167
|
+
filePath: string
|
|
168
|
+
/** Line number */
|
|
169
|
+
lineNumber: number
|
|
170
|
+
/** Vulnerability category */
|
|
171
|
+
category: VulnerabilityCategory
|
|
172
|
+
/** Severity */
|
|
173
|
+
severity: VulnerabilitySeverity
|
|
174
|
+
/** Title */
|
|
175
|
+
title: string
|
|
176
|
+
/** How it was suppressed */
|
|
177
|
+
suppressionType: 'inline' | 'config-finding' | 'config-rule'
|
|
178
|
+
/** Reason for suppression */
|
|
179
|
+
suppressionReason: string
|
|
180
|
+
/** Expiration date (if any) */
|
|
181
|
+
expires?: string
|
|
182
|
+
}
|
|
183
|
+
|
|
133
184
|
export interface ScanResult {
|
|
134
185
|
repoName: string
|
|
135
186
|
repoUrl: string
|
|
@@ -166,6 +217,45 @@ export interface ScanResult {
|
|
|
166
217
|
// Cancellation metadata
|
|
167
218
|
cancelled?: boolean // true if scan was cancelled by user
|
|
168
219
|
cancelReason?: string // Reason for cancellation (e.g., "User pressed Ctrl+C")
|
|
220
|
+
|
|
221
|
+
// Suppression metadata
|
|
222
|
+
suppressionStats?: {
|
|
223
|
+
/** Total findings before suppression */
|
|
224
|
+
total: number
|
|
225
|
+
/** Findings suppressed by inline comments */
|
|
226
|
+
inlineSuppressed: number
|
|
227
|
+
/** Findings suppressed by config (finding hash) */
|
|
228
|
+
configFindingSuppressed: number
|
|
229
|
+
/** Findings suppressed by config (rule) */
|
|
230
|
+
configRuleSuppressed: number
|
|
231
|
+
/** Findings that would have been suppressed but suppression expired */
|
|
232
|
+
expired: number
|
|
233
|
+
}
|
|
234
|
+
/** Suppressed vulnerabilities (when --show-suppressed is used) */
|
|
235
|
+
suppressedVulnerabilities?: SuppressedVulnerabilitySummary[]
|
|
236
|
+
|
|
237
|
+
// Baseline diff metadata (only present when --new flag is used)
|
|
238
|
+
baselineDiff?: {
|
|
239
|
+
/** When the baseline was created */
|
|
240
|
+
baselineCreatedAt: string
|
|
241
|
+
/** Git commit of the baseline (if available) */
|
|
242
|
+
baselineCommit?: string
|
|
243
|
+
/** Number of new findings (not in baseline) */
|
|
244
|
+
newCount: number
|
|
245
|
+
/** Number of fixed findings (in baseline, not in current) */
|
|
246
|
+
fixedCount: number
|
|
247
|
+
/** Number of existing findings (in both) */
|
|
248
|
+
existingCount: number
|
|
249
|
+
/** Details of fixed findings for display */
|
|
250
|
+
fixedFindings: Array<{
|
|
251
|
+
hash: string
|
|
252
|
+
filePath: string
|
|
253
|
+
lineNumber: number
|
|
254
|
+
category: string
|
|
255
|
+
severity: string
|
|
256
|
+
title: string
|
|
257
|
+
}>
|
|
258
|
+
}
|
|
169
259
|
}
|
|
170
260
|
|
|
171
261
|
export interface ScanProgress {
|
|
@@ -161,18 +161,22 @@ export function isDocumentationFile(filePath: string): boolean {
|
|
|
161
161
|
/**
|
|
162
162
|
* Check if file is scanner code, fixture, or rule definition
|
|
163
163
|
* Avoid flagging the scanner's own code/test cases
|
|
164
|
+
*
|
|
165
|
+
* Note: Uses (?:^|\/) to match both:
|
|
166
|
+
* - paths with leading segments: packages/scanner/src/...
|
|
167
|
+
* - paths starting with the pattern: scanner/src/...
|
|
164
168
|
*/
|
|
165
169
|
export function isScannerOrFixtureFile(filePath: string): boolean {
|
|
166
170
|
const scannerPatterns = [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
/(?:^|\/)scanner\//i,
|
|
172
|
+
/(?:^|\/)detector\//i,
|
|
173
|
+
/(?:^|\/)security\//i,
|
|
174
|
+
/(?:^|\/)rules?\//i,
|
|
175
|
+
/(?:^|\/)patterns?\//i,
|
|
176
|
+
/(?:^|\/)fixtures?\//i,
|
|
177
|
+
/(?:^|\/)testdata\//i,
|
|
178
|
+
/(?:^|\/)test-data\//i,
|
|
179
|
+
/(?:^|\/)test_data\//i,
|
|
176
180
|
]
|
|
177
181
|
return scannerPatterns.some(pattern => pattern.test(filePath))
|
|
178
182
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Layer 2: Dangerous Function Call Analysis
|
|
3
|
-
* Detects usage of dangerous functions that can lead to security vulnerabilities
|
|
4
|
-
*/
|
|
5
|
-
import type { Vulnerability } from '../types';
|
|
6
|
-
export declare function detectDangerousFunctions(content: string, filePath: string): Vulnerability[];
|
|
7
|
-
//# sourceMappingURL=dangerous-functions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dangerous-functions.d.ts","sourceRoot":"","sources":["../../src/layer2/dangerous-functions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,UAAU,CAAA;AAqoCpE,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,aAAa,EAAE,CAobjB"}
|