Skip to content
Illustration: a workbench where a blueprint cable runs into a glowing server rack

Engineering — Reference Implementation

Engineering Specs Index ​

Companion implementation contracts for the Zero-Trust Octagon architecture. These specs define the "how" — complementing the theory chapters (01-foundations/ through 04-synthesis/) that define the "why."

Implementation Order ​

Specs must be read and implemented in dependency order. Each spec declares its prerequisites in a **Dependencies:** block.

Phase 1: Core Infrastructure
  redis-challenge-pipeline-docker.md      ── defines ZtaRedisPipelineManager
  siem-logging-pipeline.md                ── defines ztaLogger, fluent-bit.conf

Phase 2: Authentication Primitives
  webauthn-client-enterprise-handler.md   ── defines WebAuthnClientHandler
  webauthn-server-validation-backend.md   ── defines EnterpriseWebAuthnServerValidator

Phase 3: Enrollment & Identity
  enrollment-onboarding-flows.md          ── depends on Phase 1 + Phase 2
  identity-fabric-architecture-2026.md    ── architecture reference (no code deps)
  zero-trust-identity-blueprint.md        ── executive overview (no code deps)

Phase 4: NFC & Relay Defense
  nfc-relay-threat-defense.md             ── depends on Phase 1 + Phase 2
  anti-relay-cryptographic-channel-binding.md ── depends on nfc-relay-threat-defense.md

Phase 5: Deployment & Multi-Region
  kubernetes-deployment-manifests.md      ── depends on Phase 1
  multi-region-redis-replication.md       ── defines CrossRegionZtaDataPipeline
  terraform-chaos-engineering-validation.md ── depends on multi-region-redis-replication.md

Phase 6: Observability & Response
  caep-ssf-grpc-audit-trail.md           ── Go service, depends on Phase 1 + Phase 2
  soar-incident-containment-playbook.md   ── depends on Phase 1, Phase 2, siem-logging-pipeline.md

Phase 7: Audit & Compliance
  auditor-topology-schematics.md          ── reference material (no deps)
  compliance-audit-appendices.md          ── template material (no deps)

Module Dependency Map ​

Shared code modules are defined in the specs listed as their canonical source. All other specs import from these canonical definitions.

ModuleCanonical SourceImported By
ZtaRedisPipelineManagerredis-challenge-pipeline-docker.mdenrollment, SOAR, SIEM, multi-region, terraform-chaos
ztaLogger / logSecurityEventsiem-logging-pipeline.mdenrollment, SOAR, nfc-relay, anti-relay
EnterpriseWebAuthnServerValidatorwebauthn-server-validation-backend.mdenrollment, redis-pipeline
WebAuthnClientHandlerwebauthn-client-enterprise-handler.mdenrollment, anti-relay
CrossRegionZtaDataPipelinemulti-region-redis-replication.mdterraform-chaos
ZtaAutomatedResponsePlaybooksoar-incident-containment-playbook.mdstandalone
ZtaEnrollmentOrchestratorenrollment-onboarding-flows.mdstandalone
AntiRelayEnrollmentEnginenfc-relay-threat-defense.mdstandalone
SoTAAntiRelayValidatoranti-relay-cryptographic-channel-binding.mdstandalone
AuthServer (Go)caep-ssf-grpc-audit-trail.mdstandalone

Polyglot Rationale ​

The codebase spans TypeScript and Go intentionally:

  • TypeScript (Node.js) — Application-layer services: WebAuthn handlers, enrollment flows, SOAR playbook, Redis pipeline manager. Chosen for rapid iteration, ecosystem compatibility with @simplewebauthn/server, and Express/Fastify HTTP handling.
  • Go — Performance-critical gRPC External Authorization service (caep-ssf-grpc-audit-trail.md). Chosen for Envoy ExtAuthz compatibility (native gRPC, sub-millisecond Redis checks), minimal GC pressure, and the envoyproxy/go-control-plane SDK.

The boundary is clear: Go owns the Envoy control plane path. TypeScript owns everything else. The two communicate exclusively through Redis (shared state) and gRPC (Envoy → Go AuthServer). No cross-language imports exist.

Shared Error Handling Convention ​

All TypeScript modules follow a consistent error handling pattern:

typescript
// Errors thrown from security-critical operations use descriptive messages
// prefixed with the violation category:
throw new Error('Security Violation: <specific reason>');

// Operational errors use:
throw new Error('Infrastructure Fault: <specific reason>');

// Validation failures return HTTP error responses directly (not thrown):
return res.status(4xx).json({ error: '<user-facing message>' });

// All catch blocks MUST log before re-throwing or responding:
} catch (err: any) {
  ztaLogger.error({ error: err.message, ...context }, '<operation> Failed');
  return res.status(500).json({ error: 'Internal system configuration failure.' });
}
  • Never swallow errors silently — always log at minimum
  • Never expose stack traces in API responses
  • Prefer ztaLogger.error() for security events, ztaLogger.warn() for policy rejections
  • Go services use status.Error(codes.PermissionDenied, "message") for gRPC responses

Spec Format Convention ​

Every engineering spec follows this structure:

# Title
> **Purpose:** One-line summary of what this spec enables.

**Version:** X.Y.Z | **Last Updated:** YYYY-MM-DD
**Dependencies:** `spec-name.md`, `spec-name.md`

---

## 1. Section Title
...

## N. Section Title
...

---

## References
[1] URL
...

Identity & Authentication ​

NFC & Relay Defense ​

Infrastructure & Deployment ​

Observability & Response ​

Compliance & Audit ​