events

package
v0.0.0-...-ee6749e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options struct {
	// VerboseAssumeRoleEvents if true, will log AssumeRoleEvents when are processed
	VerboseAssumeRoleEvents bool
}

Options defines analyzer global options

Functions

func AddEvent

func AddEvent(event Event)

AddEvent adds one event

func AddLog

func AddLog(log Log)

AddLog adds events from a log

func Analyze

func Analyze() error

Analyze analyses the events

Types

type AssumedRoleUser

type AssumedRoleUser struct {
	AssumedRoleID string `json:"assumedRoleId"`
	ARN           string `json:"arn"`
}

AssumedRoleUser ...

type ByTime

type ByTime []Event

ByTime sorts events by time

func (ByTime) Len

func (a ByTime) Len() int

func (ByTime) Less

func (a ByTime) Less(i, j int) bool

func (ByTime) Swap

func (a ByTime) Swap(i, j int)

type Credentials

type Credentials struct {
	AccessKeyID  string `json:"accessKeyId"`
	Expiration   string `json:"expiration"`
	SessionToken string `json:"sessionToken"`
}

Credentials ...

type Event

type Event struct {
	Source             string            `json:"eventSource"`
	ErrorCode          string            `json:"errorCode"`
	Name               string            `json:"eventName"`
	UserIdentity       UserIdentity      `json:"userIdentity"`
	SourceIPAddress    string            `json:"sourceIPAddress"`
	UserAgent          string            `json:"userAgent"`
	Time               time.Time         `json:"eventTime"`
	Region             string            `json:"awsRegion"`
	RequestParameters  RequestParameters `json:"requestParameters"`
	ResponseElements   ResponseElements  `json:"responseElements"`
	RequestID          string            `json:"requestID"`
	ID                 string            `json:"eventID"`
	Resources          []Resource        `json:"resources"`
	Type               string            `json:"eventType"`
	RecipientAccountID string            `json:"recipientAccountId"`
}

Event is AWS cloud trail event

func (*Event) BuildAssumedRoleARN

func (e *Event) BuildAssumedRoleARN() string

BuildAssumedRoleARN constructs assumed role ARN from event if applicable

func (*Event) HasError

func (e *Event) HasError() bool

HasError checks if errorcode is empty

func (*Event) JSONString

func (e *Event) JSONString() (string, error)

JSONString exports event as a JSON string

type Log

type Log struct {
	Records []Event `json:"Records"`
}

Log ...

type RequestParameters

type RequestParameters struct {
	RoleArn         string `json:"roleArn"`
	RoleSessionName string `json:"roleSessionName"`
}

RequestParameters ...

type Resource

type Resource struct {
	ARN       string `json:"ARN"`
	AccountID string `json:"accountId"`
	Type      string `json:"type"`
}

Resource ...

type ResponseElements

type ResponseElements struct {
	Credentials     Credentials     `json:"credentials"`
	AssumedRoleUser AssumedRoleUser `json:"assumedRoleUser"`
}

ResponseElements ...

type UserIdentity

type UserIdentity struct {
	Type     string `json:"type"`
	ARN      string `json:"arn"`
	UserName string `json:"userName"`
}

UserIdentity ...

Jump to

Keyboard shortcuts

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