# Manage Scans

## Creating an Integration with your SCM

Xygeni provides a quick way to scan your repositories directly from the UI. With this functionality (named **Managed Scans**) you will be able to scan your repos and Xygeni will manage everything behind the scenes.

First, go to **Manage Scans** in the **Navigation Bar:**

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FdeO4UqizYNSxXarZIN3m%2Fimage.png?alt=media&#x26;token=78cacda4-9f4a-4455-a529-3c7661109732" alt=""><figcaption></figcaption></figure>

The **Managed Scans** page will open.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FYzitzns2lsTZDYWU3lYV%2Fimage.png?alt=media&#x26;token=d3053f9b-09fd-43a9-801f-b989e82d8fd0" alt=""><figcaption></figcaption></figure>

Click on **New Integration** button to create an integration with your SCM. A dialog will open to select your SCM:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fx07WFpxNAKv2pSzMA6LQ%2Fimage.png?alt=media&#x26;token=f70d2174-eeec-4195-8c22-5e64895fc636" alt=""><figcaption></figcaption></figure>

For this example, we will use GitHub. So clicking on GitHub will install **Xygeni GitHub Application.**

As you can see below, the installation procedure will let you specify the scope of the installation (user- or organization-level)

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FwPUqE4InXdB6xMoFR6wv%2Fimage.png?alt=media&#x26;token=2cf2717b-acc3-41a4-9406-cd479ce5b7f9" alt="" width="349"><figcaption></figcaption></figure>

The installation will ask you to grant permission to **Xygeni GitHub Application** to all or only selected repositories.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FeqYYlvJYddm8PNOgxEWs%2Fimage.png?alt=media&#x26;token=d9c70898-dd62-4f3e-a70b-897dbea651de" alt="" width="320"><figcaption></figcaption></figure>

After clicking on **Install & Authorize** button, Managed Scans page will display the new integration.

It also display a table listing the granted repositories (this list depends on previous step).

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F9Lk27alze2iAEce6plXI%2FScreenshot%202025-04-04%20105058.png?alt=media&#x26;token=d60fe2ab-500f-4914-9d78-9d1d4dfeb086" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can create as many integrations as you wish. Just click on any integration and the list of repos will be refreshed accordingly.
{% endhint %}

Any integration has some available actions:

* Clicking on the ![](https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F3y2ZMTR5G1uKU9rjHocy%2Fimage.png?alt=media\&token=ff66837a-4c11-4203-a1e2-26825d3a3cc0) icon of an integration allows you to delete the integration.
* Clicking on the ![](https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FNStI4NseobrMbI70a3Ae%2Fimage.png?alt=media\&token=0435e381-1534-4cfa-af84-79eaa8cf89c2) icon of an integration will refresh the list of repos.
* Clicking on the ![](https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FVfFzVqEKeQwAQuGsXDgf%2Fimage.png?alt=media\&token=1d74c084-6ccc-4307-8498-cd31be0653b1) icon of an integration will take you to Xygeni GitHub App configuration page.

Once that you get your list of repositories you can execute scans as follows.

{% hint style="info" %}
Once that you hace created an integration and you can see the list of repos, you can execute scans in different ways:

1. Scanning a repo **on-demand**
2. Programming a **daily scan** of the repo
3. Executing the **scan on Pull Requests**

Follow below instructions on every method.
{% endhint %}

### On-Demand Scan

Clicking on the **Scan Now** button of any repo will execute a scan on that repo.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FoBfEd33spuIaWO50aBHm%2Fimage.png?alt=media&#x26;token=56d8361d-a2a6-40b4-8f1e-30ef8e6c6d6f" alt=""><figcaption></figcaption></figure>

If you go now to GitHub, you will see a workflow running the scan:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FbduBzx4ymsAZSMUxGCHF%2Fimage.png?alt=media&#x26;token=f3b06634-227f-4e44-abf6-8eebb597cfee" alt=""><figcaption></figcaption></figure>

Xygeni automatically created a GitHub workflow into the selected repo.

The workflows would be like this:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FbbzWcZUXTYS8cyoVLsxy%2Fimage.png?alt=media&#x26;token=33b8c923-576e-4eff-a884-562e2c0d18a5" alt=""><figcaption></figcaption></figure>

In the last line you can see that Xygeni has created a **secret (XYGENI\_TOKEN)** in the repo with the Xygeni token (needed to authenticate against Xygeni, to execute the scan and upload the results to Xygeni platform).

