# Security & Compliance Brief

**Audience:** Compliance, CISO, Engineering, Executive
**Read time:** ~7 minutes

---

## Posture in one paragraph

Civops runs **on-premises** behind a Purdue Level 3.5 DMZ on a single-box appliance. Pre-cutover (marketing, sales, assessment, setup), the platform may use cloud Anthropic for AI inference; **post-cutover, every agent inference call routes through onboard Ollama** — there is no implicit cloud fallback. Every config mutation, vault read, outbound HTTP call, connector write, and inference call lands in an append-only audit chain with SHA-256 hash linkage. The platform is built to SOC 2 Trust Services Criteria and to GxP / 21 CFR Part 11 for life-sciences customers, with explicit honest framing: **"built to the standard, not yet audited."**

---

## SOC 2 readiness

We do not currently hold a SOC 2 Type II report. We are **built to the standard** with active readiness work — Drata + Schellman path, Year 1 budget ~$83–137K. Until we hold the report, we say so plainly. We never claim a report we don't hold.

What's in place:

- **Trust Services Criteria + Common Criteria CC1–CC9** — readiness scan at `/platform/admin/soc2-readiness` shows live coverage.
- **Audit chain** — every action logged via `src/lib/audit.ts`, hash-chained, mirrored to JSONL with tamper detection.
- **Authentication** — NextAuth.js with MFA, lockout protection, session-bound tenant isolation, password rotation.
- **Vault key rotation** — `scripts/vault-rotate.ts` (--plan / --apply, idempotent).
- **Postgres backup + restore drill** — daily, with restore-drill validation.
- **DMZ compliance scan** — runs at boot, embeds in readiness; critical findings block go-live.

What's outstanding (honest punch list):

- Type II report itself (planned year 1 with Schellman or A-LIGN).
- Penetration test (planned year 1 with Bishop Fox or NCC Group).
- Continuous monitoring SaaS integration (Drata candidate).

---

## Pharma / GxP readiness

For life-sciences customers, Civops offers a Pharma Vertical Pack with explicit standards coverage:

- **21 CFR Part 11** — electronic signatures, audit trail, records retention.
- **21 CFR Part 211** — cGMP for finished pharmaceuticals.
- **EU Annex 11** — computerised systems.
- **EU Annex 1** — sterile manufacturing.
- **ICH Q7 / Q8 / Q9 / Q10** — quality systems.
- **ALCOA+** — data integrity (Attributable, Legible, Contemporaneous, Original, Accurate + Complete, Consistent, Enduring, Available).
- **GAMP 5** — categorization, risk-based validation.

Coverage is surfaced at `/platform/admin/pharma-compliance` with a citation tree (rule → control → evidence) and a live scan that flags violations. **Pharma Sentinel** is the pre-closeout audit gate — find the issue before the regulator does.

---

## On-prem AI sovereignty

This matters most to customers in regulated verticals or those with data-residency constraints.

- **Pre-cutover:** Cloud Anthropic. Used for the demo / assessment phase only. Customer reviews and approves what data is shared during these phases.
- **Post-cutover:** Ollama in the DMZ. No customer plant data leaves the appliance. The cutover state machine (`offline → preloading → warming → vetting → ready → live`) is observable, audit-logged, and gated.
- **No silent fallback:** If a vet fails after cutover, the state regresses to vetting. Admin must re-clear before re-flipping. Drift cannot hide behind a year-old vet.

---

## Tenant isolation

- Every API route runs through `withTenantContext` — no tenant data crosses tenant boundaries.
- Audit events carry tenantId; no global aggregation without explicit tier authorization.
- Database queries are tenant-scoped via Prisma middleware.
- 6 routes migrated to the strict isolation pattern; all new routes added under it.

---

## Network requirements

| | Requirement |
|---|---|
| **Outbound** | Pre-cutover: api.anthropic.com (allowlist). Post-cutover: zero (compliance scan blocks it). |
| **Inbound** | Customer's L4 → L3.5 DMZ (HTTPS only). Operator browsers + admin via L4. |
| **OT segment** | L2/L3 OT VLAN reachable only via the appliance's second NIC. Eth0/eth1 never bridged. |
| **TLS** | nginx termination at the appliance edge. Customer-provided cert or Civops-managed via Let's Encrypt. |

---

## What CISOs ask first

**"How do we audit you?"**
The audit chain is append-only, hash-chained, exportable. We provide a JSONL audit dump on request. Tamper attempts surface as digest mismatches at a specific row index.

**"What happens if Civops is breached?"**
Customer source systems remain primary in passive_read mode. A Civops compromise does not write back to your ERP/MES/CMMS. The blast radius is the appliance and the data Civops has read into it.

**"Can we run our own SBOM scan?"**
Yes. The appliance image is reproducible via Packer. SBOM is generated as part of the build and shipped with the image.

**"What's your disclosure policy?"**
72-hour customer notification on any incident affecting that customer's tenant. Public disclosure follows responsible-disclosure norms.

---

## What we will NOT do

- Claim a SOC 2 Type II report we don't hold.
- Hide a broken control in the readiness dashboard.
- Allow silent cloud fallback after cutover.
- Bridge OT and IT VLANs.
- Run with audit logging disabled.

---

## Next step

The **Customer Install Guide** walks the on-site engineer through DMZ posture validation, network discovery, and the cutover readiness gate. The **Pilot Scoping Checklist** sets the security baseline as part of pilot success criteria.
