Giter Site home page Giter Site logo

aws-samples / config-report Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 1.0 211 KB

Automated AWS Config reporting for resources that have been non compliant for a period of time.

Home Page: https://aws.amazon.com/blogs/mt/automate-aws-config-reporting-for-noncompliant-resources-that-have-been-non-compliant-for-a-period-of-time/

License: MIT No Attribution

Python 97.77% Batchfile 2.23%
aws-compliance aws-config aws-ops reporting

config-report's Introduction

Automated AWS Config reporting for resources that have been non compliant for a period of time.

Use AWS Config to evaluate the configuration settings of your AWS resources. You do this by creating AWS Config rules, which represent your ideal configuration settings. AWS Config provides customizable, predefined rules called managed rules to help you get started. While AWS Config continuously tracks the configuration changes that occur among your resources, it checks whether these changes violate any of the conditions in your rules. If a resource violates a rule, AWS Config flags the resource and the rule as noncompliant.

This solution includes a serverless architecture for running a query against AWS Config. Amazon EventBridge Rule triggers an AWS Lambda function on the day and time of your choice to find the list of non-compliant resources from non compliant rules which are not remediated over a period of 30 days.

The following figure provides the architecture for this end-to-end flow within the solution:

SolutionWorkflowDiagram

  1. The Lambda function will run a query against AWS Config, thereby getting the list of non-compliant resources over a period of 30 days.
  2. The Lambda function will generate a CSV report and send it via email using Amazon Simple Email Service (Amazon SES)

Prerequisites

Before getting started, make sure that you have a basic understating of the following:

You will also need to have a pre-configured Multi-Account AWS Config Aggregator and Amazon SES for sending email.

A pre-configured AWS Config Aggregator. A pre-configured Amazon SES.

Architecture

  1. Amazon EventBridge rule - triggers an AWS Lambda function on a specific configurable day and time.
  2. AWS Lambda - will run API against AWS Config, creates a CSV file with details and sends email using SES.
  3. AWS Config aggregator - collects AWS Config configuration and compliance data.
  4. Amazon Simple Email Service - will be used to send an email with the CSV file created by Lambda function.

Getting Started

  1. git clone https://github.com/aws-samples/Config-report

  2. cd Config-Report/config_report

  3. cdk bootstrap

  4. cdk deploy ConfigReport --parameters Aggregator=<aggregator name> --parameters Recipient=<recipient email address> --parameters Sender=<sender email address> --parameters Weekday=<Day-of-week 1-7 or SUN-SAT> --parameters Hour=<time in UTC (hour)> --parameters Minute=<time in UTC (minute)> --parameters SESarn=<ses arn>

    Replace the parameters as follows:

    • Aggregator - Name of AWS Config Aggregator.
    • Recipient - Email recipient that will get the csv report.
    • Sender - Email sender as configured on SES.
    • Weekday - Day-of-week 1-7 or SUN-SAT Lambda will run.
    • Hour - The hour (UTC) the Lambda will run.
    • Minute - The minute (UTC) the Lambda will run.
    • SESarn - The preconfigured SES arn.
  5. The deployment will generate a report.

  6. Check your recipient email inbox.

Security

See CONTRIBUTING for more information.

License

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

config-report's People

Contributors

amazon-auto avatar swaragandhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chriscoombs

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.