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 persistedImplementedcrates/adapters/src/db/postgres/user_tokens.rs
CC6.1 – Token expiryexpires_at enforced on every API callImplementedcrates/adapters/src/auth/user_token.rs
CC6.1 – Token revocationrevoked_at soft-delete; revoked tokens rejected immediatelyImplementedDELETE /api/v1/auth/tokens/{id}
CC6.2 – Role-based accessAnonymous / User / Admin roles with RBAC policy rules per registryImplementedcrates/core/src/rules/rbac.rs
CC6.2 – Group-based accessOIDC group claims mapped to per-registry resource grantsImplementedRbacRule::with_groups()
CC6.3 – Remove accessToken revocation API; user-block API disables all requests from a userImplementedPOST /api/v1/admin/users/{id}/block
CC6.6 – Network access restrictionIP allowlist/blocklist enforced in request middlewareImplementedcrates/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 scanningImplementeddocs/contributing/security-scanning.md

CC7 — System Operations ​

CriterionControlStatusEvidence
CC7.1 – Detect configuration changesConfig change log stored in config_changes tableImplementedGET /api/v1/admin/config/changes
CC7.2 – Monitor for anomaliesRate limiting per IP and per user; anomaly counters in PrometheusImplemented[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 actionImplementedGET /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 identityImplementedGET /api/v1/admin/config/changes
CC8.1 – Dependency updatescargo audit, cargo deny, pnpm audit gates in CIImplemented.github/workflows/back-dep-audit.yaml

CC9 — Risk Mitigation ​

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

A1 — Availability ​

CriterionControlStatusEvidence
A1.1 – Current processing capacityPrometheus metrics + Grafana dashboard; capacity planning in docsImplementeddeploy/grafana/batlehub-production.json, docs/guide/configuration.md
A1.2 – Environmental protectionsHealth endpoint; Prometheus alert for BatleHubDownImplementedGET /healthz, GET /api/v1/admin/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-cli audit export --from 2026-06-01T00:00:00Z --format json --output audit.json

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

Or via the Admin UI → Audit Log → Export 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 care and too much coffee.