Quality Gates
Last updated
Every check enforced from developer workstation to production deployment, mapped to BSI C5:2020, the OWASP Top 10 (2021), the Cyber Resilience Act, the EHDS regulation and WCAG 2.2 AA where a criterion fits, and left unmapped where none does.
Pipeline Overview
Stage 1 — Pre-commit Hooks
The 36 hooks configured in .pre-commit-config.yaml, in the order they run. They run before every git commit, and the PR Gate runs them again on the pull request's diff. Hooks that rewrite a file (Prettier, end-of-file) fail the commit; stage the file again and commit.
| Hook | Source | Stage |
|---|---|---|
| trailing-whitespace | pre-commit-hooks | pre-commit |
| end-of-file-fixer | pre-commit-hooks | pre-commit |
| check-yaml | pre-commit-hooks | pre-commit |
| check-json | pre-commit-hooks | pre-commit |
| check-added-large-files | pre-commit-hooks | pre-commit |
| check-merge-conflict | pre-commit-hooks | pre-commit |
| detect-private-key | pre-commit-hooks | pre-commit |
| check-case-conflict | pre-commit-hooks | pre-commit |
| check-symlinks | pre-commit-hooks | pre-commit |
| check-executables-have-shebangs | pre-commit-hooks | pre-commit |
| check-shebang-scripts-are-executable | pre-commit-hooks | pre-commit |
| shellcheck | shellcheck-py | pre-commit |
| hadolint-docker | hadolint | pre-commit |
| prettier | local | pre-commit |
| TypeScript (UI) | local | pre-commit |
| ESLint (UI) | local | pre-commit |
| Vitest (UI) | local | pre-push |
| iPhone app analyte parity (swift run AnalyteParity) | local | pre-push |
| CodeQL on the iPhone app (Swift, about 15 min) | local | pre-push |
| Secret Scan (gitleaks) | local | pre-commit |
| Static analysis (Semgrep) | local | pre-commit |
| Semgrep rule tests (.semgrep/) | local | pre-commit |
| Broken links (Markdown) | local | pre-commit |
| No screenshot images in doc pages | local | pre-commit |
| API spec covers every route | local | pre-commit |
| API spec describes the shape the hub answers with | local | pre-commit |
| Docs facts and last-updated dates | local | pre-commit |
| Published documents match their sources (docs/security, docs/klarbefund, docs/developer) | local | pre-commit |
| Localized image manifest matches ui/public | local | pre-commit |
| API collection covers every route, and can fail | local | pre-commit |
| A successful request cannot pass on an empty answer | local | pre-commit |
| Workflows re-run when what they run changes | local | pre-commit |
| npm audit (UI — HIGH+) | local | pre-push |
| Lint GitHub Actions workflows | local | pre-commit |
| CVE scan covers every compose image | local | pre-commit |
| No compose image pinned to a single-architecture tag | local | pre-commit |
Stage 2 — Pre-push Gates
Run before git push. These catch issues that are too slow for pre-commit.
Dependency Audit
scripts/check-npm-audit.py ui --omit=dev: npm audit, HIGH and CRITICAL fail unless excepted with an expiry (.pre-commit-config.yaml)
Stage 3 — CI Pipeline
GitHub Actions workflow .github/workflows/test.yml runs 8 jobs on every push. The other rows run in the PR Gate, CodeQL, the security scan and the nightly run (ADR-074); each row links the lines that run it. C5 criteria link to their page in the BSI C5:2020 catalogue; OWASP numbers are the 2021 edition. View latest run →
| Job | Tests | Tool | Standard | Gate |
|---|---|---|---|---|
| PR Gate | — | pr-gate.yml: pre-commit on the diff, API spec drift, Bruno coverage, knip, gitleaks over the pull request's commits | C5 DEV-09 | Blocks |
| CodeQL | — | codeql.yml (JS/TS, Python, Actions) on every PR; codeql-swift.yml when clients/ios changes, or locally with Scripts/codeql-swift.sh | C5 PSS-02, OWASP Top 10 (2021) | Reports |
| Security scan | — | Source SBOM, image and deployed-image CVEs (security-scan.yml). CVEs fail a run only when a manual run asks for it (severity gate) | C5 OPS-22, CRA Annex I, Part II (1) | Reports |
| UI Tests (Vitest) | — | Vitest 5.0.2 + v8 coverage (test.yml) | C5 DEV-06 | Blocks |
| Neo4j Proxy Tests | — | Vitest (test.yml) | C5 DEV-06 | Blocks |
| Lint | — | Next.js ESLint, a pre-commit hook the PR Gate runs (.pre-commit-config.yaml) | C5 DEV-06 | Blocks |
| Secret Scan | — | Gitleaks v8.27.2 over the whole history each night (nightly.yml); the PR Gate scans the pull request's commits | C5 CRY-04, OWASP A07:2021 | Blocks |
| Dependency Audit | — | npm audit, HIGH+ (test.yml, through check-npm-audit.py) | C5 PSS-02, OWASP A06:2021 | Blocks |
| Trivy Scan | — | Trivy v0.69.3 (test.yml) | C5 OPS-22, OWASP A06:2021 | Reports |
| K8s Posture | — | Kubescape, NSA and CIS frameworks, critical findings (test.yml) | C5 OPS-23, NSA/CISA Kubernetes Hardening Guide, CIS Kubernetes Benchmark | Blocks |
| E2E Tests | — | Playwright v1.65.1, nightly (nightly.yml) | — | Reports |
| WCAG 2.2 AA Audit | — | axe-core/playwright, nightly (nightly.yml, continue-on-error) | WCAG 2.2 AA, EN 301 549 | Reports |
| Security Pentest | — | OWASP/BSI patterns, 28-security-pentest.spec.ts, nightly (nightly.yml) | C5 PSS-02, OWASP Top 10 (2021) | Reports |
| SBOM Generation | 2 | CycloneDX npm, CycloneDX 1.5 (test.yml) | CRA Annex I, Part II (1), C5 AM-01 | Blocks |
| Licence Compliance | — | license-checker-rseidelsohn 4.4.2 with an allowlist (test.yml) | No C5 criterion or CRA article requires it | Blocks |
| Lighthouse CI | 12 | Lighthouse CI (4 pages × 3 runs), nightly (nightly.yml) | Core Web Vitals | Reports |
Supply-Chain Hardening
- Trivy (test.yml) and the nightly gitleaks (nightly.yml) are pinned to exact versions and checked against their SHA-256 checksums; the PR Gate pins its gitleaks version without a checksum check (pr-gate.yml)
- Trivy v0.69.3 used explicitly: versions 0.69.4 to 0.69.6 were compromised (CVE-2026-33634, GHSA-69fq-xp46-6x23)
- Ten fingerprints allowlisted in .gitleaksignore, each with the reason: local dev-stack credentials, false positives, and one dead session token kept in history
Security Headers (Runtime)
Set in next.config.js; the Content-Security-Policy is built per request, with a nonce, in middleware.ts. Not set in the static GitHub Pages build, which has no server (C5 OPS-23 system hardening, OWASP A05:2021 Security Misconfiguration):
Stage 4 — Protocol Compliance
Once a night, when main has changed (nightly.yml, ADR-074), and on manual dispatch. Each suite must stay at or above the floor recorded in scripts/compliance-baseline.json; a floor is raised when a suite improves and never lowered without a reason. The DSP and DCP suites are the hub's own checks of its reading of the specifications, not the Eclipse TCKs; neither TCK has run against the hub yet (#338). Workflow: .github/workflows/compliance.yml View latest run →
DSP 2025-1 checks
Dataspace Protocol: the hub's own checks (run-ehds-dataspace-checks.sh), not the Eclipse DSP TCK
DCP v1.0 checks
Decentralised Claims: the hub's own checks (run-ehds-identity-checks.sh), not the Eclipse DCP TCK
EHDS Domain
EHDS Art. 53 purposes, EHDS Art. 71 opt-out, HealthDCAT-AP, EEHRxF, OMOP (run-ehds-tests.sh)
API collection (CI)
Bruno, persona folders
API collection (Azure)
Bruno, ehds.mabu.red
DSP 2025-1 checks (Azure)
Dataspace Protocol: the hub's own checks (run-ehds-dataspace-checks.sh), not the Eclipse DSP TCK
DCP v1.0 checks (Azure)
Decentralised Claims: the hub's own checks (run-ehds-identity-checks.sh), not the Eclipse DCP TCK
EHDS Domain (Azure)
EHDS Art. 53 purposes, EHDS Art. 71 opt-out, HealthDCAT-AP, EEHRxF, OMOP (run-ehds-tests.sh)
Infrastructure Requirements
Protocol compliance tests require the full JAD stack (15 services, 8 GB RAM), on EDC 1.0 (ADR-078). In CI, the workflow starts JAD infrastructure with graceful fallback: tests produce results only when the controlplane is healthy.
Local execution: ./scripts/run-ehds-dataspace-checks.sh, ./scripts/run-ehds-identity-checks.sh, ./scripts/run-ehds-tests.sh. The old names run-dsp-tck.sh and run-dcp-tests.sh are shims for the first two; despite the name, neither is a TCK.
Coverage Floors
Enforced by ui/vitest.config.ts: the UI suite fails when coverage drops below these. The measured numbers are in the published test report.
Test Inventory
Future Quality Gates
Recommended improvements prioritised by impact and regulatory alignment.
Enforce Coverage Thresholds
Done: vitest.config.tsMinimum coverage thresholds in vitest.config.ts: 78% statements, 69% branches, 79% functions, 80% lines. Vitest fails if coverage drops below.
Enforcement prevents silent regression; raise a floor whenever coverage rises.
C5 DEV-06Mutation Testing
Medium: new tool + CI jobAdd Stryker Mutator to measure test effectiveness. Target mutation score > 60%.
Line coverage does not guarantee tests catch bugs. Mutation testing verifies tests detect real defects.
C5 DEV-06Licence Compliance Scanning
Done: implemented in test.ymllicense-checker-rseidelsohn in CI with an allowlist (test.yml): MIT, Apache-2.0, ISC, BSD-2/3-Clause, 0BSD, CC0-1.0, CC-BY-4.0, Unlicense, Python-2.0, BlueOak-1.0.0, LGPL-3.0-or-later. The job fails on any production dependency under another licence.
Neither the CRA nor BSI C5 asks for a licence check. It keeps the dependencies compatible with the hub's Apache-2.0 licence.
No C5 criterion or CRA article requires itAPI Contract Testing
Partly done: spec drift ratchet in the PR Gatescripts/check-api-spec-drift.py already blocks any new route missing from openapi.yaml (129 operations documented). Next: validate response shapes against the spec with swagger-parser or Prism.
No formal schema enforces response shapes. Contract tests prevent frontend/backend drift.
OpenAPI 3.1.0SBOM Generation
Done: implemented in test.ymlCycloneDX 1.5 SBOM generated on every CI run for UI and Neo4j Proxy, uploaded as a 90-day artifact (test.yml). The bills committed in docs/sbom are CycloneDX 1.7, made by syft (generate-sbom.sh); the iPhone app's is 1.5. The CRA asks for a software bill of materials in a commonly used, machine-readable format (Annex I, Part II (1)); the Commission may fix its format by implementing act (Art. 13(24)).
Supply chain attacks (XZ Utils, CVE-2024-3094; the Trivy compromise, GHSA-69fq-xp46-6x23) make SBOMs non-negotiable. The CRA's Annex I applies from 11 December 2027 (Art. 71(2)).
CRA Annex I, Part II (1), NTIA SBOM minimum elements, C5 AM-01Performance Regression Testing
Done: Lighthouse CI in nightly.ymlLighthouse CI with Core Web Vitals budgets: LCP < 4s (error), CLS < 0.1 (error), TBT < 300ms (warn), script size < 500 KB (warn) (nightly.yml). Runs on 4 key pages.
Healthcare professionals use the platform under time pressure. A budget error turns the nightly run red, which opens an issue; it does not block a merge (ADR-074).
Core Web VitalsRuntime ODRL Policy Enforcement
High: new engine + testsImplement ODRL engine: validate API responses respect the caller's permitted datasets and temporal limits.
Currently ODRL policies are decorative. Any authenticated user can query any dataset. This is the largest EHDS compliance gap.
EHDS Art. 66, ODRL 2.2 §2WCAG Blocking Gate
Partly done: runs nightly, does not blockWCAG 2.2 AA audit with a zero-violation budget. Since it moved to the nightly run (ADR-074) it runs with continue-on-error (nightly.yml), so a violation shows in the report but fails nothing.
The audit found zero violations when it last blocked. To block again it needs a step that fails the nightly job.
EN 301 549, Directive (EU) 2016/2102IaC Policy Enforcement
Done: blocking in test.ymlKubescape blocks on critical findings (--severity-threshold critical) under the NSA and CIS frameworks (test.yml).
K8s manifests define production topology. Critical security findings now block the build.
C5 OPS-23, NSA/CISA Kubernetes Hardening GuideDependency Freshness
Done: renovate.jsonRenovate Bot configured (renovate.json): auto-merge patches, weekly PRs for minor, manual review for major. Security updates bypass schedule.
Automated dependency updates prevent CVE accumulation. The CRA asks manufacturers to remediate vulnerabilities without delay, including by security updates (Annex I, Part II (2)).
OWASP A06:2021, C5 OPS-22, CRA Annex I, Part II (2)Compliance Mapping
| Quality Gate | BSI C5:2020 | OWASP 2021 | CRA | EHDS | WCAG |
|---|---|---|---|---|---|
| TypeScript strict | C5 DEV-01 | — | — | — | — |
| ESLint | C5 DEV-06 | — | — | — | — |
| Unit tests + coverage thresholds | C5 DEV-06 | — | — | — | — |
| Secret scan (Gitleaks) | C5 CRY-04 | OWASP A07:2021 | — | — | — |
| Dependency audit | C5 PSS-02 | OWASP A06:2021 | Annex I, Part II (1) | — | — |
| Trivy vuln scan | C5 OPS-22 | OWASP A06:2021 | Annex I, Part II (1) | — | — |
| Security headers | C5 OPS-23 | OWASP A05:2021 | — | — | — |
| WCAG 2.2 AA (nightly, reports) | — | — | — | — | 2.2 AA |
| DSP 2025-1 checks (own, not the TCK) | — | — | — | — | — |
| DCP v1.0 checks (own, not the TCK) | — | — | — | — | — |
| EHDS domain tests | — | — | — | EHDS Art. 53, EHDS Art. 71 | — |
| SBOM (CycloneDX 1.5 in CI) | C5 AM-01 | OWASP A06:2021 | Annex I, Part II (1) | — | — |
| Licence compliance | No C5 criterion | — | No CRA article | — | — |
| Lighthouse perf budget | — | — | — | — | — |
| Kubescape (blocking) | C5 OPS-23 | — | — | — | — |
| Renovate freshness | C5 OPS-22 | OWASP A06:2021 | Annex I, Part II (2) | — | — |
| ODRL enforcement (planned) | — | OWASP A01:2021 | — | EHDS Art. 66 | — |