# Gitleaks

> Open-source scanner that finds hard-coded secrets such as API keys and tokens in Git history, directories and stdin.

Source: https://osinttools.io/tools/gitleaks/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

- **Inputs:** URL, File
- **Category:** Infrastructure and domains
- **Pricing:** Free, open source
- **Footprint:** passive (does not contact the target)
- **Account required:** no
- **API:** no public API
- **Platforms:** Go CLI (Windows, macOS, Linux) · Docker
- **Website:** https://gitleaks.io/
- **Source code:** https://github.com/gitleaks/gitleaks
- **GitHub:** gitleaks/gitleaks, 31,378 stars · Go · MIT · last commit 2026-10-23
- **Listed:** Nov 27
- **Last verified by an editor:** Nov 27, 2026

## What it does

Gitleaks is a command-line tool that scans Git repositories, folders and piped input for secrets like API keys, passwords and tokens. It ships with a large set of detection rules, can decode encoded strings before matching, supports custom rules in a TOML config, and writes reports in JSON and other formats.

Investigators and security researchers run it over a cloned public repository to see whether an organisation has exposed credentials or internal endpoints in its code or commit history. Findings show where a secret is and should be reported responsibly, not used.

Footprint is passive: it reads its own index or third-party records and does not contact the target. No account is needed. There is no public API.

## Features

- Scans full Git history
- Directory and stdin scanning
- Built-in secret detection rules
- Custom TOML rules and allowlists
- Decoding of base64, hex and percent-encoded values
- JSON, CSV and template reports
- Pre-commit and CI use

## Pros

- Fast single binary
- Widely used and actively maintained
- Very configurable rules
- Free and open source

## Cons

- Pattern matching produces false positives
- Does not check whether a found secret is live
- Built for code security, so OSINT use needs care and a lawful basis

## When to use it

- Use it when you want to check a public repository's history for exposed keys or internal URLs.
- Use it when you need to audit your own code before publishing it.

## Quick start

Homebrew or Docker:

```
brew install gitleaks
gitleaks git -v path_to_repo
gitleaks dir -v path_to_directory_or_file
```

## Alternatives

- [Favihunter](https://osinttools.io/tools/favihunter/): Python CLI that hashes a site's favicon and builds pivot searches for Shodan, Censys, FOFA, ZoomEye and other engines. (Open source · URL, File · depends · 257 GitHub stars)
- [TruffleHog](https://osinttools.io/tools/trufflehog/): Open-source scanner that finds leaked API keys, passwords and tokens in Git history, files, buckets and more, and checks if they work. (Open source · URL, File · depends · 29,720 GitHub stars)
- [BetaMeta](https://osinttools.io/tools/betameta/): Web tool that pulls timestamps for a URL from certificates, Archive.org snapshots and page metadata and plots them on a timeline. (Free · URL · depends)
- [CachedView](https://osinttools.io/tools/cachedview-nl/): Checks one URL against the Wayback Machine, Archive.today, the Library of Congress and Perma.cc, and shows the live status. (Free · URL · depends)
- [CheckShortURL](https://osinttools.io/tools/checkshorturl/): Free URL unshortener that reveals where a short link leads, with page details, a screenshot and safety-check links. (Free · URL · active)
- [ExpandURL](https://osinttools.io/tools/expandurl/): Expands shortened links and shows the full redirect chain with status codes and a screenshot of the final page. (Free · URL · active)

All alternatives to Gitleaks in one table: https://osinttools.io/tools/gitleaks/alternatives/

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
