Skip to content

Commit

Permalink
common: rename cc-trusted-api to evidence-api
Browse files Browse the repository at this point in the history
* change the name of the package to 'evidence_api' instead of
  'cctrusted_base'
* change the repository name from 'cc-trusted-api' to 'evidence-api'

Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
  • Loading branch information
Ruoyu-y committed Jul 29, 2024
1 parent b7fac90 commit 21e12aa
Show file tree
Hide file tree
Showing 66 changed files with 11,998 additions and 11,996 deletions.
3 changes: 2 additions & 1 deletion .github/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"MRTD",
"CCEL",
"Bootloader",
"VMSDK"
"VMSDK",
"CIMA"
]
}
16 changes: 8 additions & 8 deletions .github/workflows/pr-check-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
branches:
- main
paths:
- 'common/rust/cctrusted_base/src/**.rs'
- 'common/rust/cctrusted_base/src/tdx/**.rs'
- 'common/rust/cctrusted_base/src/tpm/**.rs'
- 'common/rust/evidence_api/src/**.rs'
- 'common/rust/evidence_api/src/tdx/**.rs'
- 'common/rust/evidence_api/src/tpm/**.rs'
- '.github/workflows/pr-check-rust.yaml'
pull_request:
paths:
- 'common/rust/cctrusted_base/src/**.rs'
- 'common/rust/cctrusted_base/src/tdx/**.rs'
- 'common/rust/cctrusted_base/src/tpm/**.rs'
- 'common/rust/evidence_api/src/**.rs'
- 'common/rust/evidence_api/src/tdx/**.rs'
- 'common/rust/evidence_api/src/tpm/**.rs'
- '.github/workflows/pr-check-rust.yaml'
workflow_dispatch:

