Documentation
¶
Overview ¶
Package localcreds finds the credentials configured on this machine, so a report can say that a leaked token is not just out there but still in use right here.
Each provider says where its tools keep tokens: environment variables holding a token or naming a file, files under the config and home directories, commands that print one. The working directory's .env files are checked for every provider. The environment variables are searched together, as the lines of one document, so a credential that is only complete with a companion from another variable (a storage key and its account name, an AWS key id and its secret) is found the way it would be in an .env file. Only fingerprints leave this package; token values are hashed as soon as they are read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Match ¶
func Match(creds []Credential) map[string][]string
Match indexes credentials by fingerprint: the sources each token is configured in.
Types ¶
type Credential ¶
type Credential struct {
Fingerprint string
// Source says where it was found: a file path, an environment variable
// or a command.
Source string
}
Credential is one token configured locally, identified by fingerprint.