Skip to content

Commit 834daa2

Browse files
Merge pull request #276 from SuperChen-CC/docs
update: docs
2 parents 91f4d3e + 32e7de3 commit 834daa2

23 files changed

+985
-2
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[返回目录](/docs/README-zh-CN.md) / [English](./IDE_Plugins.md)
2+
3+
- [Visual Studio Code](#visual-studio-code)
4+
- [安装插件](#安装插件)
5+
- [使用插件](#使用插件)
6+
- [插件功能](#插件功能)
7+
- [插件执行流程](#插件执行流程)
8+
- [运行扫描](#运行扫描)
9+
- [Jetbrains IDEs](#jetbrains-ides)
10+
- [安装插件](#安装插件-1)
11+
- [使用插件](#使用插件-1)
12+
- [插件功能](#插件功能-1)
13+
- [插件执行流程](#插件执行流程-1)
14+
- [运行扫描](#运行扫描-1)
15+
16+
17+
# Visual Studio Code
18+
19+
## 安装插件
20+
21+
- **安装方法 一**:在 [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=xmirror.opensca) 中安装(推荐)
22+
23+
在VS Code中左边栏打开扩展->扩展的搜索框中输入“OpenSCA Xcheck”,点击“Install”
24+
25+
<img src="https://opensca.xmirror.cn/docs/img/vscode_01.jpg" alt="xcheck_market" />
26+
27+
- **安装方法二**:在[OpenSCA 官网](https://opensca.xmirror.cn/pages/plug-in)下载插件安装
28+
29+
- 从OpenSCA平台下载 “OpenSCA-Xcheck.vsix”;
30+
- 打开VS Code,依次操作:左边栏打开扩展->扩展顶栏的更多操作->“从VSIX安装”->找到并安装“OpenSCA-Xcheck.vsix”;
31+
32+
- **安装方法三**[下载源码](https://github.com/XmirrorSecurity/)自行编译安装
33+
34+
- 环境要求:
35+
36+
- node v18及以上版本
37+
- 系统支持MacOS、Windows、Linux
38+
39+
-[gitee](https://gitee.com/XmirrorSecurity/OpenSCA-VSCode-plugin)[github](https://github.com/XmirrorSecurity/OpenSCA-VSCode-plugin/)下载源码
40+
41+
* 全局安装vsce
42+
43+
```
44+
npm install --global @vscode/vsce
45+
```
46+
47+
* 执行打包命令
48+
49+
```
50+
vsce package
51+
```
52+
53+
## 使用插件
54+
55+
### 插件功能
56+
57+
- 开始检测:点击操作栏的“Run”,开始检测当前项目内的组件漏洞风险情况;
58+
- 停止检测:点击操作栏的“Stop”,停止检测当前项目内的组件漏洞风险情况;
59+
- 清除检测结果:点击操作栏的“Clean”,清除当前项目的检测结果;
60+
- 连接配置:点击操作栏的“Test”按钮,配置平台Url及Token信息,点击“测试连接”按钮可测试连接配置是否正确,连接成功后就可以开始检测啦;
61+
- 设置:点击操作栏的“Setting”,查看OpenSCA Xcheck相关设置信息。
62+
- 使用说明:点击操作栏的“Instructions”,查看OpenSCA Xcheck相关使用说明。
63+
- 查看更多:点击操作栏的“See more”,跳转到[opensca.xmirror.cn](https://opensca.xmirror.cn)查看OpenSCA Xcheck 更多相关信息。
64+
65+
<img src="https://opensca.xmirror.cn/docs/img/vscode_02.jpg" alt="xcheck_function" />
66+
67+
### 插件执行流程
68+
69+
<img src="https://opensca.xmirror.cn/docs/assets/img/xcheck_process.7083b869.jpg" alt="xcheck流程图" />
70+
71+
### 运行扫描
72+
73+
点击OpenSCA Xcheck可打开OpenSCA窗口。首先在配置界面中配置服务器参数(参考:插件功能-设置),然后在OpenSCA窗口中点击“Run”(参考:插件功能-开始检测)
74+
75+
# Jetbrains IDEs
76+
77+
## 安装插件
78+
79+
- **安装方法一**:从 [Jetbrains 插件市场](https://plugins.jetbrains.com/plugin/18246-opensca-xcheck) 中安装(推荐)
80+
81+
以IntelliJ IDEA为例:在IDE中依次点击“File|Settings|Plugins|Marketplace”,在搜索框中输入“OpenSCA Xcheck”,点击“Install”
82+
83+
![xcheck_market](/resources/xcheck_marketplace.jpg)
84+
85+
- **安装方法二**:在[OpenSCA平台](https://opensca.xmirror.cn/pages/plug-in )下载插件安装
86+
87+
以IntelliJ IDEA为例:将下载下来的插件安装包拖入适配的IDE中即可
88+
89+
- **安装方法三**:[下载源码](https://github.com/XmirrorSecurity/OpenSCA-intellij-plugin )自行编译安装
90+
91+
使用IntelliJ IDEA打开下载到本地的源码,需要配置运行环境:`jDK11`,待Gradle导入依赖和插件,在Gradle中执行`intellij`插件的`buildPlugin`任务,构建的安装包存放于当前项目下*build/distributions*目录下,将此目录下的安装包拖入当前IDE中即可
92+
93+
## 使用插件
94+
95+
### 插件功能
96+
97+
- 配置:点击File|Settings|Other Settings|OpenSCA Setting或点击OpenSCA窗口中的`Setting`按钮,在配置界面中配置连接服务器Url和Token
98+
- 测试连接:在OpenSCA配置界面中,配置服务器Url和Token之后点击`测试连接`按钮可验证Url和Token是否有效
99+
- 运行:点击OpenSCA窗口中的`Run`按钮,可对当前项目进行代码评估
100+
- 停止:如果正在对当前项目代码评估,那么`Stop`按钮是可用的,点击Stop按钮可结束当前评估任务
101+
- 清除:如果OpenSCA窗口中的Xcheck子窗口已有评估结果,点击`Clean`按钮可清除Xcheck子窗口中所有结果
102+
![xcheck_function](/resources/xcheck_function.jpg)
103+
104+
### 插件执行流程
105+
106+
![xcheck流程图](/resources/xcheck_process.jpg)
107+
108+
### 运行扫描
109+
110+
点击 `View` > `Tool Windows` > `OpenSCA` 可打开OpenSCA窗口。首先在OpenSCA配置界面中配置服务器参数(参考:插件功能-配置),然后在OpenSCA窗口中点击“运行”(参考:插件功能-运行)

docs/Integrations/IDE_Plugins.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[Go Back](/docs/README.md) | [简体中文](./IDE_Plugins-zh_CN.md)
2+
3+
- [Visual Studio Code](#visual-studio-code)
4+
- [Install Plugin](#install-plugin)
5+
- [Using the Plugin](#using-the-plugin)
6+
- [Plugin Features](#plugin-features)
7+
- [Plugin Execution Process](#plugin-execution-process)
8+
- [Running a Scan](#running-a-scan)
9+
- [JetBrains IDEs](#jetbrains-ides)
10+
- [Installing the Plugin](#installing-the-plugin)
11+
- [Using the Plugin](#using-the-plugin-1)
12+
- [Plugin Features](#plugin-features-1)
13+
- [Plugin Execution Process](#plugin-execution-process-1)
14+
- [Running a Scan](#running-a-scan-1)
15+
16+
# Visual Studio Code
17+
18+
## Install Plugin
19+
20+
- **Option 1**:Install from [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=xmirror.opensca)
21+
22+
In VS Code, open Extensions in the left sidebar -> enter "OpenSCA Xcheck" in the extension search box, click "Install"
23+
24+
<img src="https://opensca.xmirror.cn/docs/img/vscode_01.jpg" alt="xcheck_market" />
25+
26+
- **Option 2**:Download from [OpenSCA Official Web Site](https://opensca.xmirror.cn/pages/plug-in)
27+
28+
- Download "OpenSCA-Xcheck.vsix" from the OpenSCA official website;
29+
- Open VS Code, open Extensions in the left sidebar -> more actions in the top bar of the extension -> "Install from VSIX" -> find and install "OpenSCA-Xcheck.vsix";
30+
31+
- **Option 3**:Build from source code
32+
33+
- Requirements:
34+
- node v18 and above
35+
36+
- Clone the repository from [github](https://github.com/XmirrorSecurity/OpenSCA-VSCode-plugin/) or [gitee](https://gitee.com/XmirrorSecurity/OpenSCA-VSCode-plugin)
37+
38+
* Install vsce
39+
40+
```
41+
npm install --global @vscode/vsce
42+
```
43+
44+
* Package
45+
46+
```
47+
vsce package
48+
```
49+
50+
## Using the Plugin
51+
52+
### Plugin Features
53+
54+
- **Start Scan**: Click the "Run" button in the action bar to start scanning for vulnerabilities in the components of the current project.
55+
- **Stop Scan**: Click the "Stop" button in the action bar to stop the ongoing scan for vulnerabilities in the current project.
56+
- **Clear Scan Results**: Click the "Clean" button in the action bar to clear the scan results of the current project.
57+
- **Connection Configuration**: Click the "Test" button in the action bar to configure the platform URL and Token information. Click the "Test Connection" button to verify if the connection configuration is correct. Once the connection is successful, you can start scanning.
58+
- **Settings**: Click the "Setting" button in the action bar to view the settings related to OpenSCA Xcheck.
59+
- **Instructions**: Click the "Instructions" button in the action bar to view the user manual for OpenSCA Xcheck.
60+
- **See More**: Click the "See more" button in the action bar to visit [opensca.xmirror.cn](https://opensca.xmirror.cn) for more information about OpenSCA Xcheck.
61+
62+
![xcheck_function](https://opensca.xmirror.cn/docs/img/vscode_02.jpg)
63+
64+
### Plugin Execution Process
65+
66+
![xcheck_flow](https://opensca.xmirror.cn/docs/assets/img/xcheck_process.7083b869.jpg)
67+
68+
### Running a Scan
69+
70+
Click on OpenSCA Xcheck to open the OpenSCA window. First, configure the server parameters in the configuration interface (refer to: Plugin Features - Settings), then click “Run” in the OpenSCA window (refer to: Plugin Features - Start Scan).
71+
72+
# JetBrains IDEs
73+
74+
## Installing the Plugin
75+
76+
- **Method 1**: Install from the [JetBrains Plugin Marketplace](https://plugins.jetbrains.com/plugin/18246-opensca-xcheck) (Recommended)
77+
78+
For example, in IntelliJ IDEA: go to `File | Settings | Plugins | Marketplace`, search for "OpenSCA Xcheck" in the search box, and click "Install".
79+
80+
![xcheck_market](https://opensca.xmirror.cn/docs/img/xcheck_marketplace.jpg)
81+
82+
- **Method 2**: Download the plugin from the [OpenSCA Platform](https://opensca.xmirror.cn/pages/plug-in) and install it manually
83+
84+
For example, in IntelliJ IDEA: drag the downloaded plugin package into the IDE.
85+
86+
- **Method 3**: [Download the source code](https://github.com/XmirrorSecurity/OpenSCA-intellij-plugin) and compile it yourself
87+
88+
Open the downloaded source code in IntelliJ IDEA. Configure the runtime environment: `JDK11`. After Gradle imports dependencies and plugins, execute the `buildPlugin` task of the `intellij` plugin in Gradle. The built package will be located in the `build/distributions` directory of the project. Drag this package into the IDE to install it.
89+
90+
## Using the Plugin
91+
92+
### Plugin Features
93+
94+
- **Configuration**: Click `File | Settings | Other Settings | OpenSCA Setting` or click the `Setting` button in the OpenSCA window to configure the server URL and Token in the configuration interface.
95+
- **Test Connection**: After configuring the server URL and Token in the OpenSCA configuration interface, click the `Test Connection` button to verify if the URL and Token are valid.
96+
- **Run**: Click the `Run` button in the OpenSCA window to perform a code assessment on the current project.
97+
- **Stop**: If a code assessment is ongoing for the current project, the `Stop` button will be enabled. Click the `Stop` button to end the current assessment task.
98+
- **Clear**: If the Xcheck sub-window in the OpenSCA window already has assessment results, click the `Clean` button to clear all results in the Xcheck sub-window.
99+
100+
![xcheck_function](https://opensca.xmirror.cn/docs/img/xcheck_function.jpg)
101+
102+
### Plugin Execution Process
103+
104+
![xcheck_flow](https://opensca.xmirror.cn/docs/img/xcheck_process.jpg)
105+
106+
### Running a Scan
107+
108+
Click `View > Tool Windows > OpenSCA` to open the OpenSCA window. First, configure the server parameters in the OpenSCA configuration interface (refer to: Plugin Features - Configuration), then click the "Run" button in the OpenSCA window (refer to: Plugin Features - Run).

docs/README-zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [安装](./User_Guide/Installation-zh_CN.md)
99
- [扫描](./User_Guide/Scanning/)
1010
- [依赖分析](./User_Guide/Scanning/Dependency_Analysis-zh_CN.md)
11-
- [连接漏洞库](./User_Guide/Scanning/Connectiong_to_Vulnerability_Databases-zh_CN.md)
11+
- [连接漏洞库](./User_Guide/Scanning/Vulnerability_Analysis-zh_CN.md)
1212
- [查看结果](./User_Guide/Viewing_Results-zh_CN.md)
1313
- [生成报告](./User_Guide/Generating_Reports/)
1414
- [SBOM](./User_Guide/Generating_Reports/SBOM-zh_CN.md)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [Installation](./User_Guide/Installation.md)
99
- [Scanning](./User_Guide/Scanning/)
1010
- [Dependency Analysis](./User_Guide/Scanning/Dependency_Analysis.md)
11-
- [Connecting to Vulnerability Databases](./User_Guide/Scanning/Connectiong_to_Vulnerability_Databases.md)
11+
- [Connecting to Vulnerability Databases](./User_Guide/Scanning/Vulnerability_Analysis.md)
1212
- [Viewing Results](./User_Guide/Viewing_Results.md)
1313
- [Generating Reports](./User_Guide/Generating_Reports/)
1414
- [Software Bill of Materials (SBOM)](./User_Guide/Generating_Reports/SBOM.md)

docs/Troubleshooting-zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[返回目录](/docs/README-zh-CN.md) / [English](./Troubleshooting.md)

docs/Troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Go Back](/docs/README.md) | [中文](./Troubleshooting-zh_CN.md)
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
[返回目录](/docs/README-zh-CN.md) | [English](./Configuration-and-Parameters.md)
2+
3+
- [命令行参数](#命令行参数)
4+
- [配置文件说明](#配置文件说明)
5+
- [漏洞数据库配置示例](#漏洞数据库配置示例)
6+
- [漏洞数据库字段说明](#漏洞数据库字段说明)
7+
8+
9+
# 命令行参数
10+
11+
| 参数 | 描述 | 使用示例 |
12+
| --------- | -------------------------------------------- | ------------------------ |
13+
| `config` | 指定配置文件路径 | `-config config.json` |
14+
| `path` | 指定检测项目路径, 支持 http(s)/ftp/file 协议 | `-path ./foo` |
15+
| `out` | 根据后缀生成报告 | `-out out.json,out.html` |
16+
| `log` | 指定日志文件路径 | `-log my_log.txt` |
17+
| `token` | 云端服务`token` | `-token xxx` |
18+
| `proj` | saas项目`token` | `-proj xxx` |
19+
| `version` | 显示版本信息 | `-version` |
20+
| `help` | 显示帮助信息 | `-help` |
21+
22+
# 配置文件说明
23+
24+
配置文件使用 `json` 格式,支持以下字段:
25+
> 默认会从目标检测路径中查找配置文件, 否则使用[默认配置文件](/config.json)。 可通过 `-config` 参数指定配置文件路径。
26+
27+
- `path`: `String` 检测目标路径, 支持 http(s)/ftp/file 协议
28+
- `out`: `String` 报告输出路径, 通过后缀名识别文件类型, 支持 html/json/xml/csv/sqlite/cdx/spdx/swid/dsdx
29+
- `optional`: `Object` 可选配置项
30+
- `ui`: `Boolean` 是否启用交互式界面, 默认为 `false`
31+
- `dedup`: `Boolean` 是否启用组件去重(相同组件仅保留一条记录,组件路径合并), 默认为 `false`
32+
- `dir`: `Boolean` 是否仅检测目录(跳过压缩包), 默认为 `false`
33+
- `vuln`: `Boolean` 是否仅保留漏洞组件, 默认为 `false`
34+
- `progress`: `Boolean` 是否显示进度条, 默认为 `true`
35+
- `dev`: `Boolean` 是否保留开发组件, 默认为 `true`
36+
- `tls`: `Boolean` 开启 TLS 证书验证, 默认为 `false`
37+
- `proxy`: `String` 代理地址, 默认为空
38+
- `repo`: `Object` 组件仓库配置
39+
- `maven`: `Array` maven 镜像/私服仓库配置
40+
- `url`: `String` 仓库地址
41+
- `user`: `String` 用户名
42+
- `pass`: `String` 密码
43+
- `npm`: `Array` npm 镜像/私服仓库配置
44+
- `url`: `String` 仓库地址
45+
- `user`: `String` 用户名
46+
- `pass`: `String` 密码
47+
- `composer`: `Array` composer 镜像/私服仓库配置
48+
- `url`: `String` 仓库地址
49+
- `user`: `String` 用户名
50+
- `pass`: `String` 密码
51+
- `origin`: `Object` 漏洞数据源配置
52+
- `url`: `String` 漏洞数据源地址
53+
- `token`: `String` 云端漏洞数据库个人访问令牌
54+
- `proj`: `String` 项目访问令牌, 若置空则同步结果至"快速检测", 若无此字段(注释或删除)则不将结果同步至 OpenSCA SaaS
55+
- `json`: `String` JSON 格式漏洞数据库路径
56+
- `mysql`: `Object` MySQL 数据库漏洞数据源配置
57+
- `dsn`: `String` 数据库连接字符串
58+
- `table`: `String` 数据表名
59+
- `sqlite`: `Object` SQLite 数据库漏洞数据源配置
60+
- `dsn`: `String` 数据库连接字符串
61+
- `table`: `String` 数据表名
62+
63+
# 漏洞数据库配置示例
64+
65+
```json
66+
{
67+
// ...
68+
"origin": {
69+
// json 文件
70+
"json": "vuln-db.json",
71+
// MySQL
72+
"mysql": {
73+
// user:password@tcp(ip:port)/dbname
74+
"dns": "opensca:opensca@tcp(3306:127.0.0.1)/opensca",
75+
"table": "vuln"
76+
}
77+
"sqlite": {
78+
"dns": "vuln.db",
79+
"table": "vuln"
80+
}
81+
}
82+
83+
}
84+
```
85+
86+
# 漏洞数据库字段说明
87+
88+
| 字段 | 描述 | 是否必填 |
89+
| :------------------ | :-------------------------------- | :------- |
90+
| `vendor` | 组件厂商 ||
91+
| `product` | 组件名 ||
92+
| `version` | 漏洞影响版本 ||
93+
| `language` | 组件语言 ||
94+
| `name` | 漏洞名 ||
95+
| `id` | 自定义编号 ||
96+
| `cve_id` | cve 编号 ||
97+
| `cnnvd_id` | cnnvd 编号 ||
98+
| `cnvd_id` | cnvd 编号 ||
99+
| `cwe_id` | cwe 编号 ||
100+
| `description` | 漏洞描述 ||
101+
| `description_en` | 漏洞英文描述 ||
102+
| `suggestion` | 漏洞修复建议 ||
103+
| `attack_type` | 攻击方式 ||
104+
| `release_date` | 漏洞发布日期 ||
105+
| `security_level_id` | 漏洞风险评级 ||
106+
| `exploit_level_id` | 漏洞利用评级 ||
107+
108+
- `language` 可选值: `java` `javascript` `golang` `rust` `php` `ruby` `python`
109+
- `version` 描述可使用以下格式:
110+
| 符号 | 描述 (`x`为检出的组件版本) |
111+
| ------------- | -------------------------------- |
112+
| `[a,b]` | `a<=x<=b` |
113+
| `(a,b)` | `a<x<b` |
114+
| `[a,b)` | `a<=x<b` |
115+
| `(a,b]` | `a<x<=b` |
116+
| `(0,b)` | `x<b` |
117+
| `(a,)` | `x>a` |
118+
| `{a,b,c,...}` | `x=a``x=b``x=c``...` |
119+
> 同时位于多个范围需要用`||`连接,例如: `[a,b)||(b,c]`代表`a<=x<b``b<x<=c`,即`a<=x<=c``x!=b`
120+
>
121+
> 也可以区间和集合混用: `(0,b)||{c,d}||[e,)`代表`x<b``x=c``x=d``x>=e`
122+
- `security_level_id` 可选值: `1` `2` `3` `4`, 分别对应严重、高危、中危、低危
123+
- `exploit_level_id` 可选值 `0`:不可利用 `1`:可利用
File renamed without changes.

docs/User_Guide/Docker-zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[返回目录](/docs/README-zh-CN.md) / [English](./Docker.md)

0 commit comments

Comments
 (0)