Concept

Security Model

Trust boundaries, authentication, and data integrity in BSFG deployments

Audience: Security architects, platform engineers, operators. Use: Understand trust boundaries, authentication, authorization, and integrity controls.

Overview

Industrial environments require strict security controls due to network segmentation, regulatory requirements, and safety risks. BSFG deployments must enforce:

This document explains how BSFG achieves these guarantees architecturally.

Core Security Principles

Principle 1: Zones Remain Isolated

Each zone (Enterprise IT, Plant OT, IDMZ) is an independent trust domain. Zones do not share durable infrastructure, databases, or storage. Each zone owns its facts, artifacts, and operational state.

Principle 2: Boundary Infrastructure is Stateless

The network boundary (firewalls, routers, VPN terminators) contains no durable middleware. No Kafka, no PostgreSQL, no shared message broker. Only connectivity infrastructure and BSFG RPC endpoints are exposed across zone boundaries. See ADR-0001.

Principle 3: All Communication is Authenticated

Every cross-zone RPC call is authenticated via mutual TLS (mTLS). BSFG nodes present certificates identifying their zone. Peer zones verify certificate identity before accepting connections.

Principle 4: Data is Tamper-Resistant

Facts are immutable once appended. Artifacts are immutable once referenced. Transport uses authenticated encryption (TLS 1.3+). Message integrity is enforced via idempotent append semantics.

Principle 5: Audit Trail is Authoritative

The append-only fact log is the source of truth. There is no mutable state at the boundary. All cross-zone synchronization is explicit and traceable through the fact history.

Trust Boundaries

BSFG deployments define explicit trust boundaries — zones that operate independently and require authentication to communicate.

Enterprise IT Zone ╔══════════════════════════════════╗ ║ ERP, Analytics, Cloud APIs ║ ║ ↓ ║ ║ BSFG Node (enterprise-bsfg) ║ ║ JetStream + Object Storage ║ ╚══════════════════════════════════╝ ↕ mTLS ╔══════════════════════════════════╗ (optional) ║ IDMZ (Connectivity only) ║ ║ ↓ ║ ║ BSFG Node (idmz-bsfg) ║ ║ (No durable state) ║ ╚══════════════════════════════════╝ ↕ mTLS ╔══════════════════════════════════╗ ║ Plant OT Zone ║ ║ MES, PLC, Historians ║ ║ ↓ ║ ║ BSFG Node (plant-a-bsfg) ║ ║ JetStream + Object Storage ║ ╚══════════════════════════════════╝

Zone Independence

Each zone operates independently:

Cross-Zone Communication

Communication between zones is explicit:

Authentication: Mutual TLS (mTLS)

All BSFG nodes use mutual TLS (mTLS) for authentication. This means:

Certificate Structure

Node Certificate CN Issued By Usage
Enterprise BSFG enterprise-bsfg Enterprise PKI CA Peer identification, access control
Plant A BSFG plant-a-bsfg Enterprise PKI CA Peer identification, access control
Plant B BSFG plant-b-bsfg Enterprise PKI CA Peer identification, access control
IDMZ (optional) idmz-bsfg Enterprise PKI CA Peer identification, access control

Authentication Flow

Plant A BSFG Enterprise BSFG │ │ │ 1. TLS ClientHello (cert) │ ├──────────────────────────────→│ │ │ (verify cert CN = plant-a-bsfg) │ 2. TLS ServerHello (cert) │ │←──────────────────────────────┤ │ (verify cert CN = enterprise-bsfg) │ │ │ 3. Encrypted Connection │ ├──────────────────────────────→│ │ AppendFact, FetchFacts │ │←──────────────────────────────┤ │ │

Certificate Requirements

Authorization: Zone-Based Access Control

Authorization in BSFG is zone-level, not per-message. The security decision is: "Does this authenticated zone have permission to perform this RPC call?"

Authorization Policy

A typical authorization policy defines:

Source Zone Destination Zone Allowed Operations Rationale
enterprise-bsfg plant-a-bsfg AppendFact, FetchFacts, ConfirmReceipt, PutObject Enterprise pushes orders; Plant pulls and confirms
plant-a-bsfg enterprise-bsfg AppendFact, FetchFacts, ConfirmReceipt, PutObject Plant reports production; Enterprise pulls
plant-a-bsfg plant-b-bsfg DENY (not connected) Plants do not communicate directly; all via Enterprise

