5.1 KiB
Cluster hardening baseline: deny-by-default network, restricted pods, audit logs; signing deferred
v1 hardens the cluster with built-in mechanisms only. That means default-deny CiliumNetworkPolicies in every namespace we own, Pod Security restricted wherever it fits, two ValidatingAdmissionPolicies (in-apiserver CEL rules), Kubernetes audit logging, and a written upgrade runbook with a fixed cadence. Commit signature verification and cosign image signing are deferred. We chose this because each measure here closes a real gap without adding a controller to run. Signing would only move trust onto keys held by the same Gitea and runner it's meant to protect against.
Considered Options
- Flux commit verification plus cosign signing with admission-time verification, in v1. Rejected for now. CI commits the digest bump to
main(ADR-0007), so HEAD is usually a CI commit, and CI would need its own signing key. There's no keyless identity for Gitea, so the cosign key would be key-based too. Both keys would live in Gitea Actions secrets or on the runner, where an attacker who controls Gitea can run a workflow that uses them. Signed tags from a hardware key would break "every green merge deploys". Flux image automation would need git write credentials in the cluster. - Kyverno (or sigstore policy-controller) for admission. Rejected for two rules. It adds a controller, a webhook that can fail open or closed, and more upgrades to keep up with. Revisit when signing returns.
- Moving
monitoringtoprivilegedas a whole. Rejected in favour of isolating the node agents in their own namespace. - Keeping ops reminders out of hAPI (a personal calendar), since hAPI can't remind you to fix hAPI while it's down. Rejected: these are recurring upkeep, which is what Maintenance Tasks are for, and Kuma covers the outage case. The glossary's Maintenance now includes the Household's digital systems.
Consequences
-
NetworkPolicy: every namespace we own (
hapi,bots,gateway,envoy-gateway-system,monitoring,monitoring-node,cert-manager,flux-system) is default-deny for ingress and egress. Each component's allows sit next to its manifests indeploy/. Rules that name hosts areCiliumNetworkPolicy, usingtoFQDNsfor ntfy, Linode Object Storage, the Linode API, SimpleFIN, Kuma and Let's Encrypt, andtoCIDRfor the Managed DB's VPC address. This includes the allows already promised by ADR-0009, ADR-0011, ADR-0013 and ADR-0014.kube-system(Cilium, CCM and CoreDNS, installed by Tofu) stays open. -
Pod Security: the cluster default stays at Talos's
baseline. Every namespace we own enforcesrestricted, exceptmonitoring-node, which isprivilegedand holds only the Vector and node-exporter DaemonSets. This amends ADR-0009. -
Admission (ValidatingAdmissionPolicy, Deny from day one, delivered by Flux):
- Images must come from Gitea's registry, or carry an
@sha256:digest. Applies everywhere exceptkube-system. - Pods in
hapiandbotsmust setreadOnlyRootFilesystem: trueandautomountServiceAccountToken: false.
- Images must come from Gitea's registry, or carry an
-
Audit logging: the apiserver audit policy is set in Talos machine config at
Metadatalevel. It keeps every write and every access tosecrets,pods/exec,pods/portforwardandserviceaccounts/token, and drops controllers' and Flux's reads, health endpoints and Events. Vector inmonitoring-nodeships the control-plane node's audit file to VictoriaLogs, where it's kept 1 year and included in ADR-0014's dailyaudit/export. Apods/execor a Secret read by a human sends an alert to the ntfyopstopic. Dial the policy back if it's too noisy. -
Upgrades: Talos, Kubernetes, Cilium and CCM versions are pinned in
infra/. Renovate opens PRs for them and never auto-merges. Security patches go in within 14 days; minor versions after their.1, staying within upstream support. The procedure goes indocs/runbooks/cluster-upgrade.md, written during the build:- Take a throwaway local
talosctl etcd snapshot, never stored (ADR-0014's no-etcd-backups rule still holds). - Upgrade and drain the workers one at a time.
- Upgrade the control plane, accepting a few minutes without the API.
- Run
talosctl healthand check that Flux reconciles.
The reminder is a monthly Household Maintenance Task, "Upgrade the cluster", on a "hAPI cluster" Asset. ADR-0014's "Rehearse disaster recovery" Task hangs off the same Asset.
- Take a throwaway local
-
Supply chain in v1: images stay digest-pinned (ADR-0007), admission rule 1 limits where images come from, CI's Trivy scan stays, and
mainhas branch protection in Gitea. Revisit signing once CI has an identity a compromised Gitea can't use. -
Deferred to v2: runtime detection (Tetragon/Falco), in-cluster vulnerability scanning (Trivy Operator), CIS scanning, the Cilium host firewall (the Linode Cloud Firewall already covers nodes), least-privilege kubeconfigs (the Owner keeps Talos's admin kubeconfig, used only over the tailnet), and any CI check of policy coverage. etcd secret encryption needs no decision: Talos enables it by default.