Documentation ¶
Index ¶
- Constants
- func GetCreatedAtFromStartKey(startKey string) (time.Time, error)
- type Config
- type Log
- func (l *Log) Close() error
- func (l *Log) EmitAuditEvent(ctx context.Context, in apievents.AuditEvent) error
- func (l *Log) SearchEvents(ctx context.Context, req events.SearchEventsRequest) ([]apievents.AuditEvent, string, error)
- func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionEventsRequest) ([]apievents.AuditEvent, string, error)
Constants ¶
const ( // DefaultReadCapacityUnits specifies default value for read capacity units DefaultReadCapacityUnits = 10 // DefaultWriteCapacityUnits specifies default value for write capacity units DefaultWriteCapacityUnits = 10 // DefaultRetentionPeriod is a default data retention period in events table. // The default is 1 year. DefaultRetentionPeriod = types.Duration(365 * 24 * time.Hour) )
const ( // ErrValidationException for service response error code // "ValidationException". // // Indicates about invalid item for example max DynamoDB item length was exceeded. ErrValidationException = "ValidationException" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Region is where DynamoDB Table will be used to store k/v Region string // Tablename where to store K/V in DynamoDB Tablename string // ReadCapacityUnits is Dynamodb read capacity units ReadCapacityUnits int64 // WriteCapacityUnits is Dynamodb write capacity units WriteCapacityUnits int64 // RetentionPeriod is a default retention period for events. RetentionPeriod *types.Duration // Clock is a clock interface, used in tests Clock clockwork.Clock // UIDGenerator is unique ID generator UIDGenerator utils.UID // Endpoint is an optional non-AWS endpoint Endpoint string // ReadMaxCapacity is the maximum provisioned read capacity. ReadMaxCapacity int64 // ReadMinCapacity is the minimum provisioned read capacity. ReadMinCapacity int64 // ReadTargetValue is the ratio of consumed read to provisioned capacity. ReadTargetValue float64 // WriteMaxCapacity is the maximum provisioned write capacity. WriteMaxCapacity int64 // WriteMinCapacity is the minimum provisioned write capacity. WriteMinCapacity int64 // WriteTargetValue is the ratio of consumed write to provisioned capacity. WriteTargetValue float64 // UseFIPSEndpoint uses AWS FedRAMP/FIPS 140-2 mode endpoints. // to determine its behavior: // Unset - allows environment variables or AWS config to set the value // Enabled - explicitly enabled // Disabled - explicitly disabled UseFIPSEndpoint types.ClusterAuditConfigSpecV2_FIPSEndpointState // EnableContinuousBackups is used to enable PITR (Point-In-Time Recovery). EnableContinuousBackups bool // EnableAutoScaling is used to enable auto scaling policy. EnableAutoScaling bool }
Config structure represents DynamoDB configuration as appears in `storage` section of Teleport YAML
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults is a helper returns an error if the supplied configuration is not enough to connect to DynamoDB
type Log ¶
type Log struct { // Entry is a log entry *log.Entry // Config is a backend configuration Config // contains filtered or unexported fields }
Log is a dynamo-db backed storage of events
func New ¶
New returns new instance of DynamoDB backend. It's an implementation of backend API's NewFunc
func (*Log) EmitAuditEvent ¶
EmitAuditEvent emits audit event
func (*Log) SearchEvents ¶
func (l *Log) SearchEvents(ctx context.Context, req events.SearchEventsRequest) ([]apievents.AuditEvent, string, error)
SearchEvents is a flexible way to find events.
Event types to filter can be specified and pagination is handled by an iterator key that allows a query to be resumed.
The only mandatory requirement is a date range (UTC).
This function may never return more than 1 MiB of event data.
func (*Log) SearchSessionEvents ¶
func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionEventsRequest) ([]apievents.AuditEvent, string, error)
SearchSessionEvents returns session related events only. This is used to find completed session.