Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) DescribeS3Bucket(accountID int64, roleName string, b *s3.Bucket) (*S3Bucket, error)
- func (c *Client) EvalEC2SG(accounts []*policy.Account, p policy.Policy, regions []string, ...) error
- func (c *Client) EvalEbsVolume(accounts []*policy.Account, p policy.Policy, regions []string, ...) error
- func (c *Client) EvalEc2Instance(accounts []*policy.Account, p policy.Policy, regions []string, ...) error
- func (c *Client) EvalIAMAccessKey(accounts []*policy.Account, p policy.Policy) ([]policy.Violation, error)
- func (c *Client) EvalIAMUser(accounts []*policy.Account, p policy.Policy, regions []string) ([]policy.Violation, error)
- func (c *Client) EvalKMSKey(accounts []*policy.Account, p policy.Policy, regions []string, ...) error
- func (c *Client) EvalS3(accounts []*policy.Account, p policy.Policy) ([]policy.Violation, error)
- func (c *Client) EvalVPC(accounts []*policy.Account, p policy.Policy, regions []string, ...) error
- func (c *Client) Get(accountID int64, roleName, region string) *cziAws.Client
- func (c *Client) NewIAMAccessKey(ctx context.Context, key *iam.AccessKeyMetadata) *IAMAccessKey
- func (c *Client) NewIAMUser(user *iam.User, accountID int64, roleName string) *IAMUser
- func (c *Client) WalkAccountsAndRegions(accounts []*policy.Account, regions []string, ...) error
- type EC2Client
- type EC2EBSVol
- type EC2Instance
- type EC2SG
- type Entity
- func (e *Entity) AddBoolLabel(key TypeEntityLabel, value *bool) *Entity
- func (e *Entity) AddCreatedAt(t *time.Time) *Entity
- func (e *Entity) AddInt64Label(key TypeEntityLabel, value *int64) *Entity
- func (e *Entity) AddLabel(key TypeEntityLabel, value *string) *Entity
- func (e *Entity) AddTag(key *string, value *string) *Entity
- func (e *Entity) Delete() error
- func (e *Entity) GetCreatedAt() *time.Time
- func (e *Entity) GetLabelOr(label string, or string) string
- func (e *Entity) GetLabels() labels.Set
- func (e *Entity) GetName() string
- func (e *Entity) GetOwner() string
- func (e *Entity) GetRegion() string
- func (e *Entity) GetTags() labels.Set
- type IAMAccessKey
- type IAMUser
- type KmsKey
- type S3Bucket
- type TypeEntityLabel
- type VPC
- type WalkFun
Constants ¶
const ( // DefaultRegion is the AWS region we use for global resources, like IAM DefaultRegion = "us-east-1" // TODO find this in the sdk )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { }
Client is an AWS client
func (*Client) DescribeS3Bucket ¶
func (c *Client) DescribeS3Bucket(accountID int64, roleName string, b *s3.Bucket) (*S3Bucket, error)
DescribeS3Bucket describes the bucket
func (*Client) EvalEC2SG ¶
func (c *Client) EvalEC2SG(accounts []*policy.Account, p policy.Policy, regions []string, f func(policy.Violation)) error
EvalEC2SG walks through all ec2 instances
func (*Client) EvalEbsVolume ¶
func (c *Client) EvalEbsVolume(accounts []*policy.Account, p policy.Policy, regions []string, f func(policy.Violation)) error
EvalEbsVolume walks through all ec2 instances
func (*Client) EvalEc2Instance ¶
func (c *Client) EvalEc2Instance(accounts []*policy.Account, p policy.Policy, regions []string, f func(policy.Violation)) error
EvalEc2Instance walks through all ec2 instances
func (*Client) EvalIAMAccessKey ¶
func (c *Client) EvalIAMAccessKey(accounts []*policy.Account, p policy.Policy) ([]policy.Violation, error)
EvalIAMAccessKey walks through all IAM users' access keys
func (*Client) EvalIAMUser ¶
func (c *Client) EvalIAMUser(accounts []*policy.Account, p policy.Policy, regions []string) ([]policy.Violation, error)
EvalIAMUser walks through all ec2 instances
func (*Client) EvalKMSKey ¶
func (c *Client) EvalKMSKey(accounts []*policy.Account, p policy.Policy, regions []string, f func(policy.Violation)) error
EvalKMSKey walks through all kms keys
func (*Client) EvalVPC ¶
func (c *Client) EvalVPC(accounts []*policy.Account, p policy.Policy, regions []string, f func(policy.Violation)) error
EvalVPC will evaluate policy for a vpc
func (*Client) NewIAMAccessKey ¶
func (c *Client) NewIAMAccessKey(ctx context.Context, key *iam.AccessKeyMetadata) *IAMAccessKey
NewIAMAccessKey returns a new ec2 instance entity
func (*Client) NewIAMUser ¶
NewIAMUser returns a new ec2 instance entity I don't like that I have to pass accountId and roleName all the way down here.
type EC2Client ¶
type EC2Client struct { Client ec2iface.EC2API RegionClients map[string]ec2iface.EC2API Session *session.Session // contains filtered or unexported fields }
EC2Client is an ec2 client with multi region capabilities
type EC2EBSVol ¶
EC2EBSVol is an evaluation entity representing an ec2 ebs volume
func NewEc2EBSVol ¶
NewEc2EBSVol returns a new ec2 ebs vol entity
func (*EC2EBSVol) GetConsoleURL ¶
GetConsoleURL will return a url to the AWS console for this volume
type EC2Instance ¶
type EC2Instance struct {
Entity
}
EC2Instance is an evaluation entity representing an ec2 instance
func NewEc2Instance ¶
func NewEc2Instance(instance *ec2.Instance, region string) *EC2Instance
NewEc2Instance returns a new ec2 instance entity
func (*EC2Instance) GetConsoleURL ¶
func (e *EC2Instance) GetConsoleURL() string
GetConsoleURL will return a URL for this resource in the AWS console
type EC2SG ¶
EC2SG is an evaluation entity representing an ec2 security group
func NewEC2SG ¶
func NewEC2SG(sg *ec2.SecurityGroup, region string) *EC2SG
NewEC2SG returns a new ec2 security group
func (*EC2SG) GetConsoleURL ¶
GetConsoleURL will return a url to the AWS console for this security group
type Entity ¶
type Entity struct { ID string Name string Region string // contains filtered or unexported fields }
Entity is an AWS entity s3 bucket, ec2 instance, etc
func (*Entity) AddBoolLabel ¶
func (e *Entity) AddBoolLabel(key TypeEntityLabel, value *bool) *Entity
AddBoolLabel adds a label if the value is true
func (*Entity) AddCreatedAt ¶
AddCreatedAt adds a createdAt
func (*Entity) AddInt64Label ¶
func (e *Entity) AddInt64Label(key TypeEntityLabel, value *int64) *Entity
AddInt64Label adds a label if the value is not nil
func (*Entity) AddLabel ¶
func (e *Entity) AddLabel(key TypeEntityLabel, value *string) *Entity
AddLabel adds a label if the value is not nil
func (*Entity) GetCreatedAt ¶
GetCreatedAt returns createdAt
func (*Entity) GetLabelOr ¶
GetLabelOr will return the label value (if defined). otherwise `or`. Useful for templates.
type IAMAccessKey ¶
IAMAccessKey is an evaluation entity representing an ec2 instance
func (*IAMAccessKey) GetConsoleURL ¶
func (u *IAMAccessKey) GetConsoleURL() string
GetConsoleURL will return a URL for this resource in the AWS console
func (*IAMAccessKey) GetID ¶
func (u *IAMAccessKey) GetID() string
GetID returns the ec2_instance id
func (*IAMAccessKey) GetOwner ¶
func (u *IAMAccessKey) GetOwner() string
GetOwner will return the username as owner
type IAMUser ¶
IAMUser is an evaluation entity representing an ec2 instance
func (*IAMUser) GetConsoleURL ¶
GetConsoleURL will return a URL for this resource in the AWS console
type KmsKey ¶
type KmsKey struct { Entity // contains filtered or unexported fields }
func (*KmsKey) GetConsoleURL ¶
type S3Bucket ¶
type S3Bucket struct { Entity // contains filtered or unexported fields }
S3Bucket is an evaluation entity representing an s3 bucket
func NewS3Bucket ¶
NewS3Bucket returns a new s3 bucket entity
func (*S3Bucket) GetConsoleURL ¶
GetConsoleURL will return a URL for this resource in the AWS console
type VPC ¶
VPC represents an AWS VPC
func (*VPC) GetConsoleURL ¶
GetConsoleURL will return a URL for this resource in the AWS console