Git Product home page Git Product logo

enarx's Introduction



Test Status Bug Status Maintenance Status Coverage Status

Enarx

This crate provides the enarx command-line tool for running applications inside Trusted Execution Environments (TEEs) using technologies such as Intel SGX and AMD SEV-SNP.

For more information about Enarx, please visit the Enarx project website.

For a quick introduction to Enarx and its goals, please see our Getting Started Guide, and for a more in-depth look please see our Technical Overview.

Using Enarx

For instructions on installing the Enarx command-line tool, please see our Quick Installation Guide.

For instructions on how to build an application that can be run within Enarx, please see our WebAssembly Guide.

Contributing to Enarx

For instructions on how to build and contribute to Enarx, please see our Contributing Guide.

For an overview of the codebase, please see our Repo Guide.

enarx's People

Contributors

abhinandanudupa avatar ambaxter avatar axelsimon avatar blazebissar avatar bstrie avatar definitelynobody avatar dependabot[bot] avatar enarxbot avatar freax13 avatar haraldh avatar jarkkojs avatar jethrogb avatar jyotsna-penumaka avatar lkatalin avatar matt-ross16 avatar mbestavros avatar michiboo avatar moksh-pathak avatar npmccallum avatar platten avatar puiterwijk avatar rjzak avatar rvolosatovs avatar squidboylan avatar steveej avatar ueno avatar veehaitch avatar wgwoods avatar whitebrandy avatar ziyi-yan avatar

Stargazers

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

Watchers

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

enarx's Issues

SGX: Test IOCTLs

Write tests for SGX_IOC_ENCLAVE_ADD_PAGES and SGX_IOC_ENCLAVE_SET_ATTRIBUTE, as well as SGX_IOC_ENCLAVE_CREATE. These are specified in sgx-sys/src/ioctls/sgx.rs.

There is already one test for SGX_IOC_ENCLAVE_CREATE in sgx-sys/src/lib.rs.

All of these tests should be labeled with #[cfg_attr(not(has_sgx), ignore)] so that they do not run if SGX is not present on the system.

Propose to run execution and attestation decentralized to improve security

Our current design has done all that we have in 2019 to improve the security unless for one possible thing I propose to improve: that is to decentralize the execution and attestation from one node to a consensus between a group of nodes.

We can add a few steps as the following

  • Connect all Enarx nodes into a huge p2p network (swarm)

  • When a client deploys a wasm task, all nodes need to run a VRF to decide which node will actually run this task. At this moment, only the node who wins this VRF competition knows he is the winner. The client, the host, and other nodes do not know what a node is currently running which task until the task is completed we will discuss later time.

  • The host or the attestation code in the same node cannot claim itself a “trusted” TEE. The attestation is done by other VRF selected nodes. No one can predict or decide who is validator for who. If necessary, those VRF selected validators can run a BFT consensus to decide the truthfulness of the node who is under attestation.

  • Executors and validators will be paid for doing an honest job after the execution is completed. That means who has run which task will only be disclosed after the task is completed. (So no security information exists any more at this moment)

  • A credit score system can be used to incentivize good behavior. As well as slashing can be used for punishment.

By doing so we can get these benefits:

  • No matter a task is a high attacking value or not, no one knows which node it is executing on. This reduces the profit attraction to hackers. A hacker has to hack more nodes to get enough profit to cover his costs.

  • If one kind of under layer TEE has any secure issue, we can easily adjust the VRF function factor in real-time, so new tasks will be automatically routed away from those unsecured nodes until the problem fixed.

  • Unless hackers can comprise a large number of nodes at the same time, one comprised node can hardly pass the attestation of other healthy nodes. So it will be easily quarantine.
    Bitcoin-like token incentives can be used to fast boost the ecosystem.

  • Red hat doesn't need to run an attestation service. No single point of failure, no centralization.

Sorry, I did not find any designated place to propose this kind of improvement idea, so I post here as an issue. I hope I did not break any contribution rules here for discussion. If I did, I am sorry.

BTW, all technologies I mentioned here are mature and widely used in blockchain. If this idea can be adopted as an improvement proposal, I can contribute to this child project as this is what I was researching recently.

Red Hat Research Day 2020 Enarx Presentation

Mark and Lily are to present on Enarx at RHRD in San Francisco on April 26, 2020. The abstract was submitted to Gagan Kumar Nov. 15 2019.

Dates

Event: April 26, 2020

Location

San Francisco

CFP

N/A

Issue Templates

We need some decent issue templates. This is related, in part, to project infrastructure automation.

Social Media Image

GitHub allows us to set a "social preview" image. Preferred size is 1280x640px.

Inventory the WASM runtime syscalls

