🔐 ArcanumVault — Security Architecture

Multi-Provider Proxy · Secrets Vault · Node Mesh · PCI-DSS
v4.2.x · PCI Architecture Unified Model Phase 1 ✅ PCI-DSS L1 NIST SP 800-56B mTLS + RSA-OAEP NNG Mesh

1. Mesh Topology: Three Node Types

PCI 1.2 / 3.5.2: Network segmentation and strict access control over cryptographic material. Each node only exposes the capabilities it was configured for.

🔐 VAULT Node

  • Plugins: AWS KMS, Azure KV, GCP, Thales, CloudHSM
  • Resolves cryptographic operations locally
  • Answers Gateway requests over the mesh
  • Per-plugin failover chains

🔀 GATEWAY Node

  • No plugins or key DB
  • Deployed alongside the consuming application
  • Exposes REST / gRPC / MQTT locally
  • Forwards everything to the NNG mesh (SURVEYOR)
  • Smart fail-fast: queries the local state-map

📊 METRICS Node

  • Collects metrics from the whole mesh
  • Distributes new parameters/configuration
  • DOES NOT resolve cryptographic operations
  • Feeds Prometheus, Splunk, SIEM

🌐 STANDALONE Mode

  • No mesh configured
  • A single node serves everything
  • Ideal for development and small environments
  • Capability override: serve_crypto/metrics/config: true
graph TB subgraph "Application Zone" App["POS Application\nBanking Core"] GW["🔀 GATEWAY\nREST·gRPC·MQTT"] end subgraph "NNG/mTLS Mesh" Mesh{{"⚡ NNG Mesh\nSURVEYOR/PUB-SUB"}} end subgraph "Cryptographic Zone" VA["🔐 VAULT A\nAWS·Azure·GCP"] VB["🔐 VAULT B\nThales·CloudHSM"] end subgraph "Observability" MN["📊 METRICS\nPrometheus·SIEM"] end App-->|"local mTLS"|GW GW-->|"SURVEYOR NNG"|Mesh Mesh-->|"RESPONDENT"|VA Mesh-->|"failover"|VB Mesh-->|"PUB/SUB State"|MN
Capability🔐 VAULT🔀 GATEWAY📊 METRICS
serve_crypto (resolve operations)✅ default❌❌
serve_metrics (expose mesh metrics)⚙️ opt-in❌✅ default
serve_config (distribute parameters)❌❌✅ default
Local key DB✅❌❌
HSM/KMS Plugins✅❌❌

2. Cryptographic Operation Flow (Gateway → Vault)

PCI 3.6.1: Secure key distribution. The internal transport is NanoMsg over mTLS. The assembled key never travels over the network; only its encrypted components do.
sequenceDiagram participant App as Application participant GW as GATEWAY participant Mesh as NNG Mesh (mTLS) participant VA as VAULT A participant VB as VAULT B App->>GW: POST /api/keys/active (local mTLS) GW->>GW: Fail-Fast: serve_crypto=ONLINE in state-map? alt No nodes available GW-->>App: HTTP 503 Resource unavailable else Node available GW->>Mesh: CryptoForwardRequest (SURVEYOR) Mesh->>VA: Request to VAULT A alt VAULT A plugin available VA-->>Mesh: CryptoForwardResponse ✅ else VAULT A plugin offline → failover Mesh->>VB: Request to VAULT B VB-->>Mesh: CryptoForwardResponse ✅ end Mesh-->>GW: Response GW->>GW: Decrypt RSA-OAEP + XOR (RAM) GW->>GW: SecureZero buffers GW-->>App: Secure response end

3. Cryptographic Segregation (Defense in Depth)

PCI 3.5.2: ArcanumVault never stores the final assembled key. The components are decrypted and combined exclusively in volatile RAM.
graph TD subgraph "Volatile Memory — VAULT Node Only" RSA["RSA-OAEP-SHA256 Decryption"] XOR["Bitwise XOR"] Zero["SecureZero — Buffer wipe"] end subgraph "Provider 1: HSM / CloudHSM / Thales" DB1[("Component 1\nRSA Encrypted")] end subgraph "Provider 2: AWS KMS / Azure KV / GCP" DB2[("Component 2\nRSA Encrypted")] end subgraph "Audit — Asynchronous" Audit[("AuditLog\nPCI Masked")] end DB1-->|"comp1 enc"|RSA DB2-->|"comp2 enc"|RSA RSA-->XOR XOR-->|"Final HEX key"|Resp[Response to Client] XOR-->Zero Resp-->Audit

4. Authentication and Middleware Stack (mTLS + 7 Layers)

PCI 4.1 / 6.5.10: TLS 1.3 minimum mandatory. Bidirectional identification on all connections.
graph LR C["Client\n(cert OU=consumer)"]-->F1 subgraph "Middleware Stack — per Port" F1["IP Filter CIDR"]-->F2["mTLS Verify CA"] F2-->F3["Cert Pinning SHA-256"] F3-->F4["RBAC by OU"] F4-->F5["Rate Limiter\ntoken bucket"] F5-->F6["Anti-Replay\nNonce+Timestamp"] F6-->F7["HMAC-SHA256\nBody Integrity"] F7-->H["Handler"] end H-->V["VaultResolver\n→ PluginChain"]
PortProtocolPurposeRequired OU
8080HTTPSKeys API (REST)consumer, admin
8081HTTPSAdministration / Hot-Reloadadmin
9090HTTPSPrometheus Metricsobserver, platform, admin
50051gRPC+TLSgRPC APIconsumer, admin
40000NNG/mTLSInternal Node MeshMesh nodes

