config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config handles loading and defaulting envaudit's configuration.

envaudit intentionally avoids a third-party YAML library so the tool has zero external dependencies and builds anywhere `go build` works. The config file format is a deliberately small subset of YAML: flat "key: value" pairs plus simple "- item" lists under a key. If you need full YAML support, swapping in gopkg.in/yaml.v3 later is a small change contained entirely to this file.

Index

Constants

View Source
const ExampleYAML = `` /* 688-byte string literal not displayed */

ExampleYAML is written out by `envaudit init`.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// EntropyThreshold is the Shannon entropy (bits/char) above which a
	// value is considered "random enough" to be a real secret.
	EntropyThreshold float64

	// IgnorePatterns are filename globs (matched with filepath.Match)
	// that envaudit should skip entirely, e.g. "*.env.sample".
	IgnorePatterns []string

	// SeverityExitCode is the minimum severity that causes `envaudit scan`
	// to exit non-zero. One of: low, medium, high, critical.
	SeverityExitCode string

	// CustomSecretPatterns are extra regex rules merged with the built-in
	// pattern set in internal/rules.
	CustomSecretPatterns []CustomPattern
}

Config holds all tunable behavior for envaudit.

func Default

func Default() *Config

Default returns envaudit's out-of-the-box configuration. This is what runs when no .envaudit.yml is present, so it must be sane on its own.

func Load

func Load(path string) (*Config, error)

Load reads a .envaudit.yml-style file at path and merges it on top of Default(). Missing keys fall back to defaults. If path does not exist, Load returns Default() with no error, so callers can always call Load unconditionally.

type CustomPattern

type CustomPattern struct {
	Name  string
	Regex string
}

CustomPattern lets users define additional secret-detection regexes without recompiling envaudit.

Jump to

Keyboard shortcuts

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