Giter Site home page Giter Site logo

hardened-eks-ami's Introduction

eks-cis-ami

This is a tweaked fork (to work on AL2 2017.12) of ami-builder-packer with most of amazon-eks-ami pulled in. This repo also allows hardened Ubuntu 16.04 and Ubuntu 18.04 AMIs to be built.

If you don't want to apply CIS hardening, remove the Ansible provisioner from eks-worker.tpl

If you are using 18.04, you need to tell kubelet to point to a different resolv.conf so DNS does not break for pods - IMO this should be done with a kubelet arg. If you use the terraform-aws-eks module, you can do this by passing kubelet_extra_args to your worker groups:

locals {
  worker_groups = [
    {
      ...
      kubelet_extra_args = "--resolv-conf=/run/systemd/resolve/resolv.conf"
      ...
    }
  ]
}

To build:

  1. Clone this repo
  2. Update the root password hash in ubuntu.yaml
    • CIS disables remote root login so it doesn't REALLY matter, but you should at least know the password.
  3. Run the build script for your desired AMI:
    • ./build ubuntu16 <YOUR build subnet>
    • ./build ubuntu18 <YOUR build subnet> (FYI that Ubuntu 18.04 installs docker 18.06-ce)
    • ./build al2 <YOUR build subnet>

Modifications

I dont recommend modifying any of the EKS stuff - it should just work out of the box. However if you want to exlude CIS rules, add them to cis_level_1_exclusions or cis_level_2_exlusions. To exclude rules for Ubuntu, it's not as easy - you will have to go into the section task file and modify/comment the task(s).

There are certain things disabled already for compatibility with Kubernetes or to leave it open to customization.

Todo

  • Would be nice to consolidate the codebase - i.e. one packer config, one install script, shared files, etc

hardened-eks-ami's People

Contributors

branhap avatar hobbsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hardened-eks-ami's Issues

Build 'amazon-ebs' errored: error validating regions: RequestError: send request failed

I notice the following error while trying to create ubuntu16 ami.

Build 'amazon-ebs' errored: error validating regions: RequestError: send request failed
caused by: Post https://ec2.us-west-2.amazonaws.com/: x509: certificate signed by unknown authority

==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: error validating regions: RequestError: send request failed
caused by: Post https://ec2.us-west-2.amazonaws.com/: x509: certificate signed by unknown authority

==> Builds finished but no artifacts were created.

Any idea what could be missing.

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.