Documentation
¶
Index ¶
- Constants
- Variables
- func EventFromRecord(record *ActivityLogEventRecord) *entities.Event
- func EventIsForSource(event *ActivityLogEventRecord, resourceType string) bool
- func RelationshipFromID(id string) []string
- type ActivityLogAuthorization
- type ActivityLogEventData
- type ActivityLogEventIdentity
- type ActivityLogEventRecord
- type AuthConfig
- type AuthorizationEvidence
- type Client
- type ClientInterface
- type EventConsumer
- type EventHubConfig
- type EventType
- type GraphClient
- type GraphClientInterface
- type GraphLiveData
- type Resource
Constants ¶
View Source
const ( StorageAccountEventSource = "microsoft.storage/storageaccounts" FunctionEventSource = "microsoft.web/sites" TagsEventSource = "microsoft.resources/tags" )
Variables ¶
View Source
var ( ErrAzureClientSecretCredential = errors.New("failed to create an Azure client secret credential") ErrAzureDefaultCredential = errors.New("failed to create a default Azure credential") ErrMissingSubscriptionID = errors.New("subscriptionId is required") ErrIncompleteAuthConfigForTenantID = errors.New("both clientId and clientSecret are required when tenantId is provided") ErrIncompleteAuthConfigForClientID = errors.New("both tenantId and clientSecret are required when clientId is provided") ErrIncompleteAuthConfigForClientSecret = errors.New("both tenantId and clientId are required when clientSecret is provided") ErrEventHubNamespaceRequired = errors.New("eventHubNamespace is required") ErrEventHubNameRequired = errors.New("eventHubName is required") ErrCheckpointStorageAccountNameRequired = errors.New("checkpointStorageAccountName is required") ErrCheckpointStorageContainerNameRequired = errors.New("checkpointStorageContainerName is required") )
View Source
var (
ErrClientInitialization = errors.New("failed to initialize Azure client")
)
Functions ¶
func EventFromRecord ¶
func EventFromRecord(record *ActivityLogEventRecord) *entities.Event
func EventIsForSource ¶
func EventIsForSource(event *ActivityLogEventRecord, resourceType string) bool
func RelationshipFromID ¶
Types ¶
type ActivityLogAuthorization ¶
type ActivityLogAuthorization struct {
Scope string `json:"scope,omitempty"`
Action string `json:"action,omitempty"`
Evidence AuthorizationEvidence `json:"evidence,omitempty"`
}
type ActivityLogEventData ¶
type ActivityLogEventData struct {
Records []*ActivityLogEventRecord `json:"records,omitempty"`
}
type ActivityLogEventIdentity ¶
type ActivityLogEventIdentity struct {
Authorization *ActivityLogAuthorization `json:"authorization,omitempty"`
Claims map[string]string `json:"claims,omitempty"`
}
type ActivityLogEventRecord ¶
type ActivityLogEventRecord struct {
RoleLocation string `json:"RoleLocation,omitempty"` //nolint:tagliatelle
Stamp string `json:"Stamp,omitempty"` //nolint:tagliatelle
ReleaseVersion string `json:"ReleaseVersion,omitempty"` //nolint:tagliatelle
Time string `json:"time,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
OperationName string `json:"operationName,omitempty"`
Category string `json:"category,omitempty"`
ResultType string `json:"resultType,omitempty"`
ResultSignature string `json:"resultSignature,omitempty"`
DurationMs string `json:"durationMs,omitempty"`
CallerIPAddress string `json:"callerIpAddress,omitempty"`
CorrelationID string `json:"correlationId,omitempty"`
Identity *ActivityLogEventIdentity `json:"identity,omitempty"`
Level string `json:"level,omitempty"`
Properties map[string]any `json:"properties,omitempty"`
}
type AuthConfig ¶
type AuthConfig struct {
SubscriptionID string `json:"subscriptionId,omitempty"`
TenantID string `json:"tenantId,omitempty"`
ClientID config.SecretSource `json:"clientId,omitempty"`
ClientSecret config.SecretSource `json:"clientSecret,omitempty"`
}
func (*AuthConfig) AzureTokenProvider ¶
func (c *AuthConfig) AzureTokenProvider() (azcore.TokenCredential, error)
func (*AuthConfig) Validate ¶
func (c *AuthConfig) Validate() error
type AuthorizationEvidence ¶
type AuthorizationEvidence struct {
Role string `json:"role,omitempty"`
RoleAssignmentScope string `json:"roleAssignmentScope,omitempty"`
RoleAssignmentID string `json:"roleAssignmentId,omitempty"`
RoleDefinitionID string `json:"roleDefinitionId,omitempty"`
PrincipalID string `json:"principalId,omitempty"`
PrincipalType string `json:"principalType,omitempty"`
}
type ClientInterface ¶
type ClientInterface interface {
GetByID(ctx context.Context, resourceID, apiVersion string) (*Resource, error)
}
func NewClient ¶
func NewClient(config AuthConfig) (ClientInterface, error)
type EventConsumer ¶
type EventConsumer func(event *azeventhubs.ReceivedEventData) error
type EventHubConfig ¶
type EventHubConfig struct {
AuthConfig
EventHubNamespace string `json:"eventHubNamespace,omitempty"`
EventHubName string `json:"eventHubName,omitempty"`
CheckpointStorageAccountName string `json:"checkpointStorageAccountName,omitempty"`
CheckpointStorageContainerName string `json:"checkpointStorageContainerName,omitempty"`
EventConsumer EventConsumer `json:"-"`
}
func (*EventHubConfig) Validate ¶
func (c *EventHubConfig) Validate() error
type GraphClient ¶
type GraphClient struct {
// contains filtered or unexported fields
}
type GraphClientInterface ¶
type GraphClientInterface interface {
Resources(ctx context.Context, typesToFilter []string) ([]*entities.Event, error)
}
func NewGraphClient ¶
func NewGraphClient(config AuthConfig) (GraphClientInterface, error)
type GraphLiveData ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.