gitleaks

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gitleaks provides an adapter to convert Gitleaks JSON output to CTIS.

Package gitleaks provides an adapter to convert Gitleaks JSON output to CTIS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseToCTIS

func ParseToCTIS(data []byte, opts *core.ParseOptions) (*ctis.Report, error)

ParseToCTIS is a convenience function to parse Gitleaks JSON to CTIS format.

Types

type Adapter

type Adapter struct{}

Adapter converts Gitleaks JSON output to CTIS.

func NewAdapter

func NewAdapter() *Adapter

NewAdapter creates a new Gitleaks adapter.

func (*Adapter) CanConvert

func (a *Adapter) CanConvert(input []byte) bool

CanConvert checks if the input can be converted.

func (*Adapter) Convert

func (a *Adapter) Convert(ctx context.Context, input []byte, opts *core.AdapterOptions) (*ctis.Report, error)

Convert transforms Gitleaks JSON input to CTIS Report.

func (*Adapter) InputFormats

func (a *Adapter) InputFormats() []string

InputFormats returns supported input formats.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the adapter name.

func (*Adapter) OutputFormat

func (a *Adapter) OutputFormat() string

OutputFormat returns the output format.

type GitleaksFinding

type GitleaksFinding struct {
	Description string   `json:"Description"`
	StartLine   int      `json:"StartLine"`
	EndLine     int      `json:"EndLine"`
	StartColumn int      `json:"StartColumn"`
	EndColumn   int      `json:"EndColumn"`
	Match       string   `json:"Match,omitempty"`
	Secret      string   `json:"Secret,omitempty"`
	File        string   `json:"File"`
	SymlinkFile string   `json:"SymlinkFile,omitempty"`
	Commit      string   `json:"Commit,omitempty"`
	Entropy     float64  `json:"Entropy,omitempty"`
	Author      string   `json:"Author,omitempty"`
	Email       string   `json:"Email,omitempty"`
	Date        string   `json:"Date,omitempty"`
	Message     string   `json:"Message,omitempty"`
	Tags        []string `json:"Tags,omitempty"`
	RuleID      string   `json:"RuleID"`
	Fingerprint string   `json:"Fingerprint,omitempty"`
}

GitleaksFinding represents a single Gitleaks finding.

Jump to

Keyboard shortcuts

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