> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/secretless-analysis.md).

# Secretless analysis

Secretless analysis lets CI workflows authenticate to SonarQube Cloud through OpenID Connect, without a long-lived token stored as a secret.

Secretless analysis works with [GitHub Actions](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/github-actions-for-sonarcloud/secretless-github.md) and [GitLab CI/CD](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci/secretless-gitlab.md). Support for additional CI platforms is in development.

Secretless analysis lets a CI workflow authenticate to SonarQube Cloud without a long-lived token stored as a secret. It uses OpenID Connect (OIDC) to implement workload identity federation (WIF): the CI platform vouches for the workflow's identity, and SonarQube Cloud trusts that platform as the issuer.

## How secretless analysis works

When a workflow runs, it requests an OIDC identity token from the CI platform. SonarQube Cloud verifies that the token comes from the trusted platform and checks that the repository is bound to a SonarQube Cloud project. It then issues an ephemeral token for that project with the Execute analysis permission, valid for 30 minutes. The scanner reads the ephemeral token from the `SONAR_TOKEN` environment variable, as it does today.

Instead of a token that you create and store in your CI platform, SonarQube Cloud issues a new ephemeral token to the workflow for each run. Nothing is stored and nothing needs rotating.

For organizations that belong to an enterprise, SonarQube Cloud records an `org.token_created` event in the audit logs each time it issues an ephemeral token. Expiry of the token is not logged. See the [Audit logs](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/enterprise-security/audit-logs.md) page.

A SonarQube Cloud organization admin must turn on secretless analysis. Until then, the authentication step returns an "Access denied" error.

## Prerequisites

Secretless analysis is off by default for every organization. To use it, you need:

* A project bound to a repository on github.com or gitlab.com. See the [Configuring GitHub project binding](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/devops-platform-integration/github.md) page or the [Configuring GitLab project binding](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/devops-platform-integration/gitlab.md) page.
* A SonarQube Cloud organization admin who turns on secretless analysis. See [Enable secretless analysis for your organization](#enable-secretless-analysis-for-your-organization).
* A workflow or pipeline updated to request an ephemeral token. See [Set up your CI platform](#set-up-your-ci-platform).

For the conditions that make the option unavailable, such as GitHub Enterprise Server, see [Supported configurations and limitations](#supported-configurations-and-limitations).

## Enable secretless analysis for your organization

You must be a SonarQube Cloud organization admin to turn secretless analysis on or off.

1. Retrieve your organization. See the [Retrieving your organizations](https://docs.sonarsource.com/sonarqube-cloud/getting-started/viewing-organizations.md) page for more details.
2. Go to **Administration** > **Organization settings** > **Analysis**.
3. Turn on **Enable secretless analysis for GitHub Actions** or **Enable secretless analysis for GitLab CI**, depending on the DevOps platform that your organization is bound to.

The setting applies to every project in the organization that is bound to a repository on your DevOps platform. To turn secretless analysis off, turn off the same toggle.

## Set up your CI platform

Follow the setup page for your CI platform:

* [Secretless analysis on GitHub](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/github-actions-for-sonarcloud/secretless-github.md)
* [Secretless analysis on GitLab](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci/secretless-gitlab.md)

## Supported configurations and limitations

* Secretless analysis works with GitHub Actions on github.com and with GitLab CI/CD on gitlab.com. Other CI platforms are not supported.
* Organizations bound to GitHub Enterprise Server or to GitHub Enterprise Cloud with data residency do not show the option. GitLab Self-Managed and GitLab Dedicated are not supported.
* If your organization restricts access with an IP allowlist, the runner needs an allowed IP address. Runners with shared IP addresses cannot be allowlisted.
* Trust is based on the bound repository or project. Any workflow or pipeline in it can obtain an ephemeral token for the bound project, on any branch. You cannot restrict secretless analysis to specific branches, workflows, or environments. Manage write access to the repository accordingly.
* Secretless analysis still authenticates with a token, and the token is ephemeral. Each time the authentication step runs, SonarQube Cloud creates a new ephemeral token for the bound project, and you never create or store it.
* Secretless analysis supports the EU and US regions of SonarQube Cloud.

For the setup that stores a token, see the [Github Actions](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/github-actions-for-sonarcloud.md) page or the [GitLab CI](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci.md) page.

## Related pages

* [Secretless analysis on GitHub](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/github-actions-for-sonarcloud/secretless-github.md)
* [Secretless analysis on GitLab](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci/secretless-gitlab.md)
* [SonarQube Auth GitHub Action](https://github.com/SonarSource/sonarqube-auth-action)
* [SonarQube Auth GitLab CI/CD component](https://gitlab.com/sonarsource/sonarqube-auth-component)
* [Scoped Organization Tokens](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/scoped-organization-tokens.md)
* [Managing personal access tokens](https://docs.sonarsource.com/sonarqube-cloud/managing-your-account/managing-tokens.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/secretless-analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
