Skip to content

SOC 2 Trust Service Criteria — BatleHub Controls

This document maps each relevant SOC 2 Trust Service Criterion (TSC) to the controls implemented in BatleHub.

A mapping, not an audit result

BatleHub has not been audited, and software cannot be. The certified entity in any SOC 2 report is the organisation running a service, not the software it runs — so this page exists to give your auditor somewhere to start, and nothing on it is a claim about the project's compliance status.

"✅ Implemented" below means exactly one thing: the control exists in the code, at the file or endpoint named in the Evidence column. It says nothing about whether it is enabled in your deployment, configured correctly, monitored, or operating effectively over a period — which is the whole of what a Type II audit examines. Several rows say "Manual process", and those are processes you would have to run.

Use this as evidence to submit and as a gap list to work from. Do not cite it as a result.

Scope: BatleHub proxy-cache server (package proxy, local registry, admin API).


CC6 — Logical and Physical Access Controls

CriterionControlStatusEvidence
CC6.1 – Protect logical access credentialsAPI tokens are SHA-256 hashed before DB storage; plaintext never persisted✅ Implementedcrates/adapters/src/db/postgres/user_tokens.rs
CC6.1 – Token expiryexpires_at enforced on every API call✅ Implementedcrates/adapters/src/auth/user_token.rs
CC6.1 – Token revocationrevoked_at soft-delete; revoked tokens rejected immediately✅ ImplementedDELETE /api/v1/auth/tokens/{id}
CC6.2 – Role-based accessAnonymous / User / Admin roles with RBAC policy rules per registry✅ Implementedcrates/core/src/rules/rbac.rs
CC6.2 – Group-based accessOIDC group claims mapped to per-registry resource grants✅ ImplementedRbacRule::with_groups()
CC6.3 – Remove accessToken revocation API; user-block API disables all requests from a user✅ ImplementedPOST /api/v1/admin/users/{id}/block
CC6.6 – Network access restrictionIP allowlist/blocklist enforced in request middleware✅ Implementedcrates/web/src/middleware/ip_block.rs
CC6.7 – Transmission encryptionTLS terminated at load balancer; internal requests use HTTPS clientsManual processDeploy with TLS termination
CC6.8 – Prevent unauthorized softwareRegistry type allowlist in config; SBOM generation and vuln scanning✅ Implementeddocs/contributing/security-scanning.md

CC7 — System Operations

CriterionControlStatusEvidence
CC7.1 – Detect configuration changesConfig change log stored in config_changes table✅ ImplementedGET /api/v1/admin/config/changes
CC7.2 – Monitor for anomaliesRate limiting per IP and per user; anomaly counters in Prometheus✅ Implemented[otel] configuration, deploy/prometheus-alerts.yaml
CC7.3 – Evaluate security eventsAudit log captures every download, block, unblock, delete (by hand and by retention policy) with user, timestamp, IP; filterable by action✅ ImplementedGET /api/v1/admin/audit-log?action=…
CC7.3 – IP/UA in audit logip_address and user_agent columns in access_events (migration 029)✅ Implementedcrates/adapters/migrations/029_audit_ip_ua.sql
CC7.4 – Respond to security incidentsSee docs/operations/incident-response.mdManual processDocumented
CC7.5 – Disclose security incidentsIncident response playbook includes notification stepsManual processdocs/operations/incident-response.md

CC8 — Change Management

CriterionControlStatusEvidence
CC8.1 – Authorise changesPull request review required (GitHub/Forgejo branch protection)Manual processdocs/operations/change-management.md
CC8.1 – Config changes trackedAll admin config changes stored in config_changes table with identity✅ ImplementedGET /api/v1/admin/config/changes
CC8.1 – Dependency updatescargo audit, cargo deny, pnpm audit gates in CI✅ Implemented.github/workflows/back-dep-audit.yaml

CC9 — Risk Mitigation

CriterionControlStatusEvidence
CC9.1 – Identify risksCVE scanning via cargo audit + Trivy + OSV✅ Implementeddocs/contributing/security-scanning.md
CC9.2 – Vendor riskSBOM generated per release (CycloneDX); supply-chain scanning via socket.dev badge✅ ImplementedGET /api/v1/admin/sbom/export

A1 — Availability

CriterionControlStatusEvidence
A1.1 – Current processing capacityPrometheus metrics + Grafana dashboard; capacity planning in docs✅ Implementeddeploy/grafana/batlehub-production.json, docs/guide/configuration.md
A1.2 – Environmental protectionsHealth endpoint; Prometheus alert for BatleHubDown✅ ImplementedGET /api/v1/health, deploy/prometheus-alerts.yaml
A1.3 – Backup and recoveryPostgres pg_dump + S3 rclone sync; restore runbooksDocumenteddocs/operations/disaster-recovery.md

Compliance Export

The audit log can be exported for auditors via:

bash
# JSON export (last 30 days)
batlehub admin export-audit-log --from 2026-06-01T00:00:00Z --format json --output audit.json

# CSV export (for spreadsheet review)
batlehub admin export-audit-log --from 2026-06-01T00:00:00Z --format csv --output audit.csv

Or via the Admin UI → Audit LogExport button.


Gaps / Remediation Status

GapPriorityPlan
TLS enforcement not configured by BatleHub itselfLowDocument TLS termination requirement in deployment guide
IP/UA extraction not yet wired into proxy_stream callersMediumThread HttpRequest through proxy handlers (planned next sprint)
Incident response runbook not yet testedMediumSchedule tabletop exercise

Released under the Apache 2.0 License. Made with ❤️ and too much ☕.