PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Request an unprivileged container
- 1.1 In
agent/verification/internal/features/container/postgres_test.goanddockerengine_test.go, change the hardening assertions to the new request: the spec and the engine config start aspostgres, drop all capabilities, add none (CapAddempty) and carry no security options (SecurityOptempty). Runjust testinagent/verificationand see these tests fail on the current code for those reasons. - 1.2 In
agent/verification/internal/features/container/dockerengine.go, move the construction of the exec request indockerEngine.Execinto a pure function, astoContainerConfigsdoes for the container request, and add a test indockerengine_test.gothat asserts the request carries the command, the environment and the stdin attachment and names no user, so the agent's commands run as the container's user. Verify withjust testinagent/verification. - 1.3 Delete
NoNewPrivilegesandCapAddfromSpawnSpec,minimalCapsfrommanager.go, and their use inManager.buildSpecandtoContainerConfigs, keepingCapDropAllandUser. Rewrite the comments oncontainerUser, onbuildSpec's hardening and onCreateNetworkso they name the controls that remain and say why the container starts aspostgres(the AppArmor signal denial under no-new-privileges, per design.md). Verify thatjust testandjust lintinagent/verificationpass and thatgrep -rn "minimalCaps\|NoNewPrivileges\|no-new-priv" agent/verification --include=*.gofinds nothing.
2. Check the applied privileges end to end
- 2.1 In
agent/verification/e2e/scripts/test-container-privileges.sh, require the firstUidfield of/proc/1/statusto be non-zero andCapBndto be0000000000000000, drop theNoNewPrivscheck, and update the header comment and the failure and success messages, which no longer mention no-new-privileges. Verify thatjust e2einagent/verificationreports every test passed, and thatE2E_ENGINE_SOCKET=$XDG_RUNTIME_DIR/podman/podman.sock just e2e-podmandoes too.
3. Confirm the fix on rootful Podman in CI
- 3.1 Commit the work so far and push the branch
fix/podman-port-diagnostics, which runs onlyDebug Podman e2e. The user approved this commit and push for this task: the failure reproduces only on rootful Podman with AppArmor, and the user asked for the CI check inside the tasks (design.md, "Verify on CI as part of the tasks"). Then wait for the run withgh run watch <run-id> --exit-status. The stepRun e2e tests on Podmanmust reportResults: 3 passed, 0 failed. If it fails, read the run's log withgh run view <run-id> --log, fix the cause in groups 1 and 2, and repeat this task.
4. Remove the temporary diagnostics and restore CI
- 4.1 Delete
agent/verification/e2e/diagnose-podman-ports.shand.github/workflows/debug-podman.yml, remove the stepDiagnose Podman port publishingfrome2e-verification-agent-podman, and restore the push trigger of.github/workflows/ci-release.ymltobranches: ["**"]without the temporary comment. Verify thatgit diff origin/develop -- .github/workflows/ci-release.ymlprints nothing, thatactionlint .github/workflows/ci-release.ymlreports no findings, and thatgrep -rn "diagnose-podman-ports\|debug-podman\|podman-port-diagnostics" . --exclude-dir=.git --exclude-dir=openspecfinds nothing. - 4.2 Commit the cleanup and push the branch, which now runs the full
CI and Releaseworkflow; the user approved this commit and push for the same reason as in 3.1. Wait for the run withgh run watch <run-id> --exit-status. Every job that runs on a branch push must pass,e2e-verification-agentande2e-verification-agent-podmanincluded.
5. Hand over the open section of run-verification-on-podman
- 5.1 In
openspec/changes/run-verification-on-podman/tasks.md, replace the open tasks 6.3 and 6.4 with one line saying thatstart-restore-containers-unprivilegedfixes the cause and removes the diagnostics, so that change has no open task. In itsdesign.md, update the risk entry about the red Podman job and the paragraph on the temporary diagnostic step the same way. Verify thatopenspec validate run-verification-on-podman --strictpasses and thatopenspec listshows all of its tasks complete.
6. Final checks
- 6.1 Run
just lintat the repository root and fix every finding. Verify thatgrep -rn 'NoNewPrivileges\|NoNewPrivs\|"no-new-privileges"' agent/verification --exclude-dir=artifactsfinds nothing, so neither the code, the unit tests nor the end-to-end test still sets or checks the flag, and thatopenspec validate start-restore-containers-unprivileged --strictpasses.
Change verification
just --justfile agent/verification/Justfile test