Git Product home page Git Product logo

gdpatrol's Introduction

GDPatrol

A Serverless Security Orchestration Automation and Response (SOAR) Framework for AWS GuardDuty. The GDPatrol Lambda function receives the GuardDuty findings through the CloudWatch Event Rule and executes the appropriate actions to mitigate the threats according to their types and severity. The deployment script will enable GuardDuty and deploy the GDPatrol Lambda function in all supported regions.

Supported actions:

  • blacklist_ip(at the VPC level, using a Network ACL)
  • whitelist_ip
  • block_domain
  • quarantine_instance (deny all traffic ingress and egress to the EC2 instance)
  • snapshot_instance
  • disable_account (disable every action for a particular account)
  • disable_ec2_access
  • enable_ec2_access
  • disable_sg_access (Disable Security Group Access)
  • enable_sg_access
  • asg_detach_instance (detach instance from an auto scaling group)

The actions to be executed are configured in the config.json file:

{
  "type": "Backdoor:EC2/C&CActivity.B!DNS",
  "actions": ["block_domain", "asg_detach_instance", "quarantine_instance", "snapshot_instance"],
  "reliability": 5
},

Getting Started

Prerequisites

  • Python 3.6 (should be compatible with 2.7 as well but I didn't test it)
  • Boto3

Installing

Clone the project and just run the deployment file:

python3 deploy.py

The deployment script makes the following calls, make sure your account has the appropriate permissions:

IAM:
List Roles, Delete Role Policy, Delete Role, Create Role, Put Role Policy

Lambda:
List Functions, Delete Function, Create Function, Add Permission

CloudWatch Events:
List Rules, List Targets By Rule, Remove Targets, Delete Rule, Put Rule, Put Targets

GuardDuty:
List Detectors, Create Detector, Update Detector

Configuration

You can easily create your own playbooks by just adding or removing the actions and changing the reliability in the config.json for the desired finding type.

By default, all findings are assigned a reliability value of 5: the reliability is then added to the "severity" value found in the finding JSON, and the actions are only executed if the sum of the two values is higher than 10.

This ensures that, by default, only the playbooks for the GuardDuty findings with a severity of 6 or higher will be executed, while providing a way to effectively yet simply modify the behavior by modifying the reliability value of the config file.

After any change to the config file locally, run deploy.py again and the script will recreate the Lambda function with the updated config.json file. The GuardDuty findings types are documented here.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Most of the actions code was adapted from the AWS Phantom app published by Booz Allen Hamilton.

Note: By enabling GuardDuty, you might incur in additional costs. However, since the service is billed per log consumption usage, the cost should be irrelevant for the regions you're not actively using, so there's no reason to leave it off as you will want to monitor unused regions as well. See GuardDuty pricing for more details.

gdpatrol's People

Contributors

antoniosorrentino avatar ansorren avatar

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.