manager

package
v4.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditTime

type AuditTime int64

AuditTime is a type used to determine total audit time

type CloneTime

type CloneTime int64

CloneTime is a type used to determine total clone time

type Leak

type Leak struct {
	Line     string    `json:"line"`
	Offender string    `json:"offender"`
	Commit   string    `json:"commit"`
	Repo     string    `json:"repo"`
	Rule     string    `json:"rule"`
	Message  string    `json:"commitMessage"`
	Author   string    `json:"author"`
	Email    string    `json:"email"`
	File     string    `json:"file"`
	Date     time.Time `json:"date"`
	Tags     string    `json:"tags"`
	// contains filtered or unexported fields
}

Leak is a struct that contains information about some line of code that contains sensitive information as determined by the rules set in a gitleaks config

type Manager

type Manager struct {
	Opts   options.Options
	Config config.Config

	CloneOptions *git.CloneOptions
	CloneDir     string
	// contains filtered or unexported fields
}

Manager is a struct containing options and configs as well CloneOptions and CloneDir. This struct is passed into each NewRepo so we are not passing around the manager in func params.

func NewManager

func NewManager(opts options.Options, cfg config.Config) (*Manager, error)

NewManager accepts options and returns a manager struct. The manager is a container for gitleaks configurations, options and channel receivers.

func (*Manager) DebugOutput

func (manager *Manager) DebugOutput()

DebugOutput logs metadata and other messages that occurred during a gitleaks audit

func (*Manager) GetLeaks

func (manager *Manager) GetLeaks() []Leak

GetLeaks returns all available leaks

func (*Manager) GetMetadata

func (manager *Manager) GetMetadata() Metadata

GetMetadata returns the metadata. TODO this may not need to be private

func (*Manager) IncrementCommits

func (manager *Manager) IncrementCommits(i int)

IncrementCommits increments total commits during an audit by i.

func (*Manager) RecordTime

func (manager *Manager) RecordTime(t interface{})

RecordTime accepts an interface and sends it to the manager's time channel

func (*Manager) Report

func (manager *Manager) Report() error

Report saves gitleaks leaks to a json specified by --report={report.json}

func (*Manager) SendLeaks

func (manager *Manager) SendLeaks(l Leak)

SendLeaks accepts a leak and is used by the audit pkg. This is the public function that allows other packages to send leaks to the manager.

type Metadata

type Metadata struct {
	RegexTime map[string]int64
	Commits   int
	AuditTime int64
	// contains filtered or unexported fields
}

Metadata is a struct used to communicate metadata about an audit like timings and total commit counts.

type PatchTime

type PatchTime int64

PatchTime is a type used to determine total patch time during an audit

type RegexTime

type RegexTime struct {
	Time  int64
	Regex string
}

RegexTime is a type used to determine the time each rules' regex takes. This is especially useful if you notice that gitleaks is taking a long time. You can use --debug to see the output of the regexTime so you can determine which regex is not performing well.

Jump to

Keyboard shortcuts

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