Giter Club home page Giter Club logo

ssl-best-practices's Introduction

ssl-best-practices

Lab to illuminate SSL best practices. The Lab uses OpenSSL to create keys, create a certificate authority (CA), and sign certificates using the CA.

Final Environment

Getting Started

Deploy the CloudFormation infrastructure/cloudformation.json template. The template creates a user with the following credentials and minimal required permisisons to complete the Lab:

  • Username: student
  • Password: password

Instructions

  1. In the Cloud9 environment terminal, generate an RSA private key:

    openssl genpkey -algorithm RSA -aes-128-cbc -pass pass:Cloud_Academy -out key.pem -pkeyopt rsa_keygen_bits:2048
  2. Restrict file access to the private key:

    chmod 400 key.pem
  3. Copy the contents of src/req.cnf to a req.cnf file in the Cloud9 environment.

  4. Create a certificate signing request (CSR) to have a certificate authority (CA) certify your identity:

    openssl req -new -config csr.cnf -key key.pem -out req.csr
  5. Create a CA and root certificate (self-sign a CSR):

    openssl req -key ca.key.pem -new -out ca.csr
    chmod 400 ca.key.pem

    Fill out the fields (use the same Organization Name as used in the CSR)

    sudo sh -c 'openssl rand -hex 16 > /etc/pki/CA/serial' # initialize a random certificate serial number
    sudo touch /etc/pki/CA/index.txt # initialize the index file for tracking
    sudo openssl ca -selfsign -days 7300 -md sha256 -in ca.csr -keyfile ca.key.pem -out ca.crt -extensions v3_ca
    chmod 444 ca.crt
  6. Use the CA to sign the certificate in the CSR created earlier:

    sudo openssl ca -days 100 -notext -md sha256 -batch -in req.csr -keyfile ca/ca.key.pem -cert ca/ca.crt -out cert.pem
    sudo chmod 444 cert.pem

Cleaning Up

Delete the CloudFormation stack to remove all the resources used in the Lab.

ssl-best-practices's People

Contributors

lrakai avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

sa-jackmax

ssl-best-practices's Issues

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.