Documentation
¶
Overview ¶
Package cloudtrail emulates AWS CloudTrail (JSON 1.1): trails with event and insight selectors, event data stores as metadata, LookupEvents built from pogi's request log, and logging trails that deliver gzipped log files to S3 and CloudWatch Logs.
Index ¶
- type DataResource
- type Event
- type EventSelector
- type Resource
- type Service
- func (s *Service) Close() error
- func (s *Service) Info() core.Info
- func (s *Service) Inspect(table, id string) any
- func (s *Service) Load(b []byte) error
- func (s *Service) Reset()
- func (s *Service) Resources() []core.Table
- func (s *Service) Save() ([]byte, error)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Service) Tick(now time.Time)
- type Store
- type Tag
- type Trail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataResource ¶
DataResource names data events of an event selector (kept, not logged).
type Event ¶
type Event struct {
EventId string
EventName string
ReadOnly string
AccessKeyId string `json:",omitempty"`
EventTime core.Time
EventSource string
Username string `json:",omitempty"`
Resources []Resource `json:",omitempty"`
CloudTrailEvent string
}
Event is one LookupEvents result.
type EventSelector ¶
type EventSelector struct {
ReadWriteType string
IncludeManagementEvents *bool
DataResources []DataResource
ExcludeManagementEventSources []string
}
EventSelector picks the events a trail logs.
type Resource ¶
type Resource struct{ ResourceType, ResourceName string }
Resource is a resource an event refers to.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the CloudTrail emulator.
func New ¶
New creates the CloudTrail service: it follows the request log and delivers the logs of logging trails every minute.
func (*Service) ServeHTTP ¶
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP accepts both targets SDKs send: CloudTrail_20131101.Op and com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.Op (routed here by its signing name). core.TargetOp reads the operation from either.
type Store ¶
type Store struct {
EventDataStoreArn string
Name string
Status string
AdvancedEventSelectors json.RawMessage
MultiRegionEnabled bool
OrganizationEnabled bool
RetentionPeriod int
TerminationProtectionEnabled bool
BillingMode string
KmsKeyId string `json:",omitempty"`
CreatedTimestamp core.Time
UpdatedTimestamp core.Time
}
Store is an event data store (CloudTrail Lake), as metadata.
type Trail ¶
type Trail struct {
Name string
S3BucketName string
S3KeyPrefix string `json:",omitempty"`
SnsTopicName string `json:",omitempty"`
SnsTopicARN string `json:",omitempty"`
IncludeGlobalServiceEvents bool
IsMultiRegionTrail bool
HomeRegion string
TrailARN string
LogFileValidationEnabled bool
CloudWatchLogsLogGroupArn string `json:",omitempty"`
CloudWatchLogsRoleArn string `json:",omitempty"`
KmsKeyId string `json:",omitempty"`
HasCustomEventSelectors bool
HasInsightSelectors bool
IsOrganizationTrail bool
}
Trail is a trail in the API's shape.