curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestationimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"is_online": true,
"is_public": true,
"error": "<string>",
"name": "<string>",
"app_certificates": [
{
"subject": {
"common_name": "<string>",
"organization": "<string>",
"country": "<string>",
"state": "<string>",
"locality": "<string>"
},
"issuer": {
"common_name": "<string>",
"organization": "<string>",
"country": "<string>"
},
"serial_number": "<string>",
"not_before": "2023-11-07T05:31:56Z",
"not_after": "2023-11-07T05:31:56Z",
"version": "<string>",
"fingerprint": "<string>",
"signature_algorithm": "<string>",
"sans": [
"<string>"
],
"is_ca": false,
"position_in_chain": 123,
"quote": "<string>",
"app_id": "<string>",
"cert_usage": "<string>"
}
],
"app_certificate_chain_pem": "<string>",
"tcb_info": {
"event_log": [
{
"imr": 123,
"event_type": 123,
"digest": "<string>",
"event": "<string>",
"event_payload": "<string>"
}
],
"app_compose": "<string>",
"mrtd": "<string>",
"rootfs_hash": "<string>",
"rtmr0": "<string>",
"rtmr1": "<string>",
"rtmr2": "<string>",
"rtmr3": "<string>"
},
"compose_file": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get CVM attestation
Returns TEE attestation data including TCB info, app certificates and the certificate chain. Requires workspace READ on the CVM.
curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestationimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/attestation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"is_online": true,
"is_public": true,
"error": "<string>",
"name": "<string>",
"app_certificates": [
{
"subject": {
"common_name": "<string>",
"organization": "<string>",
"country": "<string>",
"state": "<string>",
"locality": "<string>"
},
"issuer": {
"common_name": "<string>",
"organization": "<string>",
"country": "<string>"
},
"serial_number": "<string>",
"not_before": "2023-11-07T05:31:56Z",
"not_after": "2023-11-07T05:31:56Z",
"version": "<string>",
"fingerprint": "<string>",
"signature_algorithm": "<string>",
"sans": [
"<string>"
],
"is_ca": false,
"position_in_chain": 123,
"quote": "<string>",
"app_id": "<string>",
"cert_usage": "<string>"
}
],
"app_certificate_chain_pem": "<string>",
"tcb_info": {
"event_log": [
{
"imr": 123,
"event_type": 123,
"digest": "<string>",
"event": "<string>",
"event_payload": "<string>"
}
],
"app_compose": "<string>",
"mrtd": "<string>",
"rootfs_hash": "<string>",
"rtmr0": "<string>",
"rtmr1": "<string>",
"rtmr2": "<string>",
"rtmr3": "<string>"
},
"compose_file": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Response
Attestation report. The error field can be set while the CVM is online: the guest agent could not be read, or its answer was incomplete.
Model representing CVM attestation information
Certificate chain the guest agent's app certificate was issued with, as PEM. The guest agent issues it once and caches it across requests, so it is not a fresh quote and not proof for this request. The leaf quote's report_data is SHA512(ASCII("ratls-cert:") || DER SubjectPublicKeyInfo of the leaf) and binds no caller nonce. In KMS mode the chain is issued by the KMS, so verify it against a KMS root you trust independently, not the root shipped in the chain; a local CA can also issue it. In dstack versions that write it, the leaf's 1.3.6.1.4.1.62397.1.8 extension carries the quote, the trimmed TDX runtime events and, if present, the embedded vm_config; older certificates carry the quote and event log in 1.3.6.1.4.1.62397.1.1 and 1.3.6.1.4.1.62397.1.2. The event log in tcb_info is read separately and is not the log of this certificate.
Was this page helpful?

