aws-solutions / automated-security-response-on-aws

Automated Security Response on AWS is an add-on solution that works with AWS Security Hub to provide a ready-to-deploy architecture and a library of automated playbooks. The solution makes it easier for AWS Security Hub customers to resolve common security findings and to improve their security posture in AWS.
https://aws.amazon.com/solutions/implementations/aws-security-hub-automated-response-and-remediation/
Apache License 2.0
381 stars 108 forks source link

fix: Improve the SHARR notification messages to include more relevant info for administrators receiving the events #185 #186

Open thesuavehog opened 9 months ago

thesuavehog commented 9 months ago

Issue #185

Description of changes:

Added additional properties to the Notification that is sent by SHARR on the SNS Topic when a Remediation is initiated and it's state changes.

re: Testing ...This patch was pulled from a custom branch that I have been running in production for months now.

Added Properties:

Permissions Changes

Example Notifications: Account Id changed to a dummy value for this comment

{
  "severity": "INFO",
  "message": "Remediation queued for SC control EC2.7 in account 123456789001",
  "finding": {
    "finding_id": "04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "finding_description": "This control checks whether Amazon Elastic Block Store (EBS) encryption is enabled by default. The control fails if EBS default encryption is not enabled.",
    "standard_name": "security-control",
    "standard_version": "2.0.0",
    "standard_control": "EC2.7",
    "title": "EBS default encryption should be enabled",
    "region": "us-east-1",
    "account": "123456789001",
    "finding_arn": "arn:aws:securityhub:us-east-1:123456789001:security-control/EC2.7/finding/04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "account_alias": "qcex-cloudformation-admin",
    "link": "https://console.aws.amazon.com/securityhub/home?region=us-east-1#/findings?search=Id%3D%255Coperator%255C%253AEQUALS%255C%253Aarn%253Aaws%253Asecurityhub%253Aus-east-1%253A123456789001%253Asecurity-control%252FEC2.7%252Ffinding%252F04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "note": "",
    "resource": "123456789001"
  },
  "state": "QUEUED",
  "execution_id": "836c1d27-d8ca-44b2-8af0-11481cc2695c"
}
{
  "severity": "INFO",
  "message": "Remediation succeeded for SC control EC2.7 in account 123456789001: Remediation status: Success - please verify remediation (AwsAccount AWS::::Account:123456789001)",
  "finding": {
    "finding_id": "04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "finding_description": "This control checks whether Amazon Elastic Block Store (EBS) encryption is enabled by default. The control fails if EBS default encryption is not enabled.",
    "standard_name": "security-control",
    "standard_version": "2.0.0",
    "standard_control": "EC2.7",
    "title": "EBS default encryption should be enabled",
    "region": "us-east-1",
    "account": "123456789001",
    "finding_arn": "arn:aws:securityhub:us-east-1:123456789001:security-control/EC2.7/finding/04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "account_alias": "qcex-cloudformation-admin",
    "link": "https://console.aws.amazon.com/securityhub/home?region=us-east-1#/findings?search=Id%3D%255Coperator%255C%253AEQUALS%255C%253Aarn%253Aaws%253Asecurityhub%253Aus-east-1%253A123456789001%253Asecurity-control%252FEC2.7%252Ffinding%252F04f78bbd-e10f-4a3e-b473-63a561c7b002",
    "note": "",
    "resource": "AWS::::Account:123456789001"
  },
  "state": "SUCCESS",
  "execution_id": "836c1d27-d8ca-44b2-8af0-11481cc2695c"
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

thesuavehog commented 9 months ago

Closes #185