audit

package
v7.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuditActionCategoryValues = auditActionCategoryValuesType{

	Unknown: "unknown",

	Modify: "modify",

	Remove: "remove",

	Create: "create",

	Access: "access",

	Execute: "execute",
}
View Source
var AuditStreamStatusValues = auditStreamStatusValuesType{

	Unknown: "unknown",

	Enabled: "enabled",

	DisabledByUser: "disabledByUser",

	DisabledBySystem: "disabledBySystem",

	Deleted: "deleted",

	Backfilling: "backfilling",
}
View Source
var ResourceAreaId, _ = uuid.Parse("94ff054d-5ee1-413d-9341-3f4a7827de2e")

Functions

This section is empty.

Types

type AuditActionCategory

type AuditActionCategory string

Defines all the categories an AuditAction can be

type AuditActionInfo

type AuditActionInfo struct {
	// The action id for the event, i.e Git.CreateRepo, Project.RenameProject
	ActionId *string `json:"actionId,omitempty"`
	// Area of Azure DevOps the action occurred
	Area *string `json:"area,omitempty"`
	// Type of action executed
	Category *AuditActionCategory `json:"category,omitempty"`
}

type AuditLogQueryResult

type AuditLogQueryResult struct {
	// The continuation token to pass to get the next set of results
	ContinuationToken *string `json:"continuationToken,omitempty"`
	// The list of audit log entries
	DecoratedAuditLogEntries *[]DecoratedAuditLogEntry `json:"decoratedAuditLogEntries,omitempty"`
	// True when there are more matching results to be fetched, false otherwise.
	HasMore *bool `json:"hasMore,omitempty"`
}

The object returned when the audit log is queried. It contains the log and the information needed to query more audit entries.

type AuditStream

type AuditStream struct {
	// Inputs used to communicate with external service. Inputs could be url, a connection string, a token, etc.
	ConsumerInputs *map[string]string `json:"consumerInputs,omitempty"`
	// Type of the consumer, i.e. splunk, azureEventHub, etc.
	ConsumerType *string `json:"consumerType,omitempty"`
	// The time when the stream was created
	CreatedTime *azuredevops.Time `json:"createdTime,omitempty"`
	// Used to identify individual streams
	DisplayName *string `json:"displayName,omitempty"`
	// Unique stream identifier
	Id *int `json:"id,omitempty"`
	// Status of the stream, Enabled, Disabled
	Status *AuditStreamStatus `json:"status,omitempty"`
	// Reason for the current stream status, i.e. Disabled by the system, Invalid credentials, etc.
	StatusReason *string `json:"statusReason,omitempty"`
	// The time when the stream was last updated
	UpdatedTime *azuredevops.Time `json:"updatedTime,omitempty"`
}

This class represents an audit stream

type AuditStreamStatus

type AuditStreamStatus string

Represents the status of a stream

type Client

type Client interface {
	// [Preview API] Create new Audit Stream
	CreateStream(context.Context, CreateStreamArgs) (*AuditStream, error)
	// [Preview API] Delete Audit Stream
	DeleteStream(context.Context, DeleteStreamArgs) error
	// [Preview API] Downloads audit log entries.
	DownloadLog(context.Context, DownloadLogArgs) (io.ReadCloser, error)
	// [Preview API] Get all auditable actions filterable by area.
	GetActions(context.Context, GetActionsArgs) (*[]AuditActionInfo, error)
	// [Preview API] Return all Audit Streams scoped to an organization
	QueryAllStreams(context.Context, QueryAllStreamsArgs) (*[]AuditStream, error)
	// [Preview API] Queries audit log entries
	QueryLog(context.Context, QueryLogArgs) (*AuditLogQueryResult, error)
	// [Preview API] Return Audit Stream with id of streamId if one exists otherwise throw
	QueryStreamById(context.Context, QueryStreamByIdArgs) (*AuditStream, error)
	// [Preview API] Update existing Audit Stream status
	UpdateStatus(context.Context, UpdateStatusArgs) (*AuditStream, error)
	// [Preview API] Update existing Audit Stream
	UpdateStream(context.Context, UpdateStreamArgs) (*AuditStream, error)
}

func NewClient

func NewClient(ctx context.Context, connection *azuredevops.Connection) (Client, error)

type ClientImpl

type ClientImpl struct {
	Client azuredevops.Client
}

func (*ClientImpl) CreateStream

func (client *ClientImpl) CreateStream(ctx context.Context, args CreateStreamArgs) (*AuditStream, error)

[Preview API] Create new Audit Stream

func (*ClientImpl) DeleteStream

func (client *ClientImpl) DeleteStream(ctx context.Context, args DeleteStreamArgs) error

[Preview API] Delete Audit Stream

func (*ClientImpl) DownloadLog

func (client *ClientImpl) DownloadLog(ctx context.Context, args DownloadLogArgs) (io.ReadCloser, error)

[Preview API] Downloads audit log entries.

func (*ClientImpl) GetActions

func (client *ClientImpl) GetActions(ctx context.Context, args GetActionsArgs) (*[]AuditActionInfo, error)

[Preview API] Get all auditable actions filterable by area.

func (*ClientImpl) QueryAllStreams

func (client *ClientImpl) QueryAllStreams(ctx context.Context, args QueryAllStreamsArgs) (*[]AuditStream, error)

[Preview API] Return all Audit Streams scoped to an organization

func (*ClientImpl) QueryLog

func (client *ClientImpl) QueryLog(ctx context.Context, args QueryLogArgs) (*AuditLogQueryResult, error)

[Preview API] Queries audit log entries

func (*ClientImpl) QueryStreamById

func (client *ClientImpl) QueryStreamById(ctx context.Context, args QueryStreamByIdArgs) (*AuditStream, error)

[Preview API] Return Audit Stream with id of streamId if one exists otherwise throw

func (*ClientImpl) UpdateStatus

func (client *ClientImpl) UpdateStatus(ctx context.Context, args UpdateStatusArgs) (*AuditStream, error)

[Preview API] Update existing Audit Stream status

func (*ClientImpl) UpdateStream

func (client *ClientImpl) UpdateStream(ctx context.Context, args UpdateStreamArgs) (*AuditStream, error)

[Preview API] Update existing Audit Stream

type CreateStreamArgs

type CreateStreamArgs struct {
	// (required) Stream entry
	Stream *AuditStream
	// (required) The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed.
	DaysToBackfill *int
}

Arguments for the CreateStream function

type DecoratedAuditLogEntry

type DecoratedAuditLogEntry struct {
	// The action id for the event, i.e Git.CreateRepo, Project.RenameProject
	ActionId *string `json:"actionId,omitempty"`
	// ActivityId
	ActivityId *uuid.UUID `json:"activityId,omitempty"`
	// The Actor's Client Id (if actor is a service principal)
	ActorClientId *uuid.UUID `json:"actorClientId,omitempty"`
	// The Actor's CUID
	ActorCUID *uuid.UUID `json:"actorCUID,omitempty"`
	// DisplayName of the user who initiated the action
	ActorDisplayName *string `json:"actorDisplayName,omitempty"`
	// URL of Actor's Profile image
	ActorImageUrl *string `json:"actorImageUrl,omitempty"`
	// The Actor's UPN
	ActorUPN *string `json:"actorUPN,omitempty"`
	// The Actor's User Id (if actor is a user)
	ActorUserId *uuid.UUID `json:"actorUserId,omitempty"`
	// Area of Azure DevOps the action occurred
	Area *string `json:"area,omitempty"`
	// Type of authentication used by the actor
	AuthenticationMechanism *string `json:"authenticationMechanism,omitempty"`
	// Type of action executed
	Category *AuditActionCategory `json:"category,omitempty"`
	// DisplayName of the category
	CategoryDisplayName *string `json:"categoryDisplayName,omitempty"`
	// This allows related audit entries to be grouped together. Generally this occurs when a single action causes a cascade of audit entries. For example, project creation.
	CorrelationId *uuid.UUID `json:"correlationId,omitempty"`
	// External data such as CUIDs, item names, etc.
	Data *map[string]interface{} `json:"data,omitempty"`
	// Decorated details
	Details *string `json:"details,omitempty"`
	// EventId - Needs to be unique per service
	Id *string `json:"id,omitempty"`
	// IP Address where the event was originated
	IpAddress *string `json:"ipAddress,omitempty"`
	// When specified, the id of the project this event is associated to
	ProjectId *uuid.UUID `json:"projectId,omitempty"`
	// When specified, the name of the project this event is associated to
	ProjectName *string `json:"projectName,omitempty"`
	// DisplayName of the scope
	ScopeDisplayName *string `json:"scopeDisplayName,omitempty"`
	// The organization Id (Organization is the only scope currently supported)
	ScopeId *uuid.UUID `json:"scopeId,omitempty"`
	// The type of the scope (Organization is only scope currently supported)
	ScopeType *string `json:"scopeType,omitempty"`
	// The time when the event occurred in UTC
	Timestamp *azuredevops.Time `json:"timestamp,omitempty"`
	// The user agent from the request
	UserAgent *string `json:"userAgent,omitempty"`
}

type DeleteStreamArgs

type DeleteStreamArgs struct {
	// (required) Id of stream entry to delete
	StreamId *int
}

Arguments for the DeleteStream function

type DownloadLogArgs

type DownloadLogArgs struct {
	// (required) File format for download. Can be "json" or "csv".
	Format *string
	// (optional) Start time of download window. Optional
	StartTime *azuredevops.Time
	// (optional) End time of download window. Optional
	EndTime *azuredevops.Time
}

Arguments for the DownloadLog function

type GetActionsArgs

type GetActionsArgs struct {
	// (optional) Optional. Get actions scoped to area
	AreaName *string
}

Arguments for the GetActions function

type QueryAllStreamsArgs

type QueryAllStreamsArgs struct {
}

Arguments for the QueryAllStreams function

type QueryLogArgs

type QueryLogArgs struct {
	// (optional) Start time of download window. Optional
	StartTime *azuredevops.Time
	// (optional) End time of download window. Optional
	EndTime *azuredevops.Time
	// (optional) Max number of results to return. Optional
	BatchSize *int
	// (optional) Token used for returning next set of results from previous query. Optional
	ContinuationToken *string
	// (optional) Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog.
	SkipAggregation *bool
}

Arguments for the QueryLog function

type QueryStreamByIdArgs

type QueryStreamByIdArgs struct {
	// (required) Id of stream entry to retrieve
	StreamId *int
}

Arguments for the QueryStreamById function

type UpdateStatusArgs

type UpdateStatusArgs struct {
	// (required) Id of stream entry to be updated
	StreamId *int
	// (required) Status of the stream
	Status *AuditStreamStatus
}

Arguments for the UpdateStatus function

type UpdateStreamArgs

type UpdateStreamArgs struct {
	// (required) Stream entry
	Stream *AuditStream
}

Arguments for the UpdateStream function

Jump to

Keyboard shortcuts

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