trail

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkEvents

func WalkEvents(sess *session.Session, dsn string, opt Option, fn WalkEventsFunc) error

func WalkObjects

func WalkObjects(sess *session.Session, dsn string, opt Option, fn WalkObjectsFunc) error

Types

type LogData

type LogData struct {
	Records []*Record `json:"Records"`
}

type Option

type Option struct {
	DatePath      string
	StartDatePath string
	EndDatePath   string
	Accounts      []string
	Regions       []string
	AllAccounts   bool
	AllRegions    bool
	LogFilePrefix string
}

type Prefixes

type Prefixes []*PrefixesGroupPerDay

type PrefixesGroupPerDay

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

type Record

type Record struct {
	EventVersion string `json:"eventVersion"`
	UserIdentity struct {
		Type        string `json:"type"`
		InvokedBy   string `json:"invokedBy"`
		PrincipalID string `json:"principalId"`
		Arn         string `json:"arn"`
		AccountID   string `json:"accountId"`
		AccessKeyID string `json:"accessKeyId"`
		UserName    string `json:"userName"`
	} `json:"userIdentity"`
	EventTime         time.Time `json:"eventTime"`
	EventSource       string    `json:"eventSource"`
	EventName         string    `json:"eventName"`
	AwsRegion         string    `json:"awsRegion"`
	SourceIPAddress   string    `json:"sourceIPAddress"`
	UserAgent         string    `json:"userAgent"`
	ErrorCode         string    `json:"errorCode,omitempty"`
	ErrorMessage      string    `json:"errorMessage,omitempty"`
	RequestParameters struct {
		BucketName               string `json:"bucketName"`
		Host                     string `json:"Host"`
		XAmzACL                  string `json:"x-amz-acl"`
		XAmzServerSideEncryption string `json:"x-amz-server-side-encryption"`
		Key                      string `json:"key"`
	} `json:"requestParameters,omitempty"`
	ResponseElements struct {
		XAmzServerSideEncryption string `json:"x-amz-server-side-encryption"`
		XAmzVersionID            string `json:"x-amz-version-id"`
	} `json:"responseElements"`
	AdditionalEventData struct {
		SignatureVersion     string  `json:"SignatureVersion"`
		CipherSuite          string  `json:"CipherSuite"`
		BytesTransferredIn   float64 `json:"bytesTransferredIn"`
		SSEApplied           string  `json:"SSEApplied"`
		AuthenticationMethod string  `json:"AuthenticationMethod"`
		XAmzID2              string  `json:"x-amz-id-2"`
		BytesTransferredOut  float64 `json:"bytesTransferredOut"`
	} `json:"additionalEventData,omitempty"`
	RequestID string `json:"requestID"`
	EventID   string `json:"eventID"`
	ReadOnly  bool   `json:"readOnly"`
	Resources []struct {
		Type      string `json:"type"`
		Arn       string `json:"ARN"`
		AccountID string `json:"accountId,omitempty"`
	} `json:"resources"`
	EventType          string `json:"eventType"`
	ManagementEvent    bool   `json:"managementEvent"`
	RecipientAccountID string `json:"recipientAccountId"`
	SharedEventID      string `json:"sharedEventID"`
	EventCategory      string `json:"eventCategory"`
	TLSDetails         struct {
		TLSVersion               string `json:"tlsVersion,omitempty"`
		CipherSuite              string `json:"cipherSuite,omitempty"`
		ClientProvidedHostHeader string `json:"clientProvidedHostHeader,omitempty"`
	} `json:"tlsDetails,omitempty"`
}

type WalkEventsFunc

type WalkEventsFunc func(r *Record) error

type WalkObjectsFunc

type WalkObjectsFunc func(o *s3.Object) error

Jump to

Keyboard shortcuts

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