Skip to content

Rotate the AWS credentials carried over from the Unicorn org, then prune 11 dead secrets #486

Open

Description

@thinkclay

The repo was transferred out of the Unicorn org on 2026-07-30. Repo transfer carries Actions secrets, so every secret that existed under Unicorn/UNI-Construct is now on Scaffald/SaaS — including credentials that sat in a repo we no longer control.

Rotate first (they left the old org with us):
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, SCAFFALD_AWS_ACCESS_KEY_ID, SCAFFALD_AWS_SECRET_ACCESS_KEY.

Then delete — no workflow or script references them:
NETLIFY_AUTH_TOKEN, NETLIFY_SITE_ID (Netlify is long dead), GOOGLE_SECRET, NPM_TOKEN, SCAFFALD_SDK_SYNC_TOKEN, SCAFFALD_UI_SYNC_TOKEN, EXPO_PUBLIC_MAPBOX_STYLE_URL, and the SCAFFALD_AWS_S3_BUCKET_* / SCAFFALD_AWS_CLOUDFRONT_DISTRIBUTION_ID_* set.

The AWS ones only appear in scripts/deploy-web.sh and scripts/deploy-docs.sh — the retired AWS deploy path. Prod web now ships from EAS Hosting.

Deliberately not done during the migration: secret values are unrecoverable once deleted, so this wants a human confirming each one. 11 unused variables were already pruned (they were plaintext duplicates, including a Google Maps API key).

Acceptance: AWS keys rotated; the listed secrets deleted; deploy-web.yml and eas-ios-build.yml still pass.

Activity

  1. thinkclay commented on Sep 15, 2026

    @thinkclay
    ContributorAuthor

    One thing to know before rotating, found while running a production deploy tonight.

    AWS_KEY / AWS_SECRET in the repo-root .env are live in the prod release path, not just leftovers. scripts/deploy-web-eas.sh prod reads them to invalidate CloudFront E1JU35IZ18YNEL after promoting the build:

    🌐 Invalidating CloudFront E1JU35IZ18YNEL
    I5HUTN0K76Y9SCBWEQ907VEVOC     ← confirmed Completed
    

    The script treats a missing credential as non-fatal — it prints "skipping CloudFront invalidation; the edge cache expires within 60s on its own" and carries on. So rotating without updating .env will not break a deploy, it will just quietly stop invalidating, and releases will take up to the 60s TTL to appear. That is survivable but it is the kind of silent degradation worth not being surprised by.

    So the rotation checklist needs one more line: update AWS_KEY/AWS_SECRET in the local .env of whoever runs prod deploys, alongside whatever GitHub secrets get rotated.

    Still yours to do — I have not touched the credentials. Happy to prepare the prune of the 11 dead secrets separately whenever you want it.

  2. thinkclay commented on Sep 17, 2026

    @thinkclay
    ContributorAuthor

    Decision 2026-09-17: the eleven unreferenced secrets stay. Clay wants them available for CLI commands and diagnostics, so the "prune" half of this issue is withdrawn.

    Checked against every workflow and script on main today: SCAFFALD_AWS_ACCESS_KEY_ID, SCAFFALD_AWS_SECRET_ACCESS_KEY, NETLIFY_*, GOOGLE_SECRET, NPM_TOKEN, SCAFFALD_*_SYNC_TOKEN, EXPO_PUBLIC_MAPBOX_STYLE_URL, and the SCAFFALD_AWS_S3_BUCKET_* / SCAFFALD_AWS_CLOUDFRONT_DISTRIBUTION_ID_* set are referenced by nothing. One correction to the issue text: AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY are not dead. scripts/deploy-web-eas.sh:128 uses them for the CloudFront invalidation after a web deploy, and scripts/deploy-docs.sh for the docs sync.

    What remains is the rotation, and it is a console action: create a new access key for the IAM user in the AWS account that owns CloudFront E1JU35IZ18YNEL, update the two repo secrets (gh secret set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY) and the AWS_KEY / AWS_SECRET lines in .env, run pnpm deploy:web:dev once to prove the invalidation still works, then deactivate the old key. Leaving this open for that step only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highsecurity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions