OSS Review Toolkit (ORT) Documentation

repository·main·Indexed 24 days ago

https://github.com/oss-review-toolkit/ort

A policy automation and orchestration toolkit for managing open source software dependencies, including SBOM generation, security vulnerability scanning, and license compliance. The documentation covers REST API clients, plugin development using the KSP compiler plugin, and integration guides for Jenkins and Tekton pipelines.

Tokens
52.6K
Snippets
79
Records
301
Agent score
84%

What's inside OSS Review Toolkit (ORT)

  1. Overview of ORT REST API clients

    main
    The clients directory contains generic REST API clients designed for various services. These modules are independent of the core ORT logic (though ORT depends on them) and are structured as standalone components that could potentially be used as separate projects.
  2. Overview of OSS Review Toolkit (ORT) capabilities

    main

    The OSS Review Toolkit (ORT) is a FOSS policy automation and orchestration toolkit designed to manage open source software dependencies. It provides capabilities for:

    • SBOM Generation: Generate CycloneDX, SPDX SBOMs, or custom FOSS attribution documentation.
    • Policy Automation: Use risk-based Policy as Code to automate licensing, security vulnerability, InnerSource, and engineering standards checks.
    • Source Archiving: Create source code archives for software projects and dependencies to ensure compliance and long-term availability.
    • Metadata Correction: Correct package metadata or licensing findings manually or via community contributions.

    ORT can be integrated into workflows as a library (programmatic use), via a command line interface (scripted use), or through CI integrations.

  3. What is the OSS Review Toolkit (ORT)?

    main

    The OSS Review Toolkit (ORT) is a FOSS policy automation and orchestration toolkit designed to manage open source software dependencies. It can be used as a library for programmatic use, via a command line interface (CLI) for scripting, or through CI integrations.

    Key capabilities include:

    • SBOM Generation: Create CycloneDX, SPDX, or custom FOSS attribution documentation.
    • Policy Automation: Use Risk-based Policy as Code to automate licensing, security vulnerability, and engineering standard checks.
    • Source Archiving: Create source code archives for dependencies to ensure compliance and long-term availability.
    • Metadata Correction: Correct package metadata or licensing findings via InnerSource or community contributions.
  4. Understand synthetic SPDX test projects

    main

    The synthetic directory contains test projects that do not use a dedicated package manager (like Maven or NPM). Instead, these projects use SPDX files to declare project metadata and dependencies. These projects are used to verify how the ORT handles various dependency declaration patterns using SPDX.

    Available test project types:

    • inline-packages: Metadata for both the project and all its dependencies is declared within a single SPDX file.
    • package-references: The main file declares project metadata and refers to external SPDX files for each individual package's metadata.
    • subproject-dependencies: Verifies that subprojects are handled correctly within the dependency tree.
    • transitive-dependencies: Verifies that transitive dependencies (dependencies of dependencies) are resolved correctly.
    • subproject-conan: An SPDX-based project that specifically refers to Conan packages.
  5. What is the ORT Analyzer and how does it work?

    main

    The analyzer is a Software Composition Analysis (SCA) tool that determines the dependencies of software projects within a specified version-controlled input directory (-i). It is the only mandatory tool in the ORT workflow because its output serves as the required input for all subsequent tools.

    How it works

    The analyzer queries detected package managers to build a tree of transitive dependencies. It does not require modifications to your source code (like build system plugins) if the following preconditions are met:

    • Projects use supported package managers in recent versions and follow common best practices.
    • Projects can be built in a single step out-of-the-box without custom configuration (e.g., environment variables or build system properties).

    Output

    The analyzer writes the dependency tree per project into an OrtResult object. This is saved as analyzer-result.yml in the specified output directory (-o). The output format is YAML by default, but can be set to JSON using the -f flag. This file documents the current status of all package-related metadata and can be manually edited or processed by other tools.

  6. What is the ORT Scanner and how does it work?

    main

    The ORT Scanner is a tool that wraps various license and copyright scanners (like FossID or ScanCode) into a common API. This allows you to run different scanners interchangeably and compare their results using a consistent interface.

    Key Features:

    • Automatic Workflow: If you provide an ORT result file containing analyzer results using the -i flag, the scanner will automatically trigger the downloader to fetch dependency sources before performing the scan.
    • Result Reuse: The scanner can use Storage Backends to avoid re-scanning or re-downloading sources that have already been processed. It checks configured storages for existing results before proceeding with a new scan.
    • Provenance-Based Optimization: For FileBasedStorage or PostgresStorage, the scanner groups packages by their provenance. This ensures a specific VCS repository revision is scanned only once, sharing the results across all packages from that repository, which significantly improves performance for large repositories.
  7. How includes work in .ort.yml

    main

    Includes are used to define which Open Source Software (OSS) is distributed to third parties versus what is used only internally. This is useful for monorepos where you only want to analyze a specific sub-project.

    Inclusions apply to paths (files/directories) or scopes (package manager dependency groups like Maven's compile or NPM's devDependencies).

    Key Rules:

    • Every include must provide a reason (selected from a predefined list) and an optional comment.
    • Path patterns use Ant-style glob patterns.
    • Scope patterns use regular expressions.
    • By default, all scopes are included; using includes: scopes allows you to filter for specific ones.
    includes:
      paths:
      - pattern: "src/**"
        reason: "SOURCE_OF"
        comment: "This directory contains the source code of binaries that are distributed."
    
      scopes:
      - pattern: "src.*"
        reason: "SOURCE_OF"
        comment: "Source code of delivered packages."
  8. Define custom policy rules with evaluator.rules.kts

    main

    You can define custom policy rules that automatically apply to review scan findings using a evaluator.rules.kts file. Rules are written in a Kotlin-based DSL. For each policy rule violation, you can define 'How to fix' follow-up actions to assist users in resolving violations independently.

    To implement rules, you can use an existing example as a base script. Note that some examples may depend on license categorizations defined in a separate license-classifications.yml file.

  9. How the ORT pipeline tools work together

    main

    ORT consists of several specialized tools that can be combined into a highly customizable pipeline:

    • Analyzer: Determines project dependencies and metadata, abstracting package managers and build systems.
    • Downloader: Fetches source code, abstracting Version Control Systems (VCS).
    • Scanner: Uses configured scanners to detect license and copyright findings.
    • Advisor: Retrieves security advisories from configured vulnerability data services.
    • Evaluator: Evaluates custom policy rules and license classifications against gathered data to identify violations.
    • Reporter: Presents results in various formats (visual reports, Open Source notices, or Bill-of-Materials/BOMs).
    • Notifier: Sends notifications via channels like email or JIRA tickets.