Documentation
¶
Index ¶
- Variables
- func GetAccountAlias(cfg aws.Config) (string, error)
- func GetAllRegions() ([]string, error)
- func GetAwsSession(region string) aws.Config
- func GetEC2ClientFn(cfg aws.Config) *ec2.Client
- func GetIAMClientFn(cfg aws.Config) *iam.Client
- func GetRDSClientFn(cfg aws.Config) *rds.Client
- func GetRegionName(regionID string) (*string, error)
- func GetRoute53ClientFn(cfg aws.Config) *route53.Client
- func GetS3ClientFn(cfg aws.Config) *s3.Client
- func GetSTSClientFn(cfg aws.Config) *sts.Client
- type BucketPolicy
- type Client
- func ChooseResourceClient(resource string, h Helper) (Client, error)
- func CreateResourceClient(provider, resource, region string) (Client, error)
- func NewEC2Client(cfg aws.Config, helper Helper) (Client, error)
- func NewIAMClient(cfg aws.Config, _ Helper) (Client, error)
- func NewRDSClient(cfg aws.Config, helper Helper) (Client, error)
- func NewRoute53Client(cfg aws.Config, _ Helper) (Client, error)
- func NewS3Client(cfg aws.Config, helper Helper) (Client, error)
- func NewSGClient(cfg aws.Config, _ Helper) (Client, error)
- type EC2Client
- type Helper
- type IAMClient
- func (i IAMClient) GetAccessKeys(user string) ([]types.AccessKeyMetadata, error)
- func (i *IAMClient) GetGroupList() ([]types.Group, error)
- func (i *IAMClient) GetGroupPolicies(group string) ([]types.AttachedPolicy, error)
- func (i *IAMClient) GetLastAccessKeyUsed(accessKey *string) (*types.AccessKeyLastUsed, error)
- func (i *IAMClient) GetMFADevices(user string) ([]types.MFADevice, error)
- func (i IAMClient) GetResourceName() string
- func (i *IAMClient) GetRoleList() ([]types.Role, error)
- func (i *IAMClient) GetUserList() ([]types.User, error)
- func (i *IAMClient) GetUserListInGroup(group string) ([]types.User, error)
- func (i *IAMClient) Scan() ([]resource.Resource, error)
- func (i *IAMClient) ScanGroup() ([]resource.Resource, map[string][]string, error)
- func (i *IAMClient) ScanRole() ([]resource.Resource, error)
- func (i *IAMClient) ScanUser(userGroupMap map[string][]string) ([]resource.Resource, error)
- func (i *IAMClient) SetAlias(alias *string)
- type PolicyDocument
- type Principal
- type RDSClient
- type Route53Client
- func (r *Route53Client) GetResourceName() string
- func (r *Route53Client) GetRoute53HostedZones() ([]types.HostedZone, error)
- func (r *Route53Client) GetRoute53List() ([]types.ResourceRecordSet, error)
- func (r *Route53Client) Scan() ([]resource.Resource, error)
- func (r *Route53Client) SetAlias(alias *string)
- type S3Client
- func (s *S3Client) GetBucketList() ([]types.Bucket, error)
- func (s *S3Client) GetBucketLocation(bucket string) (*string, error)
- func (s *S3Client) GetBucketLogging(bucket string) (*types.LoggingEnabled, error)
- func (s *S3Client) GetBucketPolicy(bucket string) (*string, error)
- func (s *S3Client) GetResourceName() string
- func (s *S3Client) Scan() ([]resource.Resource, error)
- func (s *S3Client) SetAlias(alias *string)
- type SGClient
- type STSClient
- type Statement
- type StatementEntry
Constants ¶
This section is empty.
Variables ¶
var RegionNameMapping = map[string]string{
"eu-north-1": "Stockholm",
"ap-south-1": "Mumbai",
"eu-west-3": "Paris",
"eu-west-2": "London",
"eu-west-1": "Ireland",
"ap-northeast-2": "Seoul",
"ap-northeast-1": "Tokyo",
"sa-east-1": "São Paulo",
"ca-central-1": "Canada(Central)",
"ap-southeast-1": "Singapore",
"ap-southeast-2": "Sydney",
"eu-central-1": "Frankfurt",
"us-east-1": "N. Virginia",
"us-east-2": "Ohio",
"us-west-1": "N. California",
"us-west-2": "Oregon",
}
Functions ¶
func GetAccountAlias ¶
GetAccountAlias returns account alias
func GetAwsSession ¶
GetAwsSession creates new session for AWS
func GetEC2ClientFn ¶
GetEC2ClientFn creates ec2 client
func GetIAMClientFn ¶
GetIAMClientFn creates iam client
func GetRDSClientFn ¶
GetRDSClientFn creates rds client
func GetRegionName ¶
GetRegionName returns exact name of region
func GetRoute53ClientFn ¶
GetRoute53ClientFn creates route53 client
Types ¶
type BucketPolicy ¶
type Client ¶
type Client interface {
GetResourceName() string
SetAlias(*string)
Scan() ([]resource.Resource, error)
}
func ChooseResourceClient ¶
ChooseResourceClient selects resource client from the list
func CreateResourceClient ¶
CreateResourceClient creates a new client fro redhawk
func NewEC2Client ¶
NewEC2Client creates EC2Client resource with ec2 client
func NewIAMClient ¶
NewIAMClient creates IAMClient
func NewRDSClient ¶
NewRDSClient creates a RDSClient
func NewRoute53Client ¶
NewRoute53Client creates a Route53Client
func NewS3Client ¶
NewS3Client creates S3Client
type EC2Client ¶
func (*EC2Client) GetEC2Instances ¶
func (e *EC2Client) GetEC2Instances(original []types.Reservation, nextToken *string) ([]types.Reservation, error)
GetEC2Instances get all instances in the account
func (*EC2Client) GetResourceName ¶
GetResourceName returns resource name of client
type IAMClient ¶
func (IAMClient) GetAccessKeys ¶
func (i IAMClient) GetAccessKeys(user string) ([]types.AccessKeyMetadata, error)
GetAccessKeys returns all access keys of user
func (*IAMClient) GetGroupList ¶
GetGroupList returns all IAM group list
func (*IAMClient) GetGroupPolicies ¶
func (i *IAMClient) GetGroupPolicies(group string) ([]types.AttachedPolicy, error)
GetGroupPolicies returns policies of group
func (*IAMClient) GetLastAccessKeyUsed ¶
func (i *IAMClient) GetLastAccessKeyUsed(accessKey *string) (*types.AccessKeyLastUsed, error)
GetLastAccessKeyUsed returns lastly used date of access key
func (*IAMClient) GetMFADevices ¶
GetMFADevices returns all MFA devices
func (IAMClient) GetResourceName ¶
GetResourceName returns resource name of client
func (*IAMClient) GetRoleList ¶
GetRoleList returns all IAM role list
func (*IAMClient) GetUserList ¶
GetUserList returns all IAM User list
func (*IAMClient) GetUserListInGroup ¶
GetUserListInGroup returns user list of group
type PolicyDocument ¶
type PolicyDocument struct {
Version string
Statement []StatementEntry
}
type RDSClient ¶
func (*RDSClient) GetRDSClusterList ¶
GetRDSClusterList returns all DB clusters list in the account
func (*RDSClient) GetRDSInfo ¶
func (r *RDSClient) GetRDSInfo(identifier string) (*types.DBInstance, error)
GetRDSInfo returns DB instance information
func (*RDSClient) GetResourceName ¶
GetResourceName returns resource name of client
type Route53Client ¶
func (*Route53Client) GetResourceName ¶
func (r *Route53Client) GetResourceName() string
GetResourceName returns resource name of client
func (*Route53Client) GetRoute53HostedZones ¶
func (r *Route53Client) GetRoute53HostedZones() ([]types.HostedZone, error)
GetRoute53HostedZones get all hosted zones in the account
func (*Route53Client) GetRoute53List ¶
func (r *Route53Client) GetRoute53List() ([]types.ResourceRecordSet, error)
GetRoute53List get all record set in the account
func (*Route53Client) Scan ¶
func (r *Route53Client) Scan() ([]resource.Resource, error)
Scan scans all data
func (*Route53Client) SetAlias ¶
func (r *Route53Client) SetAlias(alias *string)
SetAlias sets alias
type S3Client ¶
func (*S3Client) GetBucketList ¶
GetSGList returns all security group list in the account
func (*S3Client) GetBucketLocation ¶
GetBucketLocation returns region of bucket
func (*S3Client) GetBucketLogging ¶
func (s *S3Client) GetBucketLogging(bucket string) (*types.LoggingEnabled, error)
GetBucketLogging returns a bucket logging configuration
func (*S3Client) GetBucketPolicy ¶
GetBucketPolicy returns a bucket policy
func (*S3Client) GetResourceName ¶
GetResourceName returns resource name of client
type SGClient ¶
func (SGClient) GetResourceName ¶
GetResourceName returns resource name of client
type STSClient ¶
func NewSTSClient ¶
NewSTSClient creates a STSClients
func (STSClient) CheckWhoIam ¶
CheckWhoIam calls get-caller-identity and print the result
type Statement ¶
type Statement struct {
Effect string `json:"Effect"`
Principal interface{} `json:"Principal"`
Action interface{} `json:"Action"`
Resource interface{} `json:"Resource"`
}