Skip to content

Commit

Permalink
Migrate to GitHub OIDC based auth for Launchable (#11808)
Browse files Browse the repository at this point in the history
This change updates the CI workflows to use the new GitHub OpenID
connect based authentication flow.

GitHub started to provide a public-key signed token that contain
pull-request data. This is commonly used as a short-lived token in the
authentication flow (Open ID Connect). Launchable recently started
supporting this. Migrate to this new method.

The permission clause added to the jobs is more restrictive than the
default access except for the "id-token: write" permission
(https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token).
This should give the e2e tests enough permissions to run. The id-token
permission is necessary to get the OIDC ID tokens as instructed by the
GitHub article
https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings.

See
https://docs.launchableinc.com/sending-data-to-launchable/migration-to-github-oidc-auth
for the overview and the process.

Signed-off-by: Masaya Suzuki <[email protected]>

Signed-off-by: Masaya Suzuki <[email protected]>
  • Loading branch information
draftcode authored Nov 29, 2022
1 parent bd0a5b8 commit e84bfdb
Show file tree
Hide file tree
Showing 77 changed files with 308 additions and 77 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (12)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (13)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (15)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (18)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (21)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (22)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (ers_prs_newfeatures_heavy)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_mysql80.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (mysql80)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_mysql_server_vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (mysql_server_vault)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_declarative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_declarative)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_declarative) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_ghost)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_ghost) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_revert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revert)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revert) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_revertible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revertible)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revertible) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_scheduler)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_scheduler) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_singleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_singleton)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_singleton) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cluster_endtoend_onlineddl_vrepl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl)
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
EXPERIMENTAL_GITHUB_OIDC_TOKEN_AUTH: 1

jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl) mysql57
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read

steps:
- name: Skip CI
Expand Down
Loading

0 comments on commit e84bfdb

Please sign in to comment.