vaspera 2.5.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/CHANGELOG.md +184 -0
- package/LICENSE +21 -0
- package/README.md +809 -0
- package/dist/__tests__/integration/certification-flow.test.d.ts +5 -0
- package/dist/__tests__/integration/certification-flow.test.d.ts.map +1 -0
- package/dist/__tests__/integration/certification-flow.test.js +245 -0
- package/dist/__tests__/integration/certification-flow.test.js.map +1 -0
- package/dist/__tests__/integration/commands.test.d.ts +5 -0
- package/dist/__tests__/integration/commands.test.d.ts.map +1 -0
- package/dist/__tests__/integration/commands.test.js +93 -0
- package/dist/__tests__/integration/commands.test.js.map +1 -0
- package/dist/action/diff-mode.d.ts +34 -0
- package/dist/action/diff-mode.d.ts.map +1 -0
- package/dist/action/diff-mode.js +201 -0
- package/dist/action/diff-mode.js.map +1 -0
- package/dist/action/diff-mode.test.d.ts +5 -0
- package/dist/action/diff-mode.test.d.ts.map +1 -0
- package/dist/action/diff-mode.test.js +162 -0
- package/dist/action/diff-mode.test.js.map +1 -0
- package/dist/action/index.d.ts +10 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +231 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/pr-comment.d.ts +30 -0
- package/dist/action/pr-comment.d.ts.map +1 -0
- package/dist/action/pr-comment.js +301 -0
- package/dist/action/pr-comment.js.map +1 -0
- package/dist/action/pr-comment.test.d.ts +5 -0
- package/dist/action/pr-comment.test.d.ts.map +1 -0
- package/dist/action/pr-comment.test.js +189 -0
- package/dist/action/pr-comment.test.js.map +1 -0
- package/dist/action/sarif-upload.d.ts +104 -0
- package/dist/action/sarif-upload.d.ts.map +1 -0
- package/dist/action/sarif-upload.js +188 -0
- package/dist/action/sarif-upload.js.map +1 -0
- package/dist/action/sarif-upload.test.d.ts +5 -0
- package/dist/action/sarif-upload.test.d.ts.map +1 -0
- package/dist/action/sarif-upload.test.js +206 -0
- package/dist/action/sarif-upload.test.js.map +1 -0
- package/dist/action/types.d.ts +104 -0
- package/dist/action/types.d.ts.map +1 -0
- package/dist/action/types.js +33 -0
- package/dist/action/types.js.map +1 -0
- package/dist/action/types.test.d.ts +5 -0
- package/dist/action/types.test.d.ts.map +1 -0
- package/dist/action/types.test.js +79 -0
- package/dist/action/types.test.js.map +1 -0
- package/dist/agents/agent-integrity.d.ts +111 -0
- package/dist/agents/agent-integrity.d.ts.map +1 -0
- package/dist/agents/agent-integrity.js +308 -0
- package/dist/agents/agent-integrity.js.map +1 -0
- package/dist/agents/agent-privacy.d.ts +68 -0
- package/dist/agents/agent-privacy.d.ts.map +1 -0
- package/dist/agents/agent-privacy.js +345 -0
- package/dist/agents/agent-privacy.js.map +1 -0
- package/dist/agents/exploit-chain.d.ts +64 -0
- package/dist/agents/exploit-chain.d.ts.map +1 -0
- package/dist/agents/exploit-chain.js +477 -0
- package/dist/agents/exploit-chain.js.map +1 -0
- package/dist/agents/exploit-chain.test.d.ts +5 -0
- package/dist/agents/exploit-chain.test.d.ts.map +1 -0
- package/dist/agents/exploit-chain.test.js +455 -0
- package/dist/agents/exploit-chain.test.js.map +1 -0
- package/dist/agents/index.d.ts +14 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +19 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/logic-flaw-detector.d.ts +55 -0
- package/dist/agents/logic-flaw-detector.d.ts.map +1 -0
- package/dist/agents/logic-flaw-detector.js +454 -0
- package/dist/agents/logic-flaw-detector.js.map +1 -0
- package/dist/agents/zero-day-hunter.d.ts +69 -0
- package/dist/agents/zero-day-hunter.d.ts.map +1 -0
- package/dist/agents/zero-day-hunter.js +591 -0
- package/dist/agents/zero-day-hunter.js.map +1 -0
- package/dist/certification/artifacts.d.ts +21 -0
- package/dist/certification/artifacts.d.ts.map +1 -0
- package/dist/certification/artifacts.js +275 -0
- package/dist/certification/artifacts.js.map +1 -0
- package/dist/certification/autofix.d.ts +122 -0
- package/dist/certification/autofix.d.ts.map +1 -0
- package/dist/certification/autofix.js +476 -0
- package/dist/certification/autofix.js.map +1 -0
- package/dist/certification/badge.d.ts +56 -0
- package/dist/certification/badge.d.ts.map +1 -0
- package/dist/certification/badge.js +155 -0
- package/dist/certification/badge.js.map +1 -0
- package/dist/certification/cache.d.ts +121 -0
- package/dist/certification/cache.d.ts.map +1 -0
- package/dist/certification/cache.js +275 -0
- package/dist/certification/cache.js.map +1 -0
- package/dist/certification/cache.test.d.ts +5 -0
- package/dist/certification/cache.test.d.ts.map +1 -0
- package/dist/certification/cache.test.js +270 -0
- package/dist/certification/cache.test.js.map +1 -0
- package/dist/certification/consensus.d.ts +105 -0
- package/dist/certification/consensus.d.ts.map +1 -0
- package/dist/certification/consensus.js +353 -0
- package/dist/certification/consensus.js.map +1 -0
- package/dist/certification/consensus.test.d.ts +5 -0
- package/dist/certification/consensus.test.d.ts.map +1 -0
- package/dist/certification/consensus.test.js +342 -0
- package/dist/certification/consensus.test.js.map +1 -0
- package/dist/certification/index.d.ts +14 -0
- package/dist/certification/index.d.ts.map +1 -0
- package/dist/certification/index.js +14 -0
- package/dist/certification/index.js.map +1 -0
- package/dist/certification/rules.d.ts +89 -0
- package/dist/certification/rules.d.ts.map +1 -0
- package/dist/certification/rules.js +317 -0
- package/dist/certification/rules.js.map +1 -0
- package/dist/certification/sarif.d.ts +107 -0
- package/dist/certification/sarif.d.ts.map +1 -0
- package/dist/certification/sarif.js +191 -0
- package/dist/certification/sarif.js.map +1 -0
- package/dist/certification/store.d.ts +255 -0
- package/dist/certification/store.d.ts.map +1 -0
- package/dist/certification/store.js +835 -0
- package/dist/certification/store.js.map +1 -0
- package/dist/certification/store.test.d.ts +5 -0
- package/dist/certification/store.test.d.ts.map +1 -0
- package/dist/certification/store.test.js +468 -0
- package/dist/certification/store.test.js.map +1 -0
- package/dist/certification/summary.d.ts +72 -0
- package/dist/certification/summary.d.ts.map +1 -0
- package/dist/certification/summary.js +296 -0
- package/dist/certification/summary.js.map +1 -0
- package/dist/certification/types.d.ts +138 -0
- package/dist/certification/types.d.ts.map +1 -0
- package/dist/certification/types.js +34 -0
- package/dist/certification/types.js.map +1 -0
- package/dist/commands/audits/api-check.d.ts +3 -0
- package/dist/commands/audits/api-check.d.ts.map +1 -0
- package/dist/commands/audits/api-check.js +71 -0
- package/dist/commands/audits/api-check.js.map +1 -0
- package/dist/commands/audits/deadcode.d.ts +3 -0
- package/dist/commands/audits/deadcode.d.ts.map +1 -0
- package/dist/commands/audits/deadcode.js +63 -0
- package/dist/commands/audits/deadcode.js.map +1 -0
- package/dist/commands/audits/deps.d.ts +3 -0
- package/dist/commands/audits/deps.d.ts.map +1 -0
- package/dist/commands/audits/deps.js +56 -0
- package/dist/commands/audits/deps.js.map +1 -0
- package/dist/commands/audits/errors.d.ts +3 -0
- package/dist/commands/audits/errors.d.ts.map +1 -0
- package/dist/commands/audits/errors.js +65 -0
- package/dist/commands/audits/errors.js.map +1 -0
- package/dist/commands/audits/index.d.ts +3 -0
- package/dist/commands/audits/index.d.ts.map +1 -0
- package/dist/commands/audits/index.js +15 -0
- package/dist/commands/audits/index.js.map +1 -0
- package/dist/commands/audits/perf.d.ts +3 -0
- package/dist/commands/audits/perf.d.ts.map +1 -0
- package/dist/commands/audits/perf.js +85 -0
- package/dist/commands/audits/perf.js.map +1 -0
- package/dist/commands/audits/secrets.d.ts +3 -0
- package/dist/commands/audits/secrets.d.ts.map +1 -0
- package/dist/commands/audits/secrets.js +71 -0
- package/dist/commands/audits/secrets.js.map +1 -0
- package/dist/commands/certification/certify.d.ts +3 -0
- package/dist/commands/certification/certify.d.ts.map +1 -0
- package/dist/commands/certification/certify.js +108 -0
- package/dist/commands/certification/certify.js.map +1 -0
- package/dist/commands/certification/index.d.ts +3 -0
- package/dist/commands/certification/index.d.ts.map +1 -0
- package/dist/commands/certification/index.js +17 -0
- package/dist/commands/certification/index.js.map +1 -0
- package/dist/commands/certification/performance.d.ts +3 -0
- package/dist/commands/certification/performance.d.ts.map +1 -0
- package/dist/commands/certification/performance.js +89 -0
- package/dist/commands/certification/performance.js.map +1 -0
- package/dist/commands/certification/quality.d.ts +3 -0
- package/dist/commands/certification/quality.d.ts.map +1 -0
- package/dist/commands/certification/quality.js +92 -0
- package/dist/commands/certification/quality.js.map +1 -0
- package/dist/commands/certification/redteam.d.ts +3 -0
- package/dist/commands/certification/redteam.d.ts.map +1 -0
- package/dist/commands/certification/redteam.js +114 -0
- package/dist/commands/certification/redteam.js.map +1 -0
- package/dist/commands/certification/reliability.d.ts +3 -0
- package/dist/commands/certification/reliability.d.ts.map +1 -0
- package/dist/commands/certification/reliability.js +93 -0
- package/dist/commands/certification/reliability.js.map +1 -0
- package/dist/commands/certification/security.d.ts +3 -0
- package/dist/commands/certification/security.d.ts.map +1 -0
- package/dist/commands/certification/security.js +90 -0
- package/dist/commands/certification/security.js.map +1 -0
- package/dist/commands/certification/typesafety.d.ts +3 -0
- package/dist/commands/certification/typesafety.d.ts.map +1 -0
- package/dist/commands/certification/typesafety.js +87 -0
- package/dist/commands/certification/typesafety.js.map +1 -0
- package/dist/commands/core/add-tests.d.ts +3 -0
- package/dist/commands/core/add-tests.d.ts.map +1 -0
- package/dist/commands/core/add-tests.js +29 -0
- package/dist/commands/core/add-tests.js.map +1 -0
- package/dist/commands/core/audit.d.ts +3 -0
- package/dist/commands/core/audit.d.ts.map +1 -0
- package/dist/commands/core/audit.js +64 -0
- package/dist/commands/core/audit.js.map +1 -0
- package/dist/commands/core/fix-critical.d.ts +3 -0
- package/dist/commands/core/fix-critical.d.ts.map +1 -0
- package/dist/commands/core/fix-critical.js +22 -0
- package/dist/commands/core/fix-critical.js.map +1 -0
- package/dist/commands/core/fix-high.d.ts +3 -0
- package/dist/commands/core/fix-high.d.ts.map +1 -0
- package/dist/commands/core/fix-high.js +32 -0
- package/dist/commands/core/fix-high.js.map +1 -0
- package/dist/commands/core/fix-medium.d.ts +3 -0
- package/dist/commands/core/fix-medium.d.ts.map +1 -0
- package/dist/commands/core/fix-medium.js +29 -0
- package/dist/commands/core/fix-medium.js.map +1 -0
- package/dist/commands/core/fix-rls.d.ts +3 -0
- package/dist/commands/core/fix-rls.d.ts.map +1 -0
- package/dist/commands/core/fix-rls.js +17 -0
- package/dist/commands/core/fix-rls.js.map +1 -0
- package/dist/commands/core/harden.d.ts +3 -0
- package/dist/commands/core/harden.d.ts.map +1 -0
- package/dist/commands/core/harden.js +19 -0
- package/dist/commands/core/harden.js.map +1 -0
- package/dist/commands/core/index.d.ts +3 -0
- package/dist/commands/core/index.d.ts.map +1 -0
- package/dist/commands/core/index.js +21 -0
- package/dist/commands/core/index.js.map +1 -0
- package/dist/commands/core/preflight.d.ts +3 -0
- package/dist/commands/core/preflight.d.ts.map +1 -0
- package/dist/commands/core/preflight.js +50 -0
- package/dist/commands/core/preflight.js.map +1 -0
- package/dist/commands/core/verify.d.ts +3 -0
- package/dist/commands/core/verify.d.ts.map +1 -0
- package/dist/commands/core/verify.js +32 -0
- package/dist/commands/core/verify.js.map +1 -0
- package/dist/commands/index.d.ts +28 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +37 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/types.d.ts +9 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +5 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/compliance/cis.d.ts +29 -0
- package/dist/compliance/cis.d.ts.map +1 -0
- package/dist/compliance/cis.js +316 -0
- package/dist/compliance/cis.js.map +1 -0
- package/dist/compliance/frameworks/eu-ai-act.d.ts +55 -0
- package/dist/compliance/frameworks/eu-ai-act.d.ts.map +1 -0
- package/dist/compliance/frameworks/eu-ai-act.js +621 -0
- package/dist/compliance/frameworks/eu-ai-act.js.map +1 -0
- package/dist/compliance/frameworks/index.d.ts +67 -0
- package/dist/compliance/frameworks/index.d.ts.map +1 -0
- package/dist/compliance/frameworks/index.js +97 -0
- package/dist/compliance/frameworks/index.js.map +1 -0
- package/dist/compliance/frameworks/iso-42001.d.ts +59 -0
- package/dist/compliance/frameworks/iso-42001.d.ts.map +1 -0
- package/dist/compliance/frameworks/iso-42001.js +719 -0
- package/dist/compliance/frameworks/iso-42001.js.map +1 -0
- package/dist/compliance/frameworks/mitre-atlas.d.ts +58 -0
- package/dist/compliance/frameworks/mitre-atlas.d.ts.map +1 -0
- package/dist/compliance/frameworks/mitre-atlas.js +686 -0
- package/dist/compliance/frameworks/mitre-atlas.js.map +1 -0
- package/dist/compliance/frameworks/nist-ai-rmf.d.ts +51 -0
- package/dist/compliance/frameworks/nist-ai-rmf.d.ts.map +1 -0
- package/dist/compliance/frameworks/nist-ai-rmf.js +677 -0
- package/dist/compliance/frameworks/nist-ai-rmf.js.map +1 -0
- package/dist/compliance/frameworks/owasp-llm.d.ts +58 -0
- package/dist/compliance/frameworks/owasp-llm.d.ts.map +1 -0
- package/dist/compliance/frameworks/owasp-llm.js +399 -0
- package/dist/compliance/frameworks/owasp-llm.js.map +1 -0
- package/dist/compliance/gdpr.d.ts +34 -0
- package/dist/compliance/gdpr.d.ts.map +1 -0
- package/dist/compliance/gdpr.js +319 -0
- package/dist/compliance/gdpr.js.map +1 -0
- package/dist/compliance/hipaa.d.ts +29 -0
- package/dist/compliance/hipaa.d.ts.map +1 -0
- package/dist/compliance/hipaa.js +205 -0
- package/dist/compliance/hipaa.js.map +1 -0
- package/dist/compliance/index.d.ts +18 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +26 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/iso27001.d.ts +30 -0
- package/dist/compliance/iso27001.d.ts.map +1 -0
- package/dist/compliance/iso27001.js +332 -0
- package/dist/compliance/iso27001.js.map +1 -0
- package/dist/compliance/mapper.d.ts +42 -0
- package/dist/compliance/mapper.d.ts.map +1 -0
- package/dist/compliance/mapper.js +269 -0
- package/dist/compliance/mapper.js.map +1 -0
- package/dist/compliance/mapper.test.d.ts +5 -0
- package/dist/compliance/mapper.test.d.ts.map +1 -0
- package/dist/compliance/mapper.test.js +360 -0
- package/dist/compliance/mapper.test.js.map +1 -0
- package/dist/compliance/pci-dss.d.ts +29 -0
- package/dist/compliance/pci-dss.d.ts.map +1 -0
- package/dist/compliance/pci-dss.js +247 -0
- package/dist/compliance/pci-dss.js.map +1 -0
- package/dist/compliance/report.d.ts +25 -0
- package/dist/compliance/report.d.ts.map +1 -0
- package/dist/compliance/report.js +254 -0
- package/dist/compliance/report.js.map +1 -0
- package/dist/compliance/report.test.d.ts +5 -0
- package/dist/compliance/report.test.d.ts.map +1 -0
- package/dist/compliance/report.test.js +128 -0
- package/dist/compliance/report.test.js.map +1 -0
- package/dist/compliance/soc2.d.ts +30 -0
- package/dist/compliance/soc2.d.ts.map +1 -0
- package/dist/compliance/soc2.js +262 -0
- package/dist/compliance/soc2.js.map +1 -0
- package/dist/compliance/soc2.test.d.ts +5 -0
- package/dist/compliance/soc2.test.d.ts.map +1 -0
- package/dist/compliance/soc2.test.js +86 -0
- package/dist/compliance/soc2.test.js.map +1 -0
- package/dist/compliance/types.d.ts +125 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +10 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/config/flags.d.ts +456 -0
- package/dist/config/flags.d.ts.map +1 -0
- package/dist/config/flags.js +464 -0
- package/dist/config/flags.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +10 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/severity-overrides.d.ts +209 -0
- package/dist/config/severity-overrides.d.ts.map +1 -0
- package/dist/config/severity-overrides.js +380 -0
- package/dist/config/severity-overrides.js.map +1 -0
- package/dist/cost/index.d.ts +11 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +12 -0
- package/dist/cost/index.js.map +1 -0
- package/dist/cost/pricing.d.ts +57 -0
- package/dist/cost/pricing.d.ts.map +1 -0
- package/dist/cost/pricing.js +196 -0
- package/dist/cost/pricing.js.map +1 -0
- package/dist/cost/pricing.test.d.ts +5 -0
- package/dist/cost/pricing.test.d.ts.map +1 -0
- package/dist/cost/pricing.test.js +195 -0
- package/dist/cost/pricing.test.js.map +1 -0
- package/dist/cost/tracker.d.ts +100 -0
- package/dist/cost/tracker.d.ts.map +1 -0
- package/dist/cost/tracker.js +366 -0
- package/dist/cost/tracker.js.map +1 -0
- package/dist/cost/tracker.test.d.ts +5 -0
- package/dist/cost/tracker.test.d.ts.map +1 -0
- package/dist/cost/tracker.test.js +360 -0
- package/dist/cost/tracker.test.js.map +1 -0
- package/dist/cost/types.d.ts +135 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +9 -0
- package/dist/cost/types.js.map +1 -0
- package/dist/enterprise/auth/oidc.d.ts +231 -0
- package/dist/enterprise/auth/oidc.d.ts.map +1 -0
- package/dist/enterprise/auth/oidc.js +372 -0
- package/dist/enterprise/auth/oidc.js.map +1 -0
- package/dist/enterprise/auth/oidc.test.d.ts +5 -0
- package/dist/enterprise/auth/oidc.test.d.ts.map +1 -0
- package/dist/enterprise/auth/oidc.test.js +435 -0
- package/dist/enterprise/auth/oidc.test.js.map +1 -0
- package/dist/enterprise/index.d.ts +14 -0
- package/dist/enterprise/index.d.ts.map +1 -0
- package/dist/enterprise/index.js +19 -0
- package/dist/enterprise/index.js.map +1 -0
- package/dist/enterprise/integrations/chat.d.ts +205 -0
- package/dist/enterprise/integrations/chat.d.ts.map +1 -0
- package/dist/enterprise/integrations/chat.js +624 -0
- package/dist/enterprise/integrations/chat.js.map +1 -0
- package/dist/enterprise/integrations/chat.test.d.ts +5 -0
- package/dist/enterprise/integrations/chat.test.d.ts.map +1 -0
- package/dist/enterprise/integrations/chat.test.js +557 -0
- package/dist/enterprise/integrations/chat.test.js.map +1 -0
- package/dist/enterprise/integrations/ticketing.d.ts +257 -0
- package/dist/enterprise/integrations/ticketing.d.ts.map +1 -0
- package/dist/enterprise/integrations/ticketing.js +548 -0
- package/dist/enterprise/integrations/ticketing.js.map +1 -0
- package/dist/enterprise/integrations/ticketing.test.d.ts +5 -0
- package/dist/enterprise/integrations/ticketing.test.d.ts.map +1 -0
- package/dist/enterprise/integrations/ticketing.test.js +693 -0
- package/dist/enterprise/integrations/ticketing.test.js.map +1 -0
- package/dist/enterprise/policy/opa.d.ts +194 -0
- package/dist/enterprise/policy/opa.d.ts.map +1 -0
- package/dist/enterprise/policy/opa.js +385 -0
- package/dist/enterprise/policy/opa.js.map +1 -0
- package/dist/enterprise/policy/opa.test.d.ts +5 -0
- package/dist/enterprise/policy/opa.test.d.ts.map +1 -0
- package/dist/enterprise/policy/opa.test.js +702 -0
- package/dist/enterprise/policy/opa.test.js.map +1 -0
- package/dist/enterprise/signing/kms.d.ts +211 -0
- package/dist/enterprise/signing/kms.d.ts.map +1 -0
- package/dist/enterprise/signing/kms.js +480 -0
- package/dist/enterprise/signing/kms.js.map +1 -0
- package/dist/enterprise/signing/kms.test.d.ts +5 -0
- package/dist/enterprise/signing/kms.test.d.ts.map +1 -0
- package/dist/enterprise/signing/kms.test.js +511 -0
- package/dist/enterprise/signing/kms.test.js.map +1 -0
- package/dist/eval/fixtures.d.ts +58 -0
- package/dist/eval/fixtures.d.ts.map +1 -0
- package/dist/eval/fixtures.js +571 -0
- package/dist/eval/fixtures.js.map +1 -0
- package/dist/eval/fixtures.test.d.ts +5 -0
- package/dist/eval/fixtures.test.d.ts.map +1 -0
- package/dist/eval/fixtures.test.js +193 -0
- package/dist/eval/fixtures.test.js.map +1 -0
- package/dist/eval/harness.d.ts +30 -0
- package/dist/eval/harness.d.ts.map +1 -0
- package/dist/eval/harness.js +221 -0
- package/dist/eval/harness.js.map +1 -0
- package/dist/eval/harness.test.d.ts +5 -0
- package/dist/eval/harness.test.d.ts.map +1 -0
- package/dist/eval/harness.test.js +314 -0
- package/dist/eval/harness.test.js.map +1 -0
- package/dist/eval/index.d.ts +15 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +18 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/metrics.d.ts +56 -0
- package/dist/eval/metrics.d.ts.map +1 -0
- package/dist/eval/metrics.js +298 -0
- package/dist/eval/metrics.js.map +1 -0
- package/dist/eval/metrics.test.d.ts +5 -0
- package/dist/eval/metrics.test.d.ts.map +1 -0
- package/dist/eval/metrics.test.js +426 -0
- package/dist/eval/metrics.test.js.map +1 -0
- package/dist/eval/report.d.ts +30 -0
- package/dist/eval/report.d.ts.map +1 -0
- package/dist/eval/report.js +333 -0
- package/dist/eval/report.js.map +1 -0
- package/dist/eval/report.test.d.ts +5 -0
- package/dist/eval/report.test.d.ts.map +1 -0
- package/dist/eval/report.test.js +275 -0
- package/dist/eval/report.test.js.map +1 -0
- package/dist/eval/types.d.ts +234 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +27 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/http-server.d.ts +3 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +127 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4120 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +46 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +131 -0
- package/dist/logger.js.map +1 -0
- package/dist/multimodel/consensus.d.ts +49 -0
- package/dist/multimodel/consensus.d.ts.map +1 -0
- package/dist/multimodel/consensus.js +454 -0
- package/dist/multimodel/consensus.js.map +1 -0
- package/dist/multimodel/consensus.test.d.ts +5 -0
- package/dist/multimodel/consensus.test.d.ts.map +1 -0
- package/dist/multimodel/consensus.test.js +415 -0
- package/dist/multimodel/consensus.test.js.map +1 -0
- package/dist/multimodel/index.d.ts +13 -0
- package/dist/multimodel/index.d.ts.map +1 -0
- package/dist/multimodel/index.js +14 -0
- package/dist/multimodel/index.js.map +1 -0
- package/dist/multimodel/runner.d.ts +95 -0
- package/dist/multimodel/runner.d.ts.map +1 -0
- package/dist/multimodel/runner.js +312 -0
- package/dist/multimodel/runner.js.map +1 -0
- package/dist/multimodel/runner.test.d.ts +5 -0
- package/dist/multimodel/runner.test.d.ts.map +1 -0
- package/dist/multimodel/runner.test.js +224 -0
- package/dist/multimodel/runner.test.js.map +1 -0
- package/dist/multimodel/types.d.ts +202 -0
- package/dist/multimodel/types.d.ts.map +1 -0
- package/dist/multimodel/types.js +10 -0
- package/dist/multimodel/types.js.map +1 -0
- package/dist/observability/index.d.ts +9 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +9 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/otel.d.ts +102 -0
- package/dist/observability/otel.d.ts.map +1 -0
- package/dist/observability/otel.js +284 -0
- package/dist/observability/otel.js.map +1 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +78 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +470 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/types.d.ts +304 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +100 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/sbom/cyclonedx.d.ts +30 -0
- package/dist/sbom/cyclonedx.d.ts.map +1 -0
- package/dist/sbom/cyclonedx.js +392 -0
- package/dist/sbom/cyclonedx.js.map +1 -0
- package/dist/sbom/cyclonedx.test.d.ts +5 -0
- package/dist/sbom/cyclonedx.test.d.ts.map +1 -0
- package/dist/sbom/cyclonedx.test.js +244 -0
- package/dist/sbom/cyclonedx.test.js.map +1 -0
- package/dist/sbom/index.d.ts +13 -0
- package/dist/sbom/index.d.ts.map +1 -0
- package/dist/sbom/index.js +15 -0
- package/dist/sbom/index.js.map +1 -0
- package/dist/sbom/provenance.d.ts +37 -0
- package/dist/sbom/provenance.d.ts.map +1 -0
- package/dist/sbom/provenance.js +268 -0
- package/dist/sbom/provenance.js.map +1 -0
- package/dist/sbom/provenance.test.d.ts +5 -0
- package/dist/sbom/provenance.test.d.ts.map +1 -0
- package/dist/sbom/provenance.test.js +189 -0
- package/dist/sbom/provenance.test.js.map +1 -0
- package/dist/sbom/signing.d.ts +87 -0
- package/dist/sbom/signing.d.ts.map +1 -0
- package/dist/sbom/signing.js +354 -0
- package/dist/sbom/signing.js.map +1 -0
- package/dist/sbom/signing.test.d.ts +5 -0
- package/dist/sbom/signing.test.d.ts.map +1 -0
- package/dist/sbom/signing.test.js +170 -0
- package/dist/sbom/signing.test.js.map +1 -0
- package/dist/sbom/types.d.ts +384 -0
- package/dist/sbom/types.d.ts.map +1 -0
- package/dist/sbom/types.js +17 -0
- package/dist/sbom/types.js.map +1 -0
- package/dist/scanners/agent/credential-scope-audit.d.ts +40 -0
- package/dist/scanners/agent/credential-scope-audit.d.ts.map +1 -0
- package/dist/scanners/agent/credential-scope-audit.js +404 -0
- package/dist/scanners/agent/credential-scope-audit.js.map +1 -0
- package/dist/scanners/agent/exfil-path-graph.d.ts +50 -0
- package/dist/scanners/agent/exfil-path-graph.d.ts.map +1 -0
- package/dist/scanners/agent/exfil-path-graph.js +764 -0
- package/dist/scanners/agent/exfil-path-graph.js.map +1 -0
- package/dist/scanners/agent/index.d.ts +43 -0
- package/dist/scanners/agent/index.d.ts.map +1 -0
- package/dist/scanners/agent/index.js +616 -0
- package/dist/scanners/agent/index.js.map +1 -0
- package/dist/scanners/agent/manifest-audit.d.ts +43 -0
- package/dist/scanners/agent/manifest-audit.d.ts.map +1 -0
- package/dist/scanners/agent/manifest-audit.js +403 -0
- package/dist/scanners/agent/manifest-audit.js.map +1 -0
- package/dist/scanners/agent/payloads/index.d.ts +44 -0
- package/dist/scanners/agent/payloads/index.d.ts.map +1 -0
- package/dist/scanners/agent/payloads/index.js +184 -0
- package/dist/scanners/agent/payloads/index.js.map +1 -0
- package/dist/scanners/agent/permission-minimiser.d.ts +48 -0
- package/dist/scanners/agent/permission-minimiser.d.ts.map +1 -0
- package/dist/scanners/agent/permission-minimiser.js +551 -0
- package/dist/scanners/agent/permission-minimiser.js.map +1 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.d.ts +39 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.d.ts.map +1 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.js +720 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.js.map +1 -0
- package/dist/scanners/agent/sandbox-audit.d.ts +44 -0
- package/dist/scanners/agent/sandbox-audit.d.ts.map +1 -0
- package/dist/scanners/agent/sandbox-audit.js +425 -0
- package/dist/scanners/agent/sandbox-audit.js.map +1 -0
- package/dist/scanners/agent/supply-chain-mcp.d.ts +53 -0
- package/dist/scanners/agent/supply-chain-mcp.d.ts.map +1 -0
- package/dist/scanners/agent/supply-chain-mcp.js +479 -0
- package/dist/scanners/agent/supply-chain-mcp.js.map +1 -0
- package/dist/scanners/agent/tool-description-drift.d.ts +62 -0
- package/dist/scanners/agent/tool-description-drift.d.ts.map +1 -0
- package/dist/scanners/agent/tool-description-drift.js +365 -0
- package/dist/scanners/agent/tool-description-drift.js.map +1 -0
- package/dist/scanners/agent/types.d.ts +840 -0
- package/dist/scanners/agent/types.d.ts.map +1 -0
- package/dist/scanners/agent/types.js +149 -0
- package/dist/scanners/agent/types.js.map +1 -0
- package/dist/scanners/bandit.d.ts +25 -0
- package/dist/scanners/bandit.d.ts.map +1 -0
- package/dist/scanners/bandit.js +129 -0
- package/dist/scanners/bandit.js.map +1 -0
- package/dist/scanners/binary-analysis.d.ts +41 -0
- package/dist/scanners/binary-analysis.d.ts.map +1 -0
- package/dist/scanners/binary-analysis.js +587 -0
- package/dist/scanners/binary-analysis.js.map +1 -0
- package/dist/scanners/binary-analysis.test.d.ts +5 -0
- package/dist/scanners/binary-analysis.test.d.ts.map +1 -0
- package/dist/scanners/binary-analysis.test.js +291 -0
- package/dist/scanners/binary-analysis.test.js.map +1 -0
- package/dist/scanners/brakeman.d.ts +30 -0
- package/dist/scanners/brakeman.d.ts.map +1 -0
- package/dist/scanners/brakeman.js +271 -0
- package/dist/scanners/brakeman.js.map +1 -0
- package/dist/scanners/dependencies.d.ts +22 -0
- package/dist/scanners/dependencies.d.ts.map +1 -0
- package/dist/scanners/dependencies.js +202 -0
- package/dist/scanners/dependencies.js.map +1 -0
- package/dist/scanners/dependencies.test.d.ts +5 -0
- package/dist/scanners/dependencies.test.d.ts.map +1 -0
- package/dist/scanners/dependencies.test.js +185 -0
- package/dist/scanners/dependencies.test.js.map +1 -0
- package/dist/scanners/eslint.d.ts +25 -0
- package/dist/scanners/eslint.d.ts.map +1 -0
- package/dist/scanners/eslint.js +220 -0
- package/dist/scanners/eslint.js.map +1 -0
- package/dist/scanners/gosec.d.ts +25 -0
- package/dist/scanners/gosec.d.ts.map +1 -0
- package/dist/scanners/gosec.js +128 -0
- package/dist/scanners/gosec.js.map +1 -0
- package/dist/scanners/index.d.ts +128 -0
- package/dist/scanners/index.d.ts.map +1 -0
- package/dist/scanners/index.js +811 -0
- package/dist/scanners/index.js.map +1 -0
- package/dist/scanners/index.test.d.ts +5 -0
- package/dist/scanners/index.test.d.ts.map +1 -0
- package/dist/scanners/index.test.js +424 -0
- package/dist/scanners/index.test.js.map +1 -0
- package/dist/scanners/memory-safety.d.ts +44 -0
- package/dist/scanners/memory-safety.d.ts.map +1 -0
- package/dist/scanners/memory-safety.js +571 -0
- package/dist/scanners/memory-safety.js.map +1 -0
- package/dist/scanners/memory-safety.test.d.ts +5 -0
- package/dist/scanners/memory-safety.test.d.ts.map +1 -0
- package/dist/scanners/memory-safety.test.js +321 -0
- package/dist/scanners/memory-safety.test.js.map +1 -0
- package/dist/scanners/race-condition.d.ts +25 -0
- package/dist/scanners/race-condition.d.ts.map +1 -0
- package/dist/scanners/race-condition.js +443 -0
- package/dist/scanners/race-condition.js.map +1 -0
- package/dist/scanners/race-condition.test.d.ts +5 -0
- package/dist/scanners/race-condition.test.d.ts.map +1 -0
- package/dist/scanners/race-condition.test.js +428 -0
- package/dist/scanners/race-condition.test.js.map +1 -0
- package/dist/scanners/secrets.d.ts +25 -0
- package/dist/scanners/secrets.d.ts.map +1 -0
- package/dist/scanners/secrets.js +367 -0
- package/dist/scanners/secrets.js.map +1 -0
- package/dist/scanners/secrets.test.d.ts +5 -0
- package/dist/scanners/secrets.test.d.ts.map +1 -0
- package/dist/scanners/secrets.test.js +160 -0
- package/dist/scanners/secrets.test.js.map +1 -0
- package/dist/scanners/semgrep.d.ts +33 -0
- package/dist/scanners/semgrep.d.ts.map +1 -0
- package/dist/scanners/semgrep.js +350 -0
- package/dist/scanners/semgrep.js.map +1 -0
- package/dist/scanners/semgrep.test.d.ts +8 -0
- package/dist/scanners/semgrep.test.d.ts.map +1 -0
- package/dist/scanners/semgrep.test.js +254 -0
- package/dist/scanners/semgrep.test.js.map +1 -0
- package/dist/scanners/trivy.d.ts +26 -0
- package/dist/scanners/trivy.d.ts.map +1 -0
- package/dist/scanners/trivy.js +187 -0
- package/dist/scanners/trivy.js.map +1 -0
- package/dist/scanners/types.d.ts +210 -0
- package/dist/scanners/types.d.ts.map +1 -0
- package/dist/scanners/types.js +106 -0
- package/dist/scanners/types.js.map +1 -0
- package/dist/scanners/types.test.d.ts +5 -0
- package/dist/scanners/types.test.d.ts.map +1 -0
- package/dist/scanners/types.test.js +103 -0
- package/dist/scanners/types.test.js.map +1 -0
- package/dist/scanners/typescript.d.ts +32 -0
- package/dist/scanners/typescript.d.ts.map +1 -0
- package/dist/scanners/typescript.js +300 -0
- package/dist/scanners/typescript.js.map +1 -0
- package/dist/scanners/typescript.test.d.ts +5 -0
- package/dist/scanners/typescript.test.d.ts.map +1 -0
- package/dist/scanners/typescript.test.js +296 -0
- package/dist/scanners/typescript.test.js.map +1 -0
- package/dist/transcripts/index.d.ts +13 -0
- package/dist/transcripts/index.d.ts.map +1 -0
- package/dist/transcripts/index.js +17 -0
- package/dist/transcripts/index.js.map +1 -0
- package/dist/transcripts/logger.d.ts +190 -0
- package/dist/transcripts/logger.d.ts.map +1 -0
- package/dist/transcripts/logger.js +385 -0
- package/dist/transcripts/logger.js.map +1 -0
- package/dist/transcripts/logger.test.d.ts +5 -0
- package/dist/transcripts/logger.test.d.ts.map +1 -0
- package/dist/transcripts/logger.test.js +227 -0
- package/dist/transcripts/logger.test.js.map +1 -0
- package/dist/transcripts/redaction.d.ts +125 -0
- package/dist/transcripts/redaction.d.ts.map +1 -0
- package/dist/transcripts/redaction.js +416 -0
- package/dist/transcripts/redaction.js.map +1 -0
- package/dist/transcripts/redaction.test.d.ts +5 -0
- package/dist/transcripts/redaction.test.d.ts.map +1 -0
- package/dist/transcripts/redaction.test.js +267 -0
- package/dist/transcripts/redaction.test.js.map +1 -0
- package/dist/transcripts/signing.d.ts +108 -0
- package/dist/transcripts/signing.d.ts.map +1 -0
- package/dist/transcripts/signing.js +173 -0
- package/dist/transcripts/signing.js.map +1 -0
- package/dist/transcripts/verifier.d.ts +133 -0
- package/dist/transcripts/verifier.d.ts.map +1 -0
- package/dist/transcripts/verifier.js +489 -0
- package/dist/transcripts/verifier.js.map +1 -0
- package/dist/transcripts/verifier.test.d.ts +5 -0
- package/dist/transcripts/verifier.test.d.ts.map +1 -0
- package/dist/transcripts/verifier.test.js +330 -0
- package/dist/transcripts/verifier.test.js.map +1 -0
- package/dist/util/concurrency.d.ts +221 -0
- package/dist/util/concurrency.d.ts.map +1 -0
- package/dist/util/concurrency.js +339 -0
- package/dist/util/concurrency.js.map +1 -0
- package/dist/util/index.d.ts +12 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +12 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/json.d.ts +63 -0
- package/dist/util/json.d.ts.map +1 -0
- package/dist/util/json.js +134 -0
- package/dist/util/json.js.map +1 -0
- package/dist/util/paths.d.ts +56 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +128 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/retry.d.ts +185 -0
- package/dist/util/retry.d.ts.map +1 -0
- package/dist/util/retry.js +338 -0
- package/dist/util/retry.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scanner Aggregator
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates all deterministic scanners and aggregates results.
|
|
5
|
+
* Runs scanners in parallel for performance.
|
|
6
|
+
*
|
|
7
|
+
* @module scanners
|
|
8
|
+
*/
|
|
9
|
+
export * from "./types.js";
|
|
10
|
+
export { runDependencyAudit, checkNpmAvailable } from "./dependencies.js";
|
|
11
|
+
export { runTypeScriptAnalysis, calculateTypeCoverage } from "./typescript.js";
|
|
12
|
+
export { runSecretsScanner, checkGitleaksAvailable } from "./secrets.js";
|
|
13
|
+
export { runSemgrep, checkSemgrepAvailable, generateSupabaseRules } from "./semgrep.js";
|
|
14
|
+
export { runBandit, checkBanditAvailable, detectPython } from "./bandit.js";
|
|
15
|
+
export { runGosec, checkGosecAvailable, detectGo } from "./gosec.js";
|
|
16
|
+
export { runTrivy, checkTrivyAvailable, detectIaC } from "./trivy.js";
|
|
17
|
+
export { runEslint, checkEslintAvailable, detectEslint } from "./eslint.js";
|
|
18
|
+
export { runBrakeman, checkBrakemanAvailable, detectRails } from "./brakeman.js";
|
|
19
|
+
// Mythos-class scanners
|
|
20
|
+
export { runBinaryAnalysis, checkBinaryAnalysisAvailable, detectNativeModules } from "./binary-analysis.js";
|
|
21
|
+
export { runMemorySafetyAnalysis, checkCppcheckAvailable, checkCargoGeigerAvailable, detectUnsafeLanguages } from "./memory-safety.js";
|
|
22
|
+
export { runRaceConditionAnalysis } from "./race-condition.js";
|
|
23
|
+
import { DEFAULT_SCANNER_OPTIONS } from "./types.js";
|
|
24
|
+
import { runDependencyAudit } from "./dependencies.js";
|
|
25
|
+
import { runTypeScriptAnalysis } from "./typescript.js";
|
|
26
|
+
import { runSecretsScanner } from "./secrets.js";
|
|
27
|
+
import { runSemgrep } from "./semgrep.js";
|
|
28
|
+
import { runBandit, detectPython } from "./bandit.js";
|
|
29
|
+
import { runGosec, detectGo } from "./gosec.js";
|
|
30
|
+
import { runTrivy } from "./trivy.js";
|
|
31
|
+
import { runEslint } from "./eslint.js";
|
|
32
|
+
import { runBrakeman } from "./brakeman.js";
|
|
33
|
+
import { logger } from "../logger.js";
|
|
34
|
+
import { access } from "fs/promises";
|
|
35
|
+
import { join } from "path";
|
|
36
|
+
import { exec } from "child_process";
|
|
37
|
+
import { promisify } from "util";
|
|
38
|
+
const execAsync = promisify(exec);
|
|
39
|
+
/**
|
|
40
|
+
* Run all enabled scanners and aggregate results
|
|
41
|
+
*/
|
|
42
|
+
export async function runAllScanners(projectPath, options) {
|
|
43
|
+
const opts = { ...DEFAULT_SCANNER_OPTIONS, ...options };
|
|
44
|
+
const startTime = Date.now();
|
|
45
|
+
const timestamp = new Date().toISOString();
|
|
46
|
+
logger.info("scanners.aggregator_starting", {
|
|
47
|
+
projectPath,
|
|
48
|
+
scanners: {
|
|
49
|
+
semgrep: opts.semgrep,
|
|
50
|
+
dependencies: opts.dependencies,
|
|
51
|
+
secrets: opts.secrets,
|
|
52
|
+
typescript: opts.typescript,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
// Run enabled scanners in parallel
|
|
56
|
+
const scannerPromises = [];
|
|
57
|
+
const scannerNames = [];
|
|
58
|
+
if (opts.semgrep) {
|
|
59
|
+
scannerPromises.push(runSemgrep(projectPath, {
|
|
60
|
+
customRulesDir: opts.semgrepRulesDir,
|
|
61
|
+
timeout: opts.timeout,
|
|
62
|
+
}));
|
|
63
|
+
scannerNames.push("semgrep");
|
|
64
|
+
}
|
|
65
|
+
if (opts.dependencies) {
|
|
66
|
+
scannerPromises.push(runDependencyAudit(projectPath));
|
|
67
|
+
scannerNames.push("npm-audit");
|
|
68
|
+
}
|
|
69
|
+
if (opts.secrets) {
|
|
70
|
+
scannerPromises.push(runSecretsScanner(projectPath));
|
|
71
|
+
scannerNames.push("gitleaks");
|
|
72
|
+
}
|
|
73
|
+
if (opts.typescript) {
|
|
74
|
+
scannerPromises.push(runTypeScriptAnalysis(projectPath));
|
|
75
|
+
scannerNames.push("tsc");
|
|
76
|
+
}
|
|
77
|
+
if (opts.eslint) {
|
|
78
|
+
scannerPromises.push(runEslint(projectPath, { timeout: opts.timeout }));
|
|
79
|
+
scannerNames.push("eslint");
|
|
80
|
+
}
|
|
81
|
+
// Wait for all scanners to complete
|
|
82
|
+
const results = await Promise.all(scannerPromises);
|
|
83
|
+
// Build result map
|
|
84
|
+
const scannerResults = results;
|
|
85
|
+
// Deduplicate findings (same file:line from multiple scanners)
|
|
86
|
+
const allFindings = deduplicateFindings(results.flatMap((r) => r.findings));
|
|
87
|
+
// Calculate severity counts
|
|
88
|
+
const bySeverity = {
|
|
89
|
+
critical: 0,
|
|
90
|
+
high: 0,
|
|
91
|
+
medium: 0,
|
|
92
|
+
low: 0,
|
|
93
|
+
info: 0,
|
|
94
|
+
};
|
|
95
|
+
for (const finding of allFindings) {
|
|
96
|
+
bySeverity[finding.severity]++;
|
|
97
|
+
}
|
|
98
|
+
// Calculate per-scanner counts
|
|
99
|
+
const byScanner = {
|
|
100
|
+
semgrep: 0,
|
|
101
|
+
"npm-audit": 0,
|
|
102
|
+
gitleaks: 0,
|
|
103
|
+
tsc: 0,
|
|
104
|
+
eslint: 0,
|
|
105
|
+
bandit: 0,
|
|
106
|
+
gosec: 0,
|
|
107
|
+
brakeman: 0,
|
|
108
|
+
trivy: 0,
|
|
109
|
+
"binary-analysis": 0,
|
|
110
|
+
"memory-safety": 0,
|
|
111
|
+
"race-condition": 0,
|
|
112
|
+
plugin: 0,
|
|
113
|
+
};
|
|
114
|
+
for (const finding of allFindings) {
|
|
115
|
+
if (finding.scanner in byScanner) {
|
|
116
|
+
byScanner[finding.scanner]++;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Identify failed scanners
|
|
120
|
+
const failedScanners = scannerResults
|
|
121
|
+
.filter((r) => !r.success)
|
|
122
|
+
.map((r) => r.scanner);
|
|
123
|
+
const result = {
|
|
124
|
+
timestamp,
|
|
125
|
+
projectPath,
|
|
126
|
+
scanners: scannerResults,
|
|
127
|
+
totalFindings: allFindings.length,
|
|
128
|
+
bySeverity,
|
|
129
|
+
byScanner,
|
|
130
|
+
totalDuration: Date.now() - startTime,
|
|
131
|
+
allSucceeded: failedScanners.length === 0,
|
|
132
|
+
failedScanners,
|
|
133
|
+
};
|
|
134
|
+
logger.info("scanners.aggregator_complete", {
|
|
135
|
+
totalFindings: result.totalFindings,
|
|
136
|
+
bySeverity: result.bySeverity,
|
|
137
|
+
duration: result.totalDuration,
|
|
138
|
+
failedScanners: result.failedScanners,
|
|
139
|
+
});
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Detect if project uses JavaScript/TypeScript
|
|
144
|
+
*/
|
|
145
|
+
export async function detectJavaScript(projectPath) {
|
|
146
|
+
try {
|
|
147
|
+
await access(join(projectPath, "package.json"));
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// Check for JS/TS files
|
|
152
|
+
try {
|
|
153
|
+
const { stdout } = await execAsync(`find "${projectPath}" -maxdepth 3 \\( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" \\) | head -1`, { timeout: 5000 });
|
|
154
|
+
return stdout.trim().length > 0;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Detect if project uses Ruby
|
|
163
|
+
*/
|
|
164
|
+
export async function detectRuby(projectPath) {
|
|
165
|
+
try {
|
|
166
|
+
await access(join(projectPath, "Gemfile"));
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
try {
|
|
171
|
+
await access(join(projectPath, "Rakefile"));
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
// Check for .rb files
|
|
176
|
+
try {
|
|
177
|
+
const { stdout } = await execAsync(`find "${projectPath}" -maxdepth 3 -name "*.rb" | head -1`, { timeout: 5000 });
|
|
178
|
+
return stdout.trim().length > 0;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Detect if project uses Java
|
|
188
|
+
*/
|
|
189
|
+
export async function detectJava(projectPath) {
|
|
190
|
+
try {
|
|
191
|
+
await access(join(projectPath, "pom.xml"));
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
try {
|
|
196
|
+
await access(join(projectPath, "build.gradle"));
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
try {
|
|
201
|
+
await access(join(projectPath, "build.gradle.kts"));
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// Check for .java files
|
|
206
|
+
try {
|
|
207
|
+
const { stdout } = await execAsync(`find "${projectPath}" -maxdepth 3 -name "*.java" | head -1`, { timeout: 5000 });
|
|
208
|
+
return stdout.trim().length > 0;
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Detect if project uses Docker
|
|
219
|
+
*/
|
|
220
|
+
export async function detectDocker(projectPath) {
|
|
221
|
+
try {
|
|
222
|
+
const { stdout } = await execAsync(`find "${projectPath}" -maxdepth 2 \\( -name "Dockerfile*" -o -name "docker-compose*.yml" -o -name "docker-compose*.yaml" \\) | head -1`, { timeout: 5000 });
|
|
223
|
+
return stdout.trim().length > 0;
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Detect if project uses Terraform
|
|
231
|
+
*/
|
|
232
|
+
export async function detectTerraform(projectPath) {
|
|
233
|
+
try {
|
|
234
|
+
const { stdout } = await execAsync(`find "${projectPath}" -maxdepth 3 -name "*.tf" | head -1`, { timeout: 5000 });
|
|
235
|
+
return stdout.trim().length > 0;
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Detect all project languages and technologies
|
|
243
|
+
*/
|
|
244
|
+
export async function detectProjectLanguages(projectPath) {
|
|
245
|
+
const [javascript, python, go, ruby, java, docker, terraform] = await Promise.all([
|
|
246
|
+
detectJavaScript(projectPath),
|
|
247
|
+
detectPython(projectPath),
|
|
248
|
+
detectGo(projectPath),
|
|
249
|
+
detectRuby(projectPath),
|
|
250
|
+
detectJava(projectPath),
|
|
251
|
+
detectDocker(projectPath),
|
|
252
|
+
detectTerraform(projectPath),
|
|
253
|
+
]);
|
|
254
|
+
return {
|
|
255
|
+
javascript,
|
|
256
|
+
python,
|
|
257
|
+
go,
|
|
258
|
+
ruby,
|
|
259
|
+
java,
|
|
260
|
+
docker,
|
|
261
|
+
terraform,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Run all scanners with automatic language detection
|
|
266
|
+
*
|
|
267
|
+
* Automatically enables language-specific scanners based on project files:
|
|
268
|
+
* - JavaScript/TypeScript → npm-audit, tsc, eslint
|
|
269
|
+
* - Python → bandit
|
|
270
|
+
* - Go → gosec
|
|
271
|
+
* - Ruby → brakeman (when implemented)
|
|
272
|
+
* - Docker/Terraform → trivy
|
|
273
|
+
*
|
|
274
|
+
* Always runs: semgrep, gitleaks (if available)
|
|
275
|
+
*/
|
|
276
|
+
export async function runAllScannersWithAutoDetect(projectPath, options) {
|
|
277
|
+
const startTime = Date.now();
|
|
278
|
+
// Detect languages
|
|
279
|
+
const languages = await detectProjectLanguages(projectPath);
|
|
280
|
+
logger.info("scanners.auto_detect_languages", {
|
|
281
|
+
projectPath,
|
|
282
|
+
languages,
|
|
283
|
+
});
|
|
284
|
+
// Build scanner options based on detected languages
|
|
285
|
+
const scannerOptions = {
|
|
286
|
+
// Always enabled
|
|
287
|
+
semgrep: true,
|
|
288
|
+
secrets: true,
|
|
289
|
+
// JavaScript/TypeScript
|
|
290
|
+
dependencies: languages.javascript,
|
|
291
|
+
typescript: languages.javascript,
|
|
292
|
+
eslint: languages.javascript,
|
|
293
|
+
// Python
|
|
294
|
+
bandit: languages.python,
|
|
295
|
+
// Go
|
|
296
|
+
gosec: languages.go,
|
|
297
|
+
// Ruby (when implemented)
|
|
298
|
+
brakeman: languages.ruby,
|
|
299
|
+
// Container/IaC
|
|
300
|
+
trivy: languages.docker || languages.terraform,
|
|
301
|
+
// Timeout
|
|
302
|
+
timeout: options?.timeout,
|
|
303
|
+
semgrepRulesDir: options?.semgrepRulesDir,
|
|
304
|
+
};
|
|
305
|
+
// Apply force enable overrides
|
|
306
|
+
if (options?.forceEnable) {
|
|
307
|
+
for (const scanner of options.forceEnable) {
|
|
308
|
+
if (scanner === "npm-audit")
|
|
309
|
+
scannerOptions.dependencies = true;
|
|
310
|
+
else if (scanner === "tsc")
|
|
311
|
+
scannerOptions.typescript = true;
|
|
312
|
+
else if (scanner === "gitleaks")
|
|
313
|
+
scannerOptions.secrets = true;
|
|
314
|
+
else if (scanner in scannerOptions) {
|
|
315
|
+
scannerOptions[scanner] = true;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
// Apply force disable overrides
|
|
320
|
+
if (options?.forceDisable) {
|
|
321
|
+
for (const scanner of options.forceDisable) {
|
|
322
|
+
if (scanner === "npm-audit")
|
|
323
|
+
scannerOptions.dependencies = false;
|
|
324
|
+
else if (scanner === "tsc")
|
|
325
|
+
scannerOptions.typescript = false;
|
|
326
|
+
else if (scanner === "gitleaks")
|
|
327
|
+
scannerOptions.secrets = false;
|
|
328
|
+
else if (scanner in scannerOptions) {
|
|
329
|
+
scannerOptions[scanner] = false;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
logger.info("scanners.auto_detect_options", {
|
|
334
|
+
scannerOptions,
|
|
335
|
+
forceEnable: options?.forceEnable,
|
|
336
|
+
forceDisable: options?.forceDisable,
|
|
337
|
+
});
|
|
338
|
+
// Run scanners with auto-detected options
|
|
339
|
+
const result = await runAllScannersExtended(projectPath, scannerOptions);
|
|
340
|
+
return {
|
|
341
|
+
...result,
|
|
342
|
+
detectedLanguages: languages,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Extended version of runAllScanners that includes all language-specific scanners
|
|
347
|
+
*/
|
|
348
|
+
async function runAllScannersExtended(projectPath, options) {
|
|
349
|
+
const startTime = Date.now();
|
|
350
|
+
const timestamp = new Date().toISOString();
|
|
351
|
+
logger.info("scanners.extended_aggregator_starting", {
|
|
352
|
+
projectPath,
|
|
353
|
+
scanners: options,
|
|
354
|
+
});
|
|
355
|
+
// Run enabled scanners in parallel
|
|
356
|
+
const scannerPromises = [];
|
|
357
|
+
const scannerNames = [];
|
|
358
|
+
if (options.semgrep) {
|
|
359
|
+
scannerPromises.push(runSemgrep(projectPath, {
|
|
360
|
+
customRulesDir: options.semgrepRulesDir,
|
|
361
|
+
timeout: options.timeout,
|
|
362
|
+
}));
|
|
363
|
+
scannerNames.push("semgrep");
|
|
364
|
+
}
|
|
365
|
+
if (options.dependencies) {
|
|
366
|
+
scannerPromises.push(runDependencyAudit(projectPath));
|
|
367
|
+
scannerNames.push("npm-audit");
|
|
368
|
+
}
|
|
369
|
+
if (options.secrets) {
|
|
370
|
+
scannerPromises.push(runSecretsScanner(projectPath));
|
|
371
|
+
scannerNames.push("gitleaks");
|
|
372
|
+
}
|
|
373
|
+
if (options.typescript) {
|
|
374
|
+
scannerPromises.push(runTypeScriptAnalysis(projectPath));
|
|
375
|
+
scannerNames.push("tsc");
|
|
376
|
+
}
|
|
377
|
+
if (options.eslint) {
|
|
378
|
+
scannerPromises.push(runEslint(projectPath, { timeout: options.timeout }));
|
|
379
|
+
scannerNames.push("eslint");
|
|
380
|
+
}
|
|
381
|
+
if (options.bandit) {
|
|
382
|
+
scannerPromises.push(runBandit(projectPath, { timeout: options.timeout }));
|
|
383
|
+
scannerNames.push("bandit");
|
|
384
|
+
}
|
|
385
|
+
if (options.gosec) {
|
|
386
|
+
scannerPromises.push(runGosec(projectPath, { timeout: options.timeout }));
|
|
387
|
+
scannerNames.push("gosec");
|
|
388
|
+
}
|
|
389
|
+
if (options.trivy) {
|
|
390
|
+
scannerPromises.push(runTrivy(projectPath, { timeout: options.timeout }));
|
|
391
|
+
scannerNames.push("trivy");
|
|
392
|
+
}
|
|
393
|
+
if (options.brakeman) {
|
|
394
|
+
scannerPromises.push(runBrakeman(projectPath, { timeout: options.timeout }));
|
|
395
|
+
scannerNames.push("brakeman");
|
|
396
|
+
}
|
|
397
|
+
// Wait for all scanners to complete
|
|
398
|
+
const results = await Promise.all(scannerPromises);
|
|
399
|
+
// Deduplicate findings
|
|
400
|
+
const allFindings = deduplicateFindings(results.flatMap((r) => r.findings));
|
|
401
|
+
// Calculate severity counts
|
|
402
|
+
const bySeverity = {
|
|
403
|
+
critical: 0,
|
|
404
|
+
high: 0,
|
|
405
|
+
medium: 0,
|
|
406
|
+
low: 0,
|
|
407
|
+
info: 0,
|
|
408
|
+
};
|
|
409
|
+
for (const finding of allFindings) {
|
|
410
|
+
bySeverity[finding.severity]++;
|
|
411
|
+
}
|
|
412
|
+
// Calculate per-scanner counts
|
|
413
|
+
const byScanner = {
|
|
414
|
+
semgrep: 0,
|
|
415
|
+
"npm-audit": 0,
|
|
416
|
+
gitleaks: 0,
|
|
417
|
+
tsc: 0,
|
|
418
|
+
eslint: 0,
|
|
419
|
+
bandit: 0,
|
|
420
|
+
gosec: 0,
|
|
421
|
+
brakeman: 0,
|
|
422
|
+
trivy: 0,
|
|
423
|
+
"binary-analysis": 0,
|
|
424
|
+
"memory-safety": 0,
|
|
425
|
+
"race-condition": 0,
|
|
426
|
+
plugin: 0,
|
|
427
|
+
};
|
|
428
|
+
for (const finding of allFindings) {
|
|
429
|
+
if (finding.scanner in byScanner) {
|
|
430
|
+
byScanner[finding.scanner]++;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// Identify failed scanners
|
|
434
|
+
const failedScanners = results
|
|
435
|
+
.filter((r) => !r.success)
|
|
436
|
+
.map((r) => r.scanner);
|
|
437
|
+
const result = {
|
|
438
|
+
timestamp,
|
|
439
|
+
projectPath,
|
|
440
|
+
scanners: results,
|
|
441
|
+
totalFindings: allFindings.length,
|
|
442
|
+
bySeverity,
|
|
443
|
+
byScanner,
|
|
444
|
+
totalDuration: Date.now() - startTime,
|
|
445
|
+
allSucceeded: failedScanners.length === 0,
|
|
446
|
+
failedScanners,
|
|
447
|
+
};
|
|
448
|
+
logger.info("scanners.extended_aggregator_complete", {
|
|
449
|
+
totalFindings: result.totalFindings,
|
|
450
|
+
bySeverity: result.bySeverity,
|
|
451
|
+
duration: result.totalDuration,
|
|
452
|
+
failedScanners: result.failedScanners,
|
|
453
|
+
scannersRun: scannerNames,
|
|
454
|
+
});
|
|
455
|
+
return result;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Deduplicate findings that have the same file:line:message
|
|
459
|
+
*/
|
|
460
|
+
function deduplicateFindings(findings) {
|
|
461
|
+
const seen = new Map();
|
|
462
|
+
for (const finding of findings) {
|
|
463
|
+
const key = `${finding.file}:${finding.line}:${finding.message.slice(0, 100)}`;
|
|
464
|
+
if (!seen.has(key)) {
|
|
465
|
+
seen.set(key, finding);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
// Keep the finding with higher severity or more information
|
|
469
|
+
const existing = seen.get(key);
|
|
470
|
+
const severityOrder = {
|
|
471
|
+
critical: 5,
|
|
472
|
+
high: 4,
|
|
473
|
+
medium: 3,
|
|
474
|
+
low: 2,
|
|
475
|
+
info: 1,
|
|
476
|
+
};
|
|
477
|
+
if (severityOrder[finding.severity] > severityOrder[existing.severity]) {
|
|
478
|
+
seen.set(key, finding);
|
|
479
|
+
}
|
|
480
|
+
else if (severityOrder[finding.severity] === severityOrder[existing.severity] &&
|
|
481
|
+
(finding.cweIds?.length || 0) > (existing.cweIds?.length || 0)) {
|
|
482
|
+
seen.set(key, finding);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return Array.from(seen.values());
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Check which scanners are available
|
|
490
|
+
*/
|
|
491
|
+
export async function checkScannersAvailable() {
|
|
492
|
+
const [npm, semgrep, gitleaks, bandit, gosec, trivy, eslint, brakeman, binaryTools] = await Promise.all([
|
|
493
|
+
import("./dependencies.js").then((m) => m.checkNpmAvailable()),
|
|
494
|
+
import("./semgrep.js").then((m) => m.checkSemgrepAvailable()),
|
|
495
|
+
import("./secrets.js").then((m) => m.checkGitleaksAvailable()),
|
|
496
|
+
import("./bandit.js").then((m) => m.checkBanditAvailable()),
|
|
497
|
+
import("./gosec.js").then((m) => m.checkGosecAvailable()),
|
|
498
|
+
import("./trivy.js").then((m) => m.checkTrivyAvailable()),
|
|
499
|
+
import("./eslint.js").then((m) => m.checkEslintAvailable()),
|
|
500
|
+
import("./brakeman.js").then((m) => m.checkBrakemanAvailable()),
|
|
501
|
+
import("./binary-analysis.js").then((m) => m.checkBinaryAnalysisAvailable()),
|
|
502
|
+
]);
|
|
503
|
+
// Binary analysis is available if any of its tools are available
|
|
504
|
+
const binaryAvailable = binaryTools.checksec || binaryTools.nm || binaryTools.file;
|
|
505
|
+
return {
|
|
506
|
+
"npm-audit": { available: npm.available, version: npm.version, error: npm.error },
|
|
507
|
+
semgrep: { available: semgrep.available, version: semgrep.version, error: semgrep.error },
|
|
508
|
+
gitleaks: { available: gitleaks.available, version: gitleaks.version, error: gitleaks.error },
|
|
509
|
+
tsc: { available: true, version: "5.0+" }, // TypeScript is always available (dev dep)
|
|
510
|
+
eslint: { available: eslint.available, version: eslint.version, error: eslint.error },
|
|
511
|
+
bandit: { available: bandit.available, version: bandit.version, error: bandit.error },
|
|
512
|
+
gosec: { available: gosec.available, version: gosec.version, error: gosec.error },
|
|
513
|
+
brakeman: { available: brakeman.available, version: brakeman.version, error: brakeman.error },
|
|
514
|
+
trivy: { available: trivy.available, version: trivy.version, error: trivy.error },
|
|
515
|
+
"binary-analysis": { available: binaryAvailable, version: "1.0.0" },
|
|
516
|
+
"memory-safety": { available: true, version: "1.0.0" }, // Pattern-based analysis always available
|
|
517
|
+
"race-condition": { available: true, version: "1.0.0" }, // Pattern-based analysis always available
|
|
518
|
+
plugin: { available: true, version: "1.0.0" }, // Plugin loader is always available
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Get installation commands for missing scanners
|
|
523
|
+
*/
|
|
524
|
+
export function getScannerInstallCommands() {
|
|
525
|
+
return {
|
|
526
|
+
semgrep: {
|
|
527
|
+
name: "Semgrep",
|
|
528
|
+
description: "Fast, open-source static analysis for security and code quality",
|
|
529
|
+
installCommands: {
|
|
530
|
+
macos: "brew install semgrep",
|
|
531
|
+
linux: "pip install semgrep",
|
|
532
|
+
windows: "pip install semgrep",
|
|
533
|
+
pip: "pip install semgrep",
|
|
534
|
+
},
|
|
535
|
+
documentation: "https://semgrep.dev/docs/getting-started/",
|
|
536
|
+
},
|
|
537
|
+
"npm-audit": {
|
|
538
|
+
name: "npm audit",
|
|
539
|
+
description: "Built-in npm security audit for dependency vulnerabilities",
|
|
540
|
+
installCommands: {
|
|
541
|
+
macos: "npm install -g npm@latest",
|
|
542
|
+
linux: "npm install -g npm@latest",
|
|
543
|
+
windows: "npm install -g npm@latest",
|
|
544
|
+
npm: "npm install -g npm@latest",
|
|
545
|
+
},
|
|
546
|
+
documentation: "https://docs.npmjs.com/cli/audit",
|
|
547
|
+
},
|
|
548
|
+
gitleaks: {
|
|
549
|
+
name: "Gitleaks",
|
|
550
|
+
description: "Detect hardcoded secrets like passwords and API keys",
|
|
551
|
+
installCommands: {
|
|
552
|
+
macos: "brew install gitleaks",
|
|
553
|
+
linux: "brew install gitleaks",
|
|
554
|
+
windows: "choco install gitleaks",
|
|
555
|
+
},
|
|
556
|
+
documentation: "https://github.com/gitleaks/gitleaks",
|
|
557
|
+
},
|
|
558
|
+
tsc: {
|
|
559
|
+
name: "TypeScript Compiler",
|
|
560
|
+
description: "TypeScript type checking and analysis",
|
|
561
|
+
installCommands: {
|
|
562
|
+
macos: "npm install -D typescript",
|
|
563
|
+
linux: "npm install -D typescript",
|
|
564
|
+
windows: "npm install -D typescript",
|
|
565
|
+
npm: "npm install -D typescript",
|
|
566
|
+
},
|
|
567
|
+
documentation: "https://www.typescriptlang.org/docs/",
|
|
568
|
+
},
|
|
569
|
+
eslint: {
|
|
570
|
+
name: "ESLint",
|
|
571
|
+
description: "Pluggable JavaScript/TypeScript linter for code quality",
|
|
572
|
+
installCommands: {
|
|
573
|
+
macos: "npm install -D eslint && npx eslint --init",
|
|
574
|
+
linux: "npm install -D eslint && npx eslint --init",
|
|
575
|
+
windows: "npm install -D eslint && npx eslint --init",
|
|
576
|
+
npm: "npm install -D eslint",
|
|
577
|
+
},
|
|
578
|
+
documentation: "https://eslint.org/docs/latest/use/getting-started",
|
|
579
|
+
},
|
|
580
|
+
bandit: {
|
|
581
|
+
name: "Bandit",
|
|
582
|
+
description: "Python security linter for common vulnerabilities",
|
|
583
|
+
installCommands: {
|
|
584
|
+
macos: "pip install bandit",
|
|
585
|
+
linux: "pip install bandit",
|
|
586
|
+
windows: "pip install bandit",
|
|
587
|
+
pip: "pip install bandit",
|
|
588
|
+
},
|
|
589
|
+
documentation: "https://bandit.readthedocs.io/",
|
|
590
|
+
},
|
|
591
|
+
gosec: {
|
|
592
|
+
name: "Gosec",
|
|
593
|
+
description: "Go security checker for common vulnerabilities",
|
|
594
|
+
installCommands: {
|
|
595
|
+
macos: "brew install gosec",
|
|
596
|
+
linux: "go install github.com/securego/gosec/v2/cmd/gosec@latest",
|
|
597
|
+
windows: "go install github.com/securego/gosec/v2/cmd/gosec@latest",
|
|
598
|
+
},
|
|
599
|
+
documentation: "https://github.com/securego/gosec",
|
|
600
|
+
},
|
|
601
|
+
brakeman: {
|
|
602
|
+
name: "Brakeman",
|
|
603
|
+
description: "Ruby on Rails security scanner",
|
|
604
|
+
installCommands: {
|
|
605
|
+
macos: "gem install brakeman",
|
|
606
|
+
linux: "gem install brakeman",
|
|
607
|
+
windows: "gem install brakeman",
|
|
608
|
+
},
|
|
609
|
+
documentation: "https://brakemanscanner.org/docs/",
|
|
610
|
+
},
|
|
611
|
+
trivy: {
|
|
612
|
+
name: "Trivy",
|
|
613
|
+
description: "Comprehensive vulnerability scanner for containers and IaC",
|
|
614
|
+
installCommands: {
|
|
615
|
+
macos: "brew install trivy",
|
|
616
|
+
linux: "curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin",
|
|
617
|
+
windows: "choco install trivy",
|
|
618
|
+
},
|
|
619
|
+
documentation: "https://aquasecurity.github.io/trivy/",
|
|
620
|
+
},
|
|
621
|
+
"binary-analysis": {
|
|
622
|
+
name: "Binary Analysis",
|
|
623
|
+
description: "Detect vulnerabilities in compiled code and native modules (checksec, nm)",
|
|
624
|
+
installCommands: {
|
|
625
|
+
macos: "brew install checksec",
|
|
626
|
+
linux: "pip install checksec.py",
|
|
627
|
+
windows: "pip install checksec.py",
|
|
628
|
+
pip: "pip install checksec.py",
|
|
629
|
+
},
|
|
630
|
+
documentation: "https://github.com/slimm609/checksec.sh",
|
|
631
|
+
},
|
|
632
|
+
"memory-safety": {
|
|
633
|
+
name: "Memory Safety",
|
|
634
|
+
description: "Detect memory corruption vulnerabilities in C/C++/Rust code (cppcheck, cargo-geiger)",
|
|
635
|
+
installCommands: {
|
|
636
|
+
macos: "brew install cppcheck",
|
|
637
|
+
linux: "apt-get install cppcheck",
|
|
638
|
+
windows: "choco install cppcheck",
|
|
639
|
+
},
|
|
640
|
+
documentation: "https://cppcheck.sourceforge.io/",
|
|
641
|
+
},
|
|
642
|
+
"race-condition": {
|
|
643
|
+
name: "Race Condition",
|
|
644
|
+
description: "Detect concurrency bugs and TOCTOU vulnerabilities (go vet, pattern analysis)",
|
|
645
|
+
installCommands: {
|
|
646
|
+
macos: "Built-in pattern analysis + go vet (if Go installed)",
|
|
647
|
+
linux: "Built-in pattern analysis + go vet (if Go installed)",
|
|
648
|
+
windows: "Built-in pattern analysis + go vet (if Go installed)",
|
|
649
|
+
},
|
|
650
|
+
documentation: "https://github.com/vaspera/hardening-mcp#race-condition",
|
|
651
|
+
},
|
|
652
|
+
plugin: {
|
|
653
|
+
name: "Custom Plugin",
|
|
654
|
+
description: "Custom scanner plugin loaded from .vaspera/plugins/",
|
|
655
|
+
installCommands: {
|
|
656
|
+
macos: "Create .vaspera/plugins/<name>.ts",
|
|
657
|
+
linux: "Create .vaspera/plugins/<name>.ts",
|
|
658
|
+
windows: "Create .vaspera/plugins/<name>.ts",
|
|
659
|
+
},
|
|
660
|
+
documentation: "https://github.com/vaspera/hardening-mcp#plugins",
|
|
661
|
+
},
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Convert aggregated scanner results to certification findings format
|
|
666
|
+
*/
|
|
667
|
+
export function scannerFindingsToCertificationFindings(scanResult) {
|
|
668
|
+
const findings = [];
|
|
669
|
+
// Group findings by scanner for ID generation
|
|
670
|
+
const byScannerType = new Map();
|
|
671
|
+
for (const result of scanResult.scanners) {
|
|
672
|
+
for (const finding of result.findings) {
|
|
673
|
+
if (!byScannerType.has(finding.scanner)) {
|
|
674
|
+
byScannerType.set(finding.scanner, []);
|
|
675
|
+
}
|
|
676
|
+
byScannerType.get(finding.scanner).push(finding);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
// Generate IDs and convert
|
|
680
|
+
for (const [scanner, scannerFindings] of byScannerType) {
|
|
681
|
+
const prefixMap = {
|
|
682
|
+
semgrep: "sem",
|
|
683
|
+
"npm-audit": "dep",
|
|
684
|
+
gitleaks: "sec",
|
|
685
|
+
tsc: "tsc",
|
|
686
|
+
eslint: "lint",
|
|
687
|
+
bandit: "py",
|
|
688
|
+
gosec: "go",
|
|
689
|
+
brakeman: "rb",
|
|
690
|
+
trivy: "trv",
|
|
691
|
+
"binary-analysis": "bin",
|
|
692
|
+
"memory-safety": "mem",
|
|
693
|
+
"race-condition": "rac",
|
|
694
|
+
plugin: "plg",
|
|
695
|
+
};
|
|
696
|
+
const prefix = prefixMap[scanner];
|
|
697
|
+
for (let i = 0; i < scannerFindings.length; i++) {
|
|
698
|
+
const f = scannerFindings[i];
|
|
699
|
+
findings.push({
|
|
700
|
+
id: `${prefix}-${String(i + 1).padStart(3, "0")}`,
|
|
701
|
+
severity: f.severity,
|
|
702
|
+
category: getCategoryFromScanner(f),
|
|
703
|
+
file: f.file,
|
|
704
|
+
line: f.line,
|
|
705
|
+
description: f.message,
|
|
706
|
+
evidence: f.evidence || `Rule: ${f.ruleId}`,
|
|
707
|
+
confidence: 100,
|
|
708
|
+
scanner_source: f.scanner,
|
|
709
|
+
scanner_rule_id: f.ruleId,
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return findings;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Determine category from scanner finding
|
|
717
|
+
*/
|
|
718
|
+
function getCategoryFromScanner(finding) {
|
|
719
|
+
// Try to extract from rule ID or CWE
|
|
720
|
+
const ruleId = finding.ruleId.toLowerCase();
|
|
721
|
+
if (finding.cweIds?.some((cwe) => ["CWE-89", "CWE-564"].includes(cwe)) || ruleId.includes("sql")) {
|
|
722
|
+
return "sql-injection";
|
|
723
|
+
}
|
|
724
|
+
if (finding.cweIds?.some((cwe) => cwe === "CWE-79") || ruleId.includes("xss")) {
|
|
725
|
+
return "xss";
|
|
726
|
+
}
|
|
727
|
+
if (finding.scanner === "gitleaks" || ruleId.includes("secret") || ruleId.includes("key")) {
|
|
728
|
+
return "secrets";
|
|
729
|
+
}
|
|
730
|
+
if (finding.scanner === "npm-audit") {
|
|
731
|
+
return "dependency-vulnerability";
|
|
732
|
+
}
|
|
733
|
+
if (finding.scanner === "tsc") {
|
|
734
|
+
if (ruleId.includes("any"))
|
|
735
|
+
return "type-safety";
|
|
736
|
+
if (ruleId.includes("return"))
|
|
737
|
+
return "type-safety";
|
|
738
|
+
return "typescript";
|
|
739
|
+
}
|
|
740
|
+
if (finding.scanner === "bandit") {
|
|
741
|
+
return "python-security";
|
|
742
|
+
}
|
|
743
|
+
if (finding.scanner === "gosec") {
|
|
744
|
+
return "go-security";
|
|
745
|
+
}
|
|
746
|
+
if (finding.scanner === "trivy") {
|
|
747
|
+
if (ruleId.includes("misconfig"))
|
|
748
|
+
return "misconfiguration";
|
|
749
|
+
if (ruleId.includes("secret"))
|
|
750
|
+
return "secrets";
|
|
751
|
+
return "container-vulnerability";
|
|
752
|
+
}
|
|
753
|
+
if (finding.scanner === "brakeman") {
|
|
754
|
+
return "ruby-security";
|
|
755
|
+
}
|
|
756
|
+
if (ruleId.includes("auth")) {
|
|
757
|
+
return "authentication";
|
|
758
|
+
}
|
|
759
|
+
if (ruleId.includes("rls") || ruleId.includes("access")) {
|
|
760
|
+
return "authorization";
|
|
761
|
+
}
|
|
762
|
+
// Default to scanner name
|
|
763
|
+
return finding.scanner;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Generate a summary report of scanner results
|
|
767
|
+
*/
|
|
768
|
+
export function generateScannerSummary(result) {
|
|
769
|
+
const lines = [
|
|
770
|
+
"# Deterministic Scanner Results",
|
|
771
|
+
"",
|
|
772
|
+
`**Scanned**: ${result.projectPath}`,
|
|
773
|
+
`**Timestamp**: ${result.timestamp}`,
|
|
774
|
+
`**Duration**: ${result.totalDuration}ms`,
|
|
775
|
+
"",
|
|
776
|
+
"## Summary",
|
|
777
|
+
"",
|
|
778
|
+
`| Severity | Count |`,
|
|
779
|
+
`|----------|-------|`,
|
|
780
|
+
`| Critical | ${result.bySeverity.critical} |`,
|
|
781
|
+
`| High | ${result.bySeverity.high} |`,
|
|
782
|
+
`| Medium | ${result.bySeverity.medium} |`,
|
|
783
|
+
`| Low | ${result.bySeverity.low} |`,
|
|
784
|
+
`| Info | ${result.bySeverity.info} |`,
|
|
785
|
+
`| **Total** | **${result.totalFindings}** |`,
|
|
786
|
+
"",
|
|
787
|
+
"## By Scanner",
|
|
788
|
+
"",
|
|
789
|
+
`| Scanner | Findings | Status |`,
|
|
790
|
+
`|---------|----------|--------|`,
|
|
791
|
+
];
|
|
792
|
+
for (const scanner of result.scanners) {
|
|
793
|
+
const status = scanner.success ? "✅" : `❌ ${scanner.error?.slice(0, 50)}`;
|
|
794
|
+
lines.push(`| ${scanner.scanner} | ${scanner.findings.length} | ${status} |`);
|
|
795
|
+
}
|
|
796
|
+
if (result.totalFindings > 0) {
|
|
797
|
+
lines.push("");
|
|
798
|
+
lines.push("## Top Findings");
|
|
799
|
+
lines.push("");
|
|
800
|
+
// Show top 10 critical/high findings
|
|
801
|
+
const topFindings = result.scanners
|
|
802
|
+
.flatMap((s) => s.findings)
|
|
803
|
+
.filter((f) => f.severity === "critical" || f.severity === "high")
|
|
804
|
+
.slice(0, 10);
|
|
805
|
+
for (const finding of topFindings) {
|
|
806
|
+
lines.push(`- **[${finding.severity.toUpperCase()}]** ${finding.file}:${finding.line} - ${finding.message.slice(0, 80)}`);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return lines.join("\n");
|
|
810
|
+
}
|
|
811
|
+
//# sourceMappingURL=index.js.map
|