fix(firecracker): persist the gateway mitmproxy CA across rebuilds #511
Closed
didericis-claude
wants to merge 1 commits from
fix/firecracker-gateway-ca-persist-510 into main
pull from: fix/firecracker-gateway-ca-persist-510
merge into: didericis:main
didericis:main
didericis:feat/pinned-infra-artifacts
didericis:fix/fc-agent-build-context
didericis:prd-0081-reconcile-1-ca
didericis:production
didericis:staging
didericis:prd-gateway-reprovision-on-bringup
didericis:prd-forge-subroles
didericis:fix/shared-storage-permissions
didericis:fix/authoritative-cleanup-identities
didericis:fix/bounded-heavy-operations
didericis:fix/cleanup-execution-integrity
didericis:fix/gateway-output-pump-shutdown
didericis:fix/gateway-request-boundaries
didericis:fix/authoritative-cleanup-revalidation
didericis:refactor/egress-policy-pipeline
didericis:refactor/orchestrator-fastapi
didericis:refactor/supervisor-mcp-dispatch
didericis:chore/misc-quality-cleanup
didericis:host-control-server-2-secret
didericis:host-control-server-3-list-live
didericis:host-control-server-1-transport
didericis:prd-new-host-control-server
didericis:fix/gitgate-persist-512
didericis:didericis/disable-agit-refs
didericis:didericis/prd-audit-event-schema
didericis:fix/pr-495-audit-contract
didericis:prd-egress-control-plane
didericis:prd-macos-container-ci-runner
didericis:refactor/control-plane-auth-provisioning-476
didericis:fix/db-off-data-plane-469
didericis:feat/encrypted-egress-secrets
didericis:spike/rootless-docker-macos
didericis:fix/ci-coverage-artifact-paths
didericis:claude-forward-host-credentials-rebased
didericis:fix-gateway-gitleaks-arch
didericis:fix/websocket-response-dlp-multitenant
didericis:orchestrator-agent-compose
didericis:orchestrator-gateway-ca
didericis:orchestrator-consolidated-launch
didericis:orchestrator-gateway-provision
didericis:orchestrator-gateway-network
didericis:orchestrator-client
didericis:orchestrator-gateway-net
didericis:orchestrator-gitgate-provision
didericis:orchestrator-registration
didericis:orchestrator-lifecycle
didericis:orchestrator-supervise-writers
didericis:orchestrator-supervise-multitenant
didericis:orchestrator-gitgate-multitenant
didericis:orchestrator-rename-gateway
didericis:orchestrator-slice8
didericis:orchestrator-slice7
didericis:orchestrator-slice6
didericis:prd-orchestrator
didericis:orchestrator-slice5
didericis:orchestrator-slice4
didericis:orchestrator-slice3
didericis:orchestrator-slice2
didericis:firecracker-backend
didericis:forge-native-integration
didericis:prd-smolmachines-linux
didericis:manifest-break-import-cycle
didericis:dlp-supervise-quality-fixes
didericis:table-drive-dlp-tests
didericis:fix-integration-test-failures
didericis:fix/macos-container-relative-dockerfile
didericis:prd-0054-install-script
didericis:commit-bottle-state
didericis:pr-211
didericis:move-codex-auth-to-contrib
didericis:feat/pipelock-skip-scan-extensions
didericis:prd-0049-named-labelled-agents
didericis:harden-git-gate-shell-rendering
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Status/Needs Triage
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Awaiting initial classification
No Label
Milestone
No items
No Milestone
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: didericis/bot-bottle#511
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/firecracker-gateway-ca-persist-510"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Rebuilding/restarting the Firecracker gateway minted a fresh mitmproxy CA, breaking every already-running bottle with
SSL certificate verification failedon egress. The #450 CA-persistence fix existed only for the docker backend (host_gateway_ca_dir()bind-mount); the firecracker gateway had no equivalent, so its CA lived only in the ephemeral per-boot rootfs.Fix
Give the gateway VM a persistent CA volume, mirroring the orchestrator's registry volume:
gateway.py: boot with a small ext4data_drivevia new_ensure_ca_volume()(creates on first use, reuses after).infra_vm.py: the gateway guest init mounts/dev/vdbat mitmproxy's confdir (/home/mitmproxy/.mitmproxy) before the data plane starts, so mitmproxy reuses the on-disk CA rather than regenerating it.Tests
TestGatewayCaVolume(create/reuse) mirroring the orchestrator's registry-volume tests.test_boots_the_gateway_vm_and_seeds_the_tokento assert the CA volume rides asdata_drive.test_gateway_init_starts_only_the_data_planeto assert the/dev/vdbmount lands beforebot_bottle.gateway.bootstrap.Operational caveat
The first gateway restart after this lands still mints one final CA (into the new, initially-empty volume); it persists from then on. To skip that one-time break, seed the volume with the current gateway's CA material before restarting.
Closes #510
🤖 Generated with Claude Code
Superseded by the reprovision-on-gateway-bring-up strategy (PRD 0081, forthcoming PR). Rather than persist gateway-side state on a volume, the gateway reconciles all running bottles when it comes up — replacing each running agent's CA with the current gateway CA and re-provisioning each bottle's git-gate — giving one unified reprovision flow across CA / git-gate / egress tokens and free CA rotation on each restart. Closing in favor of that single PR.
Pull request closed