docs: rebuild architecture-overview.md around all 8 traffic laws
Previously only delivered 2-3 of the 8 traffic categories it claimed to cover. Now states every law (ingress, east-west, secrets, DNS, observability, notifications, CI/CD, management) with its own Law/Flow/Failure-behavior, plus the 4 global architectural laws that apply across all of them.
This commit is contained in:
1 file changed
+98
-20
@@ -1,7 +1,7 @@
|
||||
# 📐 Architecture Overview
|
||||
|
||||
> [!NOTE]
|
||||
> The stable, directional laws governing how traffic moves through the fleet — eight distinct traffic categories (ingress, east-west, secrets, DNS, observability, notifications, CI/CD, management), each with its own routing authority and its own failure behavior.
|
||||
> This document defines the invariant movement of traffic between infrastructure components — directional flow and authority boundaries, not configuration syntax, ports, or IP addresses. Eight distinct traffic categories, each stated as a Law (what must always be true), a Flow (the actual path), and a Failure Behavior (what happens when the target is unreachable).
|
||||
|
||||
## Dependency graph
|
||||
|
||||
@@ -45,9 +45,101 @@ flowchart LR
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> Solid arrows are real dependencies — the target has to be reachable and healthy for the source to function. Dotted arrows into Monitoring and Security Monitoring are the one exception: every host reports telemetry to both, but per the Observability Independence Law below, that reporting is asynchronous and non-blocking — nothing here actually depends on Monitoring or Security Monitoring being up. The line style carries that distinction instead of repeating "reports to" twelve times. Full detail on what's actually collected: [`docs/observability.md`](observability.md) and [`docs/security-monitoring.md`](security-monitoring.md).
|
||||
> Solid arrows are real dependencies — the target has to be reachable and healthy for the source to function. Dotted arrows are asynchronous reporting, not a blocking dependency — the distinction Law 5 below makes explicit.
|
||||
|
||||
## Four trust boundaries, not two
|
||||
## The eight traffic laws
|
||||
|
||||
### 1. Ingress — two independent authorities
|
||||
|
||||
**Law**: Public traffic and LAN-facing user traffic terminate at different places and are never conflated.
|
||||
|
||||
| | Public | LAN-facing (user apps) |
|
||||
|---|---|---|
|
||||
| **Path** | Client → WAN → Edge Firewall → Backend | Client → LAN → User-Facing Proxy (mTLS + SSO) → Backend |
|
||||
| **TLS terminates at** | The edge firewall's own reverse-proxy package | The user-facing proxy |
|
||||
| **Enforcement** | No backend is ever directly exposed to WAN — only HTTPS/HTTP and one admin SSH port pass the WAN interface | Mutual TLS (client cert required) + SSO |
|
||||
|
||||
**Failure behavior**: if the edge firewall fails, public access is unavailable and everything else keeps running. If the user-facing proxy fails, all browser-facing access is unavailable and everything else keeps running. The two failures are structurally independent — one can't cascade into the other.
|
||||
|
||||
### 2. East-West — two genuinely distinct patterns
|
||||
|
||||
**Law**: App-to-app HTTP/S traffic and non-HTTP infra-to-infra traffic are not interchangeable, and neither uses a flat unauthenticated mesh (see "what changed," below).
|
||||
|
||||
| Pattern | Path | Trust |
|
||||
|---|---|---|
|
||||
| **(a) App-to-app HTTP/S** | Service → internal proxy zone → trusted-IP bypass *or* SSO forward-auth → Service | IP-allowlist based (docker bridge subnets + every fleet host), not mTLS — mTLS is reserved exclusively for Law 1's LAN-facing ingress |
|
||||
| **(b) Infra-to-infra, non-HTTP** | Service → firewall rule (explicit per-flow allow) → Service, direct, no proxy involved | Metrics/logs, MQTT, security-agent reporting, NTP, Vault Agent auth all take this path |
|
||||
|
||||
**Failure behavior**: if internal DNS fails, app-to-app resolution fails and that path breaks with it. Direct IP communication may still work for pattern (a) but bypasses the SSO gate entirely if the source IP happens to be trusted — a real, accepted risk surface, not an oversight. Core service runtime doesn't depend on the public-facing edge (Law 1) at all — completely separate plane.
|
||||
|
||||
### 3. Secrets — one hop, never direct
|
||||
|
||||
**Law**: Applications do not communicate directly with Vault.
|
||||
|
||||
**Flow**: Service → local Vault Agent → Vault Server. Vault Agent performs AppRole authentication and token renewal; in practice it renders local files (an env file consumed via Compose, or a full rendered config file where multi-line config is needed) that the application reads. Applications never call the Vault API themselves, and Vault is never exposed directly to application containers.
|
||||
|
||||
**Failure behavior**: if Vault becomes unavailable, secret renewal stops but services continue operating until their current token expires — no immediate disruption, a slow-building one only if the outage outlasts every live token's TTL.
|
||||
|
||||
### 4. DNS — resolution determines the routing plane
|
||||
|
||||
**Law**: Which internal DNS zone a hostname resolves in determines which traffic plane (Law 1 or Law 2) a request enters.
|
||||
|
||||
Full model — the two zones, the enforcement that makes this a real boundary rather than a convention, and the audit that caught real drift in how it was documented: **[`docs/dns-naming.md`](dns-naming.md)**.
|
||||
|
||||
### 5. Observability — asynchronous, never inline
|
||||
|
||||
**Law**: Logs and metrics push asynchronously to monitoring infrastructure. Monitoring systems are not inline with application traffic.
|
||||
|
||||
**Flow**: Service → observability agent → Monitoring (logs, metrics). Service → security agent → Security Monitoring. Every managed host runs both agents, enforced by automation that self-heals on drift rather than being applied once and left alone.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Monitoring infrastructure does not proxy or mediate application traffic, and service runtime does not depend on monitoring availability — this is why these are the dotted, not solid, arrows in the dependency graph above. **Failure behavior**: if monitoring fails, log/metric collection stops; application services continue operating normally, completely unaffected.
|
||||
|
||||
Full detail on what's actually collected and why push beats pull here specifically: **[`docs/observability.md`](observability.md)** and **[`docs/security-monitoring.md`](security-monitoring.md)**.
|
||||
|
||||
### 6. Notifications — two branches, one non-critical destination
|
||||
|
||||
**Law**: Notifications converge on one flow and are non-critical to service operation — neither branch is part of any service's runtime dependency chain.
|
||||
|
||||
| Branch | Path |
|
||||
|---|---|
|
||||
| **MQTT** | Service → local notify script → message broker (per-host topic) → central subscriber |
|
||||
| **HTTP webhook** | App → shared webhook endpoint (App Router + per-app mapper) *or* a dedicated endpoint for non-JSON payloads → same downstream formatter |
|
||||
|
||||
Both branches converge on the same formatting step before delivery, but reach it differently — the MQTT branch derives its destination channel from the topic name, the webhook branch's per-app mapper functions set it explicitly. **Failure behavior**: notification failures never impact core workloads — this is event-driven, not persistent inline execution, so a dropped notification is lost, not queued against a retry that could back up into the sender.
|
||||
|
||||
Full mechanics: **[`docs/notifications.md`](notifications.md)**.
|
||||
|
||||
### 7. CI/CD — deployment traffic is separate from runtime traffic
|
||||
|
||||
**Law**: Build and deploy activity never sits inline with application runtime.
|
||||
|
||||
**Flow**: Scheduler (weekly) → build automation → self-hosted registry → target host redeploy.
|
||||
|
||||
**Invariants**: CI/CD components always initiate connections outward, never accept inbound triggers from the apps they build. Runtime services do not depend on CI/CD availability. Deployment failure doesn't affect already-running services — enforced by the redeploy step's own health-check/rollback logic, not just incidentally true. This is schedule- and upstream-digest-triggered, not push-triggered — editing a stack's own build file doesn't by itself trigger a rebuild until the next scheduled sweep finds the upstream image has actually changed.
|
||||
|
||||
Full mechanics and the reasoning behind schedule-triggered over push-triggered: **[`docs/registry-and-build.md`](registry-and-build.md)**.
|
||||
|
||||
### 8. Management — administrative access is its own separate plane
|
||||
|
||||
**Law**: Administrative access is explicitly controlled and restricted to approved management interfaces, separate from every other plane above.
|
||||
|
||||
**Flow**: Administrator → automation host → a dedicated, key-based service identity → target host, on a non-standard port.
|
||||
|
||||
**Invariants**: management interfaces are restricted to approved, non-standard ports fleet-wide, never the service's default port. Access is limited by explicit per-host-pair firewall rules sourced from the automation host only — not a blanket LAN allow. Administrative access originates only from the automation host, via one dedicated identity, never from arbitrary internal sources. Application services do not depend on management interfaces being reachable.
|
||||
|
||||
**Failure behavior**: if management access fails, administration becomes unavailable but every running service continues operating normally — the same "control plane failure doesn't touch data plane" property that holds across every law above.
|
||||
|
||||
## Global architectural laws
|
||||
|
||||
These apply across every category above, not just one:
|
||||
|
||||
| Law | Statement |
|
||||
|---|---|
|
||||
| **Routing authority** | Three routing authorities exist, each scoped to a distinct plane — the edge firewall (public ingress), the user-facing proxy (LAN ingress), the internal proxy zone (app-to-app east-west). No internal service ever acts as its own router. |
|
||||
| **Trust boundary** | Trust is segmented across four boundaries: WAN→edge (public), LAN browsers→user-facing proxy (mTLS+SSO), app-to-app→internal proxy (allowlist+SSO), LAN infra-to-infra→firewall rule (explicit per-flow). Backend services trust proxy headers, never raw client IP, on any path. |
|
||||
| **Plane separation** | Two structurally independent traffic planes — Ingress (public and LAN-facing sub-paths) and East-West (app-to-app and infra-to-infra sub-paths) — with no crossover between them. |
|
||||
| **Observability independence** | Observability never sits inline in any request path; it's asynchronous and push-based, full stop (Law 5). |
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
@@ -57,28 +149,14 @@ flowchart LR
|
||||
Infra["LAN infra-to-infra"] -->|per-flow rule| HostFW["Host firewall"]
|
||||
```
|
||||
|
||||
Backend services trust proxy headers, not raw client IP, on every path.
|
||||
|
||||
## Two structurally independent traffic planes
|
||||
|
||||
| Plane | Path |
|
||||
|---|---|
|
||||
| **Ingress — public** | Client → edge firewall/proxy → backend |
|
||||
| **Ingress — LAN-facing** | Client → user-facing proxy (mTLS) → backend |
|
||||
| **East-west — app-to-app** | Service → internal proxy zone → service |
|
||||
| **East-west — infra-to-infra** | Service → firewall rule → service, direct, no proxy |
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **Observability sits outside every request path on purpose.** Logs and metrics push asynchronously to monitoring infrastructure; nothing in that pipeline is inline with application traffic, and application services don't depend on monitoring availability. If monitoring goes down, collection stops — nothing else does.
|
||||
|
||||
## Two real architecture changes, not a static design
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This shape isn't how the fleet started — it's evolved twice, deliberately. The public-facing reverse proxy used to run as its own dedicated VM; it was consolidated directly onto the edge firewall as a package instead, removing an entire host from the public-ingress path without losing any functionality — one less thing that can fail, one less thing to patch and monitor independently. And the internal service-to-service model used to be a flat, unauthenticated mesh network; it was fully replaced by the two-zone split in [`docs/dns-naming.md`](dns-naming.md), trading a simpler-but-weaker model for one with a real trust boundary between browser-facing and app-to-app traffic. Both changes reduced the attack surface at the cost of more moving parts to reason about — a tradeoff made deliberately, not stumbled into.
|
||||
> This shape isn't how the fleet started — it's evolved twice, deliberately. The public-facing reverse proxy used to run as its own dedicated VM; it was consolidated directly onto the edge firewall as a package instead, removing an entire host from the public-ingress path without losing any functionality — one less thing that can fail, one less thing to patch and monitor independently. And Law 2's internal service-to-service model used to be a flat, unauthenticated mesh network with no trust boundary at all; it was fully replaced by the two-zone split now described in [`docs/dns-naming.md`](dns-naming.md), trading a simpler-but-weaker model for one with a real trust boundary between browser-facing and app-to-app traffic. Both changes reduced the attack surface at the cost of more moving parts to reason about — a tradeoff made deliberately, not stumbled into.
|
||||
|
||||
## What this map deliberately excludes
|
||||
|
||||
Not a firewall rule listing, not a port inventory, not a service configuration reference — those live in their own docs ([`docs/firewall-and-network.md`](firewall-and-network.md) and elsewhere). This is strictly the stable, directional shape of how trust and traffic actually move.
|
||||
Not a firewall rule listing, not a port inventory, not a service configuration reference — those live in [`docs/firewall-and-network.md`](firewall-and-network.md) and the other docs linked throughout each law above. This is strictly the stable, directional shape of how trust and traffic actually move — the eight laws above are meant to still be true even after the specific tools implementing them change.
|
||||
|
||||
---
|
||||
Related: [`docs/firewall-and-network.md`](firewall-and-network.md), [`docs/dns-naming.md`](dns-naming.md)
|
||||
Related: [`docs/firewall-and-network.md`](firewall-and-network.md), [`docs/dns-naming.md`](dns-naming.md), [`docs/secrets-and-pki.md`](secrets-and-pki.md), [`docs/notifications.md`](notifications.md), [`docs/registry-and-build.md`](registry-and-build.md)
|
||||
Reference in new issue
Block a user