rules

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 5 Imported by: 0

README

rules

import "github.com/brittonhayes/pillager/pkg/rules"

Package rules enables the parsing of Gitleaks rulesets.

Index

Constants

ErrReadConfig is the custom error message used if an error is encountered reading the gitleaks config.

const ErrReadConfig = "Failed to read gitleaks config"

Variables

These strings contain default configs. They are initialized at compile time via go:embed.

var (
    //go:embed rules_simple.toml
    RulesDefault string

    //go:embed rules_strict.toml
    RulesStrict string
)

type Loader

Loader represents a gitleaks config loader.

type Loader struct {
    // contains filtered or unexported fields
}
func NewLoader
func NewLoader(opts ...LoaderOption) *Loader

NewLoader creates a Loader instance.

func (*Loader) Load
func (l *Loader) Load() config.Config

Load parses the gitleaks configuration.

func (*Loader) WithStrict
func (l *Loader) WithStrict() LoaderOption

WithStrict enables more strict pillager scanning.

type LoaderOption

LoaderOption sets a parameter for the gitleaks config loader.

type LoaderOption func(*Loader)
func FromFile
func FromFile(file string) LoaderOption

FromFile decodes a gitleaks config from a local file.

Generated by gomarkdoc

Documentation

Overview

Package rules enables the parsing of Gitleaks rulesets.

Index

Constants

View Source
const ErrReadConfig = "Failed to read gitleaks config"

ErrReadConfig is the custom error message used if an error is encountered reading the gitleaks config.

Variables

View Source
var (
	RulesDefault = config.DefaultConfig

	//go:embed rules_strict.toml
	RulesStrict string
)

These strings contain default configs. They are initialized at compile time via go:embed.

Functions

This section is empty.

Types

type Loader added in v0.6.0

type Loader struct {
	// contains filtered or unexported fields
}

Loader represents a gitleaks config loader.

func NewLoader added in v0.6.0

func NewLoader(opts ...LoaderOption) *Loader

NewLoader creates a Loader instance.

func (*Loader) Load added in v0.6.0

func (l *Loader) Load() config.Config

Load parses the gitleaks configuration.

func (*Loader) WithStrict added in v0.6.0

func (l *Loader) WithStrict() LoaderOption

WithStrict enables more strict pillager scanning.

type LoaderOption added in v0.6.0

type LoaderOption func(*Loader)

LoaderOption sets a parameter for the gitleaks config loader.

func WithFile added in v0.7.6

func WithFile(file string) LoaderOption

WithFile decodes a gitleaks config from a local file.

Jump to

Keyboard shortcuts

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