TruffleHog – 专业的代码扫描检测凭证安全工具

TruffleHog 是一款专业的安全工具,专门用于扫描代码库,发现并验证隐藏在代码中的凭证。它能有效检测 API 密钥、密码、token 等敏感信息,帮助你及时发现并修复潜在的安全漏洞,确保代码库的安全。

file

特性

检测:

  • 扫描所有平台的版本历史以查找隐藏的密钥。TruffleHog 扫描范围不仅仅局限于代码仓库,还会识别隐藏在注释、Docker 镜像等中的密钥。

分析:

  • TruffleHog Analyze 自动识别与 API 密钥和其他密钥相关的资源和权限,无需访问提供商的 UI。

预防:

  • 使用预提交和预接收钩子,以便开发人员可以在第一时间防止密钥泄露。
  • 在提交之前自动运行安全扫描,并防止意外包含敏感数据。

补救:

  • TruffleHog 持续跟踪不同密钥类型的状态,以验证其修复情况。
  • 您可以使用链接到有关如何有效旋转和保护密钥的指南,在您首选的平台上设置警报提醒。

安装

# MacOS 
brew install trufflehog

# Docker
## Unix
docker run --rm -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys

## Windows Command Prompt
docker run --rm -it -v "%cd:/=\%:/pwd" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys

## Windows PowerShell
docker run --rm -it -v "${PWD}:/pwd" trufflesecurity/trufflehog github --repo https://github.com/trufflesecurity/test_keys

## M1 and M2 Mac
docker run --platform linux/arm64 --rm -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys

官方链接

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注