{% hint style="info" %}
After the scan is completed, you **can find the results in the Xygeni** [**Dashboard**](https://docs.xygeni.io/introduction-to-xygeni/xygeni-web-ui-overview/dashboard). The name of your project will be the same as your repo name.

You can configure to be **notified when the scan is finished**. See [Notifications](https://docs.xygeni.io/xygeni-administration/platform-administration/notifications).
{% endhint %}

### Daily Scan

Another option is to schedule the scan.

To do it, select any repo and click on **Scheduled Scan** button.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FjgI3HhsIHplbDWkArHTR%2Fimage.png?alt=media&#x26;token=ac3a27eb-d577-4dbc-9784-e790a168a9b4" alt=""><figcaption></figcaption></figure>

A dialog will open to select the time to execute the scan:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FHBMEITSVWizXyw9gAbwS%2Fimage.png?alt=media&#x26;token=0d428e09-c245-4f56-837e-ef09a4370c71" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please note that the specified time is according to your time zone, but it will be converted to to UTC time zone in the workflow
{% endhint %}

Once it is done, you will see the scheduling information:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FC6CiJY5vv2U8Yw5lHAf1%2Fimage.png?alt=media&#x26;token=568990f3-1482-4ab9-8d5f-9b24ae980465" alt=""><figcaption></figcaption></figure>

The created workflow will be like this:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FObjq6PXteVqEXruQZZEY%2Fimage.png?alt=media&#x26;token=f791fcec-1591-423b-a560-b3c6a34a74a7" alt=""><figcaption></figcaption></figure>

In the last line you can see that Xygeni has created a **secret (XYGENI\_TOKEN)** in the repo with the Xygeni token (needed to authenticate against Xygeni, to execute the scan and upload the results to Xygeni platform).

{% hint style="info" %}
After the scan is completed, you **can find the results in the Xygeni** [**Dashboard**](https://docs.xygeni.io/introduction-to-xygeni/xygeni-web-ui-overview/dashboard). The name of your project will be the same as your repo name.

You can configure to be **notified when the scan is finished**. See [Notifications](https://docs.xygeni.io/xygeni-administration/platform-administration/notifications).
{% endhint %}

If you need to **un-schedule the scan**, you only need to click on the **Stop Automatic Scan** button.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FpB8jh6jio9s9Ft39DhhJ%2Fimage.png?alt=media&#x26;token=ace50dd3-aeea-4540-8241-2112b7c6af19" alt=""><figcaption></figcaption></figure>

### Scan on Pull Request or Merge Request

Another option is to configure the scan to be executed upon a Pull Request against the default branch.

In this case, whenever any branch wants to merge ti the default branch the scan will be executed over the branch code.

To do it, select any repo and click on **Scan on PR/MR** button.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F7iTrCkMl62mdIlKX0Uns%2Fimage.png?alt=media&#x26;token=b5f58e35-120d-40a9-a0d6-6e5173d616c1" alt=""><figcaption></figcaption></figure>

Once it is done, you will see the following information:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FXDl6vySbpZkZ5df0JGH0%2Fimage.png?alt=media&#x26;token=5cb73ec5-9dfb-45d8-b4e3-d27781ced119" alt=""><figcaption></figcaption></figure>

The created workflow will be like this:

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fe3bQRYJ3mwg41nEh98R6%2Fimage.png?alt=media&#x26;token=ef3213eb-e071-4e25-9f4c-92549cd4fded" alt=""><figcaption></figcaption></figure>

In the last line you can see that Xygeni has created a **secret (XYGENI\_TOKEN)** in the repo with the Xygeni token (needed to authenticate against Xygeni, to execute the scan and upload the results to Xygeni platform).

{% hint style="info" %}
After the scan is completed, you **can find the results in the Xygeni** [**Dashboard**](https://docs.xygeni.io/introduction-to-xygeni/xygeni-web-ui-overview/dashboard). The name of your project will be the same as your repo name.

You can configure to be **notified when the scan is finished**. See [Notifications](https://docs.xygeni.io/xygeni-administration/platform-administration/notifications).
{% endhint %}

## Managed Scans FAQ

Having questions about managed scans? Check our [Managed Scans FAQ](https://docs.xygeni.io/scan-management/managed-scans/manage-scans-faq) for answers to common questions and troubleshooting tips.
