diff --git a/attestation-service/attestation-service/src/bin/grpc/mod.rs b/attestation-service/attestation-service/src/bin/grpc/mod.rs index 795345abdd..063b65b06e 100644 --- a/attestation-service/attestation-service/src/bin/grpc/mod.rs +++ b/attestation-service/attestation-service/src/bin/grpc/mod.rs @@ -1,3 +1,4 @@ +use anyhow::bail; use attestation_service::HashAlgorithm; use attestation_service::{ config::Config, config::ConfigError, AttestationService as Service, ServiceError, Tee, @@ -14,9 +15,7 @@ use tonic::transport::Server; use tonic::{Request, Response, Status}; use crate::as_api::attestation_service_server::{AttestationService, AttestationServiceServer}; -use crate::as_api::{ - AttestationRequest, AttestationResponse, SetPolicyRequest, SetPolicyResponse, Tee as GrpcTee, -}; +use crate::as_api::{AttestationRequest, AttestationResponse, SetPolicyRequest, SetPolicyResponse}; use crate::rvps_api::reference_value_provider_service_server::{ ReferenceValueProviderService, ReferenceValueProviderServiceServer, @@ -27,18 +26,21 @@ use crate::rvps_api::{ ReferenceValueRegisterResponse, }; -fn to_kbs_tee(tee: GrpcTee) -> Tee { - match tee { - GrpcTee::Sev => Tee::Sev, - GrpcTee::Sgx => Tee::Sgx, - GrpcTee::Snp => Tee::Snp, - GrpcTee::Tdx => Tee::Tdx, - GrpcTee::Csv => Tee::Csv, - GrpcTee::Sample => Tee::Sample, - GrpcTee::AzSnpVtpm => Tee::AzSnpVtpm, - GrpcTee::Cca => Tee::Cca, - GrpcTee::AzTdxVtpm => Tee::AzTdxVtpm, - } +fn to_kbs_tee(tee: &str) -> anyhow::Result { + let tee = match tee { + "sev" => Tee::Sev, + "sgx" => Tee::Sgx, + "snp" => Tee::Snp, + "tdx" => Tee::Tdx, + "csv" => Tee::Csv, + "sample" => Tee::Sample, + "azsnpvtpm" => Tee::AzSnpVtpm, + "cca" => Tee::Cca, + "aztdxvtpm" => Tee::AzTdxVtpm, + other => bail!("Unsupported TEE type: {other}"), + }; + + Ok(tee) } #[derive(Error, Debug)] @@ -100,10 +102,8 @@ impl AttestationService for Arc> { info!("AttestationEvaluate API called."); debug!("Evidence: {}", &request.evidence); - let tee = to_kbs_tee( - GrpcTee::from_i32(request.tee) - .ok_or_else(|| Status::aborted(format!("Invalid TEE {}", request.tee)))?, - ); + let tee = to_kbs_tee(&request.tee) + .map_err(|e| Status::aborted(format!("parse TEE type: {e}")))?; let evidence = URL_SAFE_NO_PAD .decode(request.evidence) .map_err(|e| Status::aborted(format!("Illegal input Evidence: {e}")))?; diff --git a/attestation-service/docs/grpc-as.md b/attestation-service/docs/grpc-as.md index 50f02f309e..48fd099365 100644 --- a/attestation-service/docs/grpc-as.md +++ b/attestation-service/docs/grpc-as.md @@ -33,7 +33,7 @@ PCCS are usually supported by cloud providers, you can find the steps to configu - IBM Cloud: [Attestation with Intel SGX and Data Center Attestation Primitives (DCAP) for Virtual Servers for VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-about-attestation-sgx-dcap-vpc) Or you can [set-up a PCCS yourself](https://download.01.org/intel-sgx/sgx-dcap/1.9/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf). -Then an attestation request can be used to request the server. We provide an [example request of validating a SGX quote](../tests/coco-as/grpc-request.json). +Then an attestation request can be used to request the server. We provide an [example request of validating a SGX quote](../tests/coco-as/request.json). You can use the [tool](https://github.com/confidential-containers/guest-components/tree/main/attestation-agent/attester#evidence-getter-tool) to generate a report on any supported platform. @@ -44,7 +44,7 @@ any supported platform. cd -REQ=$(cat tests/coco-as/grpc-request.json) +REQ=$(cat tests/coco-as/request.json) grpcurl \ -plaintext \ -import-path protos \ diff --git a/attestation-service/docs/policy.md b/attestation-service/docs/policy.md index 0c590e9d0c..f95e6fc0ce 100644 --- a/attestation-service/docs/policy.md +++ b/attestation-service/docs/policy.md @@ -33,10 +33,10 @@ $REQ EOF ``` -Then, we can use the policy to check against an evidence. We use the [request](../tests/coco-as/policy/grpc-check.json) to do this. +Then, we can use the policy to check against an evidence. We use the [request](../tests/coco-as/policy/check.json) to do this. ```shell -REQ=$(cat ../../tests/coco-as/policy/grpc-check.json) +REQ=$(cat ../../tests/coco-as/policy/check.json) grpcurl \ -plaintext \ -import-path ../../protos \ @@ -64,13 +64,13 @@ curl -k -X POST http://127.0.0.1:8080/policy \ -d @../../tests/coco-as/policy/restful-set-policy.json ``` -Then, we can use the policy to check against an evidence. We use the [request](../tests/coco-as/policy/grpc-check.json) to do this. +Then, we can use the policy to check against an evidence. We use the [request](../tests/coco-as/policy/check.json) to do this. ```shell curl -k -X POST http://127.0.0.1:8080/attestation \ -i \ -H 'Content-Type: application/json' \ - -d @../../tests/coco-as/policy/restful-check.json + -d @../../tests/coco-as/policy/check.json ``` ## How to Write a Policy (Experimental) diff --git a/attestation-service/docs/restful-as.md b/attestation-service/docs/restful-as.md index de85d59fd3..a0ae247227 100644 --- a/attestation-service/docs/restful-as.md +++ b/attestation-service/docs/restful-as.md @@ -33,7 +33,7 @@ PCCS are usually supported by cloud providers, you can find the steps to configu - IBM Cloud: [Attestation with Intel SGX and Data Center Attestation Primitives (DCAP) for Virtual Servers for VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-about-attestation-sgx-dcap-vpc) Or you can [set-up a PCCS yourself](https://download.01.org/intel-sgx/sgx-dcap/1.9/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf). -Then an attestation request can be used to request the server. We provide an [example request of validating a SGX quote](../tests/coco-as/restful-request.json). +Then an attestation request can be used to request the server. We provide an [example request of validating a SGX quote](../tests/coco-as/request.json). You can use the [tool](https://github.com/confidential-containers/guest-components/tree/main/attestation-agent/attester#evidence-getter-tool) to generate a report on any supported platform. @@ -43,7 +43,7 @@ cd curl -k -X POST http://127.0.0.1:8080/attestation \ -i \ -H 'Content-Type: application/json' \ - -d @tests/coco-as/restful-request.json + -d @tests/coco-as/request.json ``` Then, a token will be retrieved as HTTP response body like diff --git a/attestation-service/protos/attestation.proto b/attestation-service/protos/attestation.proto index 62c2c31d3e..43a01e40a5 100644 --- a/attestation-service/protos/attestation.proto +++ b/attestation-service/protos/attestation.proto @@ -2,21 +2,9 @@ syntax = "proto3"; package attestation; -enum Tee { - SEV = 0; - SGX = 1; - SNP = 2; - TDX = 3; - Sample = 4; - AzSnpVtpm = 5; - CSV = 6; - CCA = 7; - AzTdxVtpm = 8; -} - message AttestationRequest { // TEE enum. Specify the evidence type - Tee tee = 1; + string tee = 1; // Base64 encoded evidence. The alphabet is URL_SAFE_NO_PAD. // defined in https://datatracker.ietf.org/doc/html/rfc4648#section-5 diff --git a/attestation-service/tests/coco-as/policy/restful-check.json b/attestation-service/tests/coco-as/policy/check.json similarity index 100% rename from attestation-service/tests/coco-as/policy/restful-check.json rename to attestation-service/tests/coco-as/policy/check.json diff --git a/attestation-service/tests/coco-as/policy/grpc-check.json b/attestation-service/tests/coco-as/policy/grpc-check.json deleted file mode 100644 index 794745b7e4..0000000000 --- a/attestation-service/tests/coco-as/policy/grpc-check.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tee": "1", - "evidence": "eyJxdW90ZSI6IkF3QUNBQUFBQUFBSUFBMEFrNXB5TS9lY1RLbVVDZzJ6bFg4R0I5ek42Yk1jNklZRlNCYzd0S0tsZWhZQUFBQUFCZ1lNRFAvL0FBQUFBQUFBQUFBQUFBRUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQndBQUFBQUFBQURuQUFBQUFBQUFBSThYUGtZVC93WEZLcThFRmkwalR0cm95WmQrcmtmcklwbXVGcVZUQVJ4b0FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUNEMXhubmZlcktGSEQydXZZcVRYZERBOGlaMjJrQ0Q1eHc3aDM4Q01mT25nQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ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1JvYTBadlpFaFNkMk42YjNaTU1rNXNZMjVTY0ZwdGJHcFpXRkpzWTNrMU1HTnVWbnBrUjFacll6SldlV1J0YkdwYVdFMTFZVmMxTUFwYVYzZDFXVEk1ZEV3d2JIVmtSMVp6VlRCa1dWVnRPWFprUlU1Q1RHMVNiR05xUVdSQ1owNVdTRkUwUlVablVWVkpiVlZOTVd4eFpFNUpibnBuTjFOV0NsVnlPVkZIZW10dVFuRjNkMFJuV1VSV1VqQlFRVkZJTDBKQlVVUkJaMFZIVFVKSlIwRXhWV1JGZDBWQ0wzZFJTVTFCV1VKQlpqaERRVkZGZDBObldVa0tTMjlhU1hwcU1FVkJkMGxFVTFGQmQxSm5TV2hCVDFjdk5WRnJVaXRUT1VOcFUwUmpUbTl2ZDB4MVVGSk1jMWRIWmk5WmFUZEhVMWc1TkVKbmQxUjNad3BCYVVWQk5Fb3diSEpJYjAxeksxaHZOVzh2YzFnMlR6bFJWM2hJVWtGMldsVkhUMlJTVVRkamRuRlNXR0Z4U1QwS0xTMHRMUzFGVGtRZ1EwVlNWRWxHU1VOQlZFVXRMUzB0TFFvPSJ9Cg", - "policy_ids": ["some-id"] -} \ No newline at end of file diff --git a/attestation-service/tests/coco-as/grpc-request.json b/attestation-service/tests/coco-as/request.json similarity index 99% rename from attestation-service/tests/coco-as/grpc-request.json rename to attestation-service/tests/coco-as/request.json index ad759156ac..7a62af8fc7 100644 --- a/attestation-service/tests/coco-as/grpc-request.json +++ b/attestation-service/tests/coco-as/request.json @@ -1,5 +1,5 @@ { - "tee": "1", + "tee": "sgx", "evidence": "eyJxdW90ZSI6IkF3QUNBQUFBQUFBSUFBMEFrNXB5TS9lY1RLbVVDZzJ6bFg4R0I5ek42Yk1jNklZRlNCYzd0S0tsZWhZQUFBQUFCZ1lNRFAvL0FBQUFBQUFBQUFBQUFBRUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQndBQUFBQUFBQURuQUFBQUFBQUFBS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U1FTkJVVmxKUzI5YVNYcHFNRVJCVVdORVVXZEJSVU0yYmtWM1RVUkpXVnBQYWk5cFVGZHpRM3BoUlV0cE53b3hUMmxQVTB4U1JtaFhSMnBpYmtKV1NtWldibXRaTkhVelNXcHJSRmxaVERCTmVFODBiWEZ6ZVZscWJFSmhiRlJXV1hoR1VESnpTa0pMTlhwc1MwOUNDblY2UTBKMVJFRm1RbWRPVmtoVFRVVkhSRUZYWjBKUmFWcFJlbGRYY0RBd2FXWlBSSFJLVmxOMk1VRmlUMU5qUjNKRVFsTkNaMDVXU0ZJNFJWTjZRa29LVFVWbFoxSmhRa1JvYTBadlpFaFNkMk42YjNaTU1rNXNZMjVTY0ZwdGJHcFpXRkpzWTNrMU1HTnVWbnBrUjFacll6SldlV1J0YkdwYVdFMTFZVmMxTUFwYVYzZDFXVEk1ZEV3d2JIVmtSMVp6VlRCa1dWVnRPWFprUlU1Q1RHMVNiR05xUVdSQ1owNVdTRkUwUlVablVWVkpiVlZOTVd4eFpFNUpibnBuTjFOV0NsVnlPVkZIZW10dVFuRjNkMFJuV1VSV1VqQlFRVkZJTDBKQlVVUkJaMFZIVFVKSlIwRXhWV1JGZDBWQ0wzZFJTVTFCV1VKQlpqaERRVkZGZDBObldVa0tTMjlhU1hwcU1FVkJkMGxFVTFGQmQxSm5TV2hCVDFjdk5WRnJVaXRUT1VOcFUwUmpUbTl2ZDB4MVVGSk1jMWRIWmk5WmFUZEhVMWc1TkVKbmQxUjNad3BCYVVWQk5Fb3diSEpJYjAxeksxaHZOVzh2YzFnMlR6bFJWM2hJVWtGMldsVkhUMlJTVVRkamRuRlNXR0Z4U1QwS0xTMHRMUzFGVGtRZ1EwVlNWRWxHU1VOQlZFVXRMUzB0TFFvPSJ9Cg", "policy_ids": [] } \ No newline at end of file diff --git a/attestation-service/tests/coco-as/restful-request.json b/attestation-service/tests/coco-as/restful-request.json deleted file mode 100644 index 0d351e94f8..0000000000 --- a/attestation-service/tests/coco-as/restful-request.json +++ /dev/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pJYjAxeksxaHZOVzh2YzFnMlR6bFJWM2hJVWtGMldsVkhUMlJTVVRkamRuRlNXR0Z4U1QwS0xTMHRMUzFGVGtRZ1EwVlNWRWxHU1VOQlZFVXRMUzB0TFFvPSJ9Cg", - "policy_ids": [], - "runtime_data": { - "raw": "dGVzdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } -} \ No newline at end of file diff --git a/attestation-service/tests/e2e/Makefile b/attestation-service/tests/e2e/Makefile index 228938d552..2b74e03927 100644 --- a/attestation-service/tests/e2e/Makefile +++ b/attestation-service/tests/e2e/Makefile @@ -14,11 +14,8 @@ RAW_RUNTIME_DATA_FILE ?= $(MAKEFILE_DIR)/raw-runtime-data RAW_RUNTIME_DATA := $(shell cat $(RAW_RUNTIME_DATA_FILE) | base64 -w0 | tr -d '=' | sed -e "s/+/-/g" -e "s/\//_/g") EVIDENCE := $(shell cat $(EVIDENCE_FILE) | base64 -w0 | tr -d '=' | sed -e "s/+/-/g" -e "s/\//_/g") -GRPC_TEE_ENUM ?= 2 -GRPC_REQUEST := $(MAKEFILE_DIR)/grpc-request.json - -RESTFUL_TEE_ENUM ?= snp -RESTFUL_REQUEST := $(MAKEFILE_DIR)/restful-request.json +TEE_NAME ?= snp +REQUEST := $(MAKEFILE_DIR)/request.json .PHONY: install-dependencies install-dependencies: @@ -55,28 +52,21 @@ grpc.pid: $(GRPC_BIN) } && \ sleep 2 -$(RESTFUL_REQUEST): $(RESTFUL_REQUEST).template - sed -e "s/%RESTFUL_TEE_ENUM%/$(RESTFUL_TEE_ENUM)/g" \ - -e "s/%RUNTIME_DATA%/$(RAW_RUNTIME_DATA)/g" \ +$(REQUEST): $(REQUEST).template + sed -e "s/%TEE_NAME%/$(TEE_NAME)/g" \ -e "s/%EVIDENCE%/$(EVIDENCE)/g" \ - $(RESTFUL_REQUEST).template > $(RESTFUL_REQUEST) + $(REQUEST).template > $(REQUEST) .PHONY: restful-test -restful-test: restful.pid $(RESTFUL_REQUEST) +restful-test: restful.pid $(REQUEST) curl -k -X POST http://127.0.0.1:8080/attestation \ -i \ -H 'Content-Type: application/json' \ - -d @$(RESTFUL_REQUEST) - -$(GRPC_REQUEST): $(GRPC_REQUEST).template - sed -e "s/%GRPC_TEE_ENUM%/$(GRPC_TEE_ENUM)/g" \ - -e "s/%RUNTIME_DATA%/$(RAW_RUNTIME_DATA)/g" \ - -e "s/%EVIDENCE%/$(EVIDENCE)/g" \ - $(GRPC_REQUEST).template > $(GRPC_REQUEST) + -d @$(REQUEST) .PHONY: grpc-test -grpc-test: grpc.pid $(GRPC_REQUEST) - echo $$(cat $(GRPC_REQUEST)) \ +grpc-test: grpc.pid $(REQUEST) + echo $$(cat $(REQUEST)) \ | grpcurl -plaintext -import-path ../../protos -proto ../../protos/attestation.proto -d @ 127.0.0.1:50004 attestation.AttestationService/AttestationEvaluate .PHONY: stop-restful-as @@ -104,5 +94,4 @@ clean: $(GRPC_BIN) \ grpc.pid \ restful.pid \ - $(RESTFUL_REQUEST) \ - $(GRPC_REQUEST) + $(REQUEST) diff --git a/attestation-service/tests/e2e/grpc-request.json.template b/attestation-service/tests/e2e/grpc-request.json.template deleted file mode 100644 index a39f5c7478..0000000000 --- a/attestation-service/tests/e2e/grpc-request.json.template +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tee": "%GRPC_TEE_ENUM%", - "evidence": "%EVIDENCE%", - "raw_runtime_data": "%RUNTIME_DATA%", - "policy_ids": [] -} \ No newline at end of file diff --git a/attestation-service/tests/e2e/raw-runtime-data b/attestation-service/tests/e2e/raw-runtime-data deleted file mode 100644 index 6fe12dfd9d..0000000000 Binary files a/attestation-service/tests/e2e/raw-runtime-data and /dev/null differ diff --git a/attestation-service/tests/e2e/request.json.template b/attestation-service/tests/e2e/request.json.template new file mode 100644 index 0000000000..b2218ee231 --- /dev/null +++ b/attestation-service/tests/e2e/request.json.template @@ -0,0 +1,5 @@ +{ + "tee": "%TEE_NAME%", + "evidence": "%EVIDENCE%", + "policy_ids": [] +} \ No newline at end of file diff --git a/attestation-service/tests/e2e/restful-request.json.template b/attestation-service/tests/e2e/restful-request.json.template deleted file mode 100644 index 6a98681a8a..0000000000 --- a/attestation-service/tests/e2e/restful-request.json.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - "tee": "%RESTFUL_TEE_ENUM%", - "evidence": "%EVIDENCE%", - "runtime_data": { - "raw": "%RUNTIME_DATA%" - }, - "policy_ids": [] -} \ No newline at end of file diff --git a/kbs/src/api/src/attestation/coco/grpc.rs b/kbs/src/api/src/attestation/coco/grpc.rs index b113481adb..92ccd6a3ff 100644 --- a/kbs/src/api/src/attestation/coco/grpc.rs +++ b/kbs/src/api/src/attestation/coco/grpc.rs @@ -16,7 +16,7 @@ use tonic::transport::Channel; use self::attestation::{ attestation_request::RuntimeData, attestation_service_client::AttestationServiceClient, - AttestationRequest, SetPolicyRequest, Tee as GrpcTee, + AttestationRequest, SetPolicyRequest, }; mod attestation { @@ -28,20 +28,6 @@ pub const DEFAULT_POOL_SIZE: u64 = 100; pub const COCO_AS_HASH_ALGORITHM: &str = "sha384"; -fn to_grpc_tee(tee: Tee) -> GrpcTee { - match tee { - Tee::AzSnpVtpm => GrpcTee::AzSnpVtpm, - Tee::AzTdxVtpm => GrpcTee::AzTdxVtpm, - Tee::Cca => GrpcTee::Cca, - Tee::Csv => GrpcTee::Csv, - Tee::Sample => GrpcTee::Sample, - Tee::Sev => GrpcTee::Sev, - Tee::Sgx => GrpcTee::Sgx, - Tee::Snp => GrpcTee::Snp, - Tee::Tdx => GrpcTee::Tdx, - } -} - #[derive(Clone, Debug, Deserialize)] pub struct GrpcConfig { as_addr: Option, @@ -107,8 +93,13 @@ impl Attest for GrpcClientPool { let runtime_data_plaintext = serde_json::to_string(&runtime_data_plaintext) .context("CoCo AS client: serialize runtime data failed")?; + let tee = serde_json::to_string(&tee) + .context("CoCo AS client: serialize tee type failed.")? + .trim_end_matches('"') + .trim_start_matches('"') + .to_string(); let req = tonic::Request::new(AttestationRequest { - tee: to_grpc_tee(tee).into(), + tee, evidence: URL_SAFE_NO_PAD.encode(attestation.tee_evidence), runtime_data_hash_algorithm: COCO_AS_HASH_ALGORITHM.into(), init_data_hash_algorithm: COCO_AS_HASH_ALGORITHM.into(),