Xygeni User Guides
  • Welcome to Xygeni
  • Getting Started
    • Create a Free Trial Account
    • Quick start with your code repository
    • Quick start with Xygeni CLI
    • Quick start with a preloaded project
    • Log in to Xygeni
    • Subscribe to Xygeni
  • Introduction to Xygeni
    • Key Concepts
      • Projects in Xygeni
      • Project Baseline
      • Detected Issues
      • Remediation Actions
      • Policies
      • Risk Level
      • SDLC Inventory
      • Standards Compliance
      • GuardRails
    • Xygeni Products
    • How Xygeni works
    • Xygeni Web UI Overview
      • Projects Screen
        • Risk Level
    • Integrating Xygeni into your Workflow
    • Prioritization Funnels
      • Custom Funnels
      • Prioritization Criteria (Stages)
        • Reachability
        • Exploitability
        • Fixable
    • Guardrails
    • Generate a SBOM
    • Reports
      • Trends
      • Scan History
    • Supported Integrations
    • Customizations
  • Xygeni Products
    • Application Security Posture Management (ASPM)
      • ASPM User Interface Guide
      • All Risks
        • Statistics
        • Issues Evolution
        • Issue Comparison Between Different Scans
      • Governance
      • Inventory
        • All Assets
        • Repositories
        • Components
        • CI/CD Assets
        • Delivery Assets
        • Systems & Tools
        • Collaborators
      • Health Check
      • Inventory Scanner
        • Inventory Scanner Configuration
        • Inventory Collaborators Scan
      • Importing reports from 3rd party tools
        • External Scanners Supported
          • Report upload for Kiuwan
            • ExportRule (.java)
    • Code Security (SAST)
      • Code Security (SAST) User Interface Guide
        • Risks (SAST)
        • Malicious Code
      • Malware Scanner
        • Malware Scanner Configuration
        • Malware Detectors
      • SAST Scanner
        • SAST Scanner Configuration
    • Open Source (SCA)
      • Open Source (SCA) User Interface Guide
      • Open Source Components
      • Supported Package Managers for dependency resolution
      • Risks (SCA)
      • OSS Prioritization Funnels
      • OSS Auto-Remediation
      • Malware Early Warning (MEW)
        • How Malware Early Warning works
        • Common types of Malware found in open source packages
      • Dependency Scanner
        • Dependency scanner configuration
        • Dependency Analyzers
      • Suspect Dependencies Scanner
        • Suspect Deps Scanner Configuration
        • Suspect Deps Detectors
    • CI/CD Security
      • CI/CD Security User Interface Guide
      • CI/CD Details
      • Build Attestations
      • CI/CD Scanner
        • CI/CD Misconfigurations Scanner Configuration
      • Compliance Scanner
        • Supported compliance standards
    • Secrets Security
      • Secrets User Interface Guide
      • Secrets Scanner
        • Secrets scanner configuration
      • Secret Leaks Handling
        • Secret Leaks Handling
        • How to Prevent Hard-Coded Secrets
        • Secret Leaks Handling CheatSheet
      • Secrets Auto-Remediation
    • IaC Security
      • IaC User Interface Guide
      • IaC Scanner
        • IaC Scanner Configuration
    • Malware
    • Build Security
      • Build Security Concepts
      • Build Attestations
      • Attestation format
      • How SALT works
      • Installing Salt CLI
      • Salt Command-Line Reference
      • SALT Architecture
      • SALT How To…​
    • Anomalous Activity Detection
      • Anomalous Activity Detection User Interface Guide
      • Xygeni Sensors
        • Xygeni Sensor for Azure
        • Xygeni Sensor for BitBucket
        • Xygeni Sensor for GitHub
          • GitHub Audit Log Processing
        • Xygeni Sensor for GitLab
        • Xygeni Sensor for Jenkins
        • Anomaly Detection's Detectors
      • Code Tampering Scanner
        • Code Tampering Scanner Configuration
    • Compliance & Malware Insights
      • SSCS Compliance
      • Malicious Packages DB
  • Scan Management
    • Manage Scans
    • Scan History
  • Xygeni Scanner CLI
    • Xygeni Scanners
    • Xygeni CLI Overview
      • Xygeni CLI Prerequisites
      • Xygeni CLI Installation
      • Xygeni CLI Docker Image
      • Xygeni CLI Authentication
        • CLI Authentication with Xygeni
      • SCM, CI/ CD and Container Registry tokens
      • Xygeni CLI Operation Modes
        • Single scan
          • Scanning a docker image
        • Multi Scan
        • Organization scan
      • Xygeni CLI Configuration options
      • Xygeni CLI Output Formats
      • Exporting Xygeni results to 3rd party tools
      • Automatic Remediation
      • Generate SBOM with the Xygeni CLI
      • CLI utils
        • Credentials Encryption
        • Central Configuration
      • Xygeni Guardrails
        • CI/CD Audit Analysis
      • Xygeni CLI Error Codes
      • Xygeni Scanner Reference
  • Xygeni Administration
    • Platform Administration
      • Profile
      • Subscription
      • Users Management
      • Projects Management
      • Groups Management
      • Policies
      • Integrations
        • Xygeni Single Sign-On (SSO) Authentication
          • SSO - OKTA
          • SSO - Microsoft Entra ID
        • Integrate Scanner CLI into CI/CD Systems
          • Azure Pipelines Integration
          • BitBucket Integration
          • CircleCI Integration
          • GitHub Actions Integration
          • GitLab Runner Integration
          • Jenkins Integration
          • Travis CI Integration
        • Git Hooks with Xygeni
        • Collaboration & communication Tools
        • Ticketing Systems
        • Remediation systems
      • Notifications
    • Rest API
  • Support
  • Changelog
    • Version 5.11 - April 11, 2025
    • Version 5.9 – March 26, 2025
