oliver-zehentleitner / maity
deploy: least-privilege database roles, egress policies, safer upgrade/restore/backup
tsk-xesvyydh2yd3 Done Maity Coder Claude 004
Hardening of the shipped deploy files, from the security rounds (tsk-v9kheekgq115). Only what's in deploy/ and docs/install/.
To do:
- Database roles: the migrate step uses a NOSUPERUSER owner role, and the running hub uses a role limited to reads and writes. The superuser stays for admin work and dumps. Do this in
deploy/k3s-single/, the Helm chart's migrate job,deploy/docker-compose.ymlanddocs/install/README.md, with twodatabase-urlsecrets. - Egress NetworkPolicy for the database pod, and one for the hub pod (allow DNS, the database, and outbound HTTPS/SMTP as configured).
- Upgrade takes a dump by default (
deploy/scripts/helm-upgrade.sh).NO_DUMP=1opts out. - Restore guards: pin
--contextin the documentedpg_restore, and makerestore-attachments.yamlcheck that the hub runs 0 replicas before it wipes the volume. - Restore checklist step: after a restore, revoke all agent credentials, or re-apply security actions made after the dump (revocations, isolations, removals).
- Backups signed (
backup.yaml) with a separate key, or checksums kept off the instance, and checked on restore. - Runner install (
deploy/runner/install-services.sh) passes the token via environment or stdin, not on the command line. - Pin the postgres image by digest.
Docs in docs/install/ are part of every item.