Authorization Enforcement

Authorization is enforced via:

Transport Security: mTLS + Connect RPC

All BSFG cross-zone communication occurs over authenticated, encrypted channels:

What Remains Zone-Local (Never Exposed)

The following are never exposed across zone boundaries:

Component Exposure Rationale
JetStream cluster Zone-local only No cross-zone stream mirroring or pull from peer clusters
Object storage Zone-local only Artifacts stored in enterprise S3, plant NAS; not shared
NATS accounts Zone-scoped enterprise_account, plant_a_account, plant_b_account (separate)
Operational databases Zone-local only No distributed database across zones

Data Integrity

BSFG prevents data corruption through multiple mechanisms:

Idempotent Append

Producers append facts with a stable message_id. The BSFG boundary enforces idempotent semantics:

Stable Message ID

Producers derive message_id from business data, not random values:

Canonical JSON

Fact objects are serialized in canonical JSON format (deterministic, field-ordered). This ensures:

Immutable Facts and Artifacts

Once appended, facts are immutable:

Once referenced, artifacts are immutable:

Artifact Security

Binary artifacts (PDFs, batch records, test results) may contain sensitive information. Security measures:

Zone-Local Storage

All artifacts are stored in zone-local object stores:

Access Control

Artifact access is controlled via BSFG node authentication:

Immutability and Referential Integrity

Artifacts are content-addressed and immutable:

Threat Model and Mitigations

This section addresses common threats and how BSFG mitigates them.

Threat: Man-in-the-Middle (MITM) Attack

Scenario: An attacker intercepts RPC traffic between enterprise-bsfg and plant-a-bsfg, modifying fact data in transit.

Mitigation: All cross-zone traffic uses mTLS with authenticated encryption (TLS 1.3 AEAD). Attacker cannot decrypt, forge certificates, or modify ciphertext without detection.

Threat: Unauthorized Zone Access

Scenario: A compromised plant tries to access another plant's BSFG node (plant-a-bsfg attempts to pull from plant-b-bsfg).

Mitigation: Firewall rules explicitly forbid plant-to-plant connections. Even if plant-a-bsfg has a valid certificate, firewall drops the packet. Certificate validation is necessary but not sufficient; network topology enforces the policy.

Threat: Fact Tampering

Scenario: An attacker modifies a fact in the JetStream store (e.g., changes order quantity).

Mitigation: Facts are append-only. Once appended, they cannot be modified or deleted. JetStream enforces immutability at the storage layer. Audit logs record all append operations and cannot be altered retroactively.

Threat: Duplicate Fact Injection

Scenario: An attacker or buggy producer causes the same fact to be appended multiple times, creating duplicate orders or measurements.

Mitigation: BSFG enforces idempotent append: facts with the same message_id are deduplicated. Producers derive message_id from business data (order ID, timestamp), making duplicates impossible if the producer follows the contract.

Threat: Artifact Substitution

Scenario: An attacker replaces a batch record PDF with a different file, and a fact references the old digest.

Mitigation: Once a fact references an artifact by digest, that artifact becomes immutable. If the artifact is modified or replaced, the digest no longer matches. Consumers verify digest; mismatch signals tampering or data loss.

Threat: Unauthorized Cross-Zone Replication

Scenario: A rogue process in Plant A attempts to replicate sensitive data to Plant B without authorization.

Mitigation: Facts are pulled by the receiving zone, not pushed by the sending zone. Plant B controls what it fetches. Additionally, firewall rules prevent direct plant-to-plant connections; cross-zone traffic must go through the authorized boundary (e.g., via IDMZ or Enterprise).

Operational Hardening

Beyond architectural security, operational practices strengthen the defense posture:

Certificate Rotation

Least-Privilege Network Rules

Audit Logging

Anomaly Detection

Secure Deployment Practices

Compliance Alignment

BSFG's security model aligns with industrial compliance standards:

Security Checklist

Before deployment, verify:

Cross-Links to Related Documentation