infra(gateway): enable Envoy HTTP access logs for the Cilium GatewayClass (netsec F7) #76

Merged
sirius merged 1 commit from wt/t_e662b03a into master 2026-11-27 06:30:59 +00:00
Owner

Summary

Finding F7 of the 2026-11-27 cluster netsec audit: cilium-envoy emitted no request-level record, so the design's only application-layer detection (§4d traversal / union select / %00 / .env/.git probes / high-rate 401-403 per client / scanner user-agents) had no input stream.

Cilium 1.20 supports Gateway access logs through CiliumGatewayClassConfig.spec.telemetry.accessLogs, referenced from GatewayClass.spec.parametersRef. The chart has no Helm values knob for that reference, so this PR declares both objects in Git:

  • infrastructure/networking/gateway/gatewayclass-config.yaml — CiliumGatewayClassConfig kube-system/cilium, JSON, HTTP target, explicit field allowlist.
  • infrastructure/networking/gateway/gatewayclass.yaml — the chart's cilium GatewayClass plus parametersRef.
  • infrastructure/networking/gateway/kustomization.yaml — lists both.

Cilium renders the access log into every Gateway listener's HTTP connection manager and writes one JSON line per request to the cilium-envoy container stdout, i.e. /var/log/pods/kube-system_cilium-envoy-*/cilium-envoy/*.log, which the node log store (Alloy -> Loki) already tails.

Fields and what is deliberately excluded

gateway, start_time, method, path, protocol, response_code, response_flags, duration_ms, bytes_received, bytes_sent, authority, client_ip (CF-Connecting-IP), x_forwarded_for, peer, user_agent, cf_ray, upstream_host

client_ip is the real client identity: Envoy is hostNetwork, so the raw peer is cloudflared on the Pi. peer + x_forwarded_for are kept so a missing/forged CF-Connecting-IP is visible instead of silently trusted.

No request/response bodies and no header dumps — Authorization, Cookie, Set-Cookie never reach disk. Envoy application log level stays info; no debug/trace.

Safety

  • Server-side dry-run applied cleanly (created (server dry run) / configured (server dry run)).
  • Access log config is an xDS push: no Envoy or agent restart, no listener rebind, no NodePort change.
  • Rollback: delete the two objects / revert this commit; listeners return to their previous config on the next reconcile.

Verification

Live request proof, byte volume measurement, kubelet rotation window and a parser check are recorded on the card (t_e662b03a) after this merges and Flux reconciles.

## Summary Finding F7 of the 2026-11-27 cluster netsec audit: `cilium-envoy` emitted **no request-level record**, so the design's only application-layer detection (§4d traversal / `union select` / `%00` / `.env`/`.git` probes / high-rate 401-403 per client / scanner user-agents) had no input stream. Cilium 1.20 supports Gateway access logs through `CiliumGatewayClassConfig.spec.telemetry.accessLogs`, referenced from `GatewayClass.spec.parametersRef`. The chart has no Helm values knob for that reference, so this PR declares both objects in Git: - `infrastructure/networking/gateway/gatewayclass-config.yaml` — `CiliumGatewayClassConfig kube-system/cilium`, JSON, HTTP target, explicit field allowlist. - `infrastructure/networking/gateway/gatewayclass.yaml` — the chart's `cilium` GatewayClass plus `parametersRef`. - `infrastructure/networking/gateway/kustomization.yaml` — lists both. Cilium renders the access log into every Gateway listener's HTTP connection manager and writes one JSON line per request to the `cilium-envoy` container stdout, i.e. `/var/log/pods/kube-system_cilium-envoy-*/cilium-envoy/*.log`, which the node log store (Alloy -> Loki) already tails. ### Fields and what is deliberately excluded `gateway, start_time, method, path, protocol, response_code, response_flags, duration_ms, bytes_received, bytes_sent, authority, client_ip (CF-Connecting-IP), x_forwarded_for, peer, user_agent, cf_ray, upstream_host` `client_ip` is the real client identity: Envoy is hostNetwork, so the raw peer is cloudflared on the Pi. `peer` + `x_forwarded_for` are kept so a missing/forged `CF-Connecting-IP` is visible instead of silently trusted. No request/response bodies and no header dumps — `Authorization`, `Cookie`, `Set-Cookie` never reach disk. Envoy application log level stays `info`; no debug/trace. ## Safety - Server-side dry-run applied cleanly (`created (server dry run)` / `configured (server dry run)`). - Access log config is an xDS push: no Envoy or agent restart, no listener rebind, no NodePort change. - Rollback: delete the two objects / revert this commit; listeners return to their previous config on the next reconcile. ## Verification Live request proof, byte volume measurement, kubelet rotation window and a parser check are recorded on the card (t_e662b03a) after this merges and Flux reconciles.
Finding F7: cilium-envoy emitted no request-level record, so the netsec
design's application-layer rules had no input stream.

CiliumGatewayClassConfig kube-system/cilium binds spec.telemetry.accessLogs
(JSON, HTTP target) to the cilium GatewayClass via spec.parametersRef, so
Cilium renders an access log into every Gateway listener's HTTP connection
manager and writes one JSON line per request to the cilium-envoy container
stdout (/var/log/pods/kube-system_cilium-envoy-*/cilium-envoy/*.log).

Fields are an explicit allowlist: method, path, response code/flags, duration,
bytes, authority, CF-Connecting-IP (real client, since Envoy is hostNetwork
behind cloudflared), X-Forwarded-For, peer, User-Agent, CF-Ray, upstream host.
No bodies, no header dumps: Authorization/Cookie never reach disk. Application
log level stays info (no debug/trace).
sirius merged commit 81d35955aa into master 2026-11-27 06:30:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!76
No description provided.