Skip to Content
PlatformMaintainAccessNon human

Set up keyless authentication with GitHub

To configure keyless authentication to Mondoo using GitHub as your WIF provider, you use a GitHub Actions workflow in a GitHub repository. Choose an existing repository in your GitHub organization or create a new one just for this purpose.

Prerequisites

  • Sufficient privileges in your GitHub repository to create and manage GitHub Actions workflows

  • Editor or Owner privileges in the Mondoo space, organization, or platform to which your workload needs access

Step A: Create a workload identity provider in Mondoo

  1. In the Mondoo App, navigate to the space or organization in which you want to set up keyless access for non-human users.

  2. In the left navigation, select Settings, then Workload Identity.

    The Workload Identity settings page in the Mondoo App, listing workload identity providers with their expiration, created, and last used times

  3. Select ADD PROVIDER, then select GitHub.

  4. In the Issuer URL box, keep the default https://token.actions.githubusercontent.com.

  5. In the Subject box, enter the organization and repository where you plan to create your GitHub Actions workflow.

  6. In the Expiration time list, choose how long sessions authenticated with this WIF provider last: 30, 45, or 60 minutes.

  7. In the Name and Description boxes, provide a short name and longer description that help you and your teammates recognize the source and purpose of the workload identity provider.

  8. In the Roles list, check the roles the workload needs. Agent is selected by default. To learn what each role allows, read What roles can you assign?.

  9. Select ADD PROVIDER.

    The Add GitHub workload identity provider form in the Mondoo App, with issuer URL, subject, expiration time, name, description, and roles

    Mondoo generates and displays the configuration values that you need to give your workload access. Copy them, then select Finalize setup.

Step B: Create a GitHub Actions workflow

Create a GitHub Actions workflow in the repository you chose.

Set the id-token value to write.

Write the configuration values from Step A into a file, for example config.json.

Configure the workflow to run these commands:

export MONDOO_CONFIG_PATH=/path/to/config.json
cnspec status
if [ $(echo $?) != 0 ]; then echo "failed to reach mondoo"; exit 1; fi
# run the scan
cnspec scan
For...Substitute...
AUDIENCEThe audience value Mondoo provided when you followed the instructions in Step A above
ISSUERThe issuer value Mondoo provided when you followed the instructions in Step A above

On this page