亚马逊AWS官方博客
Amazon Systems Manager Incident Manager 配置指南
概述
Amazon Systems Manager Incident Manager是一个事件管理控制台。事件管理器可以通知用户,突出显示相关的故障以及提供相关工具来使服务恢复正常。 为了帮助用户熟悉如何在亚马逊云平台上使用Amazon Systems Manager Incident Manager,亚马逊工程师开发了以下演示项目供您参考。
整体架构
架构分为四大块:
- Amazon EventBridge
 - Amazon Systems Manager Incident Manager
 - Amazon Config
 - Amazon Chatbot
 
在本Demo中,我们会创建一个安全组,配置Amazon Config来评估这个安全组。随后我们会添加一条不合规的Inbound Rules,这个安全组的不合规状态会被Amazon EventBridge捕捉到,随即会触发Amazon Incident Manager的响应计划。最后报警信息会被发布到相关聊天频道中,还会通过提升计划以邮件的形式逐层通知到相关人员,同时还会执行运行手册自动地修复不合规的资源,使其达到合规状态。
步骤
在开始之前,请先确保您具有登录AWS 全球区控制台的账号,并具备管理员权限,您可以先登录控制台,选择合适的区域,并保持窗口开启。
一、创建Amazon SNS
请按下面的信息创建SNS。
- Name: IncidentManagerSNS
 - Display Name: IncidentManagerSNS
 
二、创建Amazon Chime并配置Webhook
复制Webhook URL,下一个步骤会使用到。
三、创建Amazon Chatbot
请按下面的信息创建Chatbot,目前Amazon Chatbot支持两种客户端,Amazon Chime和Slack,这里我们以Amazon Chime为例,进行配置。
- Chat client: Amazon Chime
 - Name: IncidentManagerChatbot
 - Webhook URL: 第二步复制的Webhook URL
 - Webhook description: IncidentManagerChatbot
 - Role Name: AWSChatbot-role
 - Region: Asia Pacific – Singapore
 - Topics: IncidentManagerSNS
 
四、在Amazon VPC中创建用于测试的Security Group
请按下面的信息创建SG。
- Security group name: IncidentManagerTestSG
 - Description: IncidentManagerTestSG
 - VPC: 默认VPC
 
五、在Amazon Config中创建Rules
请按下面的信息创建Amazon Config Rules。
- AWS Managed Rules: restricted-ssh
 
六、创建IAM Role
请按下面的信息分别创建用于Amazon Incident Manager和Amazon Document的IAM Role。
- IncidentManagerRole 
         
- Role name: IncidentManagerRole
 - Role description: Allows Incident Manager to call AWS services on your behalf
 - Trusted entities: AWS service: ssm-incidents.amazonaws.com
 - Policies: 
           
- AmazonSSMFullAccess
 - AmazonEC2FullAccess
 
 
 
- IncidentDocumentRole 
         
- Role name: IncidentDocumentRole
 - Role description: Allows Document to call AWS services
 - Trusted entities: AWS service: ssm.amazonaws.com
 - Policies: 
           
- AmazonEC2FullAccess
 - AWSConfigRulesExecutionRole
 
 
 
七、在Amazon System Manager中创建Document
选择Create automation,输入“IncidentManagerDocument”,选择Editor,粘贴以下内容,替换assumeRole为第六步创建的IncidentDocumentRole的ARN。
八、在Amazon Incident Manager中创建Contacts
请按下面的信息创建Contact information。
- Name: ope01
 - Unique alias: ope01
 - Contact channel: 
         
- Type: Email
 - Channel name: Email
 - Detail: example@example.com
 
 
九、在Amazon Incident Manager中创建Escalation plans
Escalation plan可以逐层通知相关联系人,在本指南中只通知了一层联系人,请按下面的信息创建escalation plan。
- Name: escalation01
 - Alias: escalation01
 - Stage1 
         
- Contact Name: ope01
 
 
十、在Amazon Incident Manager中创建Response plans
请按下面的信息创建response plan。
Name: response01
- Title: response01
 - Impact: Critical
 - Chat channel: IncidentManagerChatot
 - Chat channel SNS topics: IncidentManagerSNS
 - Engagements: escalation01
 - Runbook 
         
- Owner: Owned by me
 - Runbook: IncidentManagerDocument
 - Version: Default at the time of execuion
 - Role name: IncidentManagerRole
 
 
十一、在Amazon EventBridge中创建Rule
请按下面的信息创建Rule。
- Name: IncidentManagerRule
 
选择Event Pattern,Custom pattern,粘贴以下内容,替换GroupId为第四步中创建的Security Group Id。
- Target 
         
- Incident Manager response plan
 - Reponse plan: response01
 
 
测试验证
一、添加Inbound Rules
请按以下信息往本指南中创建的SG里添加一条Inbound Rule。
- Type: SSH
 - Source: Anywhere-IPv4
 
二、告警检查
- Incident Manager检查,已成功报警。
 
- Amazon Chime检查,已成功报警。
 
- Amazon System Manager Automation检查,已成功执行。
 
- Security Group检查,不合规的Inbound Rule已被删除。
 

















