Documentation ¶
Index ¶
- Constants
- Variables
- func GetShortSha256Hash(line string) string
- func InitRegexToReplacementMap()
- func PutIntoNodeNamesIfNotPresent(inputKey string)
- func SanitizeFilesInDirTree(rootDir string) error
- func SanitizeLines(reader io.Reader, writer io.Writer) error
- func SanitizeString(l string, redactedValuesOverride map[string]string) string
- func WriteRedactionMapFile(captureDir string, redactedValuesOverride map[string]string) error
Constants ¶
const ( RedactionPrefix = "REDACTED-" RedactionMap = "sensitive-do-not-share-redaction-map.csv" )
Variables ¶
var KnownHostNames = make(map[string]bool)
var KnownHostNamesMutex = &sync.Mutex{}
var KnownNodeNames = make(map[string]string)
var KnownNodeNamesMutex = &sync.Mutex{}
Functions ¶
func GetShortSha256Hash ¶
GetShortSha256Hash generates the one way hash for the input string and then returns "REDACTED-"and the first 7 characters of that hash
func InitRegexToReplacementMap ¶
func InitRegexToReplacementMap()
InitRegexToReplacementMap Initialize the regex string to replacement string map Append to this map for any future additions
func PutIntoNodeNamesIfNotPresent ¶
func PutIntoNodeNamesIfNotPresent(inputKey string)
PutIntoNodeNamesIfNotPresent populates the node map with a given node name
func SanitizeFilesInDirTree ¶
SanitizeFilesInDirTree all files in a directory tree, including files in all nested subdirectories
func SanitizeLines ¶
read each line, sanitize it and write to writer
func SanitizeString ¶
SanitizeString sanitizes each line in a given file, Sanitizes based on the regex map initialized above, which is currently filtering for IPv4 addresses and hostnames
The redactedValuesOverride parameter can be used to override the default redactedValues map for keeping track of redacted strings.
Types ¶
This section is empty.