Giter Site home page Giter Site logo

aws-ocsp's Introduction

aws-ocsp

A fully-serverless x.509 OCSP responder using AWS Lambda, AWS S3, and AWS DynamoDB.

Usage

Install serverless framework

npm install -g serverless

Download this project and required plugins

serverless install --url https://github.com/heri16/aws-ocsp --name ocsp
cd ocsp
npm install --only=dev

Edit custom section of serverless.yml

nano ./serverless.yml
custom:
  customDomain:
    domainName: pki.lmu.co.id
  s3_bucket: lmu-pki
  s3_key_base: certs/

Request a free ACM Certificate for your custom domainName (if not yet created)

http://docs.aws.amazon.com/acm/latest/userguide/gs.html

Create the bucket on Amazon S3 (if not yet created)

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html

Add relevant files to config folder (Adjust environment vars accordingly)

ls ./config
functions:
  respond:
    environment:
      # OCSP_COUNT should denote the total number of OCSP responders (in-case of serving intermediate-CAs)
      OCSP_COUNT: '2'
      # PFX files should contain ocsp signer's privKey (and all related certificates in the chain)
      OCSP_PFX_1: 'config/ocsp1.pfx'
      OCSP_PFX_PASS_1: 'pass_for_ocsp1'
      # 2nd OCSP Responder/Signer
      OCSP_PFX_2: 'config/ocsp2.pfx'
      OCSP_PFX_PASS_2: 'pass_for_ocsp2'
  bucket:
    environment:
      # One or many Root certificates in PEM-format to validate the certificates before being registered into OCSP
      TRUST_ROOTS: 'config/root_bundle.pem'

Deploy project to AWS

serverless create_domain
pipenv run serverless deploy --stage=prod
serverless s3deploy

Check aws credentials if you have trouble deploying

nano ~/.aws/credentials

aws iam attach-user-policy --user-name <your_username> --policy-arn arn:aws:iam::aws:policy/AWSLambdaFullAccess
aws iam attach-user-policy --user-name <your_username> --policy-arn arn:aws:iam::aws:policy/AmazonDynamoDBFullAccesswithDataPipeline
aws iam attach-user-policy --user-name <your_username> --policy-arn arn:aws:iam::aws:policy/SystemAdministrator
aws iam attach-user-policy --user-name <your_username> --policy-arn arn:aws:iam::aws:policy/IAMFullAccess

aws-ocsp's People

Contributors

heri16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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