Gitleaks

gitleaks/gitleaks
需下载安装 下载安装到本机使用,不需要服务器。

扫 git 仓库里误提交的密钥和令牌,适合放进提交钩子

安全密钥管理命令行
Gitleaks 网站截图

部署命令

# MacOS
brew install gitleaks

# Docker (DockerHub)
docker pull zricethezav/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]

# Docker (ghcr.io)
docker pull ghcr.io/gitleaks/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]

# From Source (make sure `go` is installed)
git clone https://github.com/gitleaks/gitleaks.git
cd gitleaks
make build

摘自项目 README。需要一台装了 Docker 的服务器,命令可能还需补充环境变量。

项目简介(摘自 README)

Gitleaks is a tool for detecting secrets like passwords, API keys, and tokens in git repos, files, and whatever else you wanna throw at it via stdin. If you wanna learn more about how the detection engine works check out this blog: Regex is (almost) all you need.

星数
★ 29.5k
语言
Go
许可证
MIT
最近更新
2026-09-23
分类
安全隐私
场景
通用工具