Documentation
¶
Index ¶
- type CloudTrailService
- func (s *CloudTrailService) Actions() []service.Action
- func (s *CloudTrailService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *CloudTrailService) HealthCheck() error
- func (s *CloudTrailService) Name() string
- func (s *CloudTrailService) SetEventBus(bus *eventbus.Bus)
- func (s *CloudTrailService) StartRecording()
- type DataResource
- type Event
- type EventResource
- type EventSelector
- type InsightSelector
- type LookupAttribute
- type Store
- func (s *Store) AddTags(arn string, tags []Tag) *service.AWSError
- func (s *Store) CreateTrail(name, s3Bucket, s3Prefix string, ...) (*Trail, *service.AWSError)
- func (s *Store) DeleteTrail(name string) *service.AWSError
- func (s *Store) GetTrail(name string) (*Trail, *service.AWSError)
- func (s *Store) ListTagsByARN(arn string) ([]Tag, *service.AWSError)
- func (s *Store) ListTrails() []*Trail
- func (s *Store) LookupEvents(maxResults int, startTime, endTime *time.Time, attributes []LookupAttribute) []Event
- func (s *Store) PutEventSelectors(name string, selectors []EventSelector) *service.AWSError
- func (s *Store) PutInsightSelectors(name string, selectors []InsightSelector) *service.AWSError
- func (s *Store) RecordEvent(eventName, eventSource, username string, resources []EventResource)
- func (s *Store) RemoveTags(arn string, tags []Tag) *service.AWSError
- func (s *Store) StartLogging(name string) *service.AWSError
- func (s *Store) StopLogging(name string) *service.AWSError
- func (s *Store) UpdateTrail(name string, updates map[string]any) (*Trail, *service.AWSError)
- type Tag
- type Trail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudTrailService ¶
type CloudTrailService struct {
// contains filtered or unexported fields
}
CloudTrailService is the cloudmock implementation of the AWS CloudTrail API.
func New ¶
func New(accountID, region string) *CloudTrailService
New returns a new CloudTrailService for the given AWS account ID and region.
func NewWithBus ¶
func NewWithBus(accountID, region string, bus *eventbus.Bus) *CloudTrailService
NewWithBus returns a new CloudTrailService wired to an event bus.
func (*CloudTrailService) Actions ¶
func (s *CloudTrailService) Actions() []service.Action
Actions returns the list of CloudTrail API actions supported by this service.
func (*CloudTrailService) HandleRequest ¶
func (s *CloudTrailService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming CloudTrail request to the appropriate handler.
func (*CloudTrailService) HealthCheck ¶
func (s *CloudTrailService) HealthCheck() error
HealthCheck always returns nil.
func (*CloudTrailService) Name ¶
func (s *CloudTrailService) Name() string
Name returns the AWS service name used for routing.
func (*CloudTrailService) SetEventBus ¶
func (s *CloudTrailService) SetEventBus(bus *eventbus.Bus)
SetEventBus sets the event bus for cross-service event recording.
func (*CloudTrailService) StartRecording ¶
func (s *CloudTrailService) StartRecording()
StartRecording subscribes to the event bus for all trails that have logging enabled. This is called externally after wiring up the bus.
type DataResource ¶
DataResource specifies data event logging.
type Event ¶
type Event struct {
EventId string
EventName string
EventTime time.Time
EventSource string
Username string
Resources []EventResource
CloudTrailEvent string
ReadOnly string
AccessKeyId string
}
Event represents a CloudTrail event.
type EventResource ¶
EventResource identifies an AWS resource in an event.
type EventSelector ¶
type EventSelector struct {
ReadWriteType string
IncludeManagementEvents bool
DataResources []DataResource
ExcludeManagementEventSources []string
}
EventSelector configures event filtering for a trail.
type InsightSelector ¶
type InsightSelector struct {
InsightType string
}
InsightSelector configures insight event collection.
type LookupAttribute ¶
LookupAttribute is a filter criterion for LookupEvents.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the in-memory store for CloudTrail resources.
func (*Store) CreateTrail ¶
func (s *Store) CreateTrail(name, s3Bucket, s3Prefix string, isMultiRegion, isOrg, logValidation, includeGlobal bool, tags []Tag) (*Trail, *service.AWSError)
CreateTrail creates a new trail.
func (*Store) DeleteTrail ¶
DeleteTrail removes a trail by name.
func (*Store) ListTagsByARN ¶
ListTagsByARN returns tags for a trail by ARN.
func (*Store) LookupEvents ¶
func (s *Store) LookupEvents(maxResults int, startTime, endTime *time.Time, attributes []LookupAttribute) []Event
LookupEvents returns events matching the given lookup attributes.
func (*Store) PutEventSelectors ¶
func (s *Store) PutEventSelectors(name string, selectors []EventSelector) *service.AWSError
PutEventSelectors sets event selectors for a trail.
func (*Store) PutInsightSelectors ¶
func (s *Store) PutInsightSelectors(name string, selectors []InsightSelector) *service.AWSError
PutInsightSelectors sets insight selectors for a trail.
func (*Store) RecordEvent ¶
func (s *Store) RecordEvent(eventName, eventSource, username string, resources []EventResource)
RecordEvent adds an event to the store (for cross-service logging).
func (*Store) RemoveTags ¶
RemoveTags removes tags from a trail.
func (*Store) StartLogging ¶
StartLogging enables logging for a trail.
func (*Store) StopLogging ¶
StopLogging disables logging for a trail.
type Trail ¶
type Trail struct {
Name string
TrailARN string
HomeRegion string
S3BucketName string
S3KeyPrefix string
SnsTopicName string
SnsTopicARN string
IncludeGlobalServiceEvents bool
IsMultiRegionTrail bool
IsOrganizationTrail bool
LogFileValidationEnabled bool
CloudWatchLogsLogGroupArn string
CloudWatchLogsRoleArn string
KmsKeyId string
HasCustomEventSelectors bool
HasInsightSelectors bool
Tags []Tag
IsLogging bool
LatestDeliveryTime *time.Time
LatestNotificationTime *time.Time
StartLoggingTime *time.Time
StopLoggingTime *time.Time
EventSelectors []EventSelector
InsightSelectors []InsightSelector
// contains filtered or unexported fields
}
Trail holds all metadata for a CloudTrail trail.