Coder Social home page Coder Social logo

ventz / guardduty-slack-notify Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 4.0 1.08 MB

Lambda for AWS GuardDuty Slack Notifications

License: Apache License 2.0

JavaScript 100.00%
aws-lambda guardduty slack slack-webhook notifications logs javascript nodejs amazon-web-services amazon

guardduty-slack-notify's Introduction

Amazon Lambda for GuardDuty Slack Notifications

/* Copyright (Apache License 2.0): Ventz Petkov Repository: https://github.com/ventz/guardduty-slack-notify Initial Release: 9-15-2019
*/

Configure in 4 easy steps, and make sure to edit Lambda function with your own Slack Incoming Webhook URL.

Guard Duty

1.) Enable GuardDuty and configure 5-minute subsequent findings:

Notifications for subsequent finding occurrences โ€“ By default, for every finding with a unique finding ID, GuardDuty aggregates all subsequent occurrences of a particular finding that take place in 6-hour intervals into a single event. GuardDuty then sends a notification about these subsequent occurrences based on this event. In other words, by default, for the subsequent occurrences of the existing findings, GuardDuty sends notifications based on CloudWatch events every 6 hours. You can configure this for: 15 minutes, 1 hour, or the default 6 hours. It is recommended to use 15 minutes (via GuardDuty Console -> Settings)!

CloudWatch -> SNS -> Lambda Handler (Slack Notifications)

You can enable the next three steps in the Console via point-and-click, or via the CLI:

2.) Enable CloudWatch rule to send events for all GuardDuty findings:

aws events put-rule --name GuardDuty --event-pattern "{\"source\":[\"aws.guardduty\"]}"

3.) Attach the Lambda function as a target foro the rule:

aws events put-targets --rule GuardDuty --targets Id=1,Arn=arn:aws:lambda:us-east-1:111122223333:function:<your_function_name>

4.) Add permissions to invoke the target:

aws lambda add-permission --function-name <your_function> --statement-id 1 --action 'lambda:InvokeFunction' --principal events.amazonaws.com

Useful Documents:

Examples:

https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_sns.html

See about format:

https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings_cloudwatch.html#guardduty_findings_cloudwatch_format

One example (for EC2):

https://aws.amazon.com/premiumsupport/knowledge-center/guardduty-cloudwatch-sns-rule/

This is the Full Documentation/JSON explanation:

https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-ug.pdf (For CLI Automation of Cloud Watch, SNS, and Lambda)

guardduty-slack-notify's People

Contributors

dependabot[bot] avatar stevecookms avatar ventz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.