manager

package
v6.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactLocation

type ArtifactLocation struct {
	URI string `json:"uri"`
}

ArtifactLocation ...

type CloneTime

type CloneTime int64

CloneTime is a type used to determine total clone time

type Driver

type Driver struct {
	Name            string  `json:"name"`
	SemanticVersion string  `json:"semanticVersion"`
	Rules           []Rules `json:"rules"`
}

Driver ...

type FullDescription

type FullDescription struct {
	Text string `json:"text"`
}

FullDescription ...

type Leak

type Leak struct {
	Line       string    `json:"line"`
	LineNumber int       `json:"lineNumber"`
	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"`
	Operation  string    `json:"operation"`
	// 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 Locations

type Locations struct {
	PhysicalLocation PhysicalLocation `json:"physicalLocation"`
}

Locations ...

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 scan

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 scan 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 scan pkg. This is the public function that allows other packages to send leaks to the manager.

type Message

type Message struct {
	Text string `json:"text"`
}

Message ...

type Metadata

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

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

type PatchTime

type PatchTime int64

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

type PhysicalLocation

type PhysicalLocation struct {
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	Region           Region           `json:"region"`
}

PhysicalLocation ...

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.

type Region

type Region struct {
	StartLine int     `json:"startLine"`
	Snippet   Snippet `json:"snippet"`
}

Region ...

type ResultProperties

type ResultProperties struct {
	Commit        string    `json:"commit"`
	Offender      string    `json:"offender"`
	Date          time.Time `json:"date"`
	Author        string    `json:"author"`
	Email         string    `json:"email"`
	CommitMessage string    `json:"commitMessage"`
	Operation     string    `json:"gitOperation"`
	Repo          string    `json:"repo"`
}

ResultProperties ...

type Results

type Results struct {
	Message    Message          `json:"message"`
	Properties ResultProperties `json:"properties"`
	Locations  []Locations      `json:"locations"`
}

Results ...

type Rules

type Rules struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Rules ...

type Runs

type Runs struct {
	Tool    Tool      `json:"tool"`
	Results []Results `json:"results"`
}

Runs ...

type Sarif

type Sarif struct {
	Schema  string `json:"$schema"`
	Version string `json:"version"`
	Runs    []Runs `json:"runs"`
}

Sarif ...

type ScanTime

type ScanTime int64

ScanTime is a type used to determine total scan time

type ShortDescription

type ShortDescription struct {
	Text string `json:"text"`
}

ShortDescription ...

type Snippet

type Snippet struct {
	Text string `json:"text"`
}

Snippet ...

type Tool

type Tool struct {
	Driver Driver `json:"driver"`
}

Tool ...

Jump to

Keyboard shortcuts

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