Documentation
¶
Index ¶
- func Contains(ss []string, s string) bool
- func NewAthenaTableMetaDataForCloudTrail(location string, regionList []string) *athena.TableMetadata
- func NewAuthenticatedSession(region string) (*session.Session, error)
- func SdkStringContains(ss []*string, s *string) bool
- type APIs
- type AthenaSVC
- type Client
- func (client *Client) CreateTableFromMetadata(meta *athena.TableMetadata) (*string, error)
- func (client *Client) GenerateReport(assessmentRunArn string, reportFormat string, reportType string) (string, error)
- func (client *Client) GetAccountID() (string, error)
- func (client *Client) GetECRImageScanFindings(image *ecr.ImageDetail) map[string]int64
- func (client *Client) GetECRImagesWithTag(tag string) (map[string][]*ecr.ImageDetail, error)
- func (client *Client) GetFailingTrustedAdvisorCheckResults() (map[*support.TrustedAdvisorCheckDescription]*support.TrustedAdvisorCheckResult, ...)
- func (client *Client) GetHealthAffectedEntities(arnArr []*string, nextToken *string) (*health.DescribeAffectedEntitiesOutput, error)
- func (client *Client) GetHealthEventDetails(arnArr []*string) (*health.DescribeEventDetailsOutput, error)
- func (client *Client) GetHealthEvents(eventFilter *health.EventFilter, nextToken *string) (*health.DescribeEventsOutput, error)
- func (client *Client) GetImageInformation(imageIds []string) (*ec2.DescribeImagesOutput, error)
- func (client *Client) GetInstances() (*ec2.DescribeInstancesOutput, error)
- func (client *Client) GetInstancesByFilters(ec2Filters map[string][]string) (*ec2.DescribeInstancesOutput, error)
- func (client *Client) GetInstancesMatchingAllTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error)
- func (client *Client) GetInstancesMatchingAnyTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error)
- func (client *Client) GetMostRecentAssessmentRunInfo() ([]map[string]string, error)
- func (client *Client) GetNetIAMPermissionsForRoles(roleARNs []string) map[string][]string
- func (client *Client) GetNonComplaintConfigRules() (map[string][]*configservice.EvaluationResult, error)
- func (client *Client) GetResourceGroupTags(assessmentTargetArn string) (map[string]string, error)
- func (client *Client) GetRolesFromTags(tags map[string]string) ([]string, error)
- func (client *Client) GetS3LogPrefixForCloudTrail() (*string, error)
- func (client *Client) GetTableMetadata(tableName string) (*athena.TableMetadata, error)
- func (client *Client) GetTableforMetadata(meta *athena.TableMetadata) (*string, error)
- func (client *Client) RunQuery(tableName, query string) (*athena.ResultSet, error)
- type CloudTrailSVC
- type ConfigServiceSVC
- type EC2SVC
- type ECRSVC
- type HealthSVC
- type IAMSVC
- type InspectorSVC
- type STSSVC
- type TrustedAdvisorSVC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAthenaTableMetaDataForCloudTrail ¶
func NewAthenaTableMetaDataForCloudTrail(location string, regionList []string) *athena.TableMetadata
NewAthenaTableMetaDataForCloudTrail creates the metadata for CloudTrail table Returned metadata will not have Name for the table or location of the datasource Note : Sorted by value of Name
func NewAuthenticatedSession ¶
NewAuthenticatedSession creates an AWS Session using the credentials from the running environment
func SdkStringContains ¶ added in v0.1.2
SdkStringContains tells whether slice of pointers of strings 'ss' contains pointer string 's'.
Types ¶
type APIs ¶
type APIs interface { EC2SVC TrustedAdvisorSVC ConfigServiceSVC InspectorSVC STSSVC IAMSVC HealthSVC ECRSVC CloudTrailSVC AthenaSVC }
APIs represent the different API calls available to the AWS client
type AthenaSVC ¶
type AthenaSVC interface { GetTableforMetadata(*athena.TableMetadata) (*string, error) CreateTableFromMetadata(*athena.TableMetadata) (*string, error) RunQuery(tableName, query string) (*athena.ResultSet, error) GetTableMetadata(string) (*athena.TableMetadata, error) }
AthenaSVC is a wrapper for Athena service API calls
type Client ¶
type Client struct { EC2 ec2iface.EC2API TrustedAdvisor supportiface.SupportAPI AWSConfig configserviceiface.ConfigServiceAPI Inspector inspectoriface.InspectorAPI STS stsiface.STSAPI IAM iamiface.IAMAPI Health healthiface.HealthAPI ECR ecriface.ECRAPI CloudTrail cloudtrailiface.CloudTrailAPI Athena athenaiface.AthenaAPI }
Client is the client for AWS API operations
func (*Client) CreateTableFromMetadata ¶
func (client *Client) CreateTableFromMetadata(meta *athena.TableMetadata) (*string, error)
CreateTableFromMetadata creates a Athena Table for given metadata and returns a table name in the form <databasename>.<tablename> and an error if there is any. Region is derived from authenticated session
func (*Client) GenerateReport ¶
func (client *Client) GenerateReport(assessmentRunArn string, reportFormat string, reportType string) (string, error)
GenerateReport generates an inspector report for a given assessment run ARN in either PDF or HTML and returns the URL
func (*Client) GetAccountID ¶
GetAccountID returns the AccountID associated with the current session
func (*Client) GetECRImageScanFindings ¶ added in v0.1.6
func (client *Client) GetECRImageScanFindings(image *ecr.ImageDetail) map[string]int64
func (*Client) GetECRImagesWithTag ¶
GetECRImagesWithTag finds all ECR images with a given tag. If no tag specified, all tagged images are returned
func (*Client) GetFailingTrustedAdvisorCheckResults ¶
func (client *Client) GetFailingTrustedAdvisorCheckResults() (map[*support.TrustedAdvisorCheckDescription]*support.TrustedAdvisorCheckResult, error)
GetFailingTrustedAdvisorCheckResults returns all failing trusted advisor checks with detailed results
func (*Client) GetHealthAffectedEntities ¶
func (client *Client) GetHealthAffectedEntities(arnArr []*string, nextToken *string) (*health.DescribeAffectedEntitiesOutput, error)
GetHealthAffectedEntities returns a list of Health notification events
func (*Client) GetHealthEventDetails ¶
func (client *Client) GetHealthEventDetails(arnArr []*string) (*health.DescribeEventDetailsOutput, error)
GetHealthEventDetails returns a list of Health notification events
func (*Client) GetHealthEvents ¶
func (client *Client) GetHealthEvents(eventFilter *health.EventFilter, nextToken *string) (*health.DescribeEventsOutput, error)
GetHealthEvents returns a list of Health notification events
func (*Client) GetImageInformation ¶
func (client *Client) GetImageInformation(imageIds []string) (*ec2.DescribeImagesOutput, error)
GetImageInformation returns the information about a list of EC2 imageIds
func (*Client) GetInstances ¶
func (client *Client) GetInstances() (*ec2.DescribeInstancesOutput, error)
GetInstances returns a list of EC2 instances and information
func (*Client) GetInstancesByFilters ¶
func (client *Client) GetInstancesByFilters(ec2Filters map[string][]string) (*ec2.DescribeInstancesOutput, error)
GetInstancesByFilters returns all instances that match a list of EC2 filters
func (*Client) GetInstancesMatchingAllTags ¶
func (client *Client) GetInstancesMatchingAllTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error)
GetInstancesMatchingAllTags returns instances that match ALL tags and their respective values in a given list. Ex: "k8s.io/cluster-autoscaler/enabled": "true" AND "terraform": "true"
func (*Client) GetInstancesMatchingAnyTags ¶
func (client *Client) GetInstancesMatchingAnyTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error)
GetInstancesMatchingAnyTags returns instances that match ANY tags and their respective values in a given list. Ex: "k8s.io/cluster-autoscaler/enabled": "true" AND/OR "terraform": "true"
func (*Client) GetMostRecentAssessmentRunInfo ¶
GetMostRecentAssessmentRunInfo returns the most recent assessment run and target group ARNs for each template
func (*Client) GetNetIAMPermissionsForRoles ¶
GetNetIAMPermissionsForRoles returns the IAM permissions for each role attached via different polices
func (*Client) GetNonComplaintConfigRules ¶
func (client *Client) GetNonComplaintConfigRules() (map[string][]*configservice.EvaluationResult, error)
GetNonComplaintConfigRules returns all the non complaint rules with compliance results
func (*Client) GetResourceGroupTags ¶
GetResourceGroupTags returns the resource group tags for a given assessment target ARN
func (*Client) GetRolesFromTags ¶
GetRolesFromTags returns a list of IAM Roles with tags provided Please note, ListRoles doesn't get the tags - https://github.com/aws/aws-sdk-go/issues/2442 this would mean calling ListRoleTags API for each role to get the tags we call this API in parallel to speed up the overall execution
func (*Client) GetS3LogPrefixForCloudTrail ¶
GetS3LogPrefixForCloudTrail retruns a S3Prefix associated with CloudTrail if one available for a region derived from the authenticated session and an error if there is any https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html
func (*Client) GetTableMetadata ¶
func (client *Client) GetTableMetadata(tableName string) (*athena.TableMetadata, error)
GetTableMetadata is helper function to return the athena table metadata for given table
func (*Client) GetTableforMetadata ¶
func (client *Client) GetTableforMetadata(meta *athena.TableMetadata) (*string, error)
GetTableforMetadata returns a Athena table in the form <databasename>.<tablename> for given metadata and an error if there is any. Region is derived from authenticated session
type CloudTrailSVC ¶
CloudTrailSVC is a wrapper for CloudTrail service API calls
type ConfigServiceSVC ¶
type ConfigServiceSVC interface {
GetNonComplaintConfigRules() (map[string][]*configservice.EvaluationResult, error)
}
ConfigServiceSVC is a wrapper for ConfigService API calls
type EC2SVC ¶
type EC2SVC interface { GetInstances() (*ec2.DescribeInstancesOutput, error) GetImageInformation(imageIds []string) (*ec2.DescribeImagesOutput, error) GetInstancesMatchingAllTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error) GetInstancesMatchingAnyTags(tags map[string]string) (*ec2.DescribeInstancesOutput, error) GetInstancesByFilters(ec2Filters map[string][]string) (*ec2.DescribeInstancesOutput, error) }
EC2SVC is a wrapper for EC2 API calls
type ECRSVC ¶
type ECRSVC interface { GetECRImagesWithTag(tag string) (map[string][]*ecr.ImageDetail, error) GetECRImageScanFindings(*ecr.ImageDetail) map[string]int64 }
ECRSVC is a wrapper for ECR Image Scan API calls
type HealthSVC ¶
type HealthSVC interface { GetHealthEvents(eventFilter *health.EventFilter, nextToken *string) (*health.DescribeEventsOutput, error) GetHealthEventDetails(arnArr []*string) (*health.DescribeEventDetailsOutput, error) GetHealthAffectedEntities(arnArr []*string, nextToken *string) (*health.DescribeAffectedEntitiesOutput, error) }
HealthSVC is a wrapper for Support API calls related to Health Notifactions
type IAMSVC ¶
type IAMSVC interface { GetRolesFromTags(tags map[string]string) ([]string, error) GetNetIAMPermissionsForRoles(roleARNs []string) map[string][]string }
IAMSVC is a wrapper for IAM API calls
type InspectorSVC ¶
type InspectorSVC interface { GenerateReport(assessmentRunArn string, reportFormat string, reportType string) (string, error) GetResourceGroupTags(assessmentTargetArn string) (map[string]string, error) GetMostRecentAssessmentRunInfo() ([]map[string]string, error) }
InspectorSVC is a wrapper for Inspector API calls
type TrustedAdvisorSVC ¶
type TrustedAdvisorSVC interface {
GetFailingTrustedAdvisorCheckResults() (map[*support.TrustedAdvisorCheckDescription]*support.TrustedAdvisorCheckResult, error)
}
TrustedAdvisorSVC is a wrapper for Support API calls related to TrustedAdvisor