Documentation ¶
Index ¶
- Constants
- func FlattenStringMaps(stringmaps []map[string]string) map[string]string
- func GetAccountAlias(svc *iam.Client, stsSvc *sts.Client) map[string]string
- func GetAccountID(svc *sts.Client) string
- func GetAccountSummary(svc *iam.Client) (map[string]int32, error)
- func GetAllBuckets(svc *s3.Client) ([]types.Bucket, string)
- func GetAllEC2ResourceNames(svc *ec2.Client) map[string]string
- func GetAllEc2Instances(svc *ec2.Client) []types.Reservation
- func GetAllRdsResourceNames(svc *rds.Client) map[string]string
- func GetAllSecurityGroups(svc *ec2.Client) []types.SecurityGroup
- func GetAllUnservicedAppMeshNodes(meshname *string, svc *appmesh.Client) []string
- func GetAttachedPoliciesMapForGroup(groupname *string, svc *iam.Client) map[string]string
- func GetAttachedPoliciesMapForGroups(groups []string, svc *iam.Client) map[string]string
- func GetAttachedPoliciesMapForUser(username *string, svc *iam.Client) map[string]string
- func GetEc2BySecurityGroup(securitygroupID *string, svc *ec2.Client) []types.Reservation
- func GetEc2Name(ec2name string, svc *ec2.Client) string
- func GetGroupNameSliceForUser(username *string, svc *iam.Client) []string
- func GetGroupPoliciesMapForGroup(groupname *string, svc *iam.Client) map[string]string
- func GetGroupPoliciesMapForGroups(groups []string, svc *iam.Client) map[string]string
- func GetNestedCloudFormationResources(stackname *string, svc *cloudformation.Client) []types.StackResource
- func GetPoliciesMap(svc *iam.Client) map[string]types.Policy
- func GetRDSName(rdsname *string, svc *rds.Client) string
- func GetResourcesByStackName(stackname *string, svc *cloudformation.Client) []types.StackResource
- func GetRouteTablesForTransitGateway(tgwID string, svc *ec2.Client) map[string]TransitGatewayRouteTable
- func GetStringMapFromJSONFile(filename string) map[string]string
- func GetUserPoliciesMapForUser(username *string, svc *iam.Client) map[string]string
- func IsLatestInstanceFamily(instanceFamily string) bool
- func TypeByResourceID(resourceID string) string
- type AppMeshVirtualNode
- type AppMeshVirtualService
- type AppMeshVirtualServicePath
- type AppMeshVirtualServiceRoute
- type AttachedIAMPolicy
- type IAMGroup
- func (group IAMGroup) GetDirectPolicies() map[string]string
- func (group IAMGroup) GetGroups() []string
- func (group IAMGroup) GetID() string
- func (group IAMGroup) GetInheritedPolicies() map[string]string
- func (group IAMGroup) GetName() string
- func (group IAMGroup) GetObjectType() string
- func (group IAMGroup) GetUsers() []string
- type IAMObject
- type IAMPolicyDocument
- type IAMPolicyDocumentStatement
- type IAMRole
- type IAMUser
- func (user IAMUser) GetAllPolicies() map[string]string
- func (user IAMUser) GetDirectPolicies() map[string]string
- func (user IAMUser) GetGroups() []string
- func (user IAMUser) GetID() string
- func (user IAMUser) GetInheritedPolicies() map[string]string
- func (user IAMUser) GetLastAccessKeyDate(svc *iam.Client) time.Time
- func (user IAMUser) GetLastPasswordDate() time.Time
- func (user IAMUser) GetName() string
- func (user IAMUser) GetObjectType() string
- func (user IAMUser) GetUsers() []string
- func (user IAMUser) HasAccessKeys(svc *iam.Client) bool
- func (user IAMUser) HasUsedPassword() bool
- type OrganizationEntry
- type S3Bucket
- type SSOAccount
- type SSOAccountAssignment
- type SSOInstance
- type SSOPermissionSet
- type SSOPolicy
- type TransitGateway
- type TransitGatewayAttachment
- type TransitGatewayRoute
- type TransitGatewayRouteTable
- type VPCHolder
- type VPCRoute
- type VPCRouteTable
- type VpcPeering
Constants ¶
const ( IAMRoleTypeSSOManaged = "SSO Managed Role" IAMRoleTypeServiceRole = "Service Role" IAMRoleTypeUserDefined = "User defined Role" )
IAM Role type
const ( IAMPolicyTypeAttached = "Attached Policy" IAMPolicyTypeInline = "Inline Policy" IAMPolicyTypeAssumeRole = "Assume Role Policy" )
IAM Policy Type
const ( IAMObjectTypeGroup = "Group" IAMObjectTypeUser = "User" )
IAM Object Type
Variables ¶
This section is empty.
Functions ¶
func FlattenStringMaps ¶
FlattenStringMaps combines multiple stringmaps into a single one. Later values will override earlier if duplicates are present
func GetAccountAlias ¶
GetAccountAlias returns the account alias in a map of [accountid]accountalias If no alias is present, it will return the account ID instead
func GetAccountID ¶
GetAccountID returns the ID of the account the command is run from
func GetAccountSummary ¶
GetAccountSummary retrieves the account summary map which contains high level information about the root account
func GetAllBuckets ¶
GetAllBuckets returns an overview of all buckets
func GetAllEC2ResourceNames ¶
GetAllEC2ResourceNames retrieves the names of EC2 related objects
func GetAllEc2Instances ¶
func GetAllEc2Instances(svc *ec2.Client) []types.Reservation
GetAllEc2Instances retrieves all EC2 instances
func GetAllRdsResourceNames ¶
GetAllRdsResourceNames gets a list of all names for RDS objects TODO: clusters, subnet groups, parameter groups, option groups
func GetAllSecurityGroups ¶
func GetAllSecurityGroups(svc *ec2.Client) []types.SecurityGroup
GetAllSecurityGroups returns a list of all securitygroups in the region
func GetAllUnservicedAppMeshNodes ¶
GetAllUnservicedAppMeshNodes returns a slice of nodes that don't serve as the backend for any service
func GetAttachedPoliciesMapForGroup ¶
GetAttachedPoliciesMapForGroup retrieves a map of attached policies for the provided IAM groupname where the key is the name of the policy and the value is the actual json policy document
func GetAttachedPoliciesMapForGroups ¶
GetAttachedPoliciesMapForGroups retrieves a map of attached policies for the slice of IAM groupnames where the key is the name of the policy and the value is the actual json policy document
func GetAttachedPoliciesMapForUser ¶
GetAttachedPoliciesMapForUser retrieves a map of attached policies for the provided IAM username where the key is the name of the policy and the value is the actual json policy document
func GetEc2BySecurityGroup ¶
func GetEc2BySecurityGroup(securitygroupID *string, svc *ec2.Client) []types.Reservation
GetEc2BySecurityGroup retrieves all instances attached to a securitygroup
func GetEc2Name ¶
GetEc2Name returns the name of the provided EC2 Resource
func GetGroupNameSliceForUser ¶
GetGroupNameSliceForUser retrieves a slice of all the groups the provided IAM username belongs to
func GetGroupPoliciesMapForGroup ¶
GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM groupname where the key is the name of the policy and the value is the actual json policy document
func GetGroupPoliciesMapForGroups ¶
GetGroupPoliciesMapForGroups retrieves all of the policies for the provided slice of groups, where the key is the name of the policy and the value is the json policy document
func GetNestedCloudFormationResources ¶
func GetNestedCloudFormationResources(stackname *string, svc *cloudformation.Client) []types.StackResource
GetNestedCloudFormationResources retrieves a slice of the Stack Resources that are in the provided stack or in one of its children
func GetPoliciesMap ¶
GetPoliciesMap retrieves a map of policies with the policy name as the key and the actual policy object as the value
func GetRDSName ¶
GetRDSName returns the name of the provided RDS Resource
func GetResourcesByStackName ¶
func GetResourcesByStackName(stackname *string, svc *cloudformation.Client) []types.StackResource
GetResourcesByStackName returns a slice of the Stack Resources in the provided stack
func GetRouteTablesForTransitGateway ¶
func GetRouteTablesForTransitGateway(tgwID string, svc *ec2.Client) map[string]TransitGatewayRouteTable
GetRouteTablesForTransitGateway returns all route tables attached to a Transit Gateway
func GetStringMapFromJSONFile ¶
GetStringMapFromJSONFile parses a JSON file and returns it as a string map
func GetUserPoliciesMapForUser ¶
GetUserPoliciesMapForUser retrieves a map of policies for the provided IAM username where the key is the name of the policy and the value is the actual json policy document
func IsLatestInstanceFamily ¶
IsLatestInstanceFamily checks if an instance is part of the la test family is running in the latest instance family. TODO: Automate this to work properly
func TypeByResourceID ¶
TypeByResourceID identifies the type of resource based on its unique ID
Types ¶
type AppMeshVirtualNode ¶
type AppMeshVirtualNode struct { VirtualNodeName string BackendServices []string BackendNodes []string }
AppMeshVirtualNode contains information about an App Mesh Virtual Node
func GetAllAppMeshNodeConnections ¶
func GetAllAppMeshNodeConnections(meshname *string, svc *appmesh.Client) []AppMeshVirtualNode
GetAllAppMeshNodeConnections retrieves all nodes and which services/nodes they connect to
type AppMeshVirtualService ¶
type AppMeshVirtualService struct { VirtualServiceName string VirtualServiceRoutes []AppMeshVirtualServiceRoute VirtualServicePaths []AppMeshVirtualServicePath }
AppMeshVirtualService contains information about an App Mesh Virtual Service
func GetAllAppMeshPaths ¶
func GetAllAppMeshPaths(meshName *string, svc *appmesh.Client) []AppMeshVirtualService
GetAllAppMeshPaths retrieves all the connections in the mesh
func (*AppMeshVirtualService) AddPath ¶
func (service *AppMeshVirtualService) AddPath(path AppMeshVirtualServicePath)
AddPath adds a path to an AppMeshVirtualService
type AppMeshVirtualServicePath ¶
AppMeshVirtualServicePath shows virtual nodes and their backend that a service might be connected to
type AppMeshVirtualServiceRoute ¶
type AppMeshVirtualServiceRoute struct { Router string Path string DestinationNode string Weight int32 }
AppMeshVirtualServiceRoute contains information about an App Mesh route
type AttachedIAMPolicy ¶
AttachedIAMPolicy is used to connect usernames, groups, and policy names
func (*AttachedIAMPolicy) AddObject ¶
func (policy *AttachedIAMPolicy) AddObject(object IAMObject)
AddObject adds an IAMObject (user or group) to the AttachedIAMPolicy
type IAMGroup ¶
type IAMGroup struct { Name string ID string Users []string AttachedPolicies map[string]string InlinePolicies map[string]string Group *types.Group }
IAMGroup contains information about IAM Groups
func GetGroupDetails ¶
GetGroupDetails collects detailed information about a group, consisting mostly of the users and policies it follows.
func (IAMGroup) GetDirectPolicies ¶
GetDirectPolicies retrieves all directly attached policies for the group
func (IAMGroup) GetInheritedPolicies ¶
GetInheritedPolicies retrieves all inherited policies for the group (none)
func (IAMGroup) GetObjectType ¶
GetObjectType returns the type of IAM object
type IAMObject ¶
type IAMObject interface { GetName() string GetID() string GetUsers() []string GetGroups() []string GetObjectType() string GetDirectPolicies() map[string]string GetInheritedPolicies() map[string]string }
IAMObject interface for IAM objects
type IAMPolicyDocument ¶
type IAMPolicyDocument struct { Name string Version string Type string Statement []IAMPolicyDocumentStatement Roles []*IAMRole Groups []*IAMGroup Users []*IAMUser }
IAMPolicyDocument is an abstracted version of an IAM Policy Document
func (*IAMPolicyDocument) AddRole ¶
func (policy *IAMPolicyDocument) AddRole(role *IAMRole)
AddRole adds the role to the policy document
func (*IAMPolicyDocument) GetRoleNames ¶
func (policy *IAMPolicyDocument) GetRoleNames() []string
GetRoleNames returns the names of the roles the policy is attached to
type IAMPolicyDocumentStatement ¶
type IAMPolicyDocumentStatement struct { Effect string Principal map[string]string Action interface{} Condition interface{} Resource interface{} }
IAMPolicyDocumentStatement is an abstracted version of a Statement for a policy document
type IAMRole ¶
type IAMRole struct { Name string ID string Path string AssumeRolePolicy IAMPolicyDocument InlinePolicies map[string]*IAMPolicyDocument AttachedPolicies map[string]*IAMPolicyDocument Role *types.Role Type string Verbose bool }
IAMRole is an abstracted version of an IAM Role
func GetRoleDetails ¶
GetRoleDetails returns the list of roles in the account
func GetRolesAndPolicies ¶
GetRolesAndPolicies returns all the roles and and their attached policies
func (*IAMRole) CanBeAssumedFrom ¶
CanBeAssumedFrom returns information about the assumerole policy
func (IAMRole) GetPolicyNames ¶
GetPolicyNames returns the names of the policies attached to the role
type IAMUser ¶
type IAMUser struct { Name string ID string AttachedPolicies map[string]string InlinePolicies map[string]string Groups []string AttachedGroupPolicies map[string]string InlineGroupPolicies map[string]string User *types.User }
IAMUser contains information about IAM Users
func GetUserDetails ¶
GetUserDetails collects detailed information about a user, consisting mostly of the groups and policies it follows.
func (IAMUser) GetAllPolicies ¶
GetAllPolicies retrieves a map of all the users policies
func (IAMUser) GetDirectPolicies ¶
GetDirectPolicies retrieves all directly attached policies for the user
func (IAMUser) GetInheritedPolicies ¶
GetInheritedPolicies retrieves all inherited policies for the user
func (IAMUser) GetLastAccessKeyDate ¶
GetLastAccessKeyDate returns the last date an access key was used
func (IAMUser) GetLastPasswordDate ¶
GetLastPasswordDate returns the last date the user's password was used
func (IAMUser) GetObjectType ¶
GetObjectType returns the type of IAM object
func (IAMUser) HasAccessKeys ¶
HasAccessKeys checks if a user has access keys
func (IAMUser) HasUsedPassword ¶
HasUsedPassword checks if the user has used their password
type OrganizationEntry ¶
type OrganizationEntry struct { ID string Name string Arn string Type string Children []OrganizationEntry }
OrganizationEntry is a helper struct for Organization resources
func GetFullOrganization ¶
func GetFullOrganization(svc *organizations.Client) OrganizationEntry
GetFullOrganization returns the root entry of the organization with all children fleshed out
func (*OrganizationEntry) String ¶
func (entry *OrganizationEntry) String() string
type S3Bucket ¶
type S3Bucket struct { Account string ACLs []types.Grant EncryptionRules []types.ServerSideEncryptionRule HasEncryption bool IsPublic bool LoggingBucket string LoggingEnabled bool Name string OpenACLs bool Owner string Policy string PublicAccessBlockConfiguration types.PublicAccessBlockConfiguration PublicPolicy bool Region string Replication types.ReplicationConfiguration Tags map[string]string Versioning bool VersioningMFAEnabled bool }
func GetBucketDetails ¶
func (*S3Bucket) GetReplicationStrings ¶
type SSOAccount ¶
type SSOAccount struct { AccountID string AccountAssignments []SSOAccountAssignment }
SSOAccount represents an AWS account managed by AWS
func (*SSOAccount) GetPrincipalIdsForPermissionSet ¶
func (account *SSOAccount) GetPrincipalIdsForPermissionSet(permissionset SSOPermissionSet) []string
GetPrincipalIdsForPermissionSet returns the ids of the principals that have been assigned to the provided permission set
type SSOAccountAssignment ¶
type SSOAccountAssignment struct { PrincipalType string PrincipalID string PermissionSet *SSOPermissionSet }
SSOAccountAssignment represents which principals are tied to an account using which permission set
type SSOInstance ¶
type SSOInstance struct { IdentityStoreID string Arn string //PermissionSets contains the permission sets the instance has PermissionSets []SSOPermissionSet //Accounts contains the accounts with permission sets, those permission sets, and who has access Accounts map[string]SSOAccount }
SSOInstance is the top level representation of an SSO Instance
func GetSSOAccountInstance ¶
func GetSSOAccountInstance(svc *ssoadmin.Client) SSOInstance
GetSSOAccountInstance retrieves the SSO Account Instance and all its data
func (*SSOInstance) GetAccountList ¶
func (instance *SSOInstance) GetAccountList() []string
GetAccountList returns a list of the account numbers in the SSO Instance
func (*SSOInstance) GetPermissionSetList ¶
func (instance *SSOInstance) GetPermissionSetList() []string
GetPermissionSetList returns a list of the permission sets in the SSO Instance
type SSOPermissionSet ¶
type SSOPermissionSet struct { Arn string Name string Description string CreatedAt time.Time SessionDuration string Accounts []SSOAccount ManagedPolicies []SSOPolicy InlinePolicy string Instance *SSOInstance }
SSOPermissionSet is the representation of a permission set
func (*SSOPermissionSet) GetAssignmentIdsByAccount ¶
func (permissionset *SSOPermissionSet) GetAssignmentIdsByAccount(accountnr string) []string
GetAssignmentIdsByAccount returns the assigment's principal IDs
func (*SSOPermissionSet) GetManagedPolicyNames ¶
func (permissionset *SSOPermissionSet) GetManagedPolicyNames() []string
GetManagedPolicyNames returns a slice containing the names of the policies attached to the permission set
type TransitGateway ¶
type TransitGateway struct { ID string AccountID string Name string RouteTables map[string]TransitGatewayRouteTable }
TransitGateway is a struct for managing TransitGateway objects
func GetAllTransitGateways ¶
func GetAllTransitGateways(svc *ec2.Client) []TransitGateway
GetAllTransitGateways returns an array of all Transit Gateways in the account
type TransitGatewayAttachment ¶
TransitGatewayAttachment reflects a Transit Gateway Attachment
func GetSourceAttachmentsForTransitGatewayRouteTable ¶
func GetSourceAttachmentsForTransitGatewayRouteTable(routetableID string, svc *ec2.Client) []TransitGatewayAttachment
GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table
type TransitGatewayRoute ¶
type TransitGatewayRoute struct { State string CIDR string Attachment TransitGatewayAttachment ResourceType string RouteType string }
TransitGatewayRoute reflects a Transit Gateway Route object
func GetActiveRoutesForTransitGatewayRouteTable ¶
func GetActiveRoutesForTransitGatewayRouteTable(routetableID string, svc *ec2.Client) []TransitGatewayRoute
GetActiveRoutesForTransitGatewayRouteTable returns all routes that are currently active for a Transit Gateway route table
func GetBlackholeRoutesForTransitGatewayRouteTable ¶
func GetBlackholeRoutesForTransitGatewayRouteTable(routetableID string, svc *ec2.Client) []TransitGatewayRoute
GetBlackholeRoutesForTransitGatewayRouteTable returns all routes that are currently active for a Transit Gateway route table
type TransitGatewayRouteTable ¶
type TransitGatewayRouteTable struct { ID string Name string Routes []TransitGatewayRoute SourceAttachments []TransitGatewayAttachment DestinationAttachments []TransitGatewayAttachment }
TransitGatewayRouteTable is a struct for managing Transit Gateway route table objects
type VPCRoute ¶
VPCRoute represents a Route object DestinationTarget shows the target, regardless of the type
type VPCRouteTable ¶
type VPCRouteTable struct { Vpc VPCHolder ID string Routes []VPCRoute Subnets []string Default bool }
VPCRouteTable contains the relevant information for a Route Table
func GetAllVPCRouteTables ¶
func GetAllVPCRouteTables(svc *ec2.Client) []VPCRouteTable
GetAllVPCRouteTables returns all the Routetables in the account and region
type VpcPeering ¶
VpcPeering represents a VPC Peering object
func GetAllVpcPeers ¶
func GetAllVpcPeers(svc *ec2.Client) []VpcPeering
GetAllVpcPeers returns the peerings that are present in this region of this account