-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from zema1/feat-config-file
feat: support multiple pusher && config file
- Loading branch information
Showing
20 changed files
with
474 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 配置文件 | ||
|
||
Watchvuln 从 `v2.0.0` 版本开始支持从文件加载配置, 使用时需要使用 `-c` 参数指定配置文件路径, 如: | ||
|
||
``` | ||
./watchvuln -c /path/to/config.yaml | ||
./watchvuln -c /path/to/config.json | ||
``` | ||
|
||
同时为了简化开发和减低理解成本,我们约定,**如果指定了配置文件,那么命令行指定的任何参数将不再生效** | ||
|
||
## 文件格式 | ||
|
||
支持 `yaml` 和 `json` 两种格式的配置文件,这两个格式本质上是互通的,你可以选择自己喜欢的后缀。 | ||
一般,你只需将 `config.example.yaml` 的内容改一下即可,一个最简单的配置大概如下: | ||
|
||
```yaml | ||
db_conn: sqlite3://vuln_v3.sqlite3 | ||
sources: [ "avd","nox","oscs","threatbook","seebug","struts2","kev" ] | ||
interval: 30m | ||
pusher: | ||
- type: dingding | ||
access_token: "xxxx" | ||
sign_secret: "yyyy" | ||
``` | ||
聪明的你一定发现了,配置文件里的字段和命令行参数是一一对应的,这里就不再赘述了。 | ||
实际上,配置文件的出现主要是为了解决多推送的问题,比如你有两个钉钉群需要推送,那么可以写成这样 | ||
```yaml | ||
db_conn: sqlite3://vuln_v3.sqlite3 | ||
sources: [ "avd","nox","oscs","threatbook","seebug","struts2","kev" ] | ||
interval: 30m | ||
pusher: | ||
- type: dingding | ||
access_token: "xxxx" | ||
sign_secret: "yyyy" | ||
|
||
- type: dingding | ||
access_token: "pppp" | ||
sign_secret: "qqqq" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
db_conn: sqlite3://vuln_v3.sqlite3 | ||
sources: [ "avd","nox","oscs","threatbook","seebug","struts2","kev" ] | ||
interval: 30m | ||
enable_cve_filter: true | ||
no_github_search: false | ||
no_start_message: false | ||
diff_mode: false | ||
white_keywords: [ ] | ||
black_keywords: [ ] | ||
|
||
pusher: | ||
- type: dingding | ||
access_token: "" | ||
sign_secret: "" | ||
|
||
- type: lark | ||
access_token: "" | ||
sign_secret: "" | ||
|
||
- type: wechatwork | ||
key: "" | ||
|
||
- type: lanxin | ||
domain: "" | ||
access_token: "" | ||
sign_secret: "" | ||
|
||
- type: bark | ||
url: "" | ||
|
||
- type: serverchan | ||
key: "" | ||
|
||
- type: pushplus | ||
token: "" | ||
|
||
- type: telegram | ||
bot_token: "" | ||
chat_ids: "" | ||
|
||
- type: webhook | ||
url: "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.