Documentation
¶
Overview ¶
Package redact masks secrets before they reach a terminal, a log or a telemetry backend. allbctl output is routinely pasted into issues and shared screens, so anything credential-shaped is hidden by default.
Index ¶
Constants ¶
const Mask = "********"
Mask is what a hidden value is replaced with.
Variables ¶
This section is empty.
Functions ¶
func AWSAccountIDs ¶ added in v0.1.0
AWSAccountIDs masks every AWS account ID (a run of exactly twelve digits) in value. Profile names generated by AWS SSO embed the account ID, as do ARNs and many SDK error messages.
func ClusterName ¶ added in v0.2.0
ClusterName masks the account a generated Kubernetes context or cluster name gives away: the AWS account ID in an EKS ARN and the project ID in a GKE name ("gke_<project>_<location>_<cluster>"). Names people chose themselves are returned unchanged.
func EmailAddress ¶ added in v0.2.0
EmailAddress masks who an e-mail address belongs to and keeps its domain: "dev.person@example.test" becomes "d********@example.test". The domain of a Google Cloud service account names its project, which is masked too. A value that is not an address is treated as an Identifier.
func EnvValue ¶
EnvValue returns value in a form safe to display for the given key: fully masked for secret-looking keys, and with any embedded URL password masked otherwise (e.g. DATABASE_URL=postgres://user:pass@host/db).
func Identifier ¶ added in v0.2.0
Identifier masks the middle of an identifier such as a project ID or a subscription GUID: "example-project-123456" becomes "ex********56". An identifier too short for that is masked entirely.
func IsSecretKey ¶
IsSecretKey reports whether a key name looks like it holds a credential.
func URLPassword ¶
URLPassword masks the password of a URL that embeds credentials. Values that are not URLs, or carry no password, are returned unchanged.
Types ¶
This section is empty.