Expand All @@ -33,9 +33,9 @@ jobs:
run: |
sudo apt update && yes | DEBIAN_FRONTEND=noninteractive sudo apt install -y libcryptsetup-dev clang protobuf-compiler protobuf-c-compiler libprotobuf-c-dev libprotobuf-c1 build-essential pkg-config libssl-dev
- name: Run cargo check for cctrusted_base
- name: Run cargo check for evidence_api
run: |
cd common/rust/cctrusted_base/
cd common/rust/evidence_api/
cargo check
cargo fmt -- --check
cargo clippy
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/vmsdk-test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# by previous run with sudo. Otherwise, the checkout
# will fail with permission issue.
sudo rm -fr ./*
- name: Checkout cc-trusted-api repo
- name: Checkout evidence-api repo
uses: actions/checkout@v4
with:
path: ${{env.VMSDK_PYTEST_DIR}}
Expand All @@ -47,10 +47,10 @@ jobs:
set -ex
cd ${{env.VMSDK_DIR}}
# The trick here is that we need to use the local version
# of cctrusted_base instead of the version installed by
# of evidence_api instead of the version installed by
# setupenv.sh. So uninstall it and reinstall from local.
sudo su -c 'source setupenv.sh && \
python3 -m pip uninstall -y cctrusted_base && \
python3 -m pip uninstall -y evidence_api && \
python3 -m pip install ../common/python && \
cd src/python/tests && \
python3 -m pytest -v test_sdk.py'
4 changes: 2 additions & 2 deletions .github/workflows/vmsdk-test-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# by previous run with sudo. Otherwise, the checkout
# will fail with permission issue.
sudo rm -fr ./*
- name: Checkout cc-trusted-api repo
- name: Checkout evidence-api repo
uses: actions/checkout@v4
with:
path: ${{env.VMSDK_RUST_TEST_DIR}}
Expand All @@ -45,5 +45,5 @@ jobs:
# The trick here is to override the dependencies with local version.
echo "" >> Cargo.toml
echo "[patch.crates-io]" >> Cargo.toml
echo 'cctrusted_base = { path = "../../../../common/rust/cctrusted_base" }' >> Cargo.toml
echo 'evidence_api = { path = "../../../../common/rust/evidence_api" }' >> Cargo.toml
sudo bash -c "export CARGO_TERM_COLOR=always && cargo test --verbose"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ venv/
dist/
*.egg-info/

!common/golang/cctrusted_base/go.mod
!common/golang/evidence_api/go.mod
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ Here are some general guidelines and philosophy for contributing code:
usually indicates insufficient test coverage.
* Keep API compatibility in mind when you change code in core design,
e.g., code in
[common/python](https://github.com/cc-api/cc-trusted-api/tree/main/common/python).
[common/python](https://github.com/cc-api/evidence-api/tree/main/common/python).

Project team members will be assigned to review your pull requests. Once the
pull requests are approved and pass continuous integration checks,
your pull request will be merged automatically on GitHub.

Before sending your pull request for
[review](https://github.com/cc-api/cc-trusted-api/pulls),
[review](https://github.com/cc-api/evidence-api/pulls),
make sure your changes are consistent with the guidelines and follow the
coding style.

Expand Down
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[![Python Code Scan](https://github.com/cc-api/cc-trusted-api/actions/workflows/pylint.yaml/badge.svg)](https://github.com/cc-api/cc-trusted-api/actions/workflows/pylint.yaml)
[![Document Scan](https://github.com/cc-api/cc-trusted-api/actions/workflows/doclint.yaml/badge.svg)](https://github.com/cc-api/cc-trusted-api/actions/workflows/doclint.yaml)
[![Python License Check](https://github.com/cc-api/cc-trusted-api/actions/workflows/pylicense.yaml/badge.svg)](https://github.com/cc-api/cc-trusted-api/actions/workflows/pylicense.yaml)
[![VMSDK Python Test](https://github.com/cc-api/cc-trusted-api/actions/workflows/vmsdk-test-python.yaml/badge.svg)](https://github.com/cc-api/cc-trusted-api/actions/workflows/vmsdk-test-python.yaml)
[![Python Code Scan](https://github.com/cc-api/evidence-api/actions/workflows/pylint.yaml/badge.svg)](https://github.com/cc-api/evidence-api/actions/workflows/pylint.yaml)
[![Document Scan](https://github.com/cc-api/evidence-api/actions/workflows/doclint.yaml/badge.svg)](https://github.com/cc-api/evidence-api/actions/workflows/doclint.yaml)
[![Python License Check](https://github.com/cc-api/evidence-api/actions/workflows/pylicense.yaml/badge.svg)](https://github.com/cc-api/evidence-api/actions/workflows/pylicense.yaml)
[![VMSDK Python Test](https://github.com/cc-api/evidence-api/actions/workflows/vmsdk-test-python.yaml/badge.svg)](https://github.com/cc-api/evidence-api/actions/workflows/vmsdk-test-python.yaml)

# CC Trusted API
# Evidence API

CC Trusted API helps the diverse applications to access and process the trust states
Evidence API helps the diverse applications to access and process the trust states
which was represented by integrity measurement, event record, report/quote in the confidential
computing environment.

![](docs/cc-trusted-api-overview.png)
![](docs/evidence-api-overview.png)

## 1. TCB Measurement

Expand All @@ -19,14 +19,14 @@ different type application might get the trust states measured in different Trus
Computing Base (TCB), the definition and structure of integrity measurement register and
event log follows the below specifications.

![](docs/cc-trusted-api-usage.png)
![](docs/evidence-api-usage.png)
| TCB | Measured By | Specification |
| --- | -------- | ------------- |
| Initial TEE | Trusted Security Manager (TSM), such as Intel TDX module, SEV secure processor | Vendor Specification such as [Intel TDX Module 1.5 ABI Specification](https://cdrdv2.intel.com/v1/dl/getContent/733579) |
| Firmware | EFI_CC_MEASUREMENT_PROTOCOL </br> CCEL ACPI Table </br> EFI_TCG2_PROTOCOL </br> TCG ACPI Table | [UEFI Specification 2.10](https://uefi.org/specs/UEFI/2.10/38_Confidential_Computing.html#virtual-platform-cc-event-log) </br> [ACPI Specification 6.5](https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#cc-event-log-acpi-table) </br> [TCG EFI Protocol Specification](https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/) </br> [TCG ACPI Specification](https://trustedcomputinggroup.org/resource/tcg-acpi-specification/) |
| Boot Loader | EFI_CC_MEASUREMENT_PROTOCOL </br> EFI_TCG2_PROTOCOL | Grub2/Shim |
| OS | Integrity Measurement Architecture (IMA) | [Specification](https://sourceforge.net/p/linux-ima/wiki/Home/) |
| Cloud Native | Confidential Cloud Native Primitives (CCNP) | [Repository](https://github.com/cc-api/confidential-cloud-native-primitives) |
| Cloud Native | Container Integrity Measurement Agent (CIMA) | [Repository](https://github.com/cc-api/container-integrity-measurement-agent) |

## 2. Trusted Foundation

Expand All @@ -44,8 +44,8 @@ vendor also provided simplified solution:

## 3. APIs

CC Trusted APIs aims to collect confidential primitives (i.e., measurement, event log, quote) for zero-trust design, supporting multiple deployment environments (firmware/VM/cloud native cluster).
The [APIs](common/python/cctrusted_base/api.py) are designed to be vendor agnostic and TCG compliant APIs. The APIs will keep evolving on demand.
Evidence APIs aims to collect confidential primitives (i.e., measurement, event log, quote) for zero-trust design, supporting multiple deployment environments (firmware/VM/cloud native cluster).
The [APIs](common/python/evidence_api/api.py) are designed to be vendor agnostic and TCG compliant APIs. The APIs will keep evolving on demand.

| API | Description | Parameters | Response |
| --- | ------------- |----- |----- |
Expand All @@ -65,7 +65,7 @@ Choose correct SDK according to your environment. Installation guide can be foun
| --- | --------------- | -- |
| Firmware SDK | Firmware Application | |
| [VM SDK](https://github.com/cc-api/cc-trusted-vmsdk) | Confidential Virtual Machine | [Guide](https://github.com/cc-api/cc-trusted-vmsdk/blob/main/README.md) |
| [Confidential Cloud Native Primitives (CCNP)](https://github.com/cc-api/confidential-cloud-native-primitives) | Confidential Cluster/Container | [Guide](https://github.com/cc-api/confidential-cloud-native-primitives/blob/main/deployment/README.md) |
| [Container Integrity Measurement Agent (CIMA)](https://github.com/cc-api/container-integrity-measurement-agent) | Confidential Cluster/Container | [Guide](https://github.com/cc-api/confidential-cloud-native-primitives/blob/main/deployment/README.md) |

## 5. How to use the APIs

Expand Down Expand Up @@ -172,27 +172,27 @@ cctrusted.cvm DEBUG Successful parse TDREPORT.
cctrusted.cvm INFO Using report data directly to generate quote
cctrusted.cvm DEBUG Successful open device node /dev/tdx_guest
cctrusted.cvm DEBUG Successful get Quote from /dev/tdx_guest.
cctrusted_base.tdx.quote INFO ======================================
cctrusted_base.tdx.quote INFO TD Quote
cctrusted_base.tdx.quote INFO ======================================
cctrusted_base.tdx.quote INFO TD Quote Header:
cctrusted_base.binaryblob INFO 00000000 04 00 02 00 81 00 00 00 00 00 00 00 93 9A 72 33 ..............r3
cctrusted_base.binaryblob INFO 00000010 F7 9C 4C A9 94 0A 0D B3 95 7F 06 07 C6 0E 85 25 ..L............%
cctrusted_base.binaryblob INFO 00000020 C8 09 3C 0E A0 64 EF F1 29 6B 85 83 00 00 00 00 ..<..d..)k......
cctrusted_base.tdx.quote INFO TD Quote Body:
cctrusted_base.binaryblob INFO 00000000 04 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
cctrusted_base.binaryblob INFO 00000010 97 90 D8 9A 10 21 0E C6 96 8A 77 3C EE 2C A0 5B .....!....w<.,.[
cctrusted_base.binaryblob INFO 00000020 5A A9 73 09 F3 67 27 A9 68 52 7B E4 60 6F C1 9E Z.s..g'.hR{.`o..
evidence_api.tdx.quote INFO ======================================
evidence_api.tdx.quote INFO TD Quote
evidence_api.tdx.quote INFO ======================================
evidence_api.tdx.quote INFO TD Quote Header:
evidence_api.binaryblob INFO 00000000 04 00 02 00 81 00 00 00 00 00 00 00 93 9A 72 33 ..............r3
evidence_api.binaryblob INFO 00000010 F7 9C 4C A9 94 0A 0D B3 95 7F 06 07 C6 0E 85 25 ..L............%
evidence_api.binaryblob INFO 00000020 C8 09 3C 0E A0 64 EF F1 29 6B 85 83 00 00 00 00 ..<..d..)k......
evidence_api.tdx.quote INFO TD Quote Body:
evidence_api.binaryblob INFO 00000000 04 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
evidence_api.binaryblob INFO 00000010 97 90 D8 9A 10 21 0E C6 96 8A 77 3C EE 2C A0 5B .....!....w<.,.[
evidence_api.binaryblob INFO 00000020 5A A9 73 09 F3 67 27 A9 68 52 7B E4 60 6F C1 9E Z.s..g'.hR{.`o..
...
cctrusted_base.binaryblob INFO 00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
cctrusted_base.binaryblob INFO 00000240 00 00 00 00 00 00 00 00 ........
cctrusted_base.tdx.quote INFO TD Quote Signature:
cctrusted_base.binaryblob INFO 00000000 16 1F E4 F6 8C 05 D4 8F E2 EB EB C8 32 1A CE 6C ............2..l
cctrusted_base.binaryblob INFO 00000010 90 2A B5 EA 74 F5 4C 4D A2 6A 30 AC 5C A5 13 84 .*..t.LM.j0.\...
cctrusted_base.binaryblob INFO 00000020 3D CB A2 31 20 43 8C 38 63 3D EE D1 7F B4 9F B5 =..1 C.8c=......
evidence_api.binaryblob INFO 00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
evidence_api.binaryblob INFO 00000240 00 00 00 00 00 00 00 00 ........
evidence_api.tdx.quote INFO TD Quote Signature:
evidence_api.binaryblob INFO 00000000 16 1F E4 F6 8C 05 D4 8F E2 EB EB C8 32 1A CE 6C ............2..l
evidence_api.binaryblob INFO 00000010 90 2A B5 EA 74 F5 4C 4D A2 6A 30 AC 5C A5 13 84 .*..t.LM.j0.\...
evidence_api.binaryblob INFO 00000020 3D CB A2 31 20 43 8C 38 63 3D EE D1 7F B4 9F B5 =..1 C.8c=......
...
cctrusted_base.binaryblob INFO 000010D0 44 20 43 45 52 54 49 46 49 43 41 54 45 2D 2D 2D D CERTIFICATE---
cctrusted_base.binaryblob INFO 000010E0 2D 2D 0A 00 --..
evidence_api.binaryblob INFO 000010D0 44 20 43 45 52 54 49 46 49 43 41 54 45 2D 2D 2D D CERTIFICATE---
evidence_api.binaryblob INFO 000010E0 2D 2D 0A 00 --..
```

### 5.3 Sample of `get_cc_eventlog` API
Expand Down
14 changes: 0 additions & 14 deletions common/golang/cctrusted_base/tdx/rtmr.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

type CC_Type int32

Expand Down Expand Up @@ -26,7 +26,7 @@ func (t CC_Type) String() string {
return ""
}

type CCTrustedAPI interface {
type EvidenceAPI interface {
GetDefaultAlgorithm() (TCG_ALG, error)

GetCCReport(nonce, userData string, extraArgs map[string]any) (Report, error)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import (
"encoding/binary"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cc-api/cc-trusted-api/common/golang/cctrusted_base
module github.com/cc-api/evidence-api/common/golang/evidence_api

go 1.22.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import "os"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

type QuoteDumpFormat string
type DeviceVersion string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cctrusted_base
package evidence_api

type TcgEventFormat string
type TcgEventType uint32
Expand Down
Loading

0 comments on commit 21e12aa

Please sign in to comment.