Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

OpenSCA-cli

> 安全
Open source

OpenSCA is an open source software supply chain security solution that supports the detection of open source dependencies, vulnerabilities and license complianc

1.1K stars0 likes2 views
WebsiteGitHub

About

OpenSCA is an open source software supply chain security solution that supports the detection of open source dependencies, vulnerabilities and license complianc

English|中文

  • Introduction
  • Detection Ability
  • Installation
    • Method 1: Download from Releases
    • Method 2: Use install script
    • Method 3: Use package manager(Homebrew)
    • Method 4: Build from source
  • Use OpenSCA
    • Parameters
    • Ignore Paths in Configuration
    • Report Formats
    • Sample
      • Scan & Report via Docker Container
    • Local Vulnerability Database
      • The Format of the Vulnerability Database File
      • Explanations of Vulnerability Database Fields
      • Sample of Setting the Vulnerability Database
  • FAQ
    • Is the environment variable needed while using OpenSCA?
    • About the vulnerability database?
    • About the time cost of OpenSCA scanning?
  • Contact Us
  • Authors
  • Contributing

Introduction

OpenSCA is intended for scanning third-party dependencies, vulnerabilities and licenses.

Our website: https://opensca.xmirror.cn

Click STAR to leave encouragement.


Detection Ability

OpenSCA is now capable of parsing configuration files in the listed programming languages and correspondent package managers. The team is now dedicated to introducing more languages and enriching the parsing of relevant configuration files gradually.

LANGUAGE PACKAGE MANAGER FILE
Java Maven pom.xml
Java Gradle .gradle .gradle.kts
JavaScript Npm package-lock.json package.json yarn.lock
PHP Composer composer.json composer.lock
Ruby gem gemfile.lock
Golang gomod go.mod go.sum Gopkg.toml Gopkg.lock
Rust cargo Cargo.lock
Erlang Rebar rebar.lock
Python Pip Pipfile Pipfile.lock setup.py requirements.txt requirements.in(For the latter two, pipenv environment & internet connection are needed)

Installation

OpenSCA-cli is available for Windows, Linux and MacOS. The installation method is as follows:

Method 1: Download from Releases

  1. Download the appropriate executable file according to your system architecture from releases.
  2. Unzip the downloaded file and run opensca-cli directly.

Method 2: Use install script

  • For Mac/Linux Users
    bash
    curl -sSL https://raw.githubusercontent.com/XmirrorSecurity/OpenSCA-cli/master/scripts/install.sh | sh
    
    # Try this when internet connection fails
    curl -sSL https://gitee.com/XmirrorSecurity/OpenSCA-cli/raw/master/scripts/install.sh | sh -s -- gitee
  • For Windows Users(need PowerShell)
    powershell
    iex "&{$(irm https://raw.githubusercontent.com/XmirrorSecurity/OpenSCA-cli/master/scripts/install.ps1)}"
    
    # Try this when internet connection fails
    iex "&{$(irm https://gitee.com/XmirrorSecurity/OpenSCA-cli/raw/master/scripts/install.ps1)} gitee"

Method 3: Use package manager(Homebrew)

bash
brew install opensca-cli

Method 4: Build from source

Clone the source code and compile (go 1.18 and above is needed)

bash
# github linux/mac
git clone https://github.com/XmirrorSecurity/OpenSCA-cli.git opensca && cd opensca && go build
# gitee linux/mac
git clone https://gitee.com/XmirrorSecurity/OpenSCA-cli.git opensca && cd opensca && go build
# github windows
git clone https://github.com/XmirrorSecurity/OpenSCA-cli.git opensca ; cd opensca ; go build
# gitee windows
git clone https://gitee.com/XmirrorSecurity/OpenSCA-cli.git opensca ; cd opensca ; go build

The default option is to generate the program of the current system architecture. If you want to try it for other system architectures, you can set the following environment variables before compiling.

  • Disable CGO_ENABLED CGO_ENABLED=0
  • Set the operating system GOOS=${OS} \\ darwin,liunx,windows
  • Set the architecture GOARCH=${arch} \\ amd64,arm64

Use OpenSCA

Parameters

PARAMETER TYPE Descripation SAMPLE
config string Set the path of the configuration file -config config.json
path string Set the path of the target file or directory -path ./foo
out string Save the result to the specified file whose format is defined by the suffix -out out.json, out.html
log string Specify the path of log file -log my_log.txt
token string Cloud service verification from our offical website -token xxx
proj string SaaS project token to sync report with OpenSCA SaaS -proj xxx

From v3.0.0, apart from these parameters available for CMD/CRT, there are also others for different requirements which have to be set in the configuration file.

Full introduction about each parameters can be found in config.json

v3.0.2 and above allows OpenSCA-cli to snyc reports with OpenSCA SaaS (via proj), so that all reports of multiple projects can be managed together.

If the configuration parameter conflicts with the command-line input parameter, the latter will be taken.

When there's no configuration file in the set path, one in default settings will be generated there.

If no path of configuration file is set, the following ones will be checked:

  1. config.json under the working directory
  2. opensca_config.json under the user directory
  3. config.json under opensca-cli directory

Ignore Paths in Configuration

Use optional.ignore in the configuration file to skip files or directories during scanning. OpenSCA only reads ignore rules from the current configuration file and does not automatically load the project's .gitignore. The rules are compatible with common .gitignore syntax, including directory matches, wildcards, and ! negation.

json
{
  "optional": {
    "ignore": [
      "JarCollection/",
      "*.jar",
      "!libs/keep.jar"
    ]
  }
}

From v3.0.0, url has been put in the configuration file. The default set goes to our cloud vulnerability database. Other online database in accordance with our database structure can also be set through configuration file.

Using previous versions to connect the cloud databse will still need the setting of url, which could be done via both CMD and configuration file. Example: -url https://opensca.xmirror.cn

Report Formats

Files supported by the out parameter are listed below:

TYPE FORMAT SPECIFIED SUFFIX VERSION
REPORT json .json *
xml .xml *
html .html v1.0.6 and above
sqlite .sqlite v1.0.13 and above
csv .csv v1.0.13 and above
sarif .sarif
SBOM spdx .spdx .spdx.json .spdx.xml v1.0.8 and above
cdx .cdx.json .cdx.xml v1.0.11and above
swid .swid.json .swid.xml v1.0.11and above
dsdx .dsdx .dsdx.json .dsdx.xml v3.0.0and above
bomsw .bomsw.json v3.0.8and above

Sample

bash
# Use opensca-cli to scan with CMD parameters:
opensca-cli -path ${project_path} -config ${config_path} -out ${filename}.${suffix} -token ${token}

# Start scanning after setting down the configuration file:
opensca-cli

Scan & Report via Docker Container

bash
# Detect dependencies in the current directory:
docker run -ti --rm -v ${PWD}:/src opensca/opensca-cli

# Connect to the cloud vulnerability database:
docker run -ti --rm -v ${PWD}:/src opensca/opensca-cli -token ${put_your_token_here}

You can also use the configuration file for advanced settings. Save config.json to the mounted directory of src or set other paths within the container through -config. The writing method for mounting the current directory on different terminals varies, we list common ones here FYI:

terminal pwd
bash $(pwd)
zsh ${PWD}
cmd %cd%
powershell (Get-Location).Path

For more information, visit Docker Hub Page

Local Vulnerability Database

The Format of the Vulnerability Database File

…

Explanations of Vulnerability Database Fields

FIELD Descripation REQUIRED OR NOT
vendor the manufacturer of the component N
product the name of the component Y
version the versions of the component affected by the vulnerability

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gocyclonedxdevsecopslicense-compliancesbom

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.