Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -2,6 +2,14 @@
This document is the production security entrypoint for the web, API, worker, and operations surfaces. It links the detailed header and CORS checklist in [`docs/security/runbook.md`](./security/runbook.md) and summarizes the security boundaries operators must preserve while triaging incidents or changing runtime configuration.
The latest repository-wide review and its deliberately deferred operational
risks are tracked in
[`SECURITY-AUDIT-2026-07-22`](./security/SECURITY-AUDIT-2026-07-22.md).
Search that document for `SECURITY-FOLLOWUP-COSIGN`,
`SECURITY-FOLLOWUP-REGISTRY-PULL`, or
`CI-FOLLOWUP-RESTORE-QUALITY-GATES` before changing deploy credentials,
image-signing policy, or the temporary CI quality-gate waiver.
## Security surfaces
| Surface | Boundary | Safe evidence to record |
@@ -23,6 +31,12 @@ CORS is the browser-origin access boundary for the API. Allowed origins come fro
Positive CORS checks alone are not sufficient. Incident triage should compare an expected allowed origin with a denied origin such as the generic attacker origin already documented in the detailed runbook, while recording only origin labels, header presence, status, and `x-request-id`. Never paste customer domains, tenant hostnames, raw browser headers, cookies, authorization headers, or environment dumps into tickets or logs.
## Trusted client IPs
Security-sensitive IP attribution must use the shared `@hivegrid/foundation/trusted-client-ip` resolver. It treats the rightmost `X-Forwarded-For` value as Traefik's appended TCP peer, accepts `CF-Connecting-IP` only when that peer belongs to Cloudflare's published origin networks, and otherwise uses the verified direct peer. `True-Client-IP`, the leftmost `X-Forwarded-For` value, and an unbound `CF-Connecting-IP` value are attacker-controlled and must never key rate limits, signatures, or audit evidence.
The checked-in Cloudflare CIDRs must be reviewed against Cloudflare's official [IPv4](https://www.cloudflare.com/ips-v4/) and [IPv6](https://www.cloudflare.com/ips-v6/) lists when the edge network changes. Traefik must retain its documented default of appending the remote peer to `X-Forwarded-For`; do not enable `forwardedHeaders.insecure` or `notAppendXForwardedFor` in production. See the official [Traefik entry-point contract](https://doc.traefik.io/traefik/reference/install-configuration/entrypoints/#forwarded-headers).
## Authentication and API tokens
`API_ACCESS_TOKEN` is the service-token boundary for authenticated API calls. API clients may present credentials through bearer authorization or documented API-key validation inputs, but diagnostics must never echo token values, token fragments, request bodies that contain credentials, cookies, or raw authorization headers.
@@ -71,8 +85,7 @@ text = Path('docs/security.md').read_text()
for marker in ('TO' + 'DO', 'T' + 'BD', 'FIX' + 'ME'):
assert marker not in text
PY
pnpm run verify:production-docs
pnpm exec vitest run scripts/verify-production-docs.test.mjs
pnpm run verify:docs-links
pnpm --dir server exec vitest run server.test.ts
pnpm exec vitest run apps/api/src/app.test.ts apps/api/src/cors.test.ts packages/config/src/env-access-enforcement.test.ts packages/config/src/api.test.ts
```