docs/deployment: record security hardening pass + webapp + APNs
Mark roadmap items done (network policies, Traefik middleware, CF Full strict, CF IP UFW restriction, webapp deploy, APNs wired up, admin URL-baking fix, admin probe bug). Update Chapter 4 (firewall rule inventory now shows CF-only :443, no :80), Chapter 6 (request flow walks through TLS on :443 and middleware hops), Chapter 13 (CF SSL mode is Full strict, not Flexible; documents the origin cert install), Chapter 7 (adds the web service section — proxy pattern, 3 replicas, PostHog build-args), and Appendix C (web manifests, CF origin cert paths on disk, APNs .p8 path, updated network-policies applied status). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -280,16 +280,22 @@ most Ingress controllers and matches how users think about URL routing.
|
||||
|
||||
## How requests flow
|
||||
|
||||
1. **Cloudflare DNS** resolves `api.myhoneydue.com` to one of three IPs
|
||||
(round-robin). Say it picks `178.105.32.198` (hetzner2).
|
||||
2. **Cloudflare edge** establishes TCP to `178.105.32.198:80` (plain HTTP,
|
||||
SSL=Flexible). Original HTTPS terminated at CF.
|
||||
3. **UFW on hetzner2** accepts the SYN (80/tcp open from anywhere).
|
||||
4. **Linux kernel** sees a listener on 0.0.0.0:80 (the Traefik pod).
|
||||
Hands off the SYN.
|
||||
5. **Traefik accepts** the connection. Reads the HTTP request.
|
||||
1. **Cloudflare DNS** resolves `api.myhoneydue.com` to a CF edge IP
|
||||
(client never sees the three origin IPs — CF proxies).
|
||||
2. **Cloudflare edge** terminates TLS from the browser, then opens a
|
||||
fresh TCP to one of the origin IPs on `:443` (SSL=Full (strict)).
|
||||
Say it picks `178.105.32.198` (hetzner2).
|
||||
3. **UFW on hetzner2** accepts the SYN — the source IP is in one of
|
||||
the 15 CF IPv4 CIDRs allowed on `:443`. (Any non-CF source IP is
|
||||
dropped at the kernel.)
|
||||
4. **Linux kernel** sees a listener on `0.0.0.0:443` (the Traefik pod,
|
||||
hostNetwork). Hands off the SYN.
|
||||
5. **Traefik accepts** the connection, completes the TLS handshake
|
||||
using the `cloudflare-origin-cert` secret (CF Origin CA — CF
|
||||
verifies this chain on its side). Reads the plaintext HTTP request.
|
||||
6. **Traefik matches** the `Host:` header against its router table.
|
||||
`Host: api.myhoneydue.com` → `honeydue-api` Ingress → `api` Service.
|
||||
Attached middlewares (`security-headers`, `rate-limit`) run here.
|
||||
7. **Traefik dials** `10.43.167.83:8000` (api Service ClusterIP). This
|
||||
goes through the cluster DNS (CoreDNS) and kube-proxy (IPVS).
|
||||
8. **kube-proxy IPVS** rewrites the destination to a live api pod endpoint
|
||||
|
||||
Reference in New Issue
Block a user