> For the complete documentation index, see [llms.txt](https://docs.xygeni.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xygeni.io/xygeni-products/scan-management/managed-ci.md).

# Managed CI

**Managed CI** scans your repositories inside their own CI. You decide in Xygeni **when** to scan (on every pull request, on a schedule or on demand), **what** to scan (which scanners) and **whether a failing scan blocks the pull request**. Xygeni writes and maintains everything in each repository: the pipeline, its secrets and the pull request check.

Managed CI replaces Manage Scans. Repositories that Manage Scans still scans can be moved to Managed CI (see [Migrating from Manage Scans](#migrating-from-manage-scans)).

{% hint style="info" %}
Managed CI is available to users with the **Root** or **Project Manager** role.
{% endhint %}

## Supported code repositories

| SCM         | Cloud                 | On-premise                        |
| ----------- | --------------------- | --------------------------------- |
| GitHub      | github.com            | GitHub Enterprise Server          |
| GitLab      | gitlab.com            | GitLab Self-Managed               |
| Bitbucket   | Bitbucket Cloud       | Not supported                     |
| Azure Repos | Azure DevOps Services | Azure DevOps Server               |
| Gitea       | gitea.com             | Self-hosted Gitea (1.23 or later) |

Each SCM has its own requirements (token permissions, runners or agents) and its own way of blocking pull requests. Read [Notes for each SCM](https://docs.xygeni.io/xygeni-products/scan-management/managed-ci/scm-notes.md) before you connect yours.

## Connecting your SCM

Go to **Managed CI** in the **Navigation Bar** (or click the **Managed CI** button of the [Projects](https://docs.xygeni.io/xygeni-products/application-security-posture-management-aspm/projects.md) page).

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-bac01af9809253ebd66fbb177cd8d0716c662fad%2Fmanaged-ci-01-navigation.png?alt=media" alt="Managed CI in the Navigation Bar" width="224"><figcaption><p>Managed CI in the Navigation Bar</p></figcaption></figure>

Click **Add Repository** and choose your SCM:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-509f1ad8282d0739f226e1dd978c4fcc7a5f492d%2Fmanaged-ci-02-add-repository.png?alt=media" alt="Choose your SCM"><figcaption><p>Choose your SCM</p></figcaption></figure>

* **GitHub (cloud)** and **Bitbucket Cloud** take you to the SCM to authorize Xygeni.
* For the rest, choose **Cloud** or **On-premise**, enter the server URL if it is on-premise, and the access token. Then click **Connect**.

Then select the organizations (GitHub, Gitea), groups (GitLab), projects (Azure Repos) or workspaces (Bitbucket) to connect.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-107330d82d9a68ce7a4bc26ee6ca7c5ebe01d0a3%2Fmanaged-ci-03-select-organizations.png?alt=media" alt="Select the groups to connect (GitLab)" width="492"><figcaption><p>Select the groups to connect (GitLab)</p></figcaption></figure>

### Your own SCM server

Xygeni must be able to reach your server. It only accepts servers with a public address and `https`, so the token never travels in clear text.

If you run Xygeni on-premise, your operator can allow servers of your private network in the `integrations.allowlist.scm` property (in `override.properties`): a comma-separated list of IPs, networks, host names and `*.domain` patterns. Plain `http` is accepted for the servers on the list.

```properties
integrations.allowlist.scm=10.0.0.0/8,gitlab.corp.local,*.scm.corp.local
```

{% hint style="info" %}
On-premise installations of Xygeni turn Managed CI on with the `depsdoctor.managedci.enabled=true` property.
{% endhint %}

## Adding repositories

After connecting, choose the repositories Xygeni will manage:

1. Select them in the list. Only the repositories you select are managed.
2. Click **Next: default configuration** and choose how they are scanned (see [Configuring a repository](#configuring-a-repository)). This is your **default configuration**: the repositories you add later start from it.
3. Click **Add N repositories**.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-bead744ad5978419092d1ff9cffbed7adbd100d5%2Fmanaged-ci-04-select-repositories.png?alt=media" alt="Select the repositories to manage" width="492"><figcaption><p>Select the repositories to manage</p></figcaption></figure>

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-5a77b892e8ae272088300e2570381a5dc250b9be%2Fmanaged-ci-05-default-configuration.png?alt=media" alt="Default configuration" width="752"><figcaption><p>Default configuration</p></figcaption></figure>

Xygeni writes the pipeline in each repository in the background (the row shows **Applying…**). If the default branch is protected, or if your own CI file has to change, Xygeni opens a pull request instead (see [Setup pull requests](#setup-pull-requests)).

If Managed CI does not manage any repository of an integration yet, its page shows **Add repositories**:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-c0ea80b91be94c8f5f5c96e9c774e48d659b6b8b%2Fmanaged-ci-empty-no-repositories.png?alt=media" alt="An integration without repositories in Managed CI"><figcaption><p>An integration without repositories in Managed CI</p></figcaption></figure>

To add more later, click **Add repositories** above the table. Repositories that Manage Scans scans today show a **Manage scans** tag: adding them moves them to Managed CI.

## The Managed CI page

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-d0ed41553cc299b70e7ed57409518f49d1346dcc%2Fmanaged-ci-06-page.png?alt=media" alt="The Managed CI page"><figcaption><p>The Managed CI page</p></figcaption></figure>

### Integration cards

Each connected organization, group or workspace has a card. Click it to see its repositories. The card shows:

* The server URL, if it is on-premise.
* **N repositories · N configured**.
* **N setup PRs need your merge**: pull requests from Xygeni that you have to approve and merge.
* The connection status: **Installed**, **Error** (Xygeni cannot connect with the current credentials) or **Uninstalled** (the Xygeni app or authorization was removed in the SCM). When it fails, click **Reconnect** to enter the credentials again.
* **· auto-onboarding**, when new repositories are added automatically.
* In red, **Managed CI setup failed · retried automatically** or **Managed CI owner unavailable** (see [Troubleshooting](https://docs.xygeni.io/xygeni-products/scan-management/managed-ci/troubleshooting.md)).

| Example                                                                                                                                                                                                                                                             | What it means                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-4adbca775a3b7cf10e0a0202126dbf6d24b97f21%2Fmanaged-ci-card-setup-failed.png?alt=media" alt="" data-size="original">      | Xygeni could not prepare the integration and tries again by itself.               |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-d924bd0c250bd8e1a2444923b7735e8010afeb7e%2Fmanaged-ci-card-owner-unavailable.png?alt=media" alt="" data-size="original"> | The user Managed CI works for is no longer available: take it over from the menu. |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-f74ba6fd3004c8c0c7fe5339abdcd90bc645a9f8%2Fmanaged-ci-card-reconnect.png?alt=media" alt="" data-size="original">         | Xygeni cannot connect to the SCM: click **Reconnect**.                            |

The **⋯** menu of the card:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-0dbc1d81623e321a1f0550b9b171ce96c9e42023%2Fmanaged-ci-11-card-menu.png?alt=media" alt="The integration menu" width="391"><figcaption><p>The integration menu</p></figcaption></figure>

* **Test connection**: checks the connection and brings new repositories from the SCM.
* **Update token**: replaces the access token.
* **Manage repository access**: chooses which repositories, organizations or groups Xygeni can see.
* **Add repositories**.
* **Migrate from Manage scans (N)**: see [Migrating from Manage Scans](#migrating-from-manage-scans).
* **Auto-onboard new repositories**: new repositories of the organization are added automatically with your default configuration. **Stop auto-onboarding** turns it off.
* **Take over Managed CI**: Managed CI works on behalf of the user who set it up. If that user leaves, or anyone else should own it, another user with the role takes it over here.
* **Disconnect**: removes the integration. Remove its repositories from Managed CI first, so Xygeni deletes its pipelines from your repositories. Scan results are kept.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-2e2b3b7e267ad4a8c0403d8798911232e0f39abd%2Fmanaged-ci-17-confirm-auto-onboard.png?alt=media" alt="Turning auto-onboarding on asks for confirmation" width="492"><figcaption><p>Turning auto-onboarding on asks for confirmation</p></figcaption></figure>

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-a6edeadbe03ada9b676830ccbf2a5fbc67983d2c%2Fmanaged-ci-16-confirm-disconnect.png?alt=media" alt="Disconnecting an integration that still has repositories in Managed CI" width="492"><figcaption><p>Disconnecting an integration that still has repositories in Managed CI</p></figcaption></figure>

### Repositories table

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-c18ee281ecb4db86be8e6bfb841b36a5d245e114%2Fmanaged-ci-07-table.png?alt=media" alt="Repositories of an integration"><figcaption><p>Repositories of an integration</p></figcaption></figure>

**Project**

* The repository name opens its project in Xygeni (once it has been scanned). <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-74f7778661700a7294df648ffd527e3e819b978d%2Fmanaged-ci-icon-open-repository.png?alt=media" alt="" data-size="line"> opens the repository in the SCM.
* Below, the default branch. <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-9db0a45d7ebc2bf2f696d8ba0dee46da0b527a24%2Fmanaged-ci-tag-protected.png?alt=media" alt="" data-size="line"> **protected** means Xygeni cannot commit to it: every change arrives as a pull request.
* **Migrating**, **Migrated**, **Migration failed** or **Manage scans pipeline**: see [Migrating from Manage Scans](#migrating-from-manage-scans).

**Scan triggers**

* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-bda13a4710b33b4716587079e6ccafc0d4908272%2Fmanaged-ci-tag-pr.png?alt=media" alt="" data-size="line"> **PR**: every pull request is scanned and the check always passes (report only).
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-9db0a45d7ebc2bf2f696d8ba0dee46da0b527a24%2Fmanaged-ci-tag-protected.png?alt=media" alt="" data-size="line"> **PR** with a lock: every pull request is scanned and the merge is blocked when a guardrail of the project fails.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-b8ca42e0e25a5f8b88988b5441d3b1bbb0642aa6%2Fmanaged-ci-tag-scheduled.png?alt=media" alt="" data-size="line"> **Scheduled**: full scan on a schedule. Hover it to see the day, time and branch.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-71673feab3837f0972e7c0829f1324d5f5488016%2Fmanaged-ci-tag-on-demand.png?alt=media" alt="" data-size="line"> **On demand**: only scanned when someone clicks **Scan now**.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-a78205e4c675b13a8e43933d1ac17d8166e2a79c%2Fmanaged-ci-tag-pending-change.png?alt=media" alt="" data-size="line"> **Pending change**: a pull request from Xygeni brings a new configuration. Hover it to see what changes.
* **Not configured** / **Scans disabled**: the repository is not scanned.

**Scanners**: the icons of the scanners that are on (see [What to scan](#what-to-scan)). **+N** shows the rest.

**Last scan**

The result of the latest run, what started it (**PR #N**, **Scheduled** or **Manual run**) and when. <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-74f7778661700a7294df648ffd527e3e819b978d%2Fmanaged-ci-icon-open-repository.png?alt=media" alt="" data-size="line"> opens the run in the SCM; if it failed, hover the result to see why.

| Example                                                                                                                                                                                                                                                             | What it means                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-58dfedbfa2cd0e850347d750d36126342be4383f%2Fmanaged-ci-last-scan-passed.png?alt=media" alt="" data-size="original">       | The latest run found nothing that blocks.                                                                                                                                                                       |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-170199180fb70d133b71e9f15da643109d4c23b8%2Fmanaged-ci-last-scan-pr-blocked.png?alt=media" alt="" data-size="original">   | A pull request was blocked because a guardrail of the project failed.                                                                                                                                           |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-acf41a78ddda70457103af866f82d5ccd631e611%2Fmanaged-ci-last-scan-scan-failure.png?alt=media" alt="" data-size="original"> | The run failed. Hover it to see why (for example, no agent available).                                                                                                                                          |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-d8e8047f92fd96600b69e83300d798809fc0be05%2Fmanaged-ci-last-scan-canceled.png?alt=media" alt="" data-size="original">     | The run was canceled in the SCM.                                                                                                                                                                                |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-0d0186616a513739a3c3828a9148aae68c75dbf1%2Fmanaged-ci-last-scan-one-off.png?alt=media" alt="" data-size="original">      | The last scan used other scanners than usual (see [Scan now](#scan-now)).                                                                                                                                       |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-af01757d738b7d327d3d905d774ee39f948c3c5f%2Fmanaged-ci-last-scan-applying.png?alt=media" alt="" data-size="original">     | Xygeni is setting the repository up.                                                                                                                                                                            |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-6c31590fd7ed473fb02c933b9f8698a27a51c0f0%2Fmanaged-ci-last-scan-removing.png?alt=media" alt="" data-size="original">     | Xygeni is removing the repository from Managed CI.                                                                                                                                                              |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-7190b2c468a7088dfba478fafe094af688113995%2Fmanaged-ci-last-scan-approval.png?alt=media" alt="" data-size="original">     | A pull request from Xygeni is waiting for your approval and merge.                                                                                                                                              |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-1b7a7526dbee0adbc3abade8a3a879bb55593c4c%2Fmanaged-ci-last-scan-setup-failed.png?alt=media" alt="" data-size="original"> | Xygeni could not apply the configuration (or remove it: **Removal failed**). Hover it to see why (see [Troubleshooting](https://docs.xygeni.io/xygeni-products/scan-management/managed-ci/troubleshooting.md)). |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-0c5d5b63dc0ce7d0d8c6d438095da5108d316916%2Fmanaged-ci-last-scan-never.png?alt=media" alt="" data-size="original">        | The repository has not been scanned yet.                                                                                                                                                                        |

**Row buttons**: **Scan now** (see [Scan now](#scan-now)), **Review PR** when a pull request from Xygeni is waiting, and <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-40db215bc214caee56df74769621f702fc27023b%2Fmanaged-ci-icon-configure.png?alt=media" alt="" data-size="line"> to configure the repository.

Use the filters to find repositories by name or by configuration (for example **Blocking PRs** or **Needs attention**). **Refresh** brings new repositories from the SCM.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-ab7eab9d8da6b743b2d1af5dbfddc9abcd23d6d0%2Fmanaged-ci-12-filters.png?alt=media" alt="Filter by scan configuration"><figcaption><p>Filter by scan configuration</p></figcaption></figure>

Select several repositories to **Scan now**, **Configure** or **Remove from Managed CI** at once (up to 50).

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-2cffcaa507b4f8efd5dd0a98ef69ade566bf67da%2Fmanaged-ci-13-bulk-actions.png?alt=media" alt="Actions on the selected repositories"><figcaption><p>Actions on the selected repositories</p></figcaption></figure>

## Configuring a repository

Click <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-40db215bc214caee56df74769621f702fc27023b%2Fmanaged-ci-icon-configure.png?alt=media" alt="" data-size="line"> in a repository row. Selecting several rows and clicking **Configure** shows the same form for all of them; a field with different values shows **Mixed** and is left as it is unless you change it.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-207b75f40271fff81aac065dd16f3bda7b1c58cc%2Fmanaged-ci-08-configure.png?alt=media" alt="Configuration of a repository"><figcaption><p>Configuration of a repository</p></figcaption></figure>

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-fcc121c740ac630ce4c5b07890830546138ddb4a%2Fmanaged-ci-14-bulk-configure-mixed.png?alt=media" alt="Configuring two repositories at once: Mixed marks the fields that differ" width="752"><figcaption><p>Configuring two repositories at once: Mixed marks the fields that differ</p></figcaption></figure>

### Start from a policy

A policy fills the form for you. You can change any field afterwards.

* **Standard**: report-only scan on every pull request, and a full scan every week.
* **Strict PR gate**: blocks pull requests when a guardrail of the project fails, and a full scan every night.
* **Nightly audit**: no pull request checks, a full scan every night.

**Restore defaults** goes back to your default configuration.

### When to scan

* **On every pull request**: scans the pull request when it is opened or updated.
  * **Block the pull request**: the pull request cannot be merged while a guardrail assigned to the project fails (see [Guardrails Management](https://docs.xygeni.io/xygeni-administration/platform-administration/guardrails-management.md)). **A project without guardrails is never blocked.** How each SCM blocks it is explained in [Notes for each SCM](https://docs.xygeni.io/xygeni-products/scan-management/managed-ci/scm-notes.md).
  * **Scan only the changed files**: faster. The scheduled scan still covers the whole repository.
* **Scheduled**: a full scan every day or every week, at the time you choose (in the time zone shown). Leave **Branch** empty to scan the default branch.
* **On demand**: lets anyone with access click **Scan now**.

When blocking is off, the check always passes. On GitHub, Azure Repos and Gitea, the findings are also written as a comment in the pull request.

### What to scan

The scanners every trigger runs:

| Icon                                                                                                                                                                                                                                                            | Scanner                     | Finds                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ---------------------------------------------------------------------------------------- |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-7893040809eaaa1e499c2dc57a4df4367b8b0182%2Fmanaged-ci-scanner-secrets.png?alt=media" alt="" data-size="line">        | **Secrets**                 | Hardcoded credentials and tokens                                                         |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-89a56e24e44cf3b052ddbf006bb8e8413c628f0b%2Fmanaged-ci-scanner-sast.png?alt=media" alt="" data-size="line">           | **SAST**                    | Vulnerabilities in your own code                                                         |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-9d68029bc132e89f0bef676ec14ed5e8adbb0a8e%2Fmanaged-ci-scanner-sca.png?alt=media" alt="" data-size="line">            | **SCA**                     | Vulnerable open source dependencies (it also runs inventory and suspicious dependencies) |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-fdaf9d0b76e52eec547eccc8faf70e9f21afadd8%2Fmanaged-ci-scanner-iac.png?alt=media" alt="" data-size="line">            | **IaC**                     | Terraform, Kubernetes and CloudFormation flaws                                           |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-28bbca916f036163bd36f8e36e50329daea58b02%2Fmanaged-ci-scanner-cicd.png?alt=media" alt="" data-size="line">           | **CI/CD misconfigurations** | Pipeline and SCM settings                                                                |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-f376118362c9a6058e409fc7226f52dc29155ab5%2Fmanaged-ci-scanner-malware.png?alt=media" alt="" data-size="line">        | **Malware**                 | Malicious and suspicious packages                                                        |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-be26afbbeee10b0e75565ef4333f2813e89af14d%2Fmanaged-ci-scanner-code-tampering.png?alt=media" alt="" data-size="line"> | **Code tampering**          | Unexpected changes to critical files                                                     |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-7f7bd9f6b5f6abcb6c410cfe55a793bf9a1ae9c5%2Fmanaged-ci-scanner-api-security.png?alt=media" alt="" data-size="line">   | **API Security**            | Vulnerabilities in your APIs                                                             |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-6748aec1251b10e7e6c3cfc9e71b8c82eeb02791%2Fmanaged-ci-scanner-ai-security.png?alt=media" alt="" data-size="line">    | **AI Security**             | OWASP LLM Top 10 risks in your AI code                                                   |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-78d6e5f9074585061bb9f30c49eed34474567480%2Fmanaged-ci-scanner-code-quality.png?alt=media" alt="" data-size="line">   | **Code Quality**            | Maintainability and reliability issues                                                   |
| <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-a061a63bc3ebdfbcc9d727e72e55ec7cc6142f53%2Fmanaged-ci-scanner-compliance.png?alt=media" alt="" data-size="line">     | **Compliance**              | Checks against your compliance standards                                                 |

### Saving

Click **Apply**. If the default branch is protected, the button says **Open setup pull request** instead. Check **Scan now after saving** to scan as soon as the configuration is in place.

## Setup pull requests

When the default branch is protected, or when your own CI file has to change (for example `.gitlab-ci.yml` or `bitbucket-pipelines.yml`), Xygeni opens a pull request with the change. **Nothing changes until you approve and merge it**: the current configuration keeps running.

A banner above the table tells you when one is waiting:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-66f30dc9f53c5bccd6dc46d4dbd2be819c8edf38%2Fmanaged-ci-banner-setup-prs.png?alt=media" alt="Setup pull requests waiting for you"><figcaption><p>Setup pull requests waiting for you</p></figcaption></figure>

Click **Review PR** in the banner or in the row:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-84a5381ce830b1c2ee0fb12325c5120fda3728a9%2Fmanaged-ci-09-setup-pr.png?alt=media" alt="A setup pull request"><figcaption><p>A setup pull request</p></figcaption></figure>

* You see the change, and the configuration **Running now** next to the one you get **After merge**.
* **Review pull request** opens it in the SCM, to approve and merge it.
* **Check status** updates its state here.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-e70e47314647131e6c5e27383acaf6acf58baf67%2Fmanaged-ci-09b-setup-pr-compare.png?alt=media" alt="What changes after the merge" width="592"><figcaption><p>What changes after the merge</p></figcaption></figure>

* **Close PR and discard change** cancels it. If it was the first setup of the repository, the repository stays without Managed CI.

## Scan now

**Scan now** scans the repository with its configuration. The arrow next to it lets you **Choose scanners for this scan** (just this once).

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-7c63be19165eb3506d268da61396a4639eaff073%2Fmanaged-ci-10-scan-now.png?alt=media" alt="Choose scanners for this scan" width="348"><figcaption><p>Choose scanners for this scan</p></figcaption></figure>

**Scan now** is disabled until the Xygeni pipeline is in the default branch (after its setup pull request is merged), while a scan is running, and when **On demand** is off.

The scan runs in the repository's CI. When it finishes, the results are in the Xygeni [Dashboard](https://docs.xygeni.io/introduction-to-xygeni/xygeni-web-ui-overview/dashboard.md), in a project with the repository's name. You can be [notified](https://docs.xygeni.io/xygeni-administration/platform-administration/notifications.md) when it ends.

## Migrating from Manage Scans

If Manage Scans still scans repositories of an integration, a banner tells you how many. Click **Migrate**:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-76f73dd7490b91ba6163abd741ba4e8e9ccdaa77%2Fmanaged-ci-banner-migrate.png?alt=media" alt="Repositories still scanned by Manage Scans"><figcaption><p>Repositories still scanned by Manage Scans</p></figcaption></figure>

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-6727357fafcc933d5b6528fd71a511e9353a9e0e%2Fmanaged-ci-18-migrate.png?alt=media" alt="Migrate from Manage scans" width="752"><figcaption><p>Migrate from Manage scans</p></figcaption></figure>

* Each repository shows what it gets in Managed CI: a scan on pull request or push becomes **On every pull request**, a scheduled scan becomes a daily scan at the same time. Scanners and blocking come from your default configuration.
* Select them and click **Migrate N repositories**.

When Managed CI starts running on a repository, Xygeni removes its Manage Scans pipeline, so it is never scanned twice. The **Project** column shows:

* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-c839783fb2d7191b54fe50252b024bfd42995c60%2Fmanaged-ci-tag-migrating.png?alt=media" alt="" data-size="line"> **Migrating**: in progress.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-c9102965ce14298d1f325f194f9dbd2b173693ec%2Fmanaged-ci-tag-migrated.png?alt=media" alt="" data-size="line"> **Migrated**: done.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-a53944d70b23ccb8e97697fafb47d74884514525%2Fmanaged-ci-tag-migration-failed.png?alt=media" alt="" data-size="line"> **Migration failed**: it stays on Manage Scans (hover it to see why). It also happens if you close its setup pull request.
* <img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-ef86d6adf7ab0fa28028ed91530dfb843dcc8228%2Fmanaged-ci-tag-manage-scans-pipeline.png?alt=media" alt="" data-size="line"> **Manage scans pipeline**: it is listed here but Manage Scans still scans it. Changing its configuration or scanning it moves it to Managed CI.

Clicking **Scan now** in the [Projects](https://docs.xygeni.io/xygeni-products/application-security-posture-management-aspm/projects.md) page on a repository scanned by Manage Scans also moves it to Managed CI.

## Removing repositories

Select them and click **Remove from Managed CI**. Xygeni deletes their pipeline, pull request check and configuration from the SCM. Scan results are kept.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-3b0897a9a77589b5f8596f94b5b0188d24c01464%2Fmanaged-ci-15-confirm-remove.png?alt=media" alt="Removing repositories asks for confirmation" width="492"><figcaption><p>Removing repositories asks for confirmation</p></figcaption></figure>

## The Xygeni token

The pipeline needs a Xygeni token to upload the results. Xygeni creates it and keeps it in the repository's secrets (on Azure Repos, in the **xygeni-managed-ci** variable group of the project). You don't have to do anything with it:

* It can only upload scan results.
* It is renewed every year and deleted when you remove the repository from Managed CI (on Azure Repos, the token is shared by the repositories of the integration and is deleted with the last one).
* If someone deletes it in the SCM, Xygeni writes a new one.

Like any CI secret, anyone who can push a branch to the repository can read it from that branch's pipeline. That is why it can do so little.


---

# 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.xygeni.io/xygeni-products/scan-management/managed-ci.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.
