Skip to content

chore(infra): migrate AWS auth to OIDC, add CODEOWNERS, SHA-pin actions #42

@mikanmarusan

Description

@mikanmarusan

Goal

Tighten the deploy supply chain. Three related hardening items surfaced during the WebACL fix (PR #39) review but were intentionally out of scope.

Items

1. Migrate AWS auth from long-lived keys to GitHub OIDC

Currently `.github/workflows/deploy-production.yml` uses `secrets.AWS_ACCESS_KEY_ID_PROD` / `secrets.AWS_SECRET_ACCESS_KEY_PROD`. These are long-lived IAM access keys with broad blast radius if leaked.

Replace with OIDC role assumption:

  1. Create an IAM Role `gh-actions-deploy-prod` with a trust policy scoped to `repo:mikanmarusan/lambda-function-transit:environment:production`.
  2. Replace `aws-actions/configure-aws-credentials@v4` inputs with `role-to-assume` instead of access keys.
  3. Delete the old IAM user / access keys.

2. Add `.github/CODEOWNERS`

No CODEOWNERS file exists today. Add one covering at minimum:
```
template.yml @mikanmarusan
samconfig.toml @mikanmarusan
.github/workflows/ @mikanmarusan
CLAUDE.md @mikanmarusan
```
Then enable branch protection on `main` requiring code-owner review for those paths.

3. SHA-pin third-party Actions

Currently `deploy-production.yml` and `ci.yml` reference Actions by major-version tag (`actions/checkout@v4`, `aws-actions/setup-sam@v2`, etc.). Tag refs can be hijacked. Replace with full SHAs:

```

  • uses: actions/checkout@ # v4.x.x
    ```

Use pin-github-action or Dependabot's GitHub Actions ecosystem to keep them current.

Acceptance

Each item can ship as its own PR, but ideally bundled if scope is small.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions