How to customize ChatBot Slack message?

0

I want to publish ECR vulnerability scan results to my Slack channel. I successfully configured EventBridge rule for AWS Inspector Scan and I'm receiving the messages in Slack.

However the message looks pretty unusable:

Inspector2 Scan | eu-central-1 | Account: 123456789012
Inspector2 Scan
Related resources  
• arn:aws:ecr:eu-central-1:123456789012:repository/my-app

It doesn't show the most important information, which are the findings, e.g. from the SNS message:

{
    "version": "0",
    "id": "739c0d3c-4f02-85c7-5a88-94a9EXAMPLE",
    "detail-type": "Inspector2 Scan",
    "source": "aws.inspector2",
    "account": "123456789012",
    "time": "2021-12-03T18:03:16Z",
    "region": "us-east-2",
    "resources": [
        "arn:aws:ecr:us-east-2:123456789012:repository/amazon/amazon-ecs-sample"
    ],
    "detail": {
        "scan-status": "INITIAL_SCAN_COMPLETE",
        "repository-name": "arn:aws:ecr:us-east-2:123456789012:repository/amazon/amazon-ecs-sample",
        "finding-severity-counts": {
            "CRITICAL": 7,
            "HIGH": 61,
            "MEDIUM": 62,
            "TOTAL": 158
        },
        "image-digest": "sha256:36c7b282abd0186e01419f2e58743e1bf635808231049bbc9d77e5EXAMPLE",
        "image-tags": [
            "latest"
        ]
    }
}

Is there any way to preprocess the final Slack message to include some additional information from the SNS event?

질문됨 일 년 전1296회 조회
2개 답변
0

As described in the following documentation Editing to an arbitrary message will prevent notification.

https://aws.amazon.com/chatbot/faqs/?nc1=h_ls

Notifications for Amazon EventBridge events are delivered to chat channels with their original event message content. If this message content is modified (such as by using EventBridge InputTransformers), AWS Chatbot will not be able to deliver arbitrary notifications to your chat channels.

profile picture
전문가
답변함 일 년 전
0

Chatbot supports custom notifications with this update since 2023/09.

profile picture
Kane
답변함 6달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