> 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-distributions/on-premise/getting-started.md).

# Getting Started

A **Scan** is the action performed by the **Xygeni Scanner** to find security issues in your project.

In an on-premise platform scanner CLI should be installed from Xygeni on-premise url.

1. [Install the Scanner CLI from On-Premise Url](#1-install-the-scanner-cli-from-on-premise-url)
2. [Fetch your Xygeni credentials](#2-fetch-your-xygeni-account-credentials-or-api-token-)
3. [Run the installation script](#3-run-the-installation-script)
4. [Run your first scan](#4-run-your-first-scan)
5. [View the scan results](#5-view-scan-results-)

### 1. Install the Scanner CLI from on-premise Url

An **installation script** is provided for automated installation.

{% hint style="info" %}
For **manual** installation, the scanner can be downloaded from the `https://<xygeni-on-premise-url>/scan/releases` *GET* API endpoint, unzipped, and configured by setting the xygeni api url, your credentials and proxy details (if any is used) in the configuration file `conf/xygeni.yml`
{% endhint %}

***The recommended, automated way to install the scanner is to use the installation script.***

The `Xygeni installation script`s provided by `Xygeni` as a way to speed up your xygeni experience by setting your scanning environment as fast as possible.

#### Download the script

Run one of the following commands depending on your preferences:

{% tabs %}
{% tab title="mac/Linux" %}

```
  curl -sLO https://get.xygeni.io/latest/scanner/install.sh
```

{% endtab %}

{% tab title="Windows" %}

```
 iwr https://get.xygeni.io/latest/scanner/install.ps1 -useb -OutFile install.ps1
```

{% endtab %}
{% endtabs %}

### 2. Fetch your Xygeni account credentials or API token

{% hint style="info" %}
Active Xygeni account credentials are mandatory to run the script, so make sure you’ve signed up first!
{% endhint %}

An **Access Token**, also referred to as an **API token** or **API key**, is used by applications such as the Xygeni Scanner or other integrations to access the Xygeni platform's API.

To create an access token in the Dashboard, go to the Settings >>Profile>> Access tokens, then click on the `Generate new token` button. Go to [Generate Token for Scanner and API client](/xygeni-administration/platform-administration/profile.md#generate_token_for_scanner-1) for further details.

Describe what the token will be used for, choose the validity period, and select the permissions granted to the token. Click on the `Generate` button:

{% hint style="info" %}
Each permission grants the key access to specific API endpoints. Typically, the scanner requires permissions to upload scan results.
{% endhint %}

Finally, the token is generated:

### 3. Run the installation script

The variable `XYGENI_ONPREMISE_URL` refers to the on-premise Xygeni api server, you can get it from api or ask customer platform admin.

The variable `XYGENI_TOKEN` refers to an environment variable that stores the Xygeni API token. This token will be used to authenticate with the service.

{% tabs %}
{% tab title="Linux/mac" %}

```
./install.sh -o -v -t $XYGENI_TOKEN -s $XYGENI_ONPREMISE_URL
```

{% endtab %}

{% tab title="Windows" %}

```
PS .\install.ps1 -o -verbose -t $Env:XYGENI_TOKEN -s $Env:$XYGENI_URL
```

{% endtab %}
{% endtabs %}

For a list of available options, execute `./install.sh --help` on Unix-based systems or `PS .\install.ps1 --help` on Windows.

### 4. Run your first scan

Once Xygeni Scanner CLI is installed an scan can be run, ensure that you have a file system folder containing your project content. This folder may be a clone of your repository or simply a directory housing the source code for your project.

Navigate to your project directory, with the command `cd /my/project`. Once there, initiate a scan by running `xygeni scan`. All vulnerabilities identified are listed, including their path and fix guidance.

```bash
$ cd /my/project
$ xygeni scan 
```

You can also use these commands below for other cases:

```bash
# Assuming that $XYGENI_HOME in path or xygeni shortcut set
# Scan a directory
$ xygeni scan -n <your_project_name> --dir <path_to_analyze>

# Scan a repository
$ xygeni scan --repository <repo_url>

# Scan a container image
$ xygeni scan --repository <image>

# You may add --no-upload to the scan command if you want to view
# the results before uploading to Xygeni platform. 
```

{% hint style="info" %}
IMPORTANT: In case you want the scanner performs checks against your **repository** and **organization** (See [CI/CD Misconfigurations Detection](/xygeni-products/software-supply-chain-security-sscs.md#misconfigurations_detection)), ensure that you provide your SCM and/or CI/ CD systems tokens to the scanner.

Usually, the preferred option is to **pass the token in an environment variable** (like **`GITHUB_TOKEN`** or **`GITLAB_TOKEN`**).

When run in an on-premise configuration and scans typically run in local network with a git server (Github Enterprise, Gitlab Server), **`GITHUB_TOKEN`** and **`GITLAB_TOKEN`** should be retrive from the local git server if any of these.

See [SCM and CI/ CD tokens](/xygeni-scanner-cli/xygeni-cli-overview/scm-ci-cd-and-container-registry-tokens.md) to know more about this topic.
{% endhint %}

{% hint style="info" %}
See [Xygeni Scanner Reference](/xygeni-scanner-cli/xygeni-cli-overview/xygeni-scanner-reference.md) for the full scanner command-line reference.
{% endhint %}

### 5. View scan results

After the scan is done, log into the [Dashboard](/introduction-to-xygeni/xygeni-web-ui-overview/dashboard.md), use the on-premise url [https://-on-premise-hostname-/auth/login](#5-view-scan-results-) to access the Xygeni on-premise dashboard, and navigate to the **Governance tab** to access the **Security Posture Summary** screen.

{% hint style="info" %}
Go to [Xygeni Web UI](/introduction-to-xygeni/xygeni-web-ui-overview.md) for a guide to browse the dashboard.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xygeni.io/xygeni-distributions/on-premise/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
