Giter Club home page Giter Club logo

jinzhao-attest's Introduction

Jinzhao Attest

Jinzhao Attest provides unified attestation workflows for TEE compatibility, usability, and security.

Features Overview

  1. Implement the abstraction and interconnection of heterogeneous TEE based on the following conceptions:
  • UAI: unified attestation interfaces to generate and verify attestation report
  • UAR: unified attestation report in an abstract format for all supported TEE platforms
  • UAP: unified attestation policy to verify UAR based on the union set of different TEE attributes.
  1. Provide flexible usages for different scenarios:
  • SGX SDK or Occlum LibOS development model
  • Report verification in the trusted or untrusted environment
  • Report verification by local unified attestation library (UAL) or centralized unified attestation service (UAS)
              .----------------------------.
        .---->| Unified Attestation Report +----.
        |     '----------------------------'    |
        | Unified Attestation Interface         | Unified Attestation Interface
        | (Report Generation)                   | (Report Verification)
        |                                       v
.-------+-------.                       .--------------.
| TEE Platforms |                       |   Verifier   |
'-------+-------'                       '--------------'
        |                                       ^
        |                                       |
        |     .----------------------------.    |
        '---->| Unified Attestation Policy +----'
              '----------------------------'

Supported TEE platforms and interfaces

The following table shows all the TEE platforms we currently support, and the supported interfaces for each TEE platform.

TEE platforms UAR Generation UAR Verification
Intel SGX1 Yes Yes
Intel SGX2 Yes Yes
HyperEnclave Yes Yes
Kunpeng Trustzone No Yes
Hygon CSV Yes Yes
Intel TDX Yes Yes

Quick Start

Update the submodules

git submodule update --init --recursive

Initialize and enter the development environment container

./dockerenv.sh --init  # create the container instance

./dockerenv.sh --exec  # enter the container instance

Build the unified attestation library and samples

In the development environment container, run the following command:

./build.sh --with-samples --mode SIM

NOTE: SIM mode is used here, which means you can try the quick start in the environment without TEE. If you want to try it in real TEE, you need to setup the TEE and configure remote attestation firstly. For example, in SGX2 platform, you need to register the platform to PCCS, and set the PCCS URL in /etc/sgx_default_qcnl.conf and in /etc/kubetee/unified_attestation.json (or by environment variable UA_ENV_PCCS_URL). For How to setup the PCCS, please refer to Intel DCAP document.

The other build command examples

# Occlum LibOS build environment for SGX1/SGX2/HyperEnclave
./dockerenv.sh --init --occlum
./dockerenv.sh --exec --occlum
./build.sh --with-samples --envtype OCCLUM

# Ubuntu build environment for Hygon CSV or Intel TDX VM TEE
./dockerenv.sh --init --ubuntu --csv|--tdx
./dockerenv.sh --exec --ubuntu --csv|--tdx
./build.sh --with-samples --envtype VMTEE --teetype CSV|TDX

Run the sample code

In the development environment container, run any application samples, for example, report generation sample like this:

mkdir /etc/kubetee
cp ./deployment/conf/unified_attestation.json /etc/kubetee/
cd build/out
./app-sample-unified-attestation-generation
./app-sample-unified-attestation-verification-untrusted

NOTE: If the sample applications are built with OCCLUM envtype (which is the default in Occlum docker images), you need to run the applications in Occlum runtime, please see also "tools/occlum_run_samples.sh". If you still want to run sample applications in build/out, please specify "--envtype SGXSDK" for SGX TEE.

Use UAL in your application

Jinzhao Attest provides UAL which can be integrated into an application with SGX SDK, Occlum LibOS, or without TEE at all.

Include header files

Please choose C++ or C ABI header files according to your programming language.

Header files for C++ programming language: have almost all the public interfaces

  • ua_untrusted.h: includes all untrusted header files, used in untrusted code or Occlum application
  • ua_trusted.h: includes all trusted header files, used in trusted code

Header files for other programming languages which are compatible with C ABI: have limited public interfaces

Include EDL file

This step is only for SGX-liked TEE platforms and SGX-SDK development model

  • attestation.edl: should be included in the trust application top EDL file

Link unified attestation libraries

In different TEE platforms and different development containers(see also dockerenv.sh), you will build out different libraries:

  • Untrusted/Trusted libraries for SGX-liked TEE platforms using SGX-SDK:
    • libual_u.so: untrusted library with generation and verification interfaces
    • libual_t.a: trusted library with generation and verification interfaces
    • libual.so: includes verification interface only and can be used without trusted code.
  • Library for trusted application based on Occlum LibOS:
    • libual.so: includes both generation and verification interfaces.
  • Library for platforms there is no TEE:
    • libual.so: includes verification interface only (Cannot generate UAR without TEE)

NOTES: Please refer to the example applications in the ./samples directory for more details.

Contributing

Anyone is welcome to provide any form of contribution, for example:

  • More TEE platforms (APIs, report format and attributes for different TEE)
  • More workflow about TEE based on remote attestation
  • More usage scenarios
  • Documentation, bug fixes, security improvements
  • Others ...

Please check CONTRIBUTING.md.

License

Please check LICENSE for details.

jinzhao-attest's People

Contributors

jxiao1 avatar rodgerzhu avatar

Stargazers

justwzp avatar Tobias Mierzwa avatar Allen avatar Mohan Liu avatar Yan, Like avatar Yuchen Mu avatar 朱滨 avatar  avatar  avatar Denghao Li avatar Fengyuan Yu avatar  avatar Benshan Mei avatar jensen.liang avatar Mengjun Xie avatar mingo avatar  avatar Yiling Xu avatar Weijie Liu avatar Jianfeng Jiang avatar Qingsong Chen avatar Shaowei Song avatar Zheng, Qi avatar Bojun Zhu avatar Tate, Hongliang Tian avatar volcano avatar wsjswy avatar

Watchers

Tate, Hongliang Tian avatar wsjswy avatar  avatar  avatar

jinzhao-attest's Issues

Questions for unified attestation

Hi, developers!
Thank you very much for your outstanding work!
I would like to ask if this project includes a stage for registering heterogeneous TEE nodes.
In this stage, each heterogeneous TEE node generates a pair of public-private keys (ak.pub/ak.priv) that serve as identifiers for their own identity. The public key is sent to the UAS, and in return, the node receives the UAS root certificate and the AK (Attestation Key) certificate.

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.