Powered by GitBook
On this page
  • Why are these tokens required?
  • Required token permissions
  • Providing the token
  • Full reference of conf/xygeni.yml
Export as PDF
  1. Xygeni Scanner CLI
  2. Xygeni CLI Overview

SCM, CI/ CD and Container Registry tokens

PreviousCLI Authentication with XygeniNextXygeni CLI Operation Modes

Last updated 28 days ago

Why are these tokens required?

Our scanner performs checks against your SCM, CI/ CD systems and container registries to recover information about your repository and organization, as part of the scanning process to validate if there are misconfigurations affecting them.

For image scanning, authentication with the container registry for pulling the image may require credentials, often in the form of access tokens.

For that, it is important to provide tokens with the permissions allowing the scanner to collect the data needed for analyses.

Required token permissions

For GitHub , these are the required token permissions/ scopes:

  • enterprise: read

  • org: admin

  • packages: read

  • project: read

  • repo: full

  • repo_hook: read

  • user: read

See if you have doubts about setting up a Personal Access Token.

For Azure Devops , these are the required token permissions/ scopes:

  • Build: Read

  • Code: Read, Status

  • Graph: Read

  • Identity: Read

  • Packaging: Read

  • Project and Team: Read

  • Release: Read

  • Security: Manage

See if you have doubts about setting up a Personal Access Token.

See for further information about permissions for pulling images under a repository, if you need to scan private images pushed into Azure CR registry.

  • Account: Read

  • Pipelines: Read

  • Projects: Read

  • Pull Requests: Read

  • Repositories: Admin

  • Runners: Read

  • Webhooks: Read and Write

  • Workspace membership: Read

  • api

  • read_api

  • read_user

  • read_repository

  • read_registry

Providing the token

Navigate to your scanner folder and look at the file conf/xygeni.yml. Under the scm, cicd and containerRegistry elements you are going to discover the currently available systems and how to provide their tokens to the scanner. This is done in entries under tokenSources. Each token source is tested until a valid token is found. Token sources could be an environment variable, a local file, or a hardcoded value (not recommended).

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

For example, in the case of GitHub, you can make the GitHub PAT available for Xygeni Scanner either by setting GITHUB_TOKEN or GITHUB_PAT environment variables, or storing it into a file named ${user.home}/.github.token or ${XYGENI_DIR}/conf/.github.token (in this latter case, XYGENI_DIR env var should be set)

