Documentation ¶
Index ¶
Constants ¶
View Source
const (
RedactValue = "*************"
)
Variables ¶
View Source
var Logger *logrus.Logger = GetLogger()
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 ¶
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
Click to show internal directories.
Click to hide internal directories.