1 Star 0 Fork 0

隐语SecretFlow/jinzhao-attest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

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 No 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

NOTES: 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.

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

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.

# License for Jinzhao Attest The default license for Jinzhao Attest is BSD 3-Clause. But it also includes some other source code directly, which use the original license. - cmake/FindSGX.cmake: [BSD 3-Clause](https://github.com/xzhangxa/SGX-CMake/blob/master/LICENSE) - cmake/FindProtobuf.cmake: [MIT License](https://github.com/IvanSafonov/grpc-cmake-example/blob/master/LICENSE) - cmake/FindGRPC.cmake: [MIT License](https://github.com/IvanSafonov/grpc-cmake-example/blob/master/LICENSE) - ual/verification/platforms/sgx2/qvl: [BSD License](https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/master/License.txt) - ual/verification/platforms/csv: [From librats](https://github.com/inclavare-containers/librats) - ual/verification/platforms/kunpeng: [MulanPSL2](https://gitee.com/openeuler/kunpengsecl/blob/master/LICENSE) ================================================================================ BSD 3-Clause License Copyright (c) 2023, Ant Group CO., Ltd. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

为TEE兼容性,易用性,安全性提供统一的远程认证工作流。 展开 收起
C++ 等 4 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/secretflow/jinzhao-attest.git
git@gitee.com:secretflow/jinzhao-attest.git
secretflow
jinzhao-attest
jinzhao-attest
master

搜索帮助

Cb406eda 1850385 E526c682 1850385