Secure GitHub with Mondoo
Continuously scan GitHub organizations and repositories for misconfigurations and vulnerabilities.
To connect GitHub to Mondoo, you create a GitHub personal access token and add it to a GitHub integration in your space. You can scan a whole organization or individual repositories, and Mondoo keeps the assessment current as repositories change.
To scan Kubernetes manifests, Terraform configurations, or Docker containers inside a GitHub Actions workflow, read Scan in GitHub Actions instead.
Before you begin
- Editor or Owner access to the Mondoo space, or another role with permission to add integrations. To see every role, read Roles and permissions.
- Access to a GitHub organization or repository
Choose how to connect
You can connect GitHub in two ways:
- Mondoo GitHub App (organization level): Install the read-only Mondoo GitHub App and pick the repositories to scan on GitHub. There's no token to create or rotate. Because the app's read access is organization wide, you add it to the Mondoo organization rather than to a space, and choose the space that receives the discovered repositories. The GitHub App works on github.com only, not GitHub Enterprise Server. To learn more, read Install the Mondoo GitHub App.
- Personal access token (space level): Create a token and add the integration to a space, as described in the rest of this page.
Create a GitHub personal access token
A personal access token gives Mondoo permission to read GitHub resources on your behalf.
-
Log into GitHub. Verify your email if you haven't already.
-
Select your profile photo in the top-right corner, then Settings.
-
In the left sidebar, select Developer settings, then Personal access tokens > Tokens (classic).
-
Select Generate new token > Generate new token (classic).
-
Under Note, describe the token's purpose (for example,
Mondoo security scan access). -
Set an Expiration.
-
Under Select scopes, check:
public_reporead:orgread:repo_hookadmin:org_hookread:project
To scan private repositories, select the entire repo scope instead of only public_repo. The full repo scope is also required for checks that read a repository's Actions workflows (for example, verifying that a vulnerability scanner such as Dependabot, CodeQL, or Trivy runs in CI). Without it, GitHub returns a 404 for the workflows endpoint and those checks fail as if no scanning workflow were configured.
-
Select Generate token and copy the value. You need it in the next section.
Add a GitHub integration
In the Mondoo App, navigate to the space where you want to add the integration. Some integrations can also be added once at the organization level to cover every space with one connection. To see which ones, read Set up integrations once for your whole organization.
In the space's side navigation bar, select Integrations. In the top right, select INSTALL. On the Install Integration page, find the integration you want by browsing a category or searching by name:
-
Under SaaS Security, select GitHub.

If you can add integrations at the organization level, the form opens with a pointer to the Mondoo GitHub App. The app is installed from an organization GitHub integration, not from a space, because its read access covers the whole GitHub organization. A space GitHub integration always authenticates with a personal access token. To use the app instead of a token, select Add an organization GitHub integration and follow Install the Mondoo GitHub App.
-
Under Integration Type, choose what to scan:
- Scan a GitHub organization. In Organization, enter the organization name.
- Scan a personal account. In Account, enter the login of the personal GitHub account.
- Scan a single repository. Enter the Owner and Repository names from the repo's URL. For example, if the URL is
github.com/Lunalectric/frontend, the owner isLunalectricand the repo isfrontend.
-
Paste your personal access token into Personal Access Token.
-
(Optional) In Integration Name, enter a name that identifies the GitHub organization, account, or repository. If you leave it empty, Mondoo uses the name of the organization or repository you scan.
-
(Optional) For GitHub Enterprise Server, enter your server's URL (for example,
https://github.lunalectric.com) in GitHub Enterprise Server URL. Leave it empty for github.com. -
Under Discovery and scan options, turn on what you want Mondoo to scan inside the repositories:
- Static code analysis (on by default): analyze repository source code for security issues (SAST).
- Secrets detection (on by default): detect committed credentials and other secrets.
- Dependency vulnerability scanning (on by default): scan repository dependencies for known vulnerabilities (SCA).
- Discover Terraform files: scan Terraform configuration files in the repositories.
- Discover Kubernetes manifests: scan Kubernetes manifest files in the repositories.

-
(Optional) Under Enable security policies (optional), enable the policies you want Mondoo to score your GitHub assets against.
-
(Optional) Under Set Annotations (optional), select + ADD ANNOTATION to add key-value pairs that Mondoo applies to every asset this integration discovers. To learn more, read Annotate assets.
-
Select START SCANNING.
Mondoo scores this integration against the policies you enable under Enable security policies (optional) in the setup form. You can enable or disable policies at any time. To learn how policies work, read Manage Policies.
Install the Mondoo GitHub App
The Mondoo GitHub App is added at the organization level and needs permission to add integrations to the Mondoo organization.
-
Open the organization-level GitHub form. From a space's GitHub integration form, select Add an organization GitHub integration in the notice at the top.
-
Under Authentication, select GitHub App (recommended). To use a token at the organization level instead, select Personal Access Token and, under Scope and credentials, enter what to scan and the token.
-
(Optional) Under Integration Name (optional), enter a name. If you leave it empty, Mondoo uses the name of the organization or repository you scan.
-
Under Asset routing, select the space that receives this integration's assets. Mondoo creates a default routing rule that sends the assets there.
-
Under Discovery and scan options, turn on what you want Mondoo to scan inside the repositories.
-
Select CONTINUE TO GITHUB (or START SCANNING for a token). On GitHub, install the Mondoo GitHub App on your GitHub organization and choose the repositories it can read.
GitHub returns you to Mondoo, which shows the same setup page as the space flow while it confirms the installation, discovers the repositories, and starts the first scan. To revoke Mondoo's access, uninstall the app from your GitHub organization.
Change which repositories the app can read
You manage the app's repository access on GitHub, not in Mondoo. In your GitHub organization's Settings > GitHub Apps, select Configure next to the Mondoo GitHub App and update its repository access. Mondoo picks up the new selection on its next scan, so you don't need to change anything in Mondoo.
Finish a pending installation
If you open the integration before the app is installed, Mondoo shows that setup isn't finished and offers an Install GitHub App button. Select it to open GitHub and complete the installation.
The install button only works for a GitHub organization that doesn't have the Mondoo GitHub App installed yet. If the app is already installed there, for example for another integration, GitHub can't run the install flow again. Uninstall the app in your GitHub organization's Settings > GitHub Apps, then select Install GitHub App again to connect it to this integration.
Verify the integration
When you select START SCANNING, Mondoo opens a setup page that checks the token with GitHub (Verify access), discovers the repositories the integration can see (Sync repositories), and starts the first scan (Trigger scan). When setup completes, select Open the integration. On the integration's page, Status shows Active once the scan is queued, and Most Recent Activity lists each scan and any errors it reports.

Integrations that scan an organization or a personal account also have these tabs:
- Repositories lists the repositories Mondoo discovered.
- Diagnose runs the Scan readiness check, which confirms that an enabled policy covers each kind of asset the integration scans. A failed check explains why scans produce no findings.
Organization integrations that authenticate through the Mondoo GitHub App also have a Remediation tab, where you set up repositories for remediation pull requests. To learn more, read Fix Findings with Remediation Pull Requests.
To review the assets, navigate to the space and select Inventory. To learn what each integration status means, read Integration status and troubleshooting.
Troubleshoot
| Message | Cause | Fix |
|---|---|---|
| GitHub rejected the credential. Check it and try again. when you create the integration | GitHub refused the token: it was mistyped, revoked, or expired. | Generate a new token and try again. |
| GitHub rejected the integration's credentials. Update the token, then run the repository sync again. during setup | GitHub refused the token after the integration was created. | Select Edit credentials, enter a new token, then select Retry sync. |
invalid github token or 401 in Most Recent Activity | The token expired or was revoked after the integration was created. | Generate a new token and rotate it in Mondoo. |
| Scans are paused at the top of the integration page | The integration's token was rejected by GitHub or has expired. | Generate a new token and rotate it in Mondoo. |
| Private repositories aren't scanned, or checks for a vulnerability scanner in CI fail | The token has only the public_repo scope. Without the full repo scope, GitHub returns a 404 for the workflows endpoint. | Generate a token with the full repo scope, as described in Create a GitHub personal access token, and rotate it. |
doesn't support any policies in Most Recent Activity | No enabled policy covers that kind of asset. | Open the Diagnose tab to see which asset kinds lack a policy, then enable one. Read Manage Policies. |
| Waiting for the GitHub App installation to be completed in Most Recent Activity | The integration connects through the Mondoo GitHub App, and the app installation hasn't finished. | Finish installing the app in GitHub. Read Waiting for setup. |
Manage your integration
To open the integration, navigate to the space, select Integrations > GitHub, and choose the integration. To change its settings, select the pencil icon.
Limit which repositories are scanned
An integration that scans an organization or a personal account can skip repositories, or scan only the ones you name. The add form doesn't have these settings, so set them after you create the integration:
-
Open the integration and select the pencil icon.
-
Under Repository filters (optional), enter repositories one per line, in the form
owner/repository. Case doesn't matter.- Allow list: Mondoo scans only the repositories on this list.
- Deny list: Mondoo doesn't scan the repositories on this list, even ones that are also on the allow list.
-
Select SAVE CHANGES.
Mondoo applies the lists only to repositories it finds for the first time after you save. Repositories already on the Repositories tab keep their current setting. To turn scanning on or off for one of those, open the Repositories tab, select the repository's status (Enabled or Disabled), and choose Enable scanning or Disable scanning.
To scan only some repositories with the cnspec CLI instead, read Scan specific repos in an organization.
Rotate the token
How you replace the token depends on how Mondoo stored it when the integration was created. Integrations added by someone with permission to create and view credentials store the token as a credential. Older integrations, and integrations added by someone without that permission, keep the token on the integration.
-
If the integration uses a credential: The integration detail page shows a Credential section, and the edit form shows Managed by a credential in place of the token box. Select the credential's name to open it, then select Rotate and enter the new token. Every integration that uses the credential switches to the new token. To learn more, read Manage Integration Credentials.

-
If the integration stores its own token: Select the pencil icon. In Personal access token (optional update), enter the new token, then select SAVE CHANGES. Leave the box empty to keep the existing token.
-
If the integration authenticates through the Mondoo GitHub App: There's no token to rotate. To revoke Mondoo's access, uninstall the app from your GitHub organization.
Next steps
- Explore your asset inventory.
- Assess and improve your security to review and prioritize your findings.
- Mondoo GitHub Resource Pack Reference
Last updated on