使用 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