Linux workers: automated vault.yaml fetch via mTLS - #1253
Conversation
Companion to mozilla-platform-ops/relops-bootstrap. When the operator
stages a step-ca-issued client cert at /etc/relops-bootstrap/{cert,key}.pem
on the worker (via the updated deliver_linux.sh), bootstrap_linux.sh
mTLS-curls forge.relops.mozilla.com/secret/<role> to fetch the role's
vault.yaml and lands it at /root/vault.yaml — replacing the existing
manual operator SCP step.
Backwards-compatible: if no cert is staged, the new function is a no-op
and falls through to the existing "vault.yaml must be hand-dropped" path.
Workers being provisioned today via the old flow continue to work
unchanged.
Architecture (full doc in mozilla-platform-ops/relops-bootstrap):
- Per-role SCEP provisioners on step-ca with x509 templates that
hardcode the role in the cert's SPIFFE URI SAN.
- GCP HTTPS LB does mTLS termination against a Trust Config containing
the step-ca root + intermediate, forwards X-Client-Cert-Leaf to broker.
- Broker (Cloud Run) parses the leaf, URL-decodes the SPIFFE URI from
the SAN, role-binds against the URL path, returns vault-<role> from
Secret Manager.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pairs with the Phase 2 fetch_vault_yaml_via_mtls function in provisioners/linux/bootstrap_linux.sh. When the operator exports RELOPS_BOOTSTRAP_REPO=/path/to/relops-bootstrap, deliver_linux.sh mints a step-ca client cert + key locally via $RELOPS_BOOTSTRAP_REPO/scripts/mint-scep-cert.sh (which uses sscep + a SCEP challenge fetched via gcloud auth), then SCPs the cert + key to /etc/relops-bootstrap/ on the worker. The operator no longer needs a local vault.yaml file — bootstrap_linux.sh fetches it from the broker via mTLS at first run. Backwards-compatible: unset RELOPS_BOOTSTRAP_REPO to keep the legacy flow that requires vault.yaml in the operator's CWD. Workers being provisioned by the existing flow continue to work unchanged. Operator workflow with the new flow: export RELOPS_BOOTSTRAP_REPO=~/git/relops-bootstrap ./deliver_linux.sh worker-01.mdc1.mozops.net gecko_t_linux_2404_talos # (no vault.yaml required in CWD) Prereqs on operator laptop: sscep (brew/apt), gcloud auth against the relops-bootstrap project. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@aerickson would you be up for testing the new Linux Path C flow on a spare Linux test host? Test steps are in the updated PR description above — TL;DR:
The macOS side of this ( Backwards-compat is preserved: don't set |
|
The diff is cleanly backward-compatible, but the new Linux path introduces a custom cert/broker dependency for what used to be a direct
I’ll test it out. |
Replaces the operator's manual
vault.yamlSCP step with a step-ca-issued client cert + mTLS fetch from a brokered Secret Manager. Companion to mozilla-platform-ops/relops-bootstrap.Same mechanism as the macOS Path C work that landed on m4-81 last week — adapted for Linux (no MDM equivalent, so cert minting moves to the operator's laptop instead of via SimpleMDM SCEP profile).
What changes
provisioners/linux/bootstrap_linux.sh(worker-side)Adds a
fetch_vault_yaml_via_mtlsfunction that:/etc/relops-bootstrap/{cert,key}.pemcurl --cert ... --key ...tohttps://forge.relops.mozilla.com/secret/<role>/root/vault.yamlIf the cert isn't staged, the function is a no-op and falls through to the existing "vault.yaml must be hand-dropped" check. Existing workers being provisioned today via the legacy flow continue to work unchanged.
provisioners/linux/deliver_linux.sh(operator-side)Adds opt-in mTLS path gated on
RELOPS_BOOTSTRAP_REPOenv var:$RELOPS_BOOTSTRAP_REPO/scripts/mint-scep-cert.shto mint a fresh cert+key for the target host+role via SCEP against step-ca (using the operator's gcloud auth as the gate on the SCEP challenge)/etc/relops-bootstrap/on the worker (root:root 0600)vault.yamlfileWhen
RELOPS_BOOTSTRAP_REPOis unset, the original flow is preserved.Architecture
Full design doc in mozilla-platform-ops/relops-bootstrap. Quick version:
scep-gecko-t-linux-2404-talos, etc.). Each provisioner's x509 template hardcodes the puppet role into the cert's SPIFFE URI SAN (spiffe://relops.mozilla/host/<CN>/role/<role>).forge.relops.mozilla.comdoes mTLS termination against a Trust Config containing the step-ca root + intermediate, forwardsX-Client-Cert-Leaf(+ presence/chain-verified flags) to the broker.vault-<role>from Secret Manager. Per-cert-serial rate limit + Cloud Audit logging.Testing — @aerickson would you mind taking this for a spin?
Validated end-to-end on macOS hardware already (m4-81 post-EACS). The Linux side hasn't been tested against a real worker yet. Want a second pair of eyes + a real-host run before we merge.
Steps:
What you should see:
deliver_linux.shmints a cert via sscep and SCPs it to/etc/relops-bootstrap/{cert,key}.pemon the workerbootstrap_linux.shrunsfetch_vault_yaml_via_mtlsfirst, finds the cert, curls tohttps://forge.relops.mozilla.com/secret/gecko_t_linux_2404_talos, gets HTTP 200 with the vault.yaml content/root/vault.yamland the rest of the bootstrap proceeds normallyAvailable Linux roles (per-role step-ca SCEP provisioners are already set up):
gecko_t_linux_talosgecko_t_linux_2204_talosgecko_t_linux_2404_talosgecko_t_linux_2404_talos_waylandgecko_t_linux_netperfgecko_t_linux_2404_netperf(Each role's
vault-<role>secret in Secret Manager needs to be populated once before the first worker of that role can fetch — step 3 above. Currently all 6 secret containers exist but have no version data yet.)If anything goes wrong, the diagnostic trail is:
bootstrap_linux.shoutput: wherever you pointed-l(or stdout if interactive)mint-scep-cert.sherrors print to stderr on your laptopgcloud logging read 'resource.type=cloud_run_revision AND resource.labels.service_name=vault-broker' --project relops-bootstrap --freshness 5m