feat(ops): 2fa review, safer teardown, off-site state copy, cost refresh #830
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
priority
high
priority
low
priority
medium
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!830
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/ops-scripts-2fa-teardown-state-cost"
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?
Closes
access-review-2fa.pytakes--enrolments <csv> --rotated <date>(psql export from the runbook) and flags enrolments older than the rotation and admins with native TOTP and no passkey. Test:scripts/test_access_review_2fa.py, wired into CI.teardown.shdestroys with-targeton everything exceptprevent_destroyresources. Snapshot, backup and volume sweeps all skip items of protected volumes. Protected volumes are matched by ID from the state and by name from the tofu files; any failed lookup keeps the item.--plan-onlypreviews the destroy and every sweep without deleting.--include-data-volumesdestroys in a temp copy withoutprevent_destroyand copies the state back.--self-test(53 checks) added and wired into CI. Header,compute.tofu,outputs.tofu, runbook andopentofu/README.mdcorrected.tofu-apply.shcopies the newest snapshot'sterraform.tfstate*to the rclone destination inTOFU_STATE_OFFSITE_REMOTE.terraform.tfvarsis plaintext and is not copied. Runbook entry added. Self-test extended to 9 checks.cost/README.mdexample now prices the declared estate (1 386 SEK/month). Rates inprices.ymlmatchdocs/bahnhof-vpc.md. Cron line and systemd user timer documented.Operator steps
Prod and staging share the
opentofu/root, state and project.teardown.shacts on all of it. There is no staging-only run.scripts/teardown.sh --self-test(offline).scripts/teardown.sh --plan-only. It is read-only, not offline: it refreshes against the cloud, so it needs OpenStack credentials and the state passphrase. It runstofu plan -destroyover the-targetlist and list-only sweeps. Read both by eye: no protected volume in the plan, every data volume, snapshot and backup under "keeping".--yesor--include-data-volumesuntil a real teardown is intended.TOFU_STATE_OFFSITE_REMOTE, then runscripts/tofu-apply.shagainst prod state and check the object arrives.--enrolments/--rotatedonce. Delete the CSV.