Adding a Protected Octelium Resource-Store Backup Unit with Conditional PUTs
This push introduces a dedicated Octelium resource-store backup unit that uses a protected GitHub OIDC role and conditional PUTs to safely publish fresh backups, preventing accidental overwrites and ensuring versioned integrity.
Protected Backup Unit and Conditional PUTs
The new octelium-rscstore-backup operator unit declares a dedicated GitHub OIDC role and a matching permissions boundary. Deployments are gated to the main branch via the github-iac environment, and the octelium-rscstore-backup workflow checks that the run still targets the reviewed main revision. The application-backup.py publisher was extended with a create_only flag that uses conditional PUTs, verifies the returned version, and only proceeds when the object does not already exist, eliminating the risk of overwriting live state.
Backup Workflow Script
scripts/ci/octelium-rscstore-backup.sh defines five phases—init, authorize, cluster, publish, and cleanup—and enforces strict security checks, including verification that the run is a workflow_dispatch on Stuhlmuller/homelab main, the correct run ID and attempt, and the expected SHA. The script creates an isolated workspace, runs Terragrunt to validate the IaC, and proceeds to the backup steps only when all preconditions are satisfied, providing a reliable, auditable path for protected resource-store backups.
Verification and Guardrails
Static and offline checks were updated to include the new backup unit: static-checks.sh adds octelium-rscstore-backup to the offline guard, offline-checks.sh now validates the backup SHA and Terragrunt plan, and test files (application-backup-test.py, static-cache-test.py) assert that conditional PUTs are used and that the correct version IDs are referenced. The release_guard function in octelium-rscstore-capture.py ensures that protected backup actions run only under the exact main workflow dispatch, adding a runtime safeguard against unintended executions.
Documentation and Platform Transfer
Documentation in docs/operator-infrastructure.md and openwiki/architecture/storage-and-state.md was revised to describe the new backup unit, its OIDC role, and the conditional write workflow, removing outdated terminology. The pattern of a dedicated OIDC role, environment gating, and conditional PUTs transfers to any platform team that needs to protect stateful services, ensuring that backup operations remain auditable, versioned, and safe from accidental overwrites in a GitOps pipeline.