Просмотр исходного кода

Accept Intel Trust Authority tokens in remote-attest-01

The new ita format accepts tokens Intel Trust Authority issues for Intel
TDX trust domains, including Azure confidential VMs whose paravisor
reports for the guest. They arrive as application/eat+jwt and are told
from Confidential Space tokens by their issuer.

step-ca verifies a token with the signing key its kid names, fetched
from Intel Trust Authority's key set at a configured URL (never the
token's jku, which must match it if present), cached and refetched for
an unknown kid. The key's x5c chain must verify to Intel Trust
Authority's root, which is embedded. The token must be recent, not for
a debuggable trust domain, and carry 64 bytes of attester_user_data:
the binding and the relying party's nonce. The runtime data its TD
quote committed to must be SHA-512 of the verifier nonce, if any, and
that user data, as Intel's client computes it, so the binding is
checked against what the quote covers rather than taken on Intel Trust
Authority's word alone.

Tested end to end on a Standard_DC4es_v6 VM with Intel Trust Authority:
a remote-attest-01 order was finalized with a token it issued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FfGsdwrq6AroSzEU654oya
Ted Malone 3 недель назад
Родитель
Сommit
df35d994c9

+ 12 - 0
CHANGELOG.md

@@ -58,6 +58,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
   accepted only when listed in `formats`, and the runtime claims (the vTPM's
   `HCLAkPub` key and the VM configuration) are given to webhooks and templates
   as `.Attestation.azureRuntime`.
+- An `ita` format for `remote-attest-01`: tokens Intel Trust Authority issues
+  for Intel TDX trust domains, including Azure confidential VMs, sent as
+  `application/eat+jwt` and told from Confidential Space tokens by their
+  issuer. step-ca verifies the token with the signing key its `kid` names,
+  fetched from Intel Trust Authority's key set, whose certificate chain must
+  verify to Intel Trust Authority's root, which step-ca embeds; the binding
+  and the relying party's nonce are the 64 bytes of `attester_user_data`, and
+  the runtime data the TD quote committed to must be SHA-512 of the verifier
+  nonce, if any, and that user data. Debuggable trust domains are refused. The
+  token's claims, including the vTPM PCRs Intel Trust Authority appraised on
+  Azure, are given to webhooks and templates as `.Attestation.ita`. It is
+  configured by `remoteAttestation.ita`.
 - The `attestation` package and its subpackages, which verify TDX quotes,
   SEV-SNP reports and Confidential Space tokens, and parse CMW records and
   configfs-tsm reports. The `device-attest-01` formats' verifiers (`apple`,

+ 17 - 2
attestation/attestation.go

