Giter Site home page Giter Site logo

aws-config-custom-rule's Introduction

AWS Config auto-remediation rule

About

A cloudformation template for creating a custom AWS Config rule with auto-remediation lambda which ensures that AWS Serial Console Access feature is always disabled.

The rule is compliant when the AWS Serial Console Access feature:

  • is disabled
  • was enabled, but has been auto-remediated by the evaluation lambda.

The rule is non-compliant when the evaluation lambda:

  • fails to disable the feature

NOTE ABOUT LAMBDA RUNTIME

AWS Serial Console Access is not currently supported by the boto3 version (1.16.31) in the default runtime, as a workaround, I am using an external boto3 layer provided by https://github.com/keithrozario/Klayers (works in all supported regions).

The layer can be removed once AWS upgrades the boto3 version to at least 1.17.41.


Supported regions

The AWS Serial Console Access feature is currently supported in the following regions:

  • US East (N. Virginia), US West (Oregon), US East (Ohio)
  • Europe (Ireland), Europe (Frankfurt)
  • Asia Pacific (Tokyo), Asia Pacific (Sydney), Asia Pacific (Singapore)

Setup

[prerequisite] Enabling AWS Config

Before launching a custom config rule template, enable AWS Config in one of the supported regions. To enable AWS Config, you can use a quickstart template enable-config.yaml that creates all essential resources.

You can use the below quick launch stack button to create the stack in Ohio:

Launch Enable Config Stack

Deploying a custom config rule

Create a new AWS Cloud Formation stack using the ensure-serial-console-access-is-disabled.yaml template.

You can use the below quick launch stack button to create the stack in Ohio:

Launch Serial Console Access Disabled Stack

Tests scenarios

Scenario: 1

  • Given: AWS Serial Console Access is disabled.
  • Then: Return COMPLIANT
  • Evidence:

Scenario: 2

  • Given: AWS Serial Console Access had been enabled but was disabled succesfully.
  • Then: Return COMPLIANT
  • Evidence:

Scenario: 3

  • Given: AWS Serial Console Access is enabled and lambda fails to disable it.
  • Then: Return NON_COMPLIANT
  • Evidence:

aws-config-custom-rule's People

Contributors

mzarkowski avatar

Watchers

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