Unified Model — gRPC Access Control (Phase 1)

Zero-Trust by node identity: on top of the mTLS stack, the unified model adds authentication and authorization by NodeIdentity. The gRPC AuthN interceptor extracts the mTLS cert, computes its SHA-256 fingerprint and resolves it against node_identities (via IdentityStore); the AuthZ middleware validates each operation with CheckGrant against the declarative IdentityGrant matrix (Identity × Resource × Ops × Algorithms × Expires).
ComponentRoleDetail
NodeIdentity + IdentityStoregRPC AuthNThe interceptor resolves the mTLS cert by SHA-256 fingerprint and injects the identity into the context. bootstrap_token validated with bcrypt.
IdentityGrant + AuthZ middlewarePer-operation AuthZCheckGrant(op=admin / crypto_op) validates the operation, the resource, the allowed algorithms and the expiration. No grant → PermissionDenied.
AdminVaultService (AV-06)Authenticated gRPC backoffice9 RPCs (Upsert/Delete/List × Identities/Resources/Grants). Each RPC requires an op=admin grant over the _admin meta-resource. Replaces seeding via direct SQL.

5. Plugin Health Check and Mesh State (Circuit Breaker)

PCI 12.10.2: The system refuses service before delivering incorrect data. Nodes propagate their health state to the whole mesh every 5 seconds.
ParameterDescriptionDefault
keepalive_idle_secondsPing when there is no activity (active mode)120s
reconnect_interval_secondsInitial interval on connection loss5s
reconnect_decay_multiplierExponential multiplication factor2.0x
reconnect_max_interval_secondsMaximum interval ceiling300s

PUB/SUB broadcast every 5s includes: node_mode, serve_crypto, serve_metrics, serve_config and each plugin's state. Gateway nodes query this state-map for the smart fail-fast before broadcasting over the mesh.

6. Native Operating System Service

PCI 2.2.3: System security configuration. Hardening of the process on the host OS.
PlatformIntegrationApplied Hardening
🐧 LinuxsystemdLimitCORE=0, NoNewPrivileges=true, PrivateTmp=true, ProtectSystem=strict, AmbientCapabilities=CAP_IPC_LOCK
🍎 macOSlaunchdKeepAlive=true, service user _arcanumvault, segregated logs
🪟 WindowsSCM (sc.exe)Automatic restart 3 attempts / 5s, managed service account (gMSA)

Unified installation: ./arcanumvault --install-service --config=/etc/arcanumvault/config.json

7. Container Strategy (Dual-Flavor)

ImageBaseCGOPluginsUse Case
🏔️ Alpinealpine:3.19✅ FullAll + PKCS#11 (Thales)Dev, QA, On-Prem HSM
🛡️ Distrolessgcr.io/distroless/static-debian12❌ CGO=0Cloud only (AWS/Azure/GCP/HashiCorp)Cloud Production, strict PCI
For PKCS#11 plugins in K8s with a Distroless image → sidecar pattern: Distroless core + Thales plugin on Alpine sharing a Unix socket.

8. PCI Audit — Events and Destinations

PCI 10.2: Automated audit trails for all system components.
EventDescriptionPCI Control
KEY_REQUESTKey request by an application10.2.1
CRYPTO_OP_FORWARDGateway forwards an operation to the mesh10.2.1
CRYPTO_OP_REJECTEDFail-fast: resource unavailable in the mesh10.2.4
MESH_CONNECT/DISCONNECTConnectivity change between nodes10.2.6
MESH_FORWARD_SEND/RECEIVEOperation forwarding between nodes10.2.1
AUTH_FAILmTLS / RBAC rejection10.2.4
REPLAY_REJECTEDDuplicate nonce or expired timestamp10.2.4
PLUGIN_OFFLINE/ONLINEHSM/KMS plugin state change10.2.6

Destinations: Splunk · Graylog · Syslog · AWS CloudWatch · Azure Monitor  |  PCI Masking: PAN, Track Data, cryptographic material → ****

Unified Model Audit — access_audit_logs (Phase 1)

Dedicated table, independent from the legacy audit_logs. Every AuthN and AuthZ decision of the unified model is recorded asynchronously (fire-and-forget) in access_audit_logs with identity, fingerprint, service, method, operation, resource, result and latency. Every Upsert/Delete of the AdminVaultService is logged with the identity of the admin that executed it.
EventDescriptionPCI Control
AuthN result=OK / unknown_fingerprint / identity_disabledResult of the gRPC AuthN interceptor by cert fingerprint10.2.4
AuthZ granted / deniedCheckGrant decision (op + resource + algorithm + expiration)10.2.2
AdminVaultService Upsert/DeleteCreate/delete/modify identities, resources or grants via authenticated gRPC10.2.1

9. Advanced Hardening

PCI 3.4.1 / 6.5.10: Defense in depth for cryptographic material in memory and in transit.