GithubHelp home page GithubHelp logo

aws-samples / amazonmacie-chatops-remediation Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 3.0 845 KB

This solution establishes an automated event driven workflow for notifying and auto-remediating sensitive data findings from Amazon Macie. Human interaction is via ChatOps style integration with Slack.

License: MIT No Attribution

JavaScript 80.24% TypeScript 19.76%
macie data-security incident-response autoremediation chatops slack

amazonmacie-chatops-remediation's Introduction

Automated ChatOps solution for remediating Amazon Macie findings

This solution establishes an automated event driven workflow for notifying and auto-remediating sensitive data findings from Amazon Macie. Human interaction is via ChatOps style integration with Slack.

Solution Overview

This solution allows for the configuration of the auto-remediation behaviour based on finding type and finding severity. For each finding type you can define if you want the offending S3 object to be automatically quarantined or if you want the finding details to be reviewed and approved by a human in Slack prior to being quarantined. In a similar manner you can define the minimum severity level (Low, Medium, High) that a finding must have before the solution will take action. Adjusting these parameters allows you to manage false positives and tune the volume and type of findings on which you wish to be notified and take action.

The solution architecture and eight step interaction sequence are detailed below in Figure 1.

Solution Architecture Figure 1 - Solution Overview

  1. Amazon Macie is configured with sensitive data discovery jobs (scheduled or adhoc) which detect sensitive data within Amazon S3 buckets. See here for a full list of the categories of sensitive data Macie can detect.
  2. For each sensitive data finding an event is sent to Amazon EventBridge containing the finding details. An EventBridge rule triggers a Lambda function for processing.
  3. The Finding Handler Lambda function parses the event, examines the type of the finding, and based on auto-remediation configuration will either invoke the Finding Remediator function for immediate remediation, or send finding details for manual review and remediation approval via Slack.
  4. Delegated security / compliance admins monitor the configured Slack channel for notifications. Notifications provide high level finding information, remediation status, and a deep link to the Amazon Macie console for the finding in question. For findings configured for manual review, users can choose to approve the remediation in Slack via an action button on the notification.
  5. After a user clicks the “Remediate” button, Slack issues an API call to an Amazon API Gateway endpoint supplying the unique identifier of the finding to be remediated and the Slack user. API Gateway proxies the request to a remediation handler Lambda function.
  6. The Remediation Handler Lambda function validates the request and request signature, extracts the offending object location from the finding, and makes an asynchronous call to the Finding Remediator Lambda function.
  7. The Finding Remediator Lambda function moves the offending object from the source bucket to a designated S3 quarantine bucket with restricted access.
  8. Finally, the Finding Remediator Lambda function will use a callback URL to update the original finding notification in Slack indicating that the offending object has now been quarantined.

Prerequisites

Before proceeding to deploy the solution ensure your environment is setup with the following pre-requisites.

Important: this solution uses various AWS services, and there are costs associated with these resources after the Free Tier usage. Please see the AWS pricing page for details.

Deploying & Testing the Solution

Full walkthrough instructions instructions for configuring Slack and deploying the solution via AWS CDK are available in a blog post here.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

amazonmacie-chatops-remediation's People

Contributors

amazon-auto avatar dependabot[bot] avatar nikocuneo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vaquarkhan

amazonmacie-chatops-remediation's Issues

nodejs12.x is no longer supported

Solution is currently unable to deploy due to nodejs12 being deprecated for Lambda:

❌ MacieAutoRemediationStack failed: Error: The stack named MacieAutoRemediationStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: bb110d89-df72-4f88-99ff-3ec1d628adbd)" (RequestToken: 1269b183-6c1f-7bd3-0358-bd5b3fbe3771, HandlerErrorCode: InvalidRequest)
at FullCloudFormationDeployment.monitorDeployment (/opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:426:10236)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (/opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:429:153208)
at async /opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:429:136985

❌ Deployment failed: Error: The stack named MacieAutoRemediationStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: bb110d89-df72-4f88-99ff-3ec1d628adbd)" (RequestToken: 1269b183-6c1f-7bd3-0358-bd5b3fbe3771, HandlerErrorCode: InvalidRequest)
at FullCloudFormationDeployment.monitorDeployment (/opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:426:10236)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (/opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:429:153208)
at async /opt/homebrew/Cellar/aws-cdk/2.88.0/libexec/lib/node_modules/aws-cdk/lib/index.js:429:136985

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.