Once we are testing (#75) our static (#74) runtime, we need to inventory the Linux syscalls that are issued during this test. These will be the target syscalls for SGX and SEV to implement.

Sorting Hat - Workflow Automation Bot

We need a bot that runs on GitHub Action hooks to ensure that issues and pull requests have their metadata normalized. In particular, the bot needs to place issues/PRs into their respective projects when a tag is applied. Likewise, when the tag is removed, they should be removed from the respective projects.

Test for merge commits on incoming pull requests

We'd like Enarx to maintain a clean commit history. We have soft guidelines around logical commits and commit etiquette, but we can directly test incoming PRs to ensure they do not have merge commits. We should implement such a test in Travis.

Measure and attest the VM contents

Once we have a full static binary running inside a VM (#77), we need the ability to measure all the bits we put inside the VM and attest them to the client. This will use the SEV module (#71).

SGX: Include an sgx-hasher crate

This crate will include a hasher struct that:

  • Takes in Secs and outputs a hash based on SGX documentation for EADD and EEXTEND
  • Generates an RSA pubkey from OpenSSL and extracts relevant data for sgx-types::sig::Signature:
    • modulus
    • exponent
    • q1
    • q2
  • Goes through the same steps as the Builder trait but without actually creating the enclave

Merge WASM demo into enarx/enarx

The existing WASM code needs to be merged into enarx/enarx. This is done when we have a crate that builds a binary that can run a toy WASM/WASI binary.

Utilize Github Projects' built-in automation where appropriate

The Enarx project plans on developing a robust project infrastructure, with deep automation enabled by Github Actions.

As this plan is being finalized, and before we implement Actions, we should experiment with Github's built in project board automation and make whatever rules we do decide to implement consistent across all our projects. It is very surface-level, but it can potentially make some future steps easier.

Enarx Master Plan

  • Reusable Components

    • Persistent storage
      • Design and Implement Block Encryption
      • Design and Implement Block Authentication
      • Choose and Implement Filesystem
    • SEV Attestation
      • Port sev repo to use rust-vmm kvm repo
      • Port sevctl to the new sev API
      • Expand library for SEV-ES
      • Expand library for SEV-SNP
    • OpenSSL (replace mbedtls)
      • Solve ld load problem
      • Solve CPUID problem
      • Solve network IO problem
    • Enarx VMM (name: TBD)
      • KVM Library (ketuvim => rust-vmm)
        • Merge x86_64_types improvements to x86_64 repo
        • Extract ketuvim core structures to rust-vmm kvm repo using x86_64
        • Merge rust-vmm kvm-ioctl repo to kvm repo
        • Transfer sev repo ownership to rust-vmm
      • Enarx VMM (name: TBD)
        • Design Host/Guest communication channel for syscall proxy (virtio-syscall?)
        • Document VMM
        • Implement VMM
      • Enarx μKernel (name: TBD)
        • Design μKernel
        • Document μKernel
        • Implement μKernel
      • Enarx WASM Runtime
        • Cranelift
          • architectural control
        • Wasmtime
          • architectural control
          • implement modularization
          • migrate unneded functionality to unused modules
        • WASI
          • Failure stubs for unsupported APIs
          • Implement Arguments
          • Implement Clocks
          • Implement Secure Sockets
          • Implement Filesystem
  • Enarx Host Agent

    • Protocol
      • Choose transport
      • Choose serialization
      • Design protocol
      • Design instance state format
      • library/daemon
      • CLI
      • Openshift integration
      • other OS support?
  • Enarx Tenant CLI

    • Validate input before sending it to host
  • Enarx Keep Scheduler

    • Node architecture discovery
    • Security-level negotiation
    • Design Keep input and output format
  • Architectures

    • SGX

      • Validate an SGX remote attestation
      • Establish encrypted channel to an SGX enclave
      • Embed Wasmtime in an SGX enclave
      • Deliver WASM code to an SGX enclave across an encrypted channel
      • Evaluate stripped-down graphene?
    • SEV # please double check if content below here is correct. SEV got lost temporarily

      • Implement SEV attestation in our VMM
      • Implement SEV-ES attestation in our VMM
      • Implement SEV-SNP attestation in our VMM
      • Implement SEV support in our μKernel
      • Implement SEV-ES support in our μKernel
      • Implement SEV-SNP support in our μKernel
    • PEF

      • investigate once available
    • Others

      • track, investigate
    • Standardization Work

      • Evolve the WASI standard to better support our use case
        • Networking/secure sockets APIs
        • Low-level cryptography APIs
        • Secure clocks APIs
        • Secure random numbers APIs
  • Testing

  • Documentation

  • Community

  • Uncategorized

    • Key management design
      • control plane
      • data plane
    • Key sharing
    • GPU support - per platform, as available
    • FPGA support - per platform, as available
    • crypto hardware accelerator support
    • dev. tool integration (WASM + WASI): Eclipse, Eclipse Che...
    • Example applications/use cases (Java secure key store)

Better handling of `cargo audit`

Currently we have three test tasks: stable, beta, and nightly. As part of each of these, we install and run cargo-audit. However, this takes a lot of time and is duplicated unnecessarily. We should add a fourth test task: audit that runs cargo-audit in parallel to the other test tasks.

Run a toy static binary in SGX

We need an sgx-run crate that can load a toy static binary that does nothing more than issue SYS_exit into SGX and run it.

Convert TravisCI tests to git pre-commit hooks

We currently run a bunch of sanity tests in TravisCI (things like checking code formatting, etc.). I'd like these converted to git pre-commit hooks.

We can move these to the hooks/ directory and then use git config core.hooksPath hooks to ensure they are updated with the repo. Once this is done, we can configure TravisCI to run the pre-commit hooks instead.

This ensures that you hit the failures before submitting the PR.

Adopt a Code of Conduct

We need to adopt a Code of Conduct. This needs to be coordinated with our CCC membership.

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.