Documentation
¶
Overview ¶
Package secrets decrypts the age encrypted files a site keeps beside its configuration.
Plaintext is returned in memory and streamed to wherever it is needed. It is never written to the workstation's disk, which is what the exec wrappers of the shell toolkit were careful about and what this package keeps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptSops ¶
DecryptSops decrypts a sops encrypted YAML file into memory and returns the plaintext YAML.
The data key is recovered with the given age identities first, which are the ones workstation.identities names, and then with whatever sops itself finds: SOPS_AGE_KEY_FILE and its other variables, a PGP agent, or the credentials of a cloud key management service. The integrity of the whole file is verified before anything is returned.
func DecryptString ¶
DecryptString decrypts a file whose content is one line, such as a password, and returns it without the trailing newline.
Types ¶
type SopsInfo ¶
type SopsInfo struct {
// Keys are the master keys the data key is encrypted to, as sops names
// their type ("age", "pgp", "kms", "gcp_kms", "azure_kv", "hc_vault")
// and the key itself, for example an age recipient or a key ARN.
Keys []SopsKey
// Groups is the number of key groups, Threshold the number of them
// needed to recover the data key when there are several.
Groups int
Threshold int
// LastModified is when sops last wrote the file.
LastModified time.Time
// EncryptedRegex is the rule that chose which values were encrypted.
EncryptedRegex string
}
SopsInfo describes a sops encrypted document, read without decrypting it.
func InspectSops ¶
InspectSops reads the sops metadata of a YAML file without decrypting anything, so that a damaged or hand edited file is reported when the configuration loads rather than when a node is half way through a reinstall.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sopstest writes sops encrypted files for tests, the way "sops --encrypt --encrypted-regex '^(data|binaryData)$'" writes them, so that no test depends on a sops binary or on a private key kept in the repository.
|
Package sopstest writes sops encrypted files for tests, the way "sops --encrypt --encrypted-regex '^(data|binaryData)$'" writes them, so that no test depends on a sops binary or on a private key kept in the repository. |