Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Security Hub Module #159

Closed
wants to merge 12 commits into from
1 change: 1 addition & 0 deletions data-collection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ List of modules and objects collected:
| `cost-optimization-hub` | AWS Cost Optimization Hub | Management Account | Collects Detailed Reccomendations. Requires [activation](https://aws.amazon.com/aws-cost-management/cost-optimization-hub/faqs/#:~:text=You%20can%20enable%20Cost%20Optimization%20Hub%20by%20going%20to%20the,navigation%20bar%2C%20and%20click%20Enable.) |
| `health-evetns` | AWS Health | Management Accounts | Collect AWS Health notificaitons via AWS Organizational view |
| `licence-manager` | AWS License Manager | Management Accounts | Collect Licences and Grants |
| `SecurityHub-events` | AWS Security Hub | Management Accounts | Collect AWS Security Hub Events via Event Bus |



Expand Down
30 changes: 30 additions & 0 deletions data-collection/deploy/deploy-data-collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Metadata:
- IncludeTransitGatewayModule
- IncludeAWSFeedsModule
- IncludeLicenseManagerModule
- IncludeSecuirtyHubModule
ParameterLabels:
DestinationBucket:
default: 'Destination S3 bucket'
Expand Down Expand Up @@ -85,6 +86,8 @@ Metadata:
default: 'Include AWS Health Events Module'
IncludeLicenseManagerModule:
default: 'Include Marketplace Licensing Collection'
IncludeSecuirtyHubModule:
default: 'Include AWS Security Hub Module'

Mappings:
RegionMap:
Expand Down Expand Up @@ -229,6 +232,11 @@ Parameters:
Description: Collects Marketplace Licenses and Grants
AllowedValues: ['yes', 'no']
Default: 'no'
IncludeSecurityHubModule:
Type: String
Description: Collects AWS Security Hub Events
AllowedValues: ['yes', 'no']
Default: 'no'

Outputs:
S3Bucket:
Expand Down Expand Up @@ -261,6 +269,7 @@ Conditions:
DeployAWSFeedsModule: !Equals [ !Ref IncludeAWSFeedsModule, "yes"]
DeployHealthEventsModule: !Equals [ !Ref IncludeHealthEventsModule, "yes"]
DeployLicenseManagerModule: !Equals [ !Ref IncludeLicenseManagerModule, "yes"]
DeploySecurityHubModule: !Equals [!Ref IncludeSecurityHubModule, "yes"]
DeployPricingModule: !Or
- !Condition DeployInventoryCollectorModule
- !Condition DeployRDSUtilizationModule
Expand All @@ -281,6 +290,7 @@ Conditions:
- !Condition DeployCostOptimizationHubModule
- !Condition DeployHealthEventsModule
- !Condition DeployLicenseManagerModule
- !Condition DeploySecurityHubModule
RegionsInScopeIsEmpty: !Equals
- !Join [ '', !Split [ ' ', !Ref RegionsInScope ] ] # remove spaces
- ""
Expand Down Expand Up @@ -947,6 +957,26 @@ Resources:
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn

SecurityHubModule:
Type: AWS::CloudFormation::Stack
Condition: DeploySecurityHubModule
Properties:
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.amazonaws.com/cfn/data-collection/module-securityhub.yaml"
Parameters:
DatabaseName: !Ref DatabaseName
DestinationBucket: !Ref S3Bucket
DestinationBucketARN: !GetAtt S3Bucket.Arn
ManagementRoleName: !Sub "${ResourcePrefix}${ManagementAccountRole}"
Schedule: !Ref ScheduleFrequent
GlueRoleARN: !GetAtt GlueRole.Arn
ResourcePrefix: !Ref ResourcePrefix
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v2, TemplatePath]
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn

BackupModule:
Type: AWS::CloudFormation::Stack
Condition: DeployBackupModule
Expand Down
Loading