audit_trail

package
v1.0.0-beta.32 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package audit_trail provides methods and message types of the audit_trail v1alpha1 API.

Index

Constants

View Source
const (
	ListEventsRequestOrderByRecordedAtDesc = ListEventsRequestOrderBy("recorded_at_desc")
	ListEventsRequestOrderByRecordedAtAsc  = ListEventsRequestOrderBy("recorded_at_asc")
)
View Source
const (
	ResourceTypeUnknownType       = ResourceType("unknown_type")
	ResourceTypeSecmSecret        = ResourceType("secm_secret")
	ResourceTypeSecmSecretVersion = ResourceType("secm_secret_version")
	ResourceTypeKubeCluster       = ResourceType("kube_cluster")
	ResourceTypeKubePool          = ResourceType("kube_pool")
	ResourceTypeKubeNode          = ResourceType("kube_node")
	ResourceTypeKubeACL           = ResourceType("kube_acl")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) ListEvents

func (s *API) ListEvents(req *ListEventsRequest, opts ...scw.RequestOption) (*ListEventsResponse, error)

ListEvents: Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.

func (*API) ListProducts

func (s *API) ListProducts(req *ListProductsRequest, opts ...scw.RequestOption) (*ListProductsResponse, error)

ListProducts: Retrieve the list of Scaleway resources for which you have Audit Trail events.

func (*API) Regions

func (s *API) Regions() []scw.Region

type Event

type Event struct {
	// ID: ID of the event.
	ID string `json:"id"`

	// RecordedAt: timestamp of the event.
	RecordedAt *time.Time `json:"recorded_at"`

	// Locality: locality of the resource attached to the event.
	Locality string `json:"locality"`

	// Principal: user or IAM application at the origin of the event.
	Principal *EventPrincipal `json:"principal"`

	// OrganizationID: organization ID containing the event.
	OrganizationID string `json:"organization_id"`

	// ProjectID: (Optional) Project of the resource attached to the event.
	ProjectID *string `json:"project_id"`

	// SourceIP: IP address at the origin of the event.
	SourceIP net.IP `json:"source_ip"`

	// UserAgent: user Agent at the origin of the event.
	UserAgent *string `json:"user_agent"`

	// ProductName: product name of the resource attached to the event.
	ProductName string `json:"product_name"`

	// ServiceName: API name called to trigger the event.
	ServiceName string `json:"service_name"`

	// MethodName: API method called to trigger the event.
	MethodName string `json:"method_name"`

	// Resource: resource attached to the event.
	Resource *Resource `json:"resource"`

	// RequestID: unique identifier of the request at the origin of the event.
	RequestID string `json:"request_id"`

	// RequestBody: request at the origin of the event.
	RequestBody *scw.JSONObject `json:"request_body"`

	// StatusCode: HTTP status code resulting of the API call.
	StatusCode uint32 `json:"status_code"`
}

Event: event.

type EventPrincipal

type EventPrincipal struct {
	ID string `json:"id"`
}

EventPrincipal: event principal.

type KubernetesACLInfo

type KubernetesACLInfo struct {
}

KubernetesACLInfo: kubernetes acl info.

type KubernetesClusterInfo

type KubernetesClusterInfo struct {
}

KubernetesClusterInfo: kubernetes cluster info.

type KubernetesNodeInfo

type KubernetesNodeInfo struct {
	ID string `json:"id"`

	Name string `json:"name"`
}

KubernetesNodeInfo: kubernetes node info.

type KubernetesPoolInfo

type KubernetesPoolInfo struct {
	ID string `json:"id"`

	Name string `json:"name"`
}

KubernetesPoolInfo: kubernetes pool info.

type ListEventsRequest

type ListEventsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: (Optional) ID of the Project containing the Audit Trail events.
	ProjectID *string `json:"-"`

	// OrganizationID: ID of the Organization containing the Audit Trail events.
	OrganizationID string `json:"-"`

	// ResourceType: (Optional) Returns a paginated list of Scaleway resources' features.
	// Default value: unknown_type
	ResourceType ResourceType `json:"-"`

	// MethodName: (Optional) Name of the method or the API call performed.
	MethodName *string `json:"-"`

	// Status: (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied.
	Status *uint32 `json:"-"`

	// RecordedAfter: (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default.
	RecordedAfter *time.Time `json:"-"`

	// RecordedBefore: (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default.
	RecordedBefore *time.Time `json:"-"`

	// OrderBy: default value: recorded_at_desc
	OrderBy ListEventsRequestOrderBy `json:"-"`

	PageSize *uint32 `json:"-"`

	PageToken *string `json:"-"`

	// ProductName: (Optional) Name of the Scaleway resource in a hyphenated format.
	ProductName *string `json:"-"`
}

ListEventsRequest: list events request.

type ListEventsRequestOrderBy

type ListEventsRequestOrderBy string

func (ListEventsRequestOrderBy) MarshalJSON

func (enum ListEventsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListEventsRequestOrderBy) String

func (enum ListEventsRequestOrderBy) String() string

func (*ListEventsRequestOrderBy) UnmarshalJSON

func (enum *ListEventsRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListEventsRequestOrderBy) Values

type ListEventsResponse

type ListEventsResponse struct {
	// Events: single page of events matching the requested criteria.
	Events []*Event `json:"events"`

	// NextPageToken: page token to use in following calls to keep listing.
	NextPageToken *string `json:"next_page_token"`
}

ListEventsResponse: list events response.

type ListProductsRequest

type ListProductsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
}

ListProductsRequest: list products request.

type ListProductsResponse

type ListProductsResponse struct {
	// Products: list of all products integrated with Audit Trail.
	Products []*Product `json:"products"`

	// TotalCount: number of integrated products.
	TotalCount uint64 `json:"total_count"`
}

ListProductsResponse: list products response.

func (*ListProductsResponse) UnsafeAppend

func (r *ListProductsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListProductsResponse) UnsafeGetTotalCount

func (r *ListProductsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type Product

type Product struct {
	// Title: product title.
	Title string `json:"title"`

	// Name: product name.
	Name string `json:"name"`

	// Services: specifies the API versions of the products integrated with Audit Trail. Each version defines the methods logged by Audit Trail.
	Services []*ProductService `json:"services"`
}

Product: product.

type ProductService

type ProductService struct {
	Name string `json:"name"`

	Methods []string `json:"methods"`
}

ProductService: product service.

type Resource

type Resource struct {
	ID string `json:"id"`

	// Type: default value: unknown_type
	Type ResourceType `json:"type"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`

	DeletedAt *time.Time `json:"deleted_at"`

	Name *string `json:"name"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	SecmSecretInfo *SecretManagerSecretInfo `json:"secm_secret_info,omitempty"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	SecmSecretVersionInfo *SecretManagerSecretVersionInfo `json:"secm_secret_version_info,omitempty"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	KubeClusterInfo *KubernetesClusterInfo `json:"kube_cluster_info,omitempty"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	KubePoolInfo *KubernetesPoolInfo `json:"kube_pool_info,omitempty"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	KubeNodeInfo *KubernetesNodeInfo `json:"kube_node_info,omitempty"`

	// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo must be set.
	KubeACLInfo *KubernetesACLInfo `json:"kube_acl_info,omitempty"`
}

Resource: resource.

type ResourceType

type ResourceType string

func (ResourceType) MarshalJSON

func (enum ResourceType) MarshalJSON() ([]byte, error)

func (ResourceType) String

func (enum ResourceType) String() string

func (*ResourceType) UnmarshalJSON

func (enum *ResourceType) UnmarshalJSON(data []byte) error

func (ResourceType) Values

func (enum ResourceType) Values() []ResourceType

type SecretManagerSecretInfo

type SecretManagerSecretInfo struct {
	Path string `json:"path"`
}

SecretManagerSecretInfo: secret manager secret info.

type SecretManagerSecretVersionInfo

type SecretManagerSecretVersionInfo struct {
	Revision uint32 `json:"revision"`
}

SecretManagerSecretVersionInfo: secret manager secret version info.

Jump to

Keyboard shortcuts

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