Repository navigation
dns-updater: verify record ownership; give app launches their own role for the TLS key - #1607
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Live check of the self-scope and TLS-key read, using a CLI built from this head: see #1606. From a default-role instance, reading the account's wildcard key returned 403. Not yet run:
Both are production changes and are waiting on owner approval. |
|
Prod prep done 2026-11-12 (owner-approved), ahead of the release that carries this PR. Each change was snapshotted first and diffed afterwards.
After release:
|
|
App TLS live check passed (dev, 2026-11-12), using an integration build with #1603. |
9435180 to
16f0ca7
Compare
…pp launches The DNS updater now checks that the calling instance owns the record it changes or deletes, from an ownership marker held in the zone beside the record (_spore-instance.<fqdn>), written atomically with it and deleted with it by the updater, the TTL reaper's DNS teardown and its lease expiry. The updater enforces by default; DNS_AUTHZ_MODE=audit is the explicit opt-out. spawn app launch now uses its own role, spawn-instance-app, the only spawn role that may read the account's wildcard TLS key; spored-instance-role Denies the read. Spored grant schema 3.
16f0ca7 to
89df24c
Compare
Stacked on #1606 (shares the spored policy schema): this PR's base is
mainso CI runs, and it carries #1606's commit; review the last commit. Merge #1606 first.Summary
dns-updater: verify record ownership. The updater authorized the account but not the record within it. It now records which instance owns each record and checks that owner on every change and delete.
arn:aws:sts::<acct>:assumed-role/<role>/<instance id>of one of spawn's instance roles (spored-instance-role,spawn-instance-*). Those roles trust onlyec2.amazonaws.com._spore-instance.<fqdn>="<instance id>". It is written in the same Route53 batch as the A record, and a first claim usesCREATE, so two instances cannot both claim one name. It is deleted together with the record by the updater, by the TTL reaper's DNS teardown and by its lease expiry.LeaseMaxAge(6h).spawn dns register/deletefrom a workstation) may change only records that no instance owns.DNS_AUTHZ_MODE=auditis the explicit opt-out. Unset, or any other value, enforces. This covers both the account check and the ownership check.Wildcard TLS key.
spawn app launch(web and DCV) now uses its own role,spawn-instance-app. Its inline grants are: the certificate read, limited to the account's own<base36>/prefix; the DCV license; the ECR pull; and the spored binaries.spored-instance-roledrops the read and explicitly deniess3:GetObjectonspawn-certs-*, so older CLIs that rewrite the unversioned policy cannot re-add it. The app role is in thespawn-instance-*family, sopkg/instanceroledeletes it once it is unused. Spored grant schema 3.Deploy checklist impact
spawn-dns-updater(ownership, and the default mode flip) andspawn-ttl-reaper(deletes the owner marker with the record).DNS_ALLOWED_ACCOUNTS.docs/dns-updater-authorization.mdnames one such account, whose four live records are underc0zxr0ao. Otherwise, setDNS_AUTHZ_MODE=auditexplicitly. Merge into the environment, asscripts/deploy-custom-dns.shdoes; do not replace it.spawn-certs-<region>must grants3:GetObjecttorole/spawn-instance-appin each entitled account before a release containing this ships. Otherwise app launches on the new CLI get no TLS certificate. Because the role can be reaped and recreated, name it through a condition onaws:PrincipalArn, not as a role-ARN principal. That bucket is provisioned from the umbrella repo.spored-policy-v3, plus the new role and instance profilespawn-instance-app.Tests
TestAuthorizeOwnershipcovers the rules as a table.TestHandlerRefusesAnotherInstancesRecorddrives the real handler against the Route53 emulator and checks what ends up in the zone.TestCallerInstance,TestAuthzModeDefaultsToEnforceandTestDNSOwnerContractMatchesTheUpdatercheck the parts the updater and the root module share. The reaper's teardown and lease-expiry tests now expect the marker to be deleted.TestOnlyTheAppRoleReadsTheWildcardKeychecks the TLS key access.CREATE-if-absent semantics, so atomicity of a claim is asserted at the change-action level only. Confirm it live.