Documentation
¶
Overview ¶
Package verify checks whether credentials found by a secret scan are live, with one read-only identity call to the issuer:
- AWS: STS GetCallerIdentity, signed with SigV4. The secret signs the request and is not sent.
- Slack: auth.test, with the token in the Authorization header.
- GCP API key: the Discovery API, with the key in the X-Goog-Api-Key header.
- OCI API signing key: Identity ListApiKeys for the key's own user, signed with the private key (HTTP Signature, rsa-sha256). The key signs the request and is not sent.
Slack tokens and GCP API keys are bearer values, so those calls send the value itself to slack.com or googleapis.com.
Index ¶
Constants ¶
const ( CodeRegionNotFound = secrets.OCIProfileNoRegion CodeInvalidProfile = secrets.OCIProfileInvalid CodeUnsupportedRealm = secrets.OCIProfileUnsupportedRealm CodeClockSkew = "clock_skew" CodeFingerprintNotListed = "fingerprint_not_listed" )
Local reason codes for OCI.
const ( CodeUnsupportedKeyType = "unsupported_key_type" CodeSecretNotFound = "secret_not_found" CodeSessionTokenNotFound = "session_token_not_found" CodeRequestFailed = "request_failed" )
Local reason codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Status Status
Account string
AccountName string
URL string
ARN string
Identity string
IdentityName string
Code string
}
Result is the check outcome for one credential. Account is the AWS account, Slack team ID, GCP consumer project, or OCI tenancy OCID; ARN is the AWS caller; Identity is the Slack user ID or OCI user OCID. AccountName, URL, and IdentityName are the Slack workspace name, workspace URL, and user name. Code is the issuer's error code or a local reason, and on a valid GCP key the restriction that blocked the call.
type Status ¶
type Status string
Status is the outcome of one credential check.
const ( // StatusValid means the issuer accepted the credential at the time of // the call. For a GCP API key it also covers a key that exists but whose // restrictions block the call; Code then names the restriction. StatusValid Status = "valid" // StatusRejected means the issuer said the credential itself is invalid, // revoked, or expired. The global STS endpoint also rejects an AWS key // from another partition (China, GovCloud), and OCI gives the same 401 // for a region the tenancy is not subscribed to. StatusRejected Status = "rejected" // StatusUnknown means the check ran but did not decide: a network error, // a rate limit, a timeout, or an answer that does not judge the // credential. StatusUnknown Status = "unknown" // StatusUnverifiable means no check ran: the key type is not supported, // or the AWS secret or session token was not found next to the key ID. StatusUnverifiable Status = "unverifiable" )
type Verifier ¶
type Verifier struct {
AWSEndpoint string
SlackEndpoint string
GCPEndpoint string
// OCIEndpoint replaces https://identity.{region}.oci.oraclecloud.com.
OCIEndpoint string
Client *http.Client
Now func() time.Time
Workers int
}
Verifier sends the checks. Empty endpoints use the issuers' public ones.