Your User, especially WORKLOAD
User used by non-human entities such as GitHub Action workflows, can access HTTP-based Services (e.g. HTTP/gRPC APIs, Kubernetes clusters) through the client-less BeyondCorp mode via OAuth2 client credentials (read more here) and directly issued access tokens used in bearer authentication (read more here). However, in many cases, you might want to access non-HTTP Services, such as databases, from within your GitHub Action workflows. Octelium enables you to connect to your Cluster and access any arbitrary Service from within your workflows via the official octelium/github-action
GitHub Action. Here is an example of GitHub Action workflow:
1name: main2permissions:3contents: read4on:5push:6branches:7- master8- main9jobs:10do-main:11runs-on: ubuntu-24.0412steps:13- name: Check out code14uses: actions/checkout@v41516- name: Octelium17uses: octelium/github-action@master18with:19domain: <DOMAIN>20auth-token: ${{ secrets.OCTELIUM_AUTH_TOKEN }}2122- name: Access your Octelium Services23run: |24curl http://demo-nginx
As you can see, the authentication token (read more about issuing authentication tokens here) is stored in as a GitHub repository secret with the name OCTELIUM_AUTH_TOKEN
.
You can also authenticate to your Octelium Cluster in a "secret-less" way using GitHub's own OIDC issued identity token assertions (read more here). To do so, we first need to create an oidcIdentityToken
IdentityProvider as follows:
1kind: IdentityProvider2metadata:3name: github-actions4spec:5oidcIdentityToken:6issuerURL: https://token.actions.githubusercontent.com
Now your User can set an identifier for the github-actions
IdentityProvider as follows:
1kind: User2metadata:3name: github-action-workflows4spec:5type: WORKLOAD6authentication:7identities:8- identityProvider: github-actions9identifier: repo:<ORG_NAME>/<REPO_NAME>:ref:refs/heads/<BRANCH_NAME>10authorization:11policies: ["policy-1", "policy-2"]
Your GitHub Action need to add the permission id-token: write
to generate an OIDC identity token. Your action should now look as follows:
1name: main2permissions:3contents: read4id-token: write5on:6push:7branches:8- master9- main10jobs:11do-main:12runs-on: ubuntu-24.0413steps:14- name: Check out code15uses: actions/checkout@v41617- name: Octelium18uses: octelium/github-action@master19with:20domain: <DOMAIN>21assertion-idp: github-actions2223- name: Access your Octelium Services24run: |25curl http://demo-nginx