Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions SecurityHub_to_AWSChatBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,23 @@ Parameters:
AllowedPattern: ^[a-zA-Z0-9_]*$
ConstraintDescription: |
Malformed Input Parameter: Environment must contain only upper and numbers. Length should be a minimum of 9 characters and a maximum of 15 characters.



# CustomActionName:
# Description: Name of the Custom Action in SecurityHub
# Type: String
# AllowedPattern: ^[a-zA-Z0-9_]*$
# Default: Send_To_Slack
# #Default: 'Send To !Sub "${ChatApplication}"'



configureSlackChannel:
Type: String
AllowedValues: [ true, false ]
Default: true

Conditions:
configureSlackChannelConfig: !Equals [ !Ref configureSlackChannel, true ]
noConfigureSlackChannelConfig: !Equals [ !Ref configureSlackChannel, false ]

#==================================================
# Resources
#==================================================
Expand Down Expand Up @@ -123,6 +130,13 @@ Resources:
Resource: '*'
Topics:
- !Ref SNSTopicAWSChatBot
AWSChatBotSubscription:
Type: AWS::SNS::Subscription
Condition: noConfigureSlackChannelConfig
Properties:
Endpoint: https://global.sns-api.chatbot.amazonaws.com
Protocol: HTTPS
TopicArn: !Ref SNSTopicAWSChatBot
#======================================================
# CloudWatch Event Rule
#======================================================
Expand Down Expand Up @@ -158,11 +172,12 @@ Resources:
- "sts:AssumeRole"
SlackChannelConfig:
Type: AWS::Chatbot::SlackChannelConfiguration
Condition: configureSlackChannelConfig
Properties:
ConfigurationName: securityhubnotification
IamRoleArn: !GetAtt ChatBotManageIAMRole.Arn
LoggingLevel: NONE
SlackChannelId: !Ref SlackChannelID
SlackWorkspaceId: !Ref SlackWorkSpaceID
SnsTopicArns:
- !Ref SNSTopicAWSChatBot
- !Ref SNSTopicAWSChatBot