log

package
v1.2.43-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedactValue = "*************"
)

Variables

View Source
var RedactKeyList = []*regexp.Regexp{
	regexp.MustCompile(`(\\?"password\\?":\\?")([^"]*)(\\?")`),
	regexp.MustCompile(`(\\?"additional_trust_bundle\\?":\\?")([^"]*)(\\?")`),
	regexp.MustCompile(`(-----BEGIN CERTIFICATE-----\n)([^-----]*)(-----END CERTIFICATE-----)`),
	regexp.MustCompile(`(--password\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(--client-id\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(--bind-password\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(--client-secret\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(--users\s+[a-zA-Z0-9-]+:)([^\s\n\\]+)([\s\S]+)`),
	regexp.MustCompile(`(--cluster-admin-password\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(--billing-account\s+)([^\n\t\\\s]+)([\n\\\s]*)`),
	regexp.MustCompile(`(arn:aws:[a-z]+:[a-z0-9-]*:)([0-9]{12})(:)`),
	regexp.MustCompile(`("?AWS Account\s?I?D?"?:\s*"?)([0-9]{12})([\n\\n"\s\t,].)`),
	regexp.MustCompile(`(AWS Billing Account:\s*)([0-9]{12})([\n\\n].)`),
	regexp.MustCompile(`("billing_account_id"\:?\s*")([0-9]{12})(")`),
	regexp.MustCompile(`(OCM AWS role on\s*')([0-9]{12})(')`),
	regexp.MustCompile(`(_token\s*)([\w.-]+)([\s\S]*)`),
}

Functions

func GetLogger

func GetLogger() *logrus.Logger

func LevelThreshold added in v1.2.41

func LevelThreshold(l logrus.Level) []logrus.Level

LevelThreshold returns a []logrus.Level including all levels above and including the level given. If the provided level does not exit, an empty slice is returned.

Types

type SensitiveHook added in v1.2.41

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

SensitiveHook is a logrus hook for redacting information from logs via regexp

func (*SensitiveHook) Fire added in v1.2.41

func (h *SensitiveHook) Fire(e *logrus.Entry) error

Fire redacts values in an log Entry that match the regex

func (*SensitiveHook) Levels added in v1.2.41

func (h *SensitiveHook) Levels() []logrus.Level

All logrus levels are returned

Jump to

Keyboard shortcuts

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