secrets

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SECRET_DEFINITION_URLS = "https://raw.githubusercontent.com/gitleaks/gitleaks/master/config/gitleaks.toml"

Variables

This section is empty.

Functions

func InjectSecrets

func InjectSecrets(generators *SecretGeneratorCollection, data interface{}) interface{}

func UpdateSecretsFromGitLeaks

func UpdateSecretsFromGitLeaks() ([]byte, error)

Types

type GitLeaksSecretRule

type GitLeaksSecretRule struct {
	Id          string `toml:"id"`
	Description string `toml:"description"`
	Regex       string `toml:"regex"`
}

type GitLeaksSecretRules

type GitLeaksSecretRules struct {
	Rules []GitLeaksSecretRule `toml:"rules"`
}

func GetSecretsFromGitLeaks

func GetSecretsFromGitLeaks() (*GitLeaksSecretRules, error)

type SecretGenerator

type SecretGenerator struct {
	Name            string
	NameGenerator   regen.Generator
	SecretGenerator regen.Generator
}

func GetGenerators

func GetGenerators() []*SecretGenerator

func NewGenerator

func NewGenerator(rule SecretGeneratorRule) *SecretGenerator

type SecretGeneratorCollection

type SecretGeneratorCollection struct {
	Generators []*SecretGenerator
	// contains filtered or unexported fields
}

func NewSecretGeneratorCollection

func NewSecretGeneratorCollection(telemetry *metrics.Telemetry) *SecretGeneratorCollection

func (*SecretGeneratorCollection) GetRandomGenerator

func (c *SecretGeneratorCollection) GetRandomGenerator() *SecretGenerator

type SecretGeneratorCollectionInput

type SecretGeneratorCollectionInput struct {
	OnGenerate func()
}

type SecretGeneratorRule

type SecretGeneratorRule struct {
	Name        string `yaml:"name"`
	Weight      int    `yaml:"weight"`
	NameRegex   string `yaml:"name_regex"`
	SecretRegex string `yaml:"secret_regex"`
}

type SecretGeneratorRules

type SecretGeneratorRules = map[string]SecretGeneratorRule

func GetRules

func GetRules() *SecretGeneratorRules

Jump to

Keyboard shortcuts

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