<p align="center">
<img alt="logo" src="../logo.svg">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">OpenSCA-Cli</h1>
<p align="center">
<a href="https://github.com/XmirrorSecurity/OpenSCA-cli/blob/master/LICENSE"><img src="https://img.shields.io/github/license/XmirrorSecurity/OpenSCA-cli?style=flat-square"></a>
<a href="https://github.com/XmirrorSecurity/OpenSCA-cli/releases"><img src="https://img.shields.io/github/v/release/XmirrorSecurity/OpenSCA-cli?style=flat-square"></a>
</p>
## Introduction
OpenSCA is intended for scanning the third-party component dependencies and vulnerabilities.
------
## Detection Ability
OpenSCA is now capable of parsing configuration files in the listed programming languages and correspondent package managers. The project 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` |
| `Rust` | `cargo` | `Cargo.lock` |
| `Erlang` | `Rebar` | `rebar.lock` |
| `Python` | `Pip` | `Pipfile` `Pipfile.lock` `setup.py` |
## Download and Deployment
1. Download the appropriate executable file according to your system architecture from [release](https://github.com/XmirrorSecurity/OpenSCA-cli/releases).
2. Or download the source code and compile (go 1.18 and above is needed)
```
git clone https://github.com/XmirrorSecurity/OpenSCA-cli.git opensca
cd opensca
go work init cli analyzer util
go build -o opensca-cli cli
```
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,freebsd,liunx,windows`
- Set the architecture `GOARCH=${arch} \\ 386,amd64,arm`
## Samples
For detecting the component information only:
```
opensca-cli -path ${project_path}
```
For connecting to the cloud platform:
```
opensca-cli -url ${url} -token ${token} -path ${project_path}
```
Or for using the local vulnerability database:
```
opensca-cli -db db.json -path ${project_path}
```
## Parameters
**You can either configure the parameters in configuration files or input the parameters in the command-line. When the two conflict with each other, the input parameters will be prioritized.**
| PARAMETER | TYPE | DESCRIPTION | SAMPLE |
| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `config` | `string` | Set the configuration file path, when the program runs, the parameter of the configuration file will be used as the startup parameters. If the configuration parameter conflicts with the command-line input parameter, the latter will be taken. | `-config config.json` |
| `path` | `string` | Set the file or directory path to be detected. | `-path ./foo` |
| `url` | `string` | Check the vulnerabilities from the cloud vulnerability database, set the address of the cloud service. It needs to be used with the `token` parameter. | `-url https://opensca.xmirror.cn` |
| `token` | `string` | Cloud service verification. You have to apply for it on the cloud service platform and use it with the `url` parameter. | `-token xxxxxxx` |
| `cache` | `bool` | This option is recommended. It can cache the downloaded files, for example, the `.pom` file, and save your time when detecting the same component next time. The downloaded files are saved in `.cache` under the same directory as opensca-cli. | `-cache` |
| `vuln` | `bool` | Show the vulnerabilities info only. Using this parameter, the component hierarchical architecture will **NOT** be included in the result. | `-vuln` |
| `out` | `string` | Set the output file. The result defaults to json format. Support the output of SBOM list in spdx format. | `-out output.json` |
| `db` | `string` | Set the local vulnerability database file. It helps when you prefer to use your own vulnerability database. The format of the vulnerability database is shown below. If the cloud and local vulnerability databases are both set, the result of detection will merge both. | `-db db.json` |
| `progress` | `bool` | Show the progress bar. | `-progress` |
| `dedup` | `bool` | Same result deduplication | `-dedup` |
------
### The Format of the Vulnerability Database File
```
[
{
"vendor": "org.apache.logging.log4j",
"product": "log4j-core",
"version": "[2.0-beta9,2.12.2)||[2.13.0,2.15.0)",
"language": "java",
"name": "Apache Log4j2 远程代码执行漏洞",
"id": "XMIRROR-2021-44228",
"cve_id": "CVE-2021-44228",
"cnnvd_id": "CNNVD-202112-799",
"cnvd_id": "CNVD-2021-95914",
"cwe_id": "CWE-502,CWE-400,CWE-20",
"description": "Apache Log4j是美国阿帕奇(Apache)基金会的一款基于Java的开源日志记录工具。\r\nApache Log4J 存在代码问题漏洞,攻击者可设计一个数据请求发送给使用 Apache Log4j工具的服务器,当该请求被打印成日志时就会触发远程代码执行。",
"description_en": "Apache Log4j
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
OpenSCA是一款开源的软件成分分析工具,用来扫描项目的第三方开源组件依赖及漏洞信息。 OpenSCA is a Software Composition Analysis (SCA) solution that supports the detection of open source component dependencies and vulnerabilities.
资源推荐
资源详情
资源评论
收起资源包目录
OpenSCA-cli-master.zip (71个子文件)
OpenSCA-cli-master
.goreleaser.yml 498B
docs
贡献指南(中文版)v1.0.md 6KB
CODE_OF_CONDUCT.md 5KB
Contributing Guideline-en v1.0.md 8KB
npm.md 6KB
analyzer
rust
cargo.go 2KB
analyzer.go 715B
analyzer
analyzer.go 401B
php
analyzer.go 1KB
composer_lock.go 2KB
composer.go 4KB
python
req.go 5KB
pipfile.go 1KB
oss.py 835B
setup.go 2KB
analyzer.go 1KB
engine
archive.go 4KB
engine.go 3KB
parse.go 4KB
erlang
analyzer.go 724B
rebar.go 471B
ruby
gem.go 2KB
analyzer.go 824B
javascript
analyzer.go 2KB
yarn_lock.go 3KB
package_json.go 4KB
package_lock.go 3KB
java
analyzer.go 5KB
mvn.go 8KB
pom.go 4KB
ext.go 4KB
gradle.go 3KB
oss.gradle 1KB
golang
analyzer.go 896B
gomod.go 1KB
go.sum 4KB
go.mod 611B
.github
README.md 11KB
LICENSE 11KB
logo.svg 6KB
db-demo.json 9KB
util
client
client.go 5KB
aes.go 970B
cache
cache.go 2KB
filter
file.go 3KB
logs
log.go 1KB
vuln
server.go 580B
local.go 2KB
vuln.go 2KB
model
version.go 7KB
dependency.go 4KB
vuln.go 856B
quque.go 1KB
file.go 3KB
temp
temp.go 655B
ex
python.go 2KB
bar
bar.go 949B
enum
language
language.go 2KB
report
spdx.go 5KB
html_tpl 1.69MB
json.go 479B
format.go 2KB
spdx_type.go 5KB
html.go 2KB
go.sum 161B
args
args.go 3KB
go.mod 59B
config.json 168B
cli
main.go 1KB
go.sum 0B
go.mod 20B
共 71 条
- 1
资源评论
m0_72731342
- 粉丝: 4
- 资源: 1829
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功