fix: bound log retention to 7 days and cover every table in user erasure #532
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!532
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/log-retention-and-erasure"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
base: journald getsMaxRetentionSec=7dayandMaxFileSec=1dayon both hosts (variablesbase_journal_max_retention,base_journal_max_file_sec).monitoring: no config change needed beyond 1. The Caddy comment was wrong and is fixed.auth/git/www/grafana/stats/ntfy.gitborg.senames in commands, URLs and the Grafana admin group SPN (grafana_admins@auth.bitborg.se, matcheskanidm_domainandgrafana_admin_group) now usebitborg.se. Switchover history, redirect descriptions, past measurements and example email addresses are left as written.auth.bitborg.se.Why
The privacy policy says logs are kept at most 7 days. journald had a 500 MB cap and no time limit.
MaxFileSec=1dayis needed because journald only vacuums archived files and rotates monthly by default, soMaxRetentionSecalone would not bite.Findings
/var/log/caddy/access.logwithroll_size 20MiB,roll_keep 5,roll_keep_for 168h. Already set, no change. Loki retention is 168h already.roll_size). Needs the actual file age on prod to judge.email_change_requests(holds the new address, keyed by Kanidmsub) is now deleted. Step 1 reads thesubbefore the Kanidm delete. Kept on purpose:checkout_consents,withdrawal_requests(subonly, no name or email) and the billing database (accounting, 7 years).Check-mode output (
--check --diff --tags base, hosts bitborg-prod and bitborg-monitoring)Recap: bitborg-prod ok=29 changed=2, bitborg-monitoring ok=27 changed=2 (the drop-in and the
Restart journaldhandler).--tags monitoringon bitborg-monitoring: the Caddyfile comment change renders (1 task changed) and the Caddy front-door restart handler fires. Comment only, no behaviour change.Apply (operator)
Then
journalctl --disk-usageandjournalctl --header | grep -i "head realtime"after a day to confirm rotation.Tested
ansible-lint: 0 failures, 0 warnings, 57 files.pnpm format:check,pnpm mdlint: clean. Pre-commit hooks passed on all three commits.Open questions
checkout_consentsandwithdrawal_requestsis my reading (consumer-law evidence, accounting trail). Confirm.auth.gitborg.sementions remain elsewhere in the runbook (bootstrap, Kanidm and monitoring sections). Out of scope here.Visa kommandoradsinstruktioner
Checka ut
Checka ut en ny gren från din projektkatalog och testa ändringarna.