@@ -31,12 +31,15 @@ const (
 	// whose paravisor reports for the guest, with the runtime claims the
 	// quote commits to.
 	FormatAzureTDX Format = "azure-tdx"
+	// FormatITA is an Intel Trust Authority token for an Intel TDX trust
+	// domain.
+	FormatITA Format = "ita"
 )
 
 // Validate returns an error if the format is not supported.
 func (f Format) Validate() error {
 	switch f {
-	case FormatTDX, FormatSEVSNP, FormatConfidentialSpace, FormatAzureTDX:
+	case FormatTDX, FormatSEVSNP, FormatConfidentialSpace, FormatAzureTDX, FormatITA:
 		return nil
 	default:
 		return fmt.Errorf("attestation format %q is not supported", f)
@@ -44,7 +47,7 @@ func (f Format) Validate() error {
 }
 
 // Result is verified attestation evidence. Binary values are hex encoded.
-// Exactly one of TDX, SEVSNP and ConfidentialSpace is set, as Format says;
+// Exactly one of TDX, SEVSNP, ConfidentialSpace and ITA is set, as Format says;
 // for FormatAzureTDX, TDX and AzureRuntime are both set.
 type Result struct {
 	// Format is the format of the evidence.
@@ -58,6 +61,18 @@ type Result struct {
 	SEVSNP            *SEVSNP            `json:"sevSnp,omitempty"`
 	ConfidentialSpace *ConfidentialSpace `json:"confidentialSpace,omitempty"`
 	AzureRuntime      *AzureRuntime      `json:"azureRuntime,omitempty"`
+	ITA               *ITA               `json:"ita,omitempty"`
+}
+
+// ITA holds the claims of a verified Intel Trust Authority token. On an Azure
+// confidential VM they include the vTPM's PCRs, which Intel Trust Authority
+// appraised, under tpm.pcrs.
+type ITA struct {
+	// Claims are all the claims of the token.
+	Claims map[string]any `json:"claims"`
+	// SignerSerialNumber is the serial number of the certificate of the key
+	// that signed the token.
+	SignerSerialNumber string `json:"signerSerialNumber,omitempty"`
 }
 
 // AzureRuntime holds the runtime claims of an Azure confidential VM, which the

+ 28 - 0
attestation/ita/intel_trust_authority_root.crt

@@ -0,0 +1,28 @@
+-----BEGIN CERTIFICATE-----
+MIIE2TCCA0GgAwIBAgIUCN/QtoirX6FtEcYfvLyRYaIuXpMwDQYJKoZIhvcNAQEN
+BQAwdDEmMCQGA1UEAwwdSW50ZWwgVHJ1c3QgQXV0aG9yaXR5IFJvb3QgQ0ExCzAJ
+BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEUMBIGA1UEBwwLU2FudGEgQ2xhcmExGjAY
+BgNVBAoMEUludGVsIENvcnBvcmF0aW9uMB4XDTI0MTEyNzExNTE0MVoXDTQ5MTIz
+MDExNTE0MVowdDEmMCQGA1UEAwwdSW50ZWwgVHJ1c3QgQXV0aG9yaXR5IFJvb3Qg
+Q0ExCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEUMBIGA1UEBwwLU2FudGEgQ2xh
+cmExGjAYBgNVBAoMEUludGVsIENvcnBvcmF0aW9uMIIBojANBgkqhkiG9w0BAQEF
+AAOCAY8AMIIBigKCAYEAuQ1g1Q4MtnvTRhYITKVou5CDvB5FpfjBe8ssUKaDILwk
+gJlGNv66IWPQ9vhIekZQjuvHbUj9yPcrM7Hva7h7Ehlo/Sm7ZhY8AgZfGFTRJjvN
+U+vg/BTr5vuqUu/a54eewyzMcmxwmWhK/4cGQs7spFB346jpjSgOHgk5PgJ39PgE
+r5UL9SvJ1LFRuCNxZTdzyLe7K8cWvEnwGkR2RJpK9pYgzfnAWy8J0djdAKaoQxt8
+TOE/IwafG/0ujTeuNbzo+3wxeF6SGz56MimE1+KgraPpULaeX2tAL9lUz+ECMetN
+LbAyqHQwxN1jQZ/3VgpQ8qqh7Cyo4rEjpja29iRtOihBYlW0/X6TxOG1LLSuGo/N
+9CcSW6EzjsC1Bzakzjs4OD+JGaqqvc255p8URTxZSRSJr1xtimZK+BJoCHECsrCL
+vCC5UmFfTQrxkeGJ+OIDMkQFgidUw2K7kYXe9k7glKw9yyVf9C0hhqBFfPD8r+CX
+EA9m2u1tvR4NGMuoegMxAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
+BBYEFPMLB1WJSkb0GNbafK74Mj53qBYRMB8GA1UdIwQYMBaAFPMLB1WJSkb0GNba
+fK74Mj53qBYRMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQ0FAAOCAYEANqZT
+62Z7J4AqJeuBpkYYZji3a4imyoJnQN+vuuPS9x0BTsPdTo4WqV0sHIwRrmZXMEwo
+ngVAR14YqcPxfimulptyXTAFbUXt1eW5Fs6UktqHh+7vP5UMH4MMsMc53GcOpeVl
+p1m2c5U9/Ew34ryQ8XTUL/n1ssYwsN1bRvBmFVpUTYwTxa6dTBNVHE+OQNe+6kLy
+9bM2DI1HEkhz+yFuZiNIehTuoHbceN/5fqzwNGT2orD/QQyK6Sw2jAyxQmveV/Zi
+DWvN4WVgHR52Vu/6fcsBkOmjLO3Lm7tDm4hOdhIOu3lpU8/2wppZuTLZbu4HmbzL
+lpSdtBPfeBP6rRuRV/+KRdbe9jVZcdYkv79GqaeB0x2Y0cK58uY9CRtyJbXDyNJL
+QZIzpeYamUInuc7kWxtu+hTeMICP4DVaNUi6w2wKuKZ+il+1d9syuvBs9yEOrUeX
+O00/cfc6djTyeobCA0+7jJ3EYXNmRNy1UHtKxfK/LDFBJE0Iy7nNePiKli4D
+-----END CERTIFICATE-----

+ 363 - 0
attestation/ita/ita.go

@@ -0,0 +1,363 @@
+// Package ita verifies the attestation tokens Intel Trust Authority issues for
+// Intel TDX trust domains, including Azure confidential VMs whose paravisor
+// reports for the guest.
+package ita
+
+import (
+	"bytes"
+	"context"
+	"crypto"
+	"crypto/rsa"
+	"crypto/sha512"
+	"crypto/x509"
+	_ "embed"
+	"encoding/base64"
+	"encoding/hex"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io"
+	"net/http"
+	"slices"
+	"sync"
+	"time"
+
+	"go.step.sm/crypto/jose"
+
+	"github.com/smallstep/certificates/attestation"
+)
+
+const (
+	// Issuer is the issuer of Intel Trust Authority's tokens.
+	Issuer = "https://portal.trustauthority.intel.com"
+	// DefaultJWKSURL is where Intel Trust Authority publishes the keys that
+	// sign its tokens, each with its certificate chain.
+	DefaultJWKSURL = "https://portal.trustauthority.intel.com/certs"
+	// DefaultMaxTokenAge is the default maximum age of a token.
+	DefaultMaxTokenAge = 5 * time.Minute
+	// Leeway is the clock skew allowed when checking exp, nbf and iat.
+	Leeway = time.Minute
+	// UserDataSize is the size of the user data a token must carry: what
+	// the caller binds.
+	UserDataSize = 64
+
+	// keySetTTL is how long fetched keys are used before they are fetched
+	// again; keySetRetry is how soon an unknown key ID may cause a fetch.
+	keySetTTL   = 15 * time.Minute
+	keySetRetry = time.Minute
+	maxKeySet   = 1 << 20
+)
+
+// rootPEM is "Intel Trust Authority Root CA", valid from 2024-11-27 to
+// 2049-12-30, the root of the certificate chains Intel Trust Authority
+// publishes with its token signing keys at DefaultJWKSURL. Its SHA-256
+// fingerprint is
+// 70:91:E8:9E:9A:17:B9:39:ED:C0:1F:0A:87:B0:C3:86:3F:22:42:29:9B:F3:C0:FF:D5:EE:4A:21:7F:F7:4F:5F.
+//
+//go:embed intel_trust_authority_root.crt
+var rootPEM []byte
+
+var roots = sync.OnceValue(func() *x509.CertPool {
+	pool := x509.NewCertPool()
+	if !pool.AppendCertsFromPEM(rootPEM) {
+		panic("ita: the embedded root is not valid PEM")
+	}
+	return pool
+})
+
+// Roots returns a pool with Intel Trust Authority's root, the default for
+// verifying the chains of its token signing keys.
+func Roots() *x509.CertPool {
+	return roots()
+}
+
+// HTTPClient sends HTTP requests.
+type HTTPClient interface {
+	Do(*http.Request) (*http.Response, error)
+}
+
+// KeySet fetches and caches the token signing keys published at a URL that is
+// configured, never taken from a token.
+type KeySet struct {
+	url    string
+	client HTTPClient
+	now    func() time.Time
+
+	mu        sync.Mutex
+	keys      jose.JSONWebKeySet
+	fetchedAt time.Time
+}
+
+// NewKeySet returns a KeySet for the keys at url, DefaultJWKSURL if empty.
+func NewKeySet(url string, client HTTPClient) *KeySet {
+	if url == "" {
+		url = DefaultJWKSURL
+	}
+	return &KeySet{url: url, client: client, now: time.Now}
+}
+
+// URL returns the URL the keys are fetched from.
+func (s *KeySet) URL() string {
+	return s.url
+}
+
+// Key returns the key with the given ID. It fetches the keys when they are
+// older than keySetTTL, or when the ID is unknown and the last fetch is older
+// than keySetRetry, so that a rotated key is found. A failure to fetch does not
+// match attestation.ErrInvalidEvidence.
+func (s *KeySet) Key(ctx context.Context, kid string) (*jose.JSONWebKey, error) {
+	s.mu.Lock()
+	defer s.mu.Unlock()
+	age := s.now().Sub(s.fetchedAt)
+	keys := s.keys.Key(kid)
+	if s.fetchedAt.IsZero() || age > keySetTTL || (len(keys) == 0 && age > keySetRetry) {
+		if err := s.fetch(ctx); err != nil {
+			return nil, err
+		}
+		keys = s.keys.Key(kid)
+	}
+	if len(keys) == 0 {
+		return nil, attestation.Invalidf("intel trust authority has no token signing key %q", kid)
+	}
+	return &keys[0], nil
+}
+
+func (s *KeySet) fetch(ctx context.Context) error {
+	req, err := http.NewRequestWithContext(ctx, http.MethodGet, s.url, http.NoBody)
+	if err != nil {
+		return err
+	}
+	resp, err := s.client.Do(req)
+	if err != nil {
+		return fmt.Errorf("error fetching intel trust authority keys: %w", err)
+	}
+	defer resp.Body.Close()
+	if resp.StatusCode != http.StatusOK {
+		return fmt.Errorf("error fetching intel trust authority keys: %s", resp.Status)
+	}
+	b, err := io.ReadAll(io.LimitReader(resp.Body, maxKeySet+1))
+	if err != nil {
+		return fmt.Errorf("error fetching intel trust authority keys: %w", err)
+	}
+	if len(b) > maxKeySet {
+		return errors.New("intel trust authority keys exceed 1 MiB")
+	}
+	var keys jose.JSONWebKeySet
+	if err := json.Unmarshal(b, &keys); err != nil {
+		return fmt.Errorf("error parsing intel trust authority keys: %w", err)
+	}
+	s.keys = keys
+	s.fetchedAt = s.now()
+	return nil
+}
+
+// Claims are the claims of a token that Verify checks.
+type Claims struct {
+	jose.Claims
+	TDX *TDXClaims `json:"tdx"`
+}
+
+// TDXClaims are the claims of a token's tdx object that Verify checks.
+type TDXClaims struct {
+	IsDebuggable  *bool          `json:"tdx_is_debuggable"`
+	UserData      string         `json:"attester_user_data"`
+	RuntimeData   map[string]any `json:"attester_runtime_data"`
+	VerifierNonce *struct {
+		Val string `json:"val"`
+		Iat string `json:"iat"`
+	} `json:"verifier_nonce"`
+	TCBStatus string `json:"attester_tcb_status"`
+}
+
+// Token is a verified token.
+type Token struct {
+	// Leaf is the certificate of the key that signed the token.
+	Leaf *x509.Certificate
+	// Claims are the claims Verify checked.
+	Claims Claims
+	// RawClaims are all the claims of the token.
+	RawClaims map[string]any
+	// UserData is the user data the token carries, which the attested
+	// trust domain committed to.
+	UserData []byte
+}
+
+// Result returns the token as an attestation result.
+func (t *Token) Result() *attestation.ITA {
+	return &attestation.ITA{
+		Claims:             t.RawClaims,
+		SignerSerialNumber: t.Leaf.SerialNumber.String(),
+	}
+}
+
+// Options are the options Verify verifies a token with.
+type Options struct {
+	// Keys resolves the token's key ID. It is required.
+	Keys *KeySet
+	// Roots are the roots of the signing keys' chains. They default to
+	// Roots().
+	Roots *x509.CertPool
+	// MaxTokenAge is the maximum age of the token. It defaults to
+	// DefaultMaxTokenAge.
+	MaxTokenAge time.Duration
+	// Now is the time the token is verified at. It defaults to the current
+	// time.
+	Now time.Time
+}
+
+// allowedAlgorithms are the signature algorithms Intel Trust Authority signs
+// tokens with.
+var allowedAlgorithms = []string{jose.PS384, jose.RS256}
+
+// Verify verifies an Intel Trust Authority token for an Intel TDX trust
+// domain:
+//   - the token's PS384 or RS256 signature, with the published key its kid
+//     names, whose x5c chain must verify to the roots and whose leaf must be
+//     that key;
+//   - the issuer, the exp, nbf and iat claims, and the age of the token;
+//   - that the trust domain is not debuggable;
+//   - that the user data is 64 bytes, and that the runtime data's user-data,
+//     which the TD quote committed to, is SHA-512 of the verifier nonce's val
+//     and iat, if any, followed by the user data.
+//
+// Errors of the token match attestation.ErrInvalidEvidence.
+func Verify(ctx context.Context, token string, opts Options) (*Token, error) {
+	if opts.Keys == nil {
+		return nil, errors.New("no keys to verify the intel trust authority token with")
+	}
+	if opts.Roots == nil {
+		opts.Roots = Roots()
+	}
+	if opts.MaxTokenAge <= 0 {
+		opts.MaxTokenAge = DefaultMaxTokenAge
+	}
+	if opts.Now.IsZero() {
+		opts.Now = time.Now()
+	}
+
+	jwt, err := jose.ParseSigned(token)
+	if err != nil {
+		return nil, attestation.Invalidf("error parsing intel trust authority token: %w", err)
+	}
+	if len(jwt.Headers) != 1 {
+		return nil, attestation.Invalidf("intel trust authority token must have exactly one signature")
+	}
+	header := jwt.Headers[0]
+	if !slices.Contains(allowedAlgorithms, header.Algorithm) {
+		return nil, attestation.Invalidf("unsupported intel trust authority token algorithm %q", header.Algorithm)
+	}
+	if jku, ok := header.ExtraHeaders["jku"]; ok && jku != opts.Keys.URL() {
+		return nil, attestation.Invalidf("intel trust authority token jku %v is not %s", jku, opts.Keys.URL())
+	}
+	if header.KeyID == "" {
+		return nil, attestation.Invalidf("intel trust authority token has no kid")
+	}
+	key, err := opts.Keys.Key(ctx, header.KeyID)
+	if err != nil {
+		return nil, err
+	}
+	leaf, err := verifyChain(key, opts.Roots, opts.Now)
+	if err != nil {
+		return nil, err
+	}
+
+	var (
+		claims    Claims
+		rawClaims map[string]any
+	)
+	if err := jwt.Claims(leaf.PublicKey, &claims, &rawClaims); err != nil {
+		return nil, attestation.Invalidf("error verifying intel trust authority token: %w", err)
+	}
+	if err := claims.ValidateWithLeeway(jose.Expected{Issuer: Issuer, Time: opts.Now}, Leeway); err != nil {
+		return nil, attestation.Invalidf("intel trust authority token is not valid: %w", err)
+	}
+	if claims.Expiry == nil || claims.IssuedAt == nil {
+		return nil, attestation.Invalidf("intel trust authority token must have exp and iat claims")
+	}
+	if age := opts.Now.Sub(claims.IssuedAt.Time()); age > opts.MaxTokenAge {
+		return nil, attestation.Invalidf("intel trust authority token is too old: issued %s ago, the maximum is %s", age, opts.MaxTokenAge)
+	}
+
+	tdx := claims.TDX
+	if tdx == nil {
+		return nil, attestation.Invalidf("intel trust authority token has no tdx claims")
+	}
+	if tdx.IsDebuggable == nil || *tdx.IsDebuggable {
+		return nil, attestation.Invalidf("intel trust authority token is for a debuggable trust domain")
+	}
+	userData, err := base64.StdEncoding.DecodeString(tdx.UserData)
+	if err != nil || len(userData) != UserDataSize {
+		return nil, attestation.Invalidf("intel trust authority token attester_user_data is not the base64 encoding of %d bytes", UserDataSize)
+	}
+	if err := checkRuntimeData(tdx, userData); err != nil {
+		return nil, err
+	}
+
+	return &Token{Leaf: leaf, Claims: claims, RawClaims: rawClaims, UserData: userData}, nil
+}
+
+// verifyChain verifies the x5c chain of a published key and returns its leaf,
+// which must hold the key.
+func verifyChain(key *jose.JSONWebKey, roots *x509.CertPool, now time.Time) (*x509.Certificate, error) {
+	if len(key.Certificates) == 0 {
+		return nil, attestation.Invalidf("intel trust authority key %q has no certificate chain", key.KeyID)
+	}
+	leaf := key.Certificates[0]
+	intermediates := x509.NewCertPool()
+	for _, c := range key.Certificates[1:] {
+		intermediates.AddCert(c)
+	}
+	if _, err := leaf.Verify(x509.VerifyOptions{
+		Roots:         roots,
+		Intermediates: intermediates,
+		CurrentTime:   now,
+		KeyUsages:     []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
+	}); err != nil {
+		return nil, attestation.Invalidf("intel trust authority key %q chain is not valid: %w", key.KeyID, err)
+	}
+	pub, ok := leaf.PublicKey.(*rsa.PublicKey)
+	if !ok {
+		return nil, attestation.Invalidf("intel trust authority key %q has an unsupported type %T", key.KeyID, leaf.PublicKey)
+	}
+	if k, ok := key.Key.(crypto.PublicKey); !ok || !pub.Equal(k) {
+		return nil, attestation.Invalidf("intel trust authority key %q is not the key of its certificate", key.KeyID)
+	}
+	return leaf, nil
+}
+
+// checkRuntimeData checks that the runtime data's user-data is SHA-512 of the
+// verifier nonce, if any, and the user data. The nonce's val and iat claims are
+// the base64 encodings of the bytes that were hashed.
+func checkRuntimeData(tdx *TDXClaims, userData []byte) error {
+	h := sha512.New()
+	if n := tdx.VerifierNonce; n != nil {
+		val, err1 := base64.StdEncoding.DecodeString(n.Val)
+		iat, err2 := base64.StdEncoding.DecodeString(n.Iat)
+		if err1 != nil || err2 != nil {
+			return attestation.Invalidf("intel trust authority token verifier_nonce is not base64")
+		}
+		h.Write(val)
+		h.Write(iat)
+	}
+	h.Write(userData)
+	got, _ := tdx.RuntimeData["user-data"].(string)
+	want := h.Sum(nil)
+	if b, err := hex.DecodeString(got); err != nil || !bytes.Equal(b, want) {
+		return attestation.Invalidf("intel trust authority token runtime data does not commit to its user data")
+	}
+	return nil
+}
+
+// IsToken reports, without verifying it, whether token claims Intel Trust
+// Authority as its issuer, to tell it from other attestation tokens.
+func IsToken(token string) bool {
+	jwt, err := jose.ParseSigned(token)
+	if err != nil {
+		return false
+	}
+	var claims jose.Claims
+	if err := jwt.UnsafeClaimsWithoutVerification(&claims); err != nil {
+		return false
+	}
+	return claims.Issuer == Issuer
+}

+ 285 - 0
attestation/ita/ita_test.go

@@ -0,0 +1,285 @@
+package ita
+
+import (
+	"context"
+	"crypto"
+	"crypto/rand"
+	"crypto/rsa"
+	"crypto/sha512"
+	"crypto/x509"
+	"encoding/base64"
+	"encoding/hex"
+	"encoding/json"
+	"encoding/pem"
+	"errors"
+	"net/http"
+	"net/http/httptest"
+	"sync/atomic"
+	"testing"
+	"time"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+	"go.step.sm/crypto/jose"
+
+	"github.com/smallstep/certificates/attestation"
+	cstest "github.com/smallstep/certificates/attestation/confidentialspace/confidentialspacetest"
+)
+
+const testKID = "test-signing-key.PS384"
+
+// testNow is now: the test PKI is valid from when it is created.
+var testNow = time.Now().Truncate(time.Second)
+
+// server publishes keys the way Intel Trust Authority does, counting fetches.
+type server struct {
+	*httptest.Server
+	fetches atomic.Int32
+	keys    jose.JSONWebKeySet
+}
+
+func newServer(t *testing.T, keys ...jose.JSONWebKey) *server {
+	t.Helper()
+	s := &server{keys: jose.JSONWebKeySet{Keys: keys}}
+	s.Server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+		s.fetches.Add(1)
+		_ = json.NewEncoder(w).Encode(s.keys)
+	}))
+	t.Cleanup(s.Close)
+	return s
+}
+
+func publishedKey(pki *cstest.PKI, kid string) jose.JSONWebKey {
+	return jose.JSONWebKey{Key: pki.Leaf.PublicKey, KeyID: kid, Algorithm: jose.PS384, Use: "sig", Certificates: pki.Chain()}
+}
+
+func userData() []byte {
+	b := make([]byte, UserDataSize)
+	for i := range b {
+		b[i] = byte(i)
+	}
+	return b
+}
+
+// tdxClaims returns the tdx claims of a token for userData, with a verifier
+// nonce if nonce is set.
+func tdxClaims(ud []byte, nonce bool) map[string]any {
+	h := sha512.New()
+	claims := map[string]any{
+		"tdx_is_debuggable":   false,
+		"attester_tcb_status": "UpToDate",
+		"attester_user_data":  base64.StdEncoding.EncodeToString(ud),
+		"tdx_mrtd":            "efef2faf",
+	}
+	if nonce {
+		val, iat := []byte("bm9uY2U="), []byte("2026-11-07 12:00:00 +0000 UTC")
+		h.Write(val)
+		h.Write(iat)
+		claims["verifier_nonce"] = map[string]any{
+			"val": base64.StdEncoding.EncodeToString(val),
+			"iat": base64.StdEncoding.EncodeToString(iat),
+		}
+	}
+	h.Write(ud)
+	claims["attester_runtime_data"] = map[string]any{"user-data": hex.EncodeToString(h.Sum(nil))}
+	return claims
+}
+
+func tokenClaims(tdx map[string]any) map[string]any {
+	return map[string]any{
+		"iss": Issuer,
+		"iat": testNow.Unix(),
+		"nbf": testNow.Unix(),
+		"exp": testNow.Add(5 * time.Minute).Unix(),
+		"jti": "28aa9e11-19fc-46ee-bf65-ab99373b3dfb",
+		"tdx": tdx,
+		"tpm": map[string]any{"pcrs": []map[string]any{{"index": 7, "alg": "SHA-256", "digest": "f014e5cb"}}},
+	}
+}
+
+func mint(t *testing.T, key crypto.Signer, alg jose.SignatureAlgorithm, kid, jku string, claims map[string]any) string {
+	t.Helper()
+	so := new(jose.SignerOptions).WithType("JWT").WithHeader("kid", kid)
+	if jku != "" {
+		so = so.WithHeader("jku", jku)
+	}
+	signer, err := jose.NewSigner(jose.SigningKey{Algorithm: alg, Key: key}, so)
+	require.NoError(t, err)
+	token, err := jose.Signed(signer).Claims(claims).CompactSerialize()
+	require.NoError(t, err)
+	return token
+}
+
+func TestVerify(t *testing.T) {
+	pki := cstest.New(t)
+	srv := newServer(t, publishedKey(pki, testKID))
+	opts := func() Options {
+		return Options{Keys: NewKeySet(srv.URL, srv.Client()), Roots: pki.Roots(), Now: testNow}
+	}
+
+	for _, nonce := range []bool{false, true} {
+		token := mint(t, pki.LeafKey, jose.PS384, testKID, srv.URL, tokenClaims(tdxClaims(userData(), nonce)))
+		tok, err := Verify(context.Background(), token, opts())
+		require.NoError(t, err, "nonce %v", nonce)
+		assert.Equal(t, userData(), tok.UserData)
+		assert.Equal(t, "UpToDate", tok.Claims.TDX.TCBStatus)
+		res := tok.Result()
+		assert.Equal(t, pki.Leaf.SerialNumber.String(), res.SignerSerialNumber)
+		assert.Contains(t, res.Claims, "tpm")
+	}
+
+	otherKey, err := rsa.GenerateKey(rand.Reader, 2048)
+	require.NoError(t, err)
+	wrongKey := publishedKey(pki, "wrong-key")
+	wrongKey.Key = otherKey.Public()
+	wrongKeySrv := newServer(t, wrongKey)
+	otherPKI := cstest.New(t)
+
+	change := func(f func(tdx map[string]any)) map[string]any {
+		tdx := tdxClaims(userData(), false)
+		f(tdx)
+		return tokenClaims(tdx)
+	}
+	claims := func(f func(c map[string]any)) map[string]any {
+		c := tokenClaims(tdxClaims(userData(), false))
+		f(c)
+		return c
+	}
+	tests := []struct {
+		name    string
+		token   string
+		opts    func() Options
+		wantErr string
+	}{
+		{"fail algorithm", mint(t, pki.LeafKey, jose.RS512, testKID, "", tokenClaims(tdxClaims(userData(), false))), opts,
+			`unsupported intel trust authority token algorithm "RS512"`},
+		{"fail jku", mint(t, pki.LeafKey, jose.PS384, testKID, "https://evil.example/certs", tokenClaims(tdxClaims(userData(), false))), opts,
+			"is not " + srv.URL},
+		{"fail unknown kid", mint(t, pki.LeafKey, jose.PS384, "unknown", "", tokenClaims(tdxClaims(userData(), false))), opts,
+			`no token signing key "unknown"`},
+		{"fail untrusted chain", mint(t, pki.LeafKey, jose.PS384, testKID, "", tokenClaims(tdxClaims(userData(), false))),
+			func() Options { o := opts(); o.Roots = otherPKI.Roots(); return o }, "chain is not valid"},
+		{"fail signature", mint(t, otherKey, jose.PS384, testKID, "", tokenClaims(tdxClaims(userData(), false))), opts,
+			"error verifying intel trust authority token"},
+		{"fail issuer", mint(t, pki.LeafKey, jose.PS384, testKID, "", claims(func(c map[string]any) { c["iss"] = "https://other.example" })), opts,
+			"token is not valid"},
+		{"fail expired", mint(t, pki.LeafKey, jose.PS384, testKID, "", claims(func(c map[string]any) { c["exp"] = testNow.Add(-2 * time.Minute).Unix() })), opts,
+			"token is not valid"},
+		{"fail too old", mint(t, pki.LeafKey, jose.PS384, testKID, "", claims(func(c map[string]any) {
+			c["iat"] = testNow.Add(-10 * time.Minute).Unix()
+			c["nbf"] = c["iat"]
+		})), opts, "too old"},
+		{"fail no tdx", mint(t, pki.LeafKey, jose.PS384, testKID, "", claims(func(c map[string]any) { delete(c, "tdx") })), opts,
+			"has no tdx claims"},
+		{"fail debuggable", mint(t, pki.LeafKey, jose.PS384, testKID, "", change(func(tdx map[string]any) { tdx["tdx_is_debuggable"] = true })), opts,
+			"debuggable"},
+		{"fail debuggable missing", mint(t, pki.LeafKey, jose.PS384, testKID, "", change(func(tdx map[string]any) { delete(tdx, "tdx_is_debuggable") })), opts,
+			"debuggable"},
+		{"fail user data size", mint(t, pki.LeafKey, jose.PS384, testKID, "", tokenClaims(tdxClaims(userData()[:32], false))), opts,
+			"not the base64 encoding of 64 bytes"},
+		{"fail runtime data", mint(t, pki.LeafKey, jose.PS384, testKID, "", change(func(tdx map[string]any) {
+			tdx["attester_runtime_data"] = map[string]any{"user-data": hex.EncodeToString(make([]byte, 64))}
+		})), opts, "runtime data does not commit to its user data"},
+		{"fail nonce not base64", mint(t, pki.LeafKey, jose.PS384, testKID, "", change(func(tdx map[string]any) {
+			tdx["verifier_nonce"] = map[string]any{"val": "***", "iat": "***"}
+		})), opts, "verifier_nonce is not base64"},
+		{"fail not a token", "not a token", opts, "error parsing intel trust authority token"},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			_, err := Verify(context.Background(), tt.token, tt.opts())
+			assert.ErrorContains(t, err, tt.wantErr)
+			assert.True(t, errors.Is(err, attestation.ErrInvalidEvidence))
+		})
+	}
+
+	t.Run("fail key is not the certificate's", func(t *testing.T) {
+		// go-jose refuses a published key whose x5c leaf holds another key,
+		// so the key set cannot be used at all.
+		token := mint(t, otherKey, jose.PS384, "wrong-key", "", tokenClaims(tdxClaims(userData(), false)))
+		o := opts()
+		o.Keys = NewKeySet(wrongKeySrv.URL, wrongKeySrv.Client())
+		_, err := Verify(context.Background(), token, o)
+		assert.ErrorContains(t, err, "public keys in key and x5c fields do not match")
+	})
+
+	t.Run("fail no keys", func(t *testing.T) {
+		_, err := Verify(context.Background(), "x", Options{})
+		assert.EqualError(t, err, "no keys to verify the intel trust authority token with")
+	})
+}
+
+func TestKeySet(t *testing.T) {
+	pki := cstest.New(t)
+	srv := newServer(t, publishedKey(pki, testKID))
+	now := testNow
+	s := NewKeySet(srv.URL, srv.Client())
+	s.now = func() time.Time { return now }
+
+	_, err := s.Key(context.Background(), testKID)
+	require.NoError(t, err)
+	_, err = s.Key(context.Background(), testKID)
+	require.NoError(t, err)
+	assert.Equal(t, int32(1), srv.fetches.Load(), "a known key is served from the cache")
+
+	// An unknown key fetches again only after keySetRetry.
+	_, err = s.Key(context.Background(), "rotated")
+	assert.ErrorContains(t, err, `no token signing key "rotated"`)
+	assert.Equal(t, int32(1), srv.fetches.Load())
+	srv.keys.Keys = append(srv.keys.Keys, publishedKey(pki, "rotated"))
+	now = now.Add(keySetRetry + time.Second)
+	_, err = s.Key(context.Background(), "rotated")
+	require.NoError(t, err)
+	assert.Equal(t, int32(2), srv.fetches.Load())
+
+	// Keys are fetched again after keySetTTL.
+	now = now.Add(keySetTTL + time.Second)
+	_, err = s.Key(context.Background(), testKID)
+	require.NoError(t, err)
+	assert.Equal(t, int32(3), srv.fetches.Load())
+
+	assert.Equal(t, DefaultJWKSURL, NewKeySet("", nil).URL())
+}
+
+func TestKeySetFetchErrors(t *testing.T) {
+	failing := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+		http.Error(w, "down", http.StatusServiceUnavailable)
+	}))
+	defer failing.Close()
+	garbage := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+		_, _ = w.Write([]byte("not json"))
+	}))
+	defer garbage.Close()
+
+	for name, url := range map[string]string{"status": failing.URL, "json": garbage.URL} {
+		t.Run(name, func(t *testing.T) {
+			_, err := NewKeySet(url, http.DefaultClient).Key(context.Background(), testKID)
+			require.Error(t, err)
+			// The CA could not fetch keys: that is not the evidence's fault.
+			assert.False(t, errors.Is(err, attestation.ErrInvalidEvidence))
+		})
+	}
+}
+
+func TestIsToken(t *testing.T) {
+	pki := cstest.New(t)
+	assert.True(t, IsToken(mint(t, pki.LeafKey, jose.PS384, testKID, "", tokenClaims(nil))))
+	assert.False(t, IsToken(mint(t, pki.LeafKey, jose.RS256, testKID, "", map[string]any{"iss": "https://confidentialcomputing.googleapis.com"})))
+	assert.False(t, IsToken("not a token"))
+}
+
+func TestRoots(t *testing.T) {
+	subjects := Roots().Subjects() //nolint:staticcheck // the pool is built from PEM, not the system
+	require.Len(t, subjects, 1)
+	c, err := parseFirst(rootPEM)
+	require.NoError(t, err)
+	assert.Equal(t, "Intel Trust Authority Root CA", c.Subject.CommonName)
+}
+
+func parseFirst(pemBytes []byte) (*x509.Certificate, error) {
+	block, _ := pem.Decode(pemBytes)
+	if block == nil {
+		return nil, errors.New("no pem block")
+	}
+	return x509.ParseCertificate(block.Bytes)
+}

+ 76 - 3
authority/provisioner/acme_remote_attestation.go

@@ -15,6 +15,7 @@ import (
 	"github.com/smallstep/certificates/attestation/cmw"
 	"github.com/smallstep/certificates/attestation/collateral"
 	"github.com/smallstep/certificates/attestation/confidentialspace"
+	"github.com/smallstep/certificates/attestation/ita"
 	"github.com/smallstep/certificates/attestation/sevsnp"
 	"github.com/smallstep/certificates/attestation/tdx"
 	"github.com/smallstep/certificates/attestation/tsm"
@@ -44,9 +45,9 @@ type ACMERemoteAttestation struct {
 	// not have one, so that every certificate needs attestation.
 	Require bool `json:"require,omitempty"`
 	// Formats are the evidence formats accepted: tdx, sev-snp,
-	// confidential-space and azure-tdx. It defaults to tdx and sev-snp, and
-	// to confidential-space too if ConfidentialSpace is set. azure-tdx is
-	// only accepted when listed.
+	// confidential-space, azure-tdx and ita. It defaults to tdx and sev-snp,
+	// and to confidential-space and ita too if ConfidentialSpace or ITA is
+	// set. azure-tdx is only accepted when listed.
 	Formats []attestation.Format `json:"formats,omitempty"`
 	// ClaimsHint is sent to clients as the challenge's attestClaimsHint.
 	ClaimsHint []string `json:"claimsHint,omitempty"`
@@ -57,6 +58,21 @@ type ACMERemoteAttestation struct {
 	SEVSNPRoots []byte `json:"sevSnpRoots,omitempty"`
 	// ConfidentialSpace configures the confidential-space format.
 	ConfidentialSpace *ACMEConfidentialSpace `json:"confidentialSpace,omitempty"`
+	// ITA configures the ita format.
+	ITA *ACMEITA `json:"ita,omitempty"`
+}
+
+// ACMEITA configures the ita format of the remote-attest-01 challenge, which
+// accepts the tokens Intel Trust Authority issues for Intel TDX trust domains.
+type ACMEITA struct {
+	// Roots is a PEM bundle that replaces Intel Trust Authority's root, which
+	// step-ca embeds.
+	Roots []byte `json:"roots,omitempty"`
+	// JWKSURL is where the token signing keys are fetched from. It defaults
+	// to Intel Trust Authority's.
+	JWKSURL string `json:"jwksUrl,omitempty"`
+	// MaxTokenAge is the maximum age of the token. It defaults to 5 minutes.
+	MaxTokenAge *Duration `json:"maxTokenAge,omitempty"`
 }
 
 // ACMEConfidentialSpace configures the confidential-space format of the
@@ -99,6 +115,9 @@ type remoteAttestationVerifier struct {
 	csAudience  string
 	csMaxAge    time.Duration
 	csExpecting *confidentialspace.Expectations
+	itaKeys     *ita.KeySet
+	itaRoots    *x509.CertPool
+	itaMaxAge   time.Duration
 	now         func() time.Time
 }
 
@@ -140,6 +159,9 @@ func (p *ACME) initializeRemoteAttestation() error {
 		if o.ConfidentialSpace != nil {
 			v.formats = append(v.formats, attestation.FormatConfidentialSpace)
 		}
+		if o.ITA != nil {
+			v.formats = append(v.formats, attestation.FormatITA)
+		}
 	}
 
 	getter := collateral.New(p.ctl.GetHTTPClient())
@@ -158,6 +180,8 @@ func (p *ACME) initializeRemoteAttestation() error {
 			v.sevsnp, err = sevsnp.New(o.SEVSNPRoots, collateral.SEVSNP{Getter: getter})
 		case attestation.FormatConfidentialSpace:
 			err = v.initializeConfidentialSpace(o.ConfidentialSpace)
+		case attestation.FormatITA:
+			err = v.initializeITA(o.ITA, p.ctl.GetHTTPClient())
 		}
 		if err != nil {
 			return fmt.Errorf("error initializing the %s format: %w", f, err)
@@ -193,6 +217,27 @@ func (v *remoteAttestationVerifier) initializeConfidentialSpace(o *ACMEConfident
 	return nil
 }
 
+func (v *remoteAttestationVerifier) initializeITA(o *ACMEITA, client HTTPClient) error {
+	if o == nil {
+		o = &ACMEITA{}
+	}
+	v.itaRoots = ita.Roots()
+	if len(o.Roots) > 0 {
+		v.itaRoots = x509.NewCertPool()
+		if !v.itaRoots.AppendCertsFromPEM(o.Roots) {
+			return errors.New("no certificates found in ita.roots")
+		}
+	}
+	if o.MaxTokenAge != nil {
+		if o.MaxTokenAge.Duration <= 0 {
+			return errors.New("ita.maxTokenAge must be greater than 0")
+		}
+		v.itaMaxAge = o.MaxTokenAge.Duration
+	}
+	v.itaKeys = ita.NewKeySet(o.JWKSURL, client)
+	return nil
+}
+
 // GetRemoteAttestation returns the remote attestation options.
 func (p *ACME) GetRemoteAttestation() *ACMERemoteAttestation {
 	return p.RemoteAttestation
@@ -220,6 +265,10 @@ func (p *ACME) IsEABRequired() bool {
 //     bytes. Its other nonces are the relying party's and stay in the claims.
 //     The token must have been requested for the configured audience, or else
 //     for the given default audience.
+//   - For an Intel Trust Authority token (application/eat+jwt or
+//     application/jwt, issued by Intel Trust Authority), its 64 bytes of
+//     attester_user_data, which the runtime data its TD quote committed to
+//     hashes.
 //
 // The caller checks what the binding must be. Errors of the evidence match
 // attestation.ErrInvalidEvidence.
@@ -244,6 +293,9 @@ func (p *ACME) VerifyRemoteAttestation(ctx context.Context, r *cmw.Record, defau
 	case tdx.IsAzureMediaType(r.MediaType):
 		res, bound, err = v.verifyAzureTDX(ctx, r)
 		size = RemoteAttestationBindingSize + RemoteAttestationClaimNonceSize
+	case isJWTMediaType(r.MediaType) && ita.IsToken(string(r.Value)):
+		res, bound, err = v.verifyITA(ctx, r)
+		size = RemoteAttestationBindingSize + RemoteAttestationClaimNonceSize
 	case isJWTMediaType(r.MediaType):
 		res, bound, err = v.verifyConfidentialSpace(r, defaultAudience)
 		size = RemoteAttestationBindingSize
@@ -330,6 +382,27 @@ func (v *remoteAttestationVerifier) verifyAzureTDX(ctx context.Context, r *cmw.R
 	return &attestation.Result{Format: attestation.FormatAzureTDX, TDX: res, AzureRuntime: runtime}, userData, nil
 }
 
+// verifyITA verifies an Intel Trust Authority token. The binding and the
+// relying party's nonce are its user data.
+func (v *remoteAttestationVerifier) verifyITA(ctx context.Context, r *cmw.Record) (*attestation.Result, []byte, error) {
+	if err := v.enabled(attestation.FormatITA); err != nil {
+		return nil, nil, err
+	}
+	if r.Indicator != 0 && !r.Indicator.Has(cmw.AttestationResults) {
+		return nil, nil, attestation.Invalidf("an attestation token must be indicated as an attestation result")
+	}
+	tok, err := ita.Verify(ctx, string(r.Value), ita.Options{
+		Keys:        v.itaKeys,
+		Roots:       v.itaRoots,
+		MaxTokenAge: v.itaMaxAge,
+		Now:         v.now(),
+	})
+	if err != nil {
+		return nil, nil, err
+	}
+	return &attestation.Result{Format: attestation.FormatITA, ITA: tok.Result()}, tok.UserData, nil
+}
+
 func (v *remoteAttestationVerifier) verifyConfidentialSpace(r *cmw.Record, defaultAudience string) (*attestation.Result, []byte, error) {
 	if err := v.enabled(attestation.FormatConfidentialSpace); err != nil {
 		return nil, nil, err

+ 103 - 0
authority/provisioner/acme_remote_attestation_test.go

@@ -4,23 +4,27 @@ import (
 	"bytes"
 	"context"
 	"crypto/sha256"
+	"crypto/sha512"
 	"encoding/base64"
 	"encoding/hex"
 	"encoding/json"
 	"errors"
 	"io"
 	"net/http"
+	"net/http/httptest"
 	"strings"
 	"testing"
 	"time"
 
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
+	"go.step.sm/crypto/jose"
 
 	"github.com/smallstep/certificates/attestation"
 	"github.com/smallstep/certificates/attestation/cmw"
 	"github.com/smallstep/certificates/attestation/confidentialspace"
 	cstest "github.com/smallstep/certificates/attestation/confidentialspace/confidentialspacetest"
+	"github.com/smallstep/certificates/attestation/ita"
 	"github.com/smallstep/certificates/attestation/tdx"
 	"github.com/smallstep/certificates/authority/policy"
 	"github.com/smallstep/certificates/webhook"
@@ -468,3 +472,102 @@ func TestACME_VerifyRemoteAttestation_azureTDX(t *testing.T) {
 		})
 	}
 }
+
+// itaToken mints an Intel Trust Authority token for userData with the PKI's
+// leaf, published under kid.
+func itaToken(t *testing.T, pki *cstest.PKI, kid string, userData []byte, debuggable bool) string {
+	t.Helper()
+	sum := sha512.Sum512(userData)
+	now := time.Now()
+	claims := map[string]any{
+		"iss": ita.Issuer, "iat": now.Unix(), "nbf": now.Unix(), "exp": now.Add(5 * time.Minute).Unix(),
+		"tdx": map[string]any{
+			"tdx_is_debuggable":     debuggable,
+			"attester_user_data":    base64.StdEncoding.EncodeToString(userData),
+			"attester_runtime_data": map[string]any{"user-data": hex.EncodeToString(sum[:])},
+			"attester_tcb_status":   "UpToDate",
+		},
+	}
+	signer, err := jose.NewSigner(jose.SigningKey{Algorithm: jose.PS384, Key: pki.LeafKey},
+		new(jose.SignerOptions).WithType("JWT").WithHeader("kid", kid))
+	require.NoError(t, err)
+	token, err := jose.Signed(signer).Claims(claims).CompactSerialize()
+	require.NoError(t, err)
+	return token
+}
+
+func TestACME_VerifyRemoteAttestation_ita(t *testing.T) {
+	pki := cstest.New(t)
+	keys := jose.JSONWebKeySet{Keys: []jose.JSONWebKey{{
+		Key: pki.Leaf.PublicKey, KeyID: "kid", Algorithm: jose.PS384, Use: "sig", Certificates: pki.Chain(),
+	}}}
+	srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+		_ = json.NewEncoder(w).Encode(keys)
+	}))
+	defer srv.Close()
+	o := &ACMERemoteAttestation{ITA: &ACMEITA{Roots: pki.RootPEM(), JWKSURL: srv.URL}}
+	bound := testBound()
+
+	t.Run("ok", func(t *testing.T) {
+		p := newRemoteAttestationACME(t, o, srv.Client())
+		assert.Contains(t, p.remoteAttestation.formats, attestation.FormatITA, "ita is enabled when configured")
+		token := itaToken(t, pki, "kid", bound, false)
+		got, gotBound, err := p.VerifyRemoteAttestation(context.Background(),
+			jsonCMW("application/eat+jwt", []byte(token), cmw.AttestationResults), "")
+		require.NoError(t, err)
+		assert.Equal(t, bound, gotBound)
+		assert.Equal(t, attestation.FormatITA, got.Format)
+		require.NotNil(t, got.ITA)
+		assert.Equal(t, ita.Issuer, got.ITA.Claims["iss"])
+		assert.Nil(t, got.ConfidentialSpace)
+	})
+
+	tests := []struct {
+		name        string
+		o           *ACMERemoteAttestation
+		record      *cmw.Record
+		wantErr     string
+		wantInvalid bool
+	}{
+		{"fail not enabled", nil, jsonCMW("application/eat+jwt", []byte(itaToken(t, pki, "kid", bound, false)), 0),
+			"attestation format ita is not enabled", true},
+		{"fail indicator", o, jsonCMW("application/eat+jwt", []byte(itaToken(t, pki, "kid", bound, false)), cmw.Evidence),
+			"must be indicated as an attestation result", true},
+		{"fail debuggable", o, jsonCMW("application/eat+jwt", []byte(itaToken(t, pki, "kid", bound, true)), 0),
+			"debuggable", true},
+		{"fail binding size", o, jsonCMW("application/eat+jwt", []byte(itaToken(t, pki, "kid", bound[:32], false)), 0),
+			"not the base64 encoding of 64 bytes", true},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			p := newRemoteAttestationACME(t, tt.o, srv.Client())
+			_, _, err := p.VerifyRemoteAttestation(context.Background(), tt.record, "")
+			assert.ErrorContains(t, err, tt.wantErr)
+			assert.Equal(t, tt.wantInvalid, errors.Is(err, attestation.ErrInvalidEvidence))
+		})
+	}
+}
+
+func TestACME_Init_remoteAttestationITA(t *testing.T) {
+	for name, tt := range map[string]struct {
+		o       *ACMEITA
+		wantErr string
+	}{
+		"ok defaults":     {&ACMEITA{}, ""},
+		"fail roots":      {&ACMEITA{Roots: []byte("not pem")}, "no certificates found in ita.roots"},
+		"fail max age":    {&ACMEITA{MaxTokenAge: &Duration{Duration: -time.Second}}, "ita.maxTokenAge must be greater than 0"},
+		"ok listed alone": {nil, ""},
+	} {
+		t.Run(name, func(t *testing.T) {
+			p := &ACME{Type: "ACME", Name: "attested", Challenges: []ACMEChallenge{REMOTE_ATTEST_01},
+				RemoteAttestation: &ACMERemoteAttestation{Formats: []attestation.Format{attestation.FormatITA}, ITA: tt.o}}
+			err := p.Init(Config{Claims: globalProvisionerClaims, HTTPClient: staticHTTPClient{}})
+			if tt.wantErr == "" {
+				require.NoError(t, err)
+				assert.Equal(t, ita.DefaultJWKSURL, p.remoteAttestation.itaKeys.URL())
+			} else {
+				assert.ErrorContains(t, err, tt.wantErr)
+			}
+		})
+	}
+}