Repository navigation
Description
Found by running the script (#859). I introduced the resource and removed it again within minutes; filing because the script will recreate it for the next person.
What Step 5/6 does
scripts/deploy-custom-dns.sh creates a REST API and wires it to the Lambda:
Step 5: Creating API Gateway...
Step 6: Deploying API to production...
API deployed to: https://<id>.execute-api.us-east-1.amazonaws.com/prod/update-dns
Measured on the resource it created in 966362334030 before I deleted it:
name: spawn-dns-api created: 2026-10-12T16:33:01Z
POST /update-dns -> authorizationType: NONE, apiKeyRequired: false, authorizerId: null
It also adds a statement to the function's resource policy:
{ "Sid": "apigateway-invoke",
"Principal": {"Service": "apigateway.amazonaws.com"},
"Action": "lambda:InvokeFunction",
"Condition": {"ArnLike": {"AWS:SourceArn": "arn:aws:execute-api:us-east-1:966362334030:<id>/*/*"}} }So the script produces a public, unauthenticated HTTP endpoint that invokes the DNS updater — immediately after the same deploy configures the Function URL for AuthType: AWS_IAM.
It is also dead on arrival
A POST to it returns 502, not a handler response:
HTTP 502 {"message": "Internal server error"}
Because the handler signature is a Function URL one — handler(ctx, events.LambdaFunctionURLRequest) (events.LambdaFunctionURLResponse, error) — and API Gateway REST sends APIGatewayProxyRequest and expects a matching response shape. The integration cannot work.
The zone was unaffected (17 records before and after the probe), so it never wrote DNS. But it does invoke a billable function, and it is one handler-signature change away from being a live unauthenticated DNS-write path. The handler's defensive missing IAM authorizer → 403 check would catch a well-formed unauthenticated request; nothing catches the 502 path except incompatibility.
Why it exists
Step 5/6 predates #173. The updater used to be reached through API Gateway; #173 moved it to a Function URL with AuthType: AWS_IAM and rewrote the handler for the Function URL event type. The script's API Gateway section was never removed, so it now builds infrastructure for an architecture the function no longer has.
Nothing consumes it. Both /spawn/dns/domain and /spawn/dns/api_endpoint are absent from SSM — the script only prints them as manual next steps — and spored uses the Function URL. The script's closing instructions still tell the operator to publish the API Gateway URL for "auto-discovery", which would point clients at the broken path.
Fix
- Delete Steps 5 and 6, the
apigateway-invokepermission, and the "Next Steps" text that tells the operator to publish the API endpoint to SSM. - Keep the Function URL as the only invocation path, and have the script print that URL.
- Gate it: no deploy script may create an API Gateway method with
authorizationType: NONE. That is mechanical to check inscripts/deploy_scripts_test.go— the script contains the literal--authorization-type NONE(or omits the flag, which defaults to NONE), so the gate should require an explicit non-NONE value whereveraws apigateway put-methodappears.
This is the fifth thing in this audit found by running something rather than reading it — alongside the reaper's stale VERSION (#869), the dangling mycelium-development CNAMEs, the empty spore-portal-accounts, and handler.py's superseded auth model. Step 5/6 had been read during #858 and judged out of scope; only executing it surfaced this.
Activity