gitleaks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gitleaks ingests gitleaks JSON report output and normalizes it into findingspec Findings (security domain, type "secret"). It is a reference adapter: it depends only on the gitleaks report's stable JSON shape, not on the gitleaks library, so importing it stays lightweight.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader, opts Options) (*findingspec.FindingSet, error)

Parse decodes a gitleaks JSON report (a top-level array of findings) from r and returns a normalized FindingSet.

func ToFinding

func ToFinding(gl Finding, opts Options) findingspec.Finding

ToFinding normalizes a single gitleaks finding into a findingspec.Finding.

Types

type Finding

type Finding struct {
	Description string   `json:"Description"`
	StartLine   int      `json:"StartLine"`
	StartColumn int      `json:"StartColumn"`
	Match       string   `json:"Match"`
	Secret      string   `json:"Secret"`
	File        string   `json:"File"`
	Commit      string   `json:"Commit"`
	Entropy     float64  `json:"Entropy"`
	Date        string   `json:"Date"`
	Tags        []string `json:"Tags"`
	RuleID      string   `json:"RuleID"`
	Fingerprint string   `json:"Fingerprint"`
}

Finding mirrors a single entry in a gitleaks JSON report (gitleaks v8). Only the fields used for normalization are declared; unknown fields are ignored.

type Options

type Options struct {
	// Repo sets Location.Repo on every finding, for multi-repo sweeps. Optional.
	Repo string
}

Options configures normalization.

Jump to

Keyboard shortcuts

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