Xygeni CLI Installation

Xygeni CLI can be used either installing it or by using Xygeni CLI Docker Image.

This page specifies how to install CLI. Please visit Xygeni CLI Docker Image if you prefer to use the CLI docker image.

CLI Installation

Please see Xygeni CLI Prerequisites before to install.

An installation script is provided for automated installation.

For manual installation, the scanner could be downloaded from https://get.xygeni.io/latest/scanner/xygeni-release.zip, or using the https://apidev.xygeni.io/scan/releases GET API endpoint, unzipped, and configured by setting credentials and proxy, if any.

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

The Xygeni installation script is 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 the one of the following which better matches your preferences:

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

Verify the integrity of the script

Xygeni publishes a SHA-256 checksum of published components in the xygeni/xygeni GitHub repository, so you may verify the integrity of a downloaded artifact.

This GitHub repository website is hosted in a completely different platform from the download site. Hackers need to compromise two different sites to keep tampered components, like the scanner or the installation script, undetected by the checksum verification.

To ensure that the downloaded installation script checksum matches the checksum published in Xygeni repository, meaning that probably it was not tampered with:

echo "$(curl -s https://raw.githubusercontent.com/xygeni/xygeni/main/checksum/latest/install.sh.sha256) install.sh" | sha256sum --check

If under macOS, as sha256sum is probably not installed in your host, you may:

  1. read this to install it,

  2. or use shasum -a 256 instead or sha256sum if the shasum command is installed,

echo "$(curl -s https://raw.githubusercontent.com/xygeni/xygeni/main/checksum/latest/install.sh.sha256) install.sh" | sha256 -a 256 --check
  1. or use openssl to compute the SHA-256 checksum of the installation script and compare it with the published checksum.

Fetch your Xygeni account credentials or API token

Active Xygeni account credentials are mandatory to run the script, so make sure you’ve signed up first! Visit Create a Free Trial account or Log in to Xygeni

Run the installation script

In what follows, XYGENI_TOKEN names an environment variable holding the Xygeni API token that will be registered in the scanner configuration file for authentication with the service.

./install.sh -o -v -t $XYGENI_TOKEN

To get the options available, run ./install.sh --help or PS .\install.ps1 --help.

Examples

  • Default install with Basic Auth: To perform the installation into $HOME/xygeni_scanner by using Basic Authentication credentials and verbose mode:

  ./install.sh -v -u <your username> -p <your password>
  PS .\install.ps1 -verbose -u <your username> -p <your password>
  • Default install with Token Auth: To perform the installation into $HOME/xygeni_scanner by using Token Authentication credentials and quiet mode:

  ./install.sh -q -t XYGENI_TOKEN
  PS .\install.ps1 -q -t $Env:XYGENI_TOKEN
  • Install to custom directory replacing previous installation: To perform the installation into a custom directory, replacing previous installation, if any:

  ./install.sh -o -v -t $XYGENI_TOKEN --dir ~/my-custom-xygeni-dir
  PS .\install.ps1 -o -verbose -t $Env:XYGENI_TOKEN -dir ~\my-custom-xygeni-dir

What’s next?

Congratulations, at this point you should have your installation successfully completed.

Now, let’s run your first scan. Move to your installation directory and execute the command:

cd my-xygeni-installation-dir
xygeni scan -n your_project_name --dir your_project_path

Last updated