Documentation
¶
Index ¶
- Constants
- Variables
- func FetchMSIToken(cl HTTPClient, resource string) (string, error)
- func MakeAgentID(td spiffeid.TrustDomain, agentPathTemplate *agentpathtemplate.Template, ...) (spiffeid.ID, error)
- func MakeIMDSAgentID(td spiffeid.TrustDomain, agentPathTemplate *agentpathtemplate.Template, ...) (spiffeid.ID, error)
- type AgentUntrustedMetadata
- type AttestedDocument
- type AttestedDocumentContent
- type ComputeMetadata
- type HTTPClient
- type HTTPClientFunc
- type IMDSAttestationPayload
- type InstanceMetadata
- type MSIAttestationData
- type MSITokenClaims
Constants ¶
View Source
const ( // DefaultMSIResourceID is the default resource ID to use as the intended // audience of the MSI token. The current value is the service ID for the // Resource Manager API. DefaultMSIResourceID = "https://management.azure.com/" PluginName = "azure_msi" )
View Source
const (
ImdsPluginName = "azure_imds"
)
Variables ¶
View Source
var DefaultAgentPathTemplate = agentpathtemplate.MustParse("/{{ .PluginName }}/{{ .TenantID }}/{{ .PrincipalID }}")
DefaultAgentPathTemplate is the default text/template
View Source
var DefaultIMDSAgentPathTemplate = agentpathtemplate.MustParse("/{{ .PluginName }}/{{ .TenantID }}/{{ .SubscriptionID }}/{{ .VMID }}")
Functions ¶
func FetchMSIToken ¶
func FetchMSIToken(cl HTTPClient, resource string) (string, error)
func MakeAgentID ¶ added in v1.5.0
func MakeAgentID(td spiffeid.TrustDomain, agentPathTemplate *agentpathtemplate.Template, claims *MSITokenClaims) (spiffeid.ID, error)
func MakeIMDSAgentID ¶ added in v1.14.0
func MakeIMDSAgentID(td spiffeid.TrustDomain, agentPathTemplate *agentpathtemplate.Template, data *AttestedDocumentContent) (spiffeid.ID, error)
Types ¶
type AgentUntrustedMetadata ¶ added in v1.14.0
type AgentUntrustedMetadata struct {
AgentDomain string `json:"agentDomain"`
VMSSName *string `json:"vmssName"`
}
AgentUntrustedMetadata is the untrusted metadata for the IMDS attestation payload. Used to help point the server to the correct tenant and VMSS
type AttestedDocument ¶ added in v1.14.0
type AttestedDocument struct {
Encoding string `json:"encoding"`
Signature string `json:"signature"`
}
func FetchAttestedDocument ¶ added in v1.14.0
func FetchAttestedDocument(cl HTTPClient, nonce string) (*AttestedDocument, error)
type AttestedDocumentContent ¶ added in v1.14.0
type ComputeMetadata ¶
type HTTPClientFunc ¶
type IMDSAttestationPayload ¶ added in v1.14.0
type IMDSAttestationPayload struct {
Document AttestedDocument `json:"document"`
// Nothing in the metadata should ever be trusted, it is used to help point the server to the correct tenant and VMSS
Metadata AgentUntrustedMetadata `json:"metadata"`
}
type InstanceMetadata ¶
type InstanceMetadata struct {
Compute ComputeMetadata `json:"compute"`
}
func FetchInstanceMetadata ¶
func FetchInstanceMetadata(cl HTTPClient) (*InstanceMetadata, error)
type MSIAttestationData ¶
type MSIAttestationData struct {
Token string `json:"token"`
}
Click to show internal directories.
Click to hide internal directories.