azure

package
v0.15.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package azure is the Microsoft Azure credential provider: the client secrets of Entra ID applications (service principals), storage account keys, and shared access signatures.

None of the three carries a checksum, and only the client secret has a shape of its own, the `Q~` at its fifth character. A secret is useless without the tenant and the application it belongs to, and a storage key without its account, so Find looks for those next to the credential and keeps them apart in Token.Secret; the report says what it found. Verification is one client-credentials request to the tenant's token endpoint, one signed listing of the storage account's containers, or one HEAD of the resource a signature is for. Nothing here can be revoked by whoever holds it: the owner deletes the secret, rotates the key or the key that signed the signature, and the report carries the procedures.

Index

Constants

View Source
const (
	// KindClientSecret is the client secret of an Entra ID application; its
	// name is the secret itself, the tenant and client id travel apart.
	KindClientSecret detect.Kind = "azure-client-secret"
	// KindStorageAccountKey is one of the two access keys of a storage
	// account, reported only next to the account's name.
	KindStorageAccountKey detect.Kind = "azure-storage-account-key"
	// KindSASToken is a shared access signature; its name is the `sig`
	// value, the URL or query it came in travels apart.
	KindSASToken detect.Kind = "azure-sas-token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// LoginURL is the Entra ID authority, https://login.microsoftonline.com
	// by default; the tenant's token endpoint hangs off it.
	LoginURL string
	// BlobEndpoint is where a storage account's blob service is reached,
	// with {account} standing for the account name.
	BlobEndpoint string
	Client       *http.Client
	// contains filtered or unexported fields
}

Provider implements detect.Provider for Azure.

func New

func New() *Provider

New returns a Provider against the public Azure endpoints.

func (*Provider) Find

func (p *Provider) Find(content []byte) []detect.Token

Find implements detect.Provider: client secrets by their anchor, storage keys by their padding, signatures by their `sig=` parameter, each paired with what it needs from the same object.

func (*Provider) Kinds

func (*Provider) Kinds() []detect.KindInfo

Kinds implements detect.Provider. Nothing is revocable by the holder; every kind carries the owner's procedure.

func (*Provider) LocalSources

func (*Provider) LocalSources() detect.LocalSources

LocalSources implements detect.Provider: the files the Azure CLI keeps service principal logins and tokens in, and the variables the SDKs, Terraform and the storage tools read. The tenant, client and account variables hold no secret but are listed so a secret or key next to them is paired the way it is in an .env file. Only fingerprints are compared.

func (*Provider) Name

func (*Provider) Name() string

Name implements detect.Provider.

func (*Provider) Verify

func (p *Provider) Verify(ctx context.Context, tok detect.Token) detect.Verification

Verify implements detect.Provider with one request per credential: a client-credentials grant for a client secret, a signed container listing for a storage key, a HEAD of the resource for a signature. Only Azure's explicit rejections of the credential count as revoked.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL