Skip to content

Commit 21a4bb0

Browse files
aamirrasheedclaude
andcommitted
v1.2.2: restore inference attestation verify (works with tee-proxy on 9443)
CVMs now route inference through tee-proxy on :9443, which emits the JSON evidence format attestation-cli verify accepts. Restore the base64+gunzip → attestation-cli verify code path so check [4/5] reports "Platform: az-snp (via tee-proxy)" / "Attestation: valid (signature verified)" instead of stopping at "present (HCL report)". Keep the SEV-SNP Esys_Quote --report-data-hex retry-without-flag fallback in check [1/5] — that addresses a separate Azure CVM image TPM owner auth quirk (Bug 1). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 200d362 commit 21a4bb0

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

privateclaw

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,27 @@ cmd_verify() {
165165
-o "$SNP_TMPFILE" 2>&1) || true
166166
fi
167167

168-
# Fallback: TPM device (/dev/tpmrm0) is owned by root:tss. If the current user
168+
# Fallback 1: Some Azure CVM images fail Esys_Quote when --report-data-hex
169+
# is provided (TPM owner auth issue, not a permissions problem — affects
170+
# root and non-root alike). Retry without --report-data-hex; the host key
171+
# binding is independently verified in Check 3.
172+
if { [ ! -s "$SNP_TMPFILE" ] || ! jq -e . "$SNP_TMPFILE" &>/dev/null; } && [ -n "$SNP_REPORT_DATA" ]; then
173+
if echo "$SNP_ATTEST_OUT" | grep -qi "Esys_Quote\|get_quote failed\|tpm error"; then
174+
SNP_ATTEST_OUT=$($ATTESTATION_CLI attest \
175+
--platform az-snp \
176+
-o "$SNP_TMPFILE" 2>&1) || true
177+
fi
178+
fi
179+
180+
# Fallback 2: TPM device (/dev/tpmrm0) is owned by root:tss. If the current user
169181
# is not in the tss group, the attest call fails with "vtpm::get_report failed:
170182
# tpm error". Retry under sudo if available — most CVM admin users have
171183
# passwordless sudo configured.
172184
if { [ ! -s "$SNP_TMPFILE" ] || ! jq -e . "$SNP_TMPFILE" &>/dev/null; } && command -v sudo &>/dev/null; then
173185
if echo "$SNP_ATTEST_OUT" | grep -qi "tpm error\|permission denied\|EACCES\|get_report failed" || ! [ -s "$SNP_TMPFILE" ]; then
174-
if [ -n "$SNP_REPORT_DATA" ]; then
175-
SNP_ATTEST_OUT=$(sudo -n "$ATTESTATION_CLI" attest \
176-
--platform az-snp \
177-
--report-data-hex "$SNP_REPORT_DATA" \
178-
-o "$SNP_TMPFILE" 2>&1) || true
179-
else
180-
SNP_ATTEST_OUT=$(sudo -n "$ATTESTATION_CLI" attest \
181-
--platform az-snp \
182-
-o "$SNP_TMPFILE" 2>&1) || true
183-
fi
186+
SNP_ATTEST_OUT=$(sudo -n "$ATTESTATION_CLI" attest \
187+
--platform az-snp \
188+
-o "$SNP_TMPFILE" 2>&1) || true
184189
# Fix ownership so subsequent jq/cp work as the current user
185190
sudo -n chown "$(id -u):$(id -g)" "$SNP_TMPFILE" 2>/dev/null || true
186191
fi

0 commit comments

Comments
 (0)