kind: github
    # Which projects are held in this SCM?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given scm kind)
    usedBy: ${GITHUB_USED_BY}
    # The (optional) default username to connect to the SCM API.
    # If not given it could be extracted from the repository URL, when available.
    user: ${GITHUB_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${GITHUB_TOKEN}
      - ${GITHUB_PAT}
      - file:${user.home}/.github.token
      - file:${XYGENI_DIR}/conf/.github.token

In the case of Jenkins, you must set some additional env variables:

  • JENKINS_URL (your Jenkins base URL)

  • JENKINS_USER (the Jenkins username to connect to the Jenkins API)

Full reference of conf/xygeni.yml

# List of different Source Code Management (SCM) systems
# supporting projects for the organization
scm:
  # One of: github, azure_devops, bitbucket, gitlab.
  -
    kind: github
    # Which projects are held in this SCM?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given scm kind)
    usedBy: ${GITHUB_USED_BY}
    # The (optional) default username to connect to the SCM API.
    # If not given it could be extracted from the repository URL, when available.
    user: ${GITHUB_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${GITHUB_TOKEN}
      - ${GITHUB_PAT}
      - file:${user.home}/.github.token
      - file:${XYGENI_DIR}/conf/.github.token
  -
    kind: azure_devops
    # Which projects are held in this SCM?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given scm kind)
    usedBy: ${AZURE_USED_BY}
    # The (optional) default username to connect to the SCM API.
    # If not given it could be extracted from the repository URL, when available.
    user: ${AZURE_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${AZURE_TOKEN}
      - ${AZURE_PAT}
      - file:${user.home}/.azure.token
      - file:${XYGENI_DIR}/conf/.azure.token
  -
    kind: bitbucket
    # Which projects are held in this SCM?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given scm kind)
    usedBy: ${BITBUCKET_USED_BY}
    # The (optional) default username to connect to the SCM API.
    # If not given it could be extracted from the repository URL, when available.
    user: ${BITBUCKET_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${BITBUCKET_TOKEN}
      - ${BITBUCKET_PAT}
      - file:${user.home}/.bitbucket.token
      - file:${XYGENI_DIR}/conf/.bitbucket.token
  -
    kind: gitlab
    # Which projects are held in this SCM?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given scm kind)
    usedBy: ${GITLAB_USED_BY}
    # The (optional) default username to connect to the SCM API.
    # If not given it could be extracted from the repository URL, when available.
    user: ${GITLAB_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${GITLAB_TOKEN}
      - ${GITLAB_PAT}
      - file:${user.home}/.gitlab.token
      - file:${XYGENI_DIR}/conf/.gitlab.token


# CI/CD tools used, if you dont configure this, the system will assume that the SCM is used as CI/CD tool.
cicd:
  -
    kind: jenkins
    # Jenkins base URL
    url: ${JENKINS_URL}
    # Which projects use this CI/CD system?
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching any project for the given jenkins kind
    usedBy: ${JENKINS_USED_BY}
    # The username to connect to the CI/CD API.
    user: ${JENKINS_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${JENKINS_TOKEN}
      - file:${user.home}/.jenkins.token
      - file:${XYGENI_DIR}/conf/.jenkins.token
  -
    kind: circle_ci
    # CircleCI base URL
    url: '${CIRCLECI_URL:-https://circleci.com/api/}'
    tokenSources:
      - ${CIRCLECI_TOKEN}
      - file:${user.home}/.circleci.token


# Container (OCI) Registries
containerRegistry:
  -
    # Docker Hub
    # The hostname to match in the image name. This is the default when no hostname provided.
    hostname: '${DOCKER_HOST:-docker.io}'
    # Docker registry official URL
    url: '${DOCKER_URL:-https://registry-1.docker.io}'
    # Which projects use this registry? A hostname is often given in the image name.
    # Use a regex pattern, like 'project1|project2|project3' or 'prefix_.*'
    # Leave empty for matching by hostname.
    usedBy: ${DOCKER_USED_BY}
    # The username to connect to the registry api.
    user: ${DOCKER_USER}
    # How the access token should be fetched:
    # From environment/system property (env:),
    # From file (use ${scanned.dir} for scanned directory, ${XYGENI_DIR} for scanner directory, ${user.home} for $HOME),
    # or encode directly (use encryption to protect the token against casual readers)
    tokenSources:
      - ${DOCKER_TOKEN}
      - file:${user.home}/.docker.token

  #... Additional popular registries follow ...

For Bitbucket , these are the required token permissions/ scopes:

See and if you have doubts about setting up a Bitbucket token.

For GitLab , these are the required token permissions/ scopes:

See if you have doubts about setting up a Personal Access Token.

You can find a full reference of conf/xygeni.yml

Using Workspace Access Tokens
App Passwords
Creating a GitLab PAT
here
Creating a GH PAT
Creating a PAT
Create a token with repository-scoped permissions