使用detect-secrets进行仓库密钥基准线与审查 是做什么的?
扫描仓库中的密钥,维护可审计的基线,并在提交或CI检查期间仅审查新引入的问题。
先决条件
Python、detect-secrets CLI、git仓库
安装
使用适合您环境的上游安装或配置路径:
- $ pip install detect-secrets
- $ brew install detect-secrets
- $ pip install detect-secrets[word_list]
- $ pip install detect-secrets[gibberish]
来自上游的要求和注意事项:
- python
- 指定自定义过滤器路径。可以是Python模块。
- 对于非结构化密钥非常有效,但可能需要调整扫描精度。
基本使用或入门说明:
-
创建当前git仓库中潜在密钥的基线。
-
bash
-
$ detect-secrets scan > .secrets.baseline
-
摘自上游文档:https://raw.githubusercontent.com/Yelp/detect-secrets/HEAD/README.md