Skip to content
Compliance & Risk

One Scan. Twenty Regulations.

Two complementary tools: ckb audit scores file-level risk across 8 weighted factors. ckb audit compliance maps your code against 20 regulatory frameworks with 131 checks, cross-framework mapping, and --recommend to auto-detect what applies. Fully local, zero tokens, deterministic results.

20 frameworks
131 checks
8 risk factors
Zero tokens

Risk Audit — 8-Factor File Scoring

ckb audit evaluates every file on a 0-100 risk scale using 8 weighted factors. The result: a prioritized list of your riskiest files with actionable recommendations.

Complexity is calculated via tree-sitter AST analysis — cyclomatic and cognitive complexity per function across Go, TypeScript, Python, Java, Kotlin, Rust, Ruby, and C/C++.

FactorWeightScore RangeWhat It Measures
Complexity20%0-20Cyclomatic + cognitive complexity via tree-sitter AST analysis
Test Coverage20%0-20No tests for high-complexity code = maximum risk
Bus Factor15%0-151 active author in 12 months = single point of failure
Security Sensitive15%0-1519 security keywords (password, token, key, jwt, etc.)
Staleness10%0-10Months since last change — stale code may be dead or brittle
Error Rate10%0-10Runtime error frequency (requires telemetry integration)
Co-Change Coupling5%0-5Files that always change together indicate hidden dependencies
Churn5%0-5High commit frequency in 90 days may indicate design instability
Critical

Score ≥ 80 — immediate action required

High

Score ≥ 60 — address soon

Medium

Score ≥ 40 — monitor, improve when possible

Low

Score < 40 — acceptable risk

$ ckb audit --min-score=60 --format=json
{
  "items": [
    {
      "file": "drivers/modbus/handler.go",
      "riskScore": 78.5,
      "riskLevel": "high",
      "recommendation": "Security-sensitive code; review before changes",
      "factors": [
        { "factor": "security_sensitive", "value": "password, token, key", "contribution": 15.0 },
        { "factor": "bus_factor", "value": "1 (alice only)", "contribution": 15.0 },
        { "factor": "complexity", "value": "42", "contribution": 8.4 },
        { "factor": "test_coverage", "value": "no tests found", "contribution": 15.0 }
      ],
      "functionComplexity": [
        { "name": "handleModbusWrite", "cyclomatic": 18, "cognitive": 12, "lines": 86 },
        { "name": "parseRegisterMap", "cyclomatic": 14, "cognitive": 9, "lines": 65 }
      ]
    }
  ],
  "quickWins": [
    { "action": "Add tests", "target": "drivers/modbus/handler.go", "effort": "medium", "impact": "high" },
    { "action": "Assign backup owner", "target": "protocol/iec104/stack.go", "effort": "low", "impact": "medium" }
  ]
}

Use --quick-wins to surface files where low effort yields high impact — like adding tests to untested complex code or assigning a backup owner to single-author files.

131 Checks Across 8 Categories

Every check references the specific regulatory article, includes a CWE ID where applicable, a confidence score, and an actionable recommendation.

21

Privacy & Data Protection

GDPR, CCPA, ISO 27701

8

AI Governance

EU AI Act

33

Security Standards

ISO 27001, NIST 800-53, OWASP ASVS, SOC 2

28

Industry Regulations

PCI DSS, HIPAA, DORA, NIS2, FDA 21 CFR 11

6

EU Product Regulations

EU CRA

5

Supply Chain

SBOM/SLSA

17

Safety-Critical

DO-178C, IEC 61508, ISO 26262

14

Coding Standards

MISRA C, IEC 62443

20 Regulatory Frameworks

Every finding is automatically mapped to the regulations it violates. No manual tagging, no external databases.

FrameworkScopeChecksWhat CKB Checks
GDPRData privacy (EU)11PII handling, consent, data retention, right-to-erasure, encryption
CCPAConsumer privacy (CA)5Do-not-sell opt-out, data sharing, sensitive PI, deletion rights
ISO 27701Privacy extension5Data subject rights, privacy processing, data portability
EU AI ActAI governance (EU)8Human oversight, logging, risk classification, bias testing
ISO 27001Information security8Cryptography, secure development, config management, data leakage
NIST 800-53Security controls (US)6Access control, audit logging, input validation, crypto
OWASP ASVSApp security verification13Authentication, session mgmt, validation, crypto, communications
SOC 2Service organizations6Access control, change management, monitoring, error handling
PCI DSSPayment card data6PAN detection, secure coding, authentication, SQL injection
HIPAAHealthcare (US)5PHI detection, access control, audit trails, encryption
DORAFinancial services (EU)7Change management, anomaly detection, resilience testing
NIS2Critical infrastructure (EU)5Supply chain security, vulnerability management, crypto
FDA 21 CFR 11Electronic records (US)5Audit trails, electronic signatures, validation
EU CRACyber resilience (EU)6Vulnerability handling, SBOM, secure defaults
SBOM/SLSASupply chain5SBOM generation, provenance attestation, dependency pinning
DO-178CAviation software5Requirements traceability, structural coverage, dead code
IEC 61508Functional safety7SIL classification, defensive programming, complexity limits
ISO 26262Automotive safety5ASIL checks, defensive programming, coding standards
MISRA CSafety-critical C/C++7Control flow, type safety, memory safety rules
IEC 62443Industrial automation7Authentication, integrity verification, secure development

Auto-Detect Applicable Frameworks

ckb audit compliance --recommend scans your codebase for indicators — HTTP handlers, PII fields, payment SDKs, ML imports — and recommends frameworks with confidence scores.

Always recommended (universally applicable): ISO 27001 (0.95 confidence), OWASP ASVS (0.90 confidence).

Signal in CodeRecommended FrameworksConfidence
HTTP handlers (REST/gRPC)NIST 800-53, SOC 20.85
PII fields (email, name, address)GDPR, CCPA, ISO 277010.85
Payment processingPCI DSS 4.00.90
Health data / PHI fieldsHIPAA0.85
Financial services codeDORA0.80
AI/ML imports & model handlingEU AI Act0.85
C/C++ codebaseIEC 61508, MISRA C0.75
Dependency manifestsSBOM/SLSA0.70
Infrastructure / network servicesNIS20.75

Cross-Framework Mapping

A single finding can violate multiple regulations simultaneously. CKB maps each finding to every applicable framework — one scan replaces separate audits. A hardcoded credential triggers findings in 9 frameworks at once.

Hardcoded credential detected (CWE-798)

check: hardcoded-credential
9 frameworks
PCI DSS

Req 8.6.2 PCI DSS 4.0

NIST 800-53

IA-5(1) — Authenticator management

SOC 2

CC6.1 — Logical access security

ISO 27001

A.8.4 — Secret authentication management

OWASP ASVS

V2.10.4 — Credential storage

NIS2

Art. 21(2)(g) — Cryptographic controls

DORA

Art. 9(2) — ICT change management

EU CRA

Art. 13 — Product security

IEC 62443

CR 1.1 — Access control

PII in log statements (CWE-532)

check: pii-in-logs
7 frameworks
GDPR

Art. 25, 32 — Data protection by design

CCPA

§1798.100 — Consumer rights

HIPAA

§164.312(b) — Audit controls

ISO 27001

A.8.12 — Data leakage prevention

ISO 27701

A.7.4.5 — PII processing

OWASP ASVS

V7.1.1 — Logging

NIS2

Art. 21(2)(g) — Information handling

Weak cryptographic algorithm MD5 (CWE-327)

check: weak-crypto
7 frameworks
ISO 27001

A.8.24 — Cryptographic controls

NIST 800-53

SC-13 — Cryptographic protection

PCI DSS

Req 4.2.1 — Strong cryptography

OWASP ASVS

V6.2.5 — Algorithm verification

GDPR

Art. 32 — Security of processing

HIPAA

§164.312(a)(2)(iv) — Encryption

FDA 21 CFR 11

§11.10(a) — System controls

Top cross-framework findings by regulation count

Hardcoded Credential (CWE-798)
9
Weak Crypto (CWE-327)
8
Missing TLS (CWE-319)
8
PII in Logs (CWE-532)
7
Missing Auth (CWE-306)
7
SQL Injection (CWE-89)
6
XSS (CWE-79)
5
Insecure Random (CWE-338)
4
Unsafe Deserialization (CWE-502)
4

From 11,356 to ~50 Findings

In v8.3 we rewrote the false-positive filtering for the compliance engine. Confidence scoring, context-aware analysis, and AST-based checks replaced naive pattern matching.

What changed

Deep-nesting: threshold 4→6, function boundary reset, 3-per-file cap
Dead-code: skips Go (handled by AST-based bug-patterns)
Dynamic-memory: skips garbage-collected languages
Global-state: excludes regexp.MustCompile, errors.New, sync primitives
Insecure-random: inline import scanning distinguishes crypto/rand vs math/rand
SQL injection: parameterized query detection + #nosec support
Path-traversal: skips filepath.Join, prefix comparisons, testdata/
Per-check findings cap at 50 — prevents single noisy check from flooding reports

False-positive prevention

Confidence scoring (0.0-1.0) on every finding — filter with --min-confidence
Context analysis: crypto/rand vs math/rand, test code vs production code
RNG detection per-language: Go, JavaScript, Python, Java
Test files excluded from security checks
#nosec and nolint: annotations respected
Generated files excluded (20+ patterns: protobuf, Go generators, Dart/Flutter)
Internal compliance code excluded (self-reference avoidance)
110+ PII patterns including German variants (Vorname, Nachname, Kontonummer)

Scoring & Verdicts

Each framework is scored individually, then aggregated into a total compliance score. CI mode returns exit codes so you can gate deployments on compliance.

PASS

Score ≥ 90 and zero errors

CI exit code: 0

WARN

Score ≥ 70 and ≤ 3 errors

CI exit code: 0 (configurable)

FAIL

Score < 70 or > 3 errors

CI exit code: 1

Per-framework score: (passed checks / total checks) × 100. Use --fail-on=error|warning|none to set the severity gate.

How CKB Compares

Most tools check for vulnerabilities. CKB maps findings to the regulatory language auditors actually ask about.

FeatureCKBSnykSonarQubeSemgrep
Regulatory frameworks20 frameworks, 131 checks3-55-810-12
Cross-framework mappingAutomaticManualManualPartial
Risk scoring (8-factor)Yes — complexity, bus factor, churn, etc.NoPartialNo
Structural code analysisFull (SCIP + tree-sitter + call graph)Pattern matchingAST-basedPattern matching
One finding, many regsYes — up to 9 frameworks per findingNoNoPartial
PII detection patterns110+ (incl. German variants)LimitedNoLimited
CI/CD integrationNative (SARIF, JSON, markdown, compliance)NativeNativeNative
Runs locally (no cloud)Yes — zero tokensNoServer requiredYes
False-positive rate~50 findings (tuned in v8.3)HighModerateModerate
CostFree (personal)FreemiumFreemiumFreemium

CI/CD Integration

Gate pull requests on compliance. Output as SARIF for GitHub Code Scanning, or markdown for PR comments. Weekly risk audits via cron to catch drift.

.github/workflows/compliance.yml
name: Compliance Audit
on:
  pull_request:
    types: [opened, synchronize, reopened]

env:
  FRAMEWORKS: "iec62443,iso27001,owasp-asvs"
  FAIL_ON: "error"

jobs:
  compliance:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install CKB
        run: npm install -g @tastehub/ckb

      - name: Initialize CKB
        run: ckb init && ckb index

      - name: Run Compliance Audit
        run: |
          ckb audit compliance \
            --framework="${FRAMEWORKS}" \
            --ci --fail-on="${FAIL_ON}" \
            --format=json > compliance.json

      - name: Upload SARIF to GitHub Code Scanning
        run: |
          ckb audit compliance \
            --framework="${FRAMEWORKS}" \
            --format=sarif > compliance.sarif

Configuration

Customize PII patterns, AI component paths, SIL levels, and default frameworks per repository via .ckb/config.json.

.ckb/config.json
{
  "compliance": {
    "piiFieldPatterns": ["customer_id", "tax_number"],
    "aiComponentPaths": ["src/ml/**", "models/**"],
    "silLevel": 2,
    "specialCategoryPaths": ["src/health/**", "src/biometric/**"],
    "defaultFrameworks": ["iec62443", "iso27001"]
  }
}
piiFieldPatterns — additional PII patterns merged with built-in 110+ patterns
aiComponentPaths — glob patterns for EU AI Act detection scope
silLevel — Safety Integrity Level 1-4 for IEC 61508 thresholds
defaultFrameworks — auto-selected when --framework flag is omitted

Quick Start

Four output formats: human, JSON, markdown, and SARIF. Use --recommend to auto-detect, or specify frameworks directly.

1
Auto-detect frameworks
ckb audit compliance --recommend
2
Run compliance audit
ckb audit compliance --framework=gdpr,iso27001,owasp-asvs
3
Run risk audit
ckb audit --min-score=60 --quick-wins
4
Gate CI on compliance
ckb audit compliance --framework=gdpr,pci-dss --ci --fail-on=error
5
Export for auditors
ckb audit compliance --framework=all --format=sarif
6
MCP integration
auditCompliance(frameworks: ["gdpr", "iso27001"])

Runs via MCP using the persistent SCIP index. Also available as the /ckb-audit skill.

$ ckb audit compliance --framework=gdpr,iso27001,owasp-asvs
======================================================
  CKB COMPLIANCE AUDIT REPORT
======================================================

  Repository:   myapp
  Verdict:      WARN
  Score:        72/100
  Files:        245 scanned, 12 with issues
  Findings:     18 total (3 errors, 8 warnings)

FRAMEWORK COVERAGE
------------------------------------------------------
  GDPR                    12 checks  score=75%
  ISO 27001:2022          15 checks  score=80%
  OWASP ASVS 4.0          13 checks  score=76%

CHECK RESULTS
------------------------------------------------------
  gdpr/weak-pii-crypto   FAIL  Art. 32 GDPR
    Also violates: ISO 27001 A.8.24, NIST SC-13,
    PCI DSS 4.2.1, ASVS V6.2.5 (CWE-327)

Finding 2/7: PII logged without redaction
  File: api/handler.go:118
  Check: pii-in-logs (high)
  Regulations:
    GDPR     Art. 5(1)(f)
    CCPA     1798.150
    HIPAA    164.312(b)

Summary by Framework:
  PCI DSS    3 findings
  HIPAA      2 findings
  GDPR       2 findings

What It Detects — and What It Doesn't

Reliably detects

Hardcoded secrets/credentials (entropy + pattern matching)
PII/PHI in logs and errors (110+ field patterns)
Weak cryptography (MD5, SHA-1, DES, RC4, ECB, Blowfish)
Injection risks (SQL, XSS, Command, Path Traversal, XXE)
Safety violations (goto, recursion, deep nesting, global state)
Unsecure defaults (debug mode, TLS bypass, CORS wildcard)
Supply chain risks (unpinned deps, missing lock files, missing SBOM)
Regulation mapping with article numbers and CWE IDs

Does not detect

Infrastructure controls (encryption at rest, WAF, IAM policies)
Business logic (whether logging happens after redaction)
Configuration in environment variables or secrets managers
Dynamic code generation (reflection, runtime metaprogramming)
Regulatory applicability (flags HIPAA findings even in non-healthcare apps)

CKB finds structural compliance violations deterministically and reproducibly. It doesn't replace the compliance advisor who judges whether a framework applies — but it reduces manual audit effort by 80-90% and provides the machine-readable evidence auditors need.

Ship compliant code by default

Add compliance checks to your existing workflow in one command. 131 checks, 20 frameworks, zero tokens. Free for personal use.