Giter Club home page Giter Club logo

guarddutyresponder's Introduction

GuardDuty Responder

Automated responses to GuardDuty findings

Author: Timothy Orr @easttim0r

This initial capability handles the following GuardDuty finding types:

  • Recon:EC2/PortProbeUnprotectedPort
  • UnauthorizedAccess:EC2/SSHBruteForce
  • UnauthorizedAccess:EC2/RDPBruteForce

CloudWatch Events filters for GuardDuty findings, and targets the Lambda. Lambda parses the event, looks for these finding types, and enriches with the applicable NACL ID.

The Lambda looks up the instanceId-remoteIp pair in DynamoDB and:

  • adds an entry if not found
  • updates the TTL if found

For new instanceId-remoteIp pairs, the Lambda will then check DynamoDB to determine the next available rule number for the associated NACL ID. These rule numbers are initialized with an input parameter (environment variable). With the naclId and rule number both determined, the Lambda writes a NACL entry to DENY the remoteIp from the finding.

I will soon add an open source license to this.

GuardDuty Responder

Current capabilities:

  • fully provisioned with Terraform (.12 required)
  • cross account role assumption
  • writes ingress NACL rules to DENY remoteIp (/32 CIDR)
  • (untested) accomodates a white list for exempt IPs
  • tracks instanceId-remoteIp pairing in DynamoDB
  • initializes the starting rule number for each naclId in DynamoDB
  • tracks the current rule number to use for each naclId in DynamoDB

Future capabilities:

  • support for additional finding types
  • sns integration to annouce blocks
  • better logic and error handling
  • better logic for setting a rule range, potentially with a max, and ability to avoid the default allow all rule (100)
  • logic to remove rules from the NACL based on TTL
  • logic for exponental increase in block time similar to fail2ban
  • configurable ability to write blocks to WAF in addition to NACL
  • considering adding an outboud rule to the NACL; this may be useful for other finding types

guarddutyresponder's People

Contributors

easttimor avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

syllogy

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.