gitleaksrules

package
v0.152.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitleaksrules scans unified diffs with the gitleaks default ruleset embedded in the gk binary, so secret scanning works without the gitleaks binary installed.

rules.json is generated by tools/genrules from a pinned gitleaks release (see `make gen-rules`). The engine mirrors the gitleaks detection steps that the default config relies on: keyword prefilter, regex, secret group, entropy, path rules, and global and per-rule allowlists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RuleCount

func RuleCount() int

RuleCount returns the number of embedded rules.

func ScanDiff

func ScanDiff(diff string) []secrets.Finding

ScanDiff scans the added lines of a unified diff (`git diff` or `git log -p` output) and returns one finding per matched secret.

func Version

func Version() string

Version returns the gitleaks release the embedded ruleset came from.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL