Giter Club home page Giter Club logo

cfn-security-scan-integration's Introduction

Integrating AWS CloudFormation security tests with AWS Security Hub and AWS CodeBuild reports

The concept of infrastructure as code, by using pipelines for continuous integration and delivery, is fundamental for the development of cloud infrastructure. Including code quality and vulnerability scans in the pipeline is essential for the security of this infrastructure as code.

In this sample code, we introduce a method for integrating open source tools that find potentially insecure patterns in your AWS CloudFormation templates with both AWS Security Hub and AWS CodeBuild reports. We’ll be using Stelligent’s open source tool CFN-Nag. We also show you how you can extend the solution to use AWS CloudFormation Guard (currently in preview).

For more information on the solution, see AWS Blog

Getting Started

Prerequisites

  • AWS CLI - AWS Command Line Interface
  • AWS Security Hub is enabled for that particular account and region

Usage

Step 1. Clone this repository

From your terminal application, execute the following command:

git clone [email protected]:aws-samples/cfn-security-scan-integration.git

Step 2. Create S3 bucket for artifacts in source account

Create a S3 bucket where the artifacts will be uploaded. Your AWS CLI selected profile must have read/write permission to the bucket. It can be in the different region from the region you choose to deploy the solution.

Step 3. Copy HTTPS URL for target repository

Create or select an existing CodeCommit repository that you want to scan and copy its HTTPS URL. The repository must be in the same AWS account and region where you deploy.

Step 4. Configure parameters

Update ./conf/params.sh with the specific Cloudformation parameters such as repository and branch to scan copied above, tool to use (CFN-Guard or CFN-Nag) and whether to fail or not the pipeline.

Step 5. Deploy the solution

Run the deploy script, like ./deploy.sh bucket aws-cli-profile region

Example: ./deploy.sh sources-cfn-scan my-cli-profile eu-west-1

Security

See CONTRIBUTING for more information.

License

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

cfn-security-scan-integration's People

Contributors

amazon-auto avatar

Watchers

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.