in bucket-utils/bucketblocker.go [13:28]
func FixS3_8(ctx context.Context, profile string, region string, bucketCount int, exclusions []string, execute bool) {
cfg, err := common.LoadDefaultConfig(ctx, profile, region)
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
securityHubClient := securityhub.NewFromConfig(cfg)
s3Client := s3.NewFromConfig(cfg)
cfnClient := cloudformation.NewFromConfig(cfg)
bucketsToBlock, err := FindBucketsToBlock(ctx, securityHubClient, s3Client, cfnClient, int32(bucketCount), exclusions)
if err != nil {
log.Fatalf("Error working out which buckets need blocking: %v", err)
}
BlockBuckets(ctx, s3Client, bucketsToBlock, execute)
}