Giter Club home page Giter Club logo

nitro-examples's Introduction

what is in this repo

  • this repo contains demo of use Amazon Nitro Enclave and Amazon KMS which implement the crypto wallet on AWS Cloud
  • this repo contains sample code for golang, python, and rust. You can find them in nitro-golang-example, nitro-python-example, and nitro-rust-example respectively.
  • this repo supports to deploy on Nitro Enclave on EKS, you can follow the steps in README.md file in each sub-folder

two main workflow

this demo code implement two use case, generateAccount and signature

generateAccount

  • generateAccount API generates wallet in Nitro Enclave and uses KMS to encrypt it with envelope encryption.

  • below is the process of the workflow

generateAccount process

sign

  • signature API signs a transaction with the private key of the wallet

  • below is the process of the signature

sign

important configurations

when you try to run the Nitro Enclave application, you should configure below things

  • Region : you need choose a region where you deploy your application, and you need set ENV in Dockerfile
ENV REGION ap-northeast-1
  • KMS : you need create a Symmetric kms key, which used for Encrypt and decrypt, you need copy the kms id. In this demo, it is hardcode in the appClient code
  • IAM Role : IAM Role should assign the policy to allow call KMS encrypt,generateDataKey. In this demo, we attach the role on EC2
  • vsock-proxy : before you start the enclave application, you should start the vsock-proxy for kms. below command with run the proxy on parent instance which will forward request on port 8000 to endpoint kms.ap-southeast-1.amazonaws.com on port 443. you should run it before run enclave
vsock-proxy 8000 kms.ap-northeast-1.amazonaws.com 443 &
  • cid : vsock connection use CID not address. when the vsock-proxy start, CID 3 is default parent CID, according to this doc

nitro-examples's People

Contributors

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