Execute local-first OSV vulnerability audits, Shannon entropy secret detection, polyglot unsafe code scanning, CycloneDX/SPDX SBOM generation, open-source license compliance checks, and automated SOC 2 Type II, OWASP Top 10 (2021), and ISO/IEC 27001:2022 compliance reports.

1. Automated Compliance Audits (eforge audit)

Maps deterministic repository findings, dependency health, and architectural metrics to formal compliance clauses. Returns ExitCode::Success (0) when all clauses pass or ExitCode::SecurityPolicyFailure (4) if any clause fails.

# SOC 2 Type II Trust Services Criteria audit
eforge audit --standard soc2 --format terminal

# OWASP Top 10 (2021) audit exported as GitHub-Flavored Markdown
eforge audit --standard owasp --format markdown -o owasp-audit.md

# ISO/IEC 27001:2022 Information Security Controls exported as JSON
eforge audit --standard iso27001 --format json -o iso27001-audit.json
SOC 2 Type II (--standard soc2)
  • • CC6.1 (Logical Access): Zero hardcoded secrets, private keys, or high-entropy tokens.
  • • CC6.6 (Boundary Protection): Layer boundary rules (arch/*) and CORS hygiene.
  • • CC7.1 (Vulnerability Mgmt): Zero unpatched OSV dependency CVEs or unsafe code patterns.
  • • CC8.1 (Change Management): Acyclic architecture graph, companion tests, and lockfile hygiene.
OWASP Top 10 (--standard owasp)
  • • A01 (Broken Access Control): Enforces architectural layer isolation (no-direct-db-in-ui) and permissive-cors checks.
  • • A02 (Cryptographic Failures): Verifies absence of leaked credentials, API tokens, and private keys.
  • • A03 (Injection): Scans for eval, shell exec, dangerouslySetInnerHTML, pickle.loads, and unserialize.
  • • A06 (Vulnerable Components): Audits all dependencies against OSV/GHSA advisories and unpinned versions.
ISO/IEC 27001 (--standard iso27001)
  • • Control 8.8 (Technical Vulnerabilities): Continuous polyglot dependency CVE scanning (security/vulnerable-dependency) and lockfile pinning.
  • • Control 8.28 (Secure Coding): Enforces static security pattern rules, secret redaction, and architectural modularity.

2. OSV Vulnerability Audit (eforge security --audit)

Audits declared and locked dependencies across npm (pkg:npm/), PyPI (pkg:pypi/), Go (pkg:golang/), Cargo (pkg:cargo/), and Composer (pkg:composer/) against OSV and GHSA advisories, with offline cache support in .eforge/cache/osv/:

# Deep dependency CVE audit + secret & pattern scan
eforge security --audit --fail-on high

# Strictly offline audit using cached & embedded advisories
eforge security --audit --offline

# Export OASIS SARIF v2.1.0 with CVSS v3 scores
eforge security --audit --format sarif -o security.sarif

3. NTIA-Compliant SBOM (eforge sbom)

Generates deterministic Software Bill of Materials in OASIS CycloneDX v1.5 JSON (--format cyclonedx) or ISO/IEC 5962:2021 SPDX v2.3 JSON (--format spdx) with canonical Package URLs (PURL), license categories, and BLAKE3 serial numbers:

# Export CycloneDX v1.5 JSON SBOM
eforge sbom --format cyclonedx -o sbom.cdx.json

# Export SPDX v2.3 JSON SBOM
eforge sbom --format spdx -o sbom.spdx.json

4. Secret Detection, Shannon Entropy & Built-in Security Rules

Every discovered credential is strictly masked with ****REDACTED**** in finding evidence and [REDACTED_SECRET] in AI context packs. Candidate tokens with length ≥ entropy_min_len (20) and Shannon entropy ≥ entropy_threshold (4.5 bits/symbol, proportionally scaled for hex strings) trigger security/high-entropy-secret.

Rule IDEcosystemSeverityDetection Target
security/hardcoded-secretAllCriticalVerified AWS (AKIA...), GitHub PATs (ghp_, github_pat_), Slack (xoxb-, xoxp-), OpenAI (sk-), Anthropic (sk-ant-), and generic secret assignments.
security/private-keyAllCriticalPEM RSA, EC, DSA, OpenSSH, and PKCS#8 private key blocks.
security/high-entropy-secretAllHighUnclassified high-entropy tokens (≥ 4.5 bits/symbol, length ≥ 20, lockfiles & allowlist excluded).
security/no-eval, no-implied-eval, no-dangerous-inner-html, unsafe-shell-exec, permissive-corsJS / TS / SFCCritical / HighDynamic eval(), new Function(), string setTimeout, dangerouslySetInnerHTML, child_process.exec, and wildcard CORS.
security/python-unsafe-eval, python-insecure-subprocess, python-pickle-deserializationPythonCritical / HighPython eval()/exec(), subprocess(..., shell=True)/os.system(), and untrusted pickle.loads().
security/php-unsafe-eval, php-insecure-unserialize, php-command-injection, php-create-functionPHPCritical / HighPHP eval(), unserialize() object injection, shell_exec/system/passthru/proc_open, and create_function().
license/disallowed-copyleft, denied-license, unapproved-license, missing-project-licenseAllHigh / Med / LowEnforces license.disallow_copyleft, license.denylist, license.allowlist, and root LICENSE presence.