Skip to Content
App AttestationOperating the verifier

Operating the verifier

For platform and ops engineers. At the end of this page, Prometheus scrapes your verifiers and alerts you when something needs attention, and you know how to roll out a policy change, rotate keys and secrets, upgrade, scale, and respond to incidents.

Before you start

  • A verifier deployed and passing its checks. See Deploying the verifier.
  • A path from your probes and Prometheus to the verifier’s port 9090 that stays inside your private network.

Applying a configuration change

Every change on this page is an environment variable change, and the verifier reads its variables at start. To apply one:

  • Docker Compose: update .env, or your secret store, then run docker compose up -d. The container is recreated.
  • Kubernetes: update the attest-verifier Secret or ConfigMap, then run kubectl rollout restart deploy/attest-verifier. Pods are replaced one at a time.

Run attest-verifier check with the new values first when you can.

The monitor port

Port 9090 is the monitor port. It is read-only: every endpoint is GET, and nothing on it changes the verifier.

EndpointReturns
GET /healthzLiveness: 200 with {"status":"ok"} while the process serves HTTP. Also on the public port
GET /readyzReadiness: the overall status and one block per check. See Readiness
GET /metricsPrometheus metrics. See Metrics
GET /openapi.yamlThe OpenAPI document of both ports. See Verifier API reference

The monitor port listens on 127.0.0.1:9090 by default, so only the verifier’s own container reaches it. When probes or Prometheus connect from another host, pod or container, set TRUSTPIN_MONITOR_LISTEN_ADDR=:9090 together with TRUSTPIN_MONITOR_API_KEY. The Docker Compose and Kubernetes bundles already set :9090. Never route the monitor port through your public gateway or an Ingress.

Calling it with the key

TRUSTPIN_MONITOR_API_KEY is accepted in two forms:

# HTTP Basic: any user name, the key as the password curl -s -u monitor:"$TRUSTPIN_MONITOR_API_KEY" http://localhost:9090/readyz # Bearer token curl -s -H "Authorization: Bearer $TRUSTPIN_MONITOR_API_KEY" http://localhost:9090/metrics

With the key set, a request without it gets:

EndpointWithout the key
/healthzUnchanged
/readyzThe same status code, with only {"status": …}, so orchestrator probes keep working
/metrics, /openapi.yaml401 with WWW-Authenticate: Basic

Without TRUSTPIN_MONITOR_API_KEY, every endpoint answers anyone who can reach the port, and startup logs a warning when the port listens beyond the container.

Readiness

GET /readyz answers 200 for ok and degraded, and 503 for unavailable. Point your orchestrator’s readiness probe at it, and its liveness probe at /healthz. The Kubernetes bundle does both.

{ "status": "ok", "checks": { "policy": { "status": "ok", "version": 5, "source": "cdn", "lastRefreshAt": "2026-11-02T08:00:00Z", "lastRefreshResult": "unchanged" }, "signingKeys": { "status": "ok", "ephemeral": false, "count": 1 }, "revocationList": { "status": "ok", "source": "download", "ageHours": 3 }, "store": { "status": "ok" }, "playIntegrity": { "status": "ok" }, "debugTokens": { "status": "disabled" } } }

policy.source is cdn, configuration_url or cache. store.status is ok, error, or disabled with TRUSTPIN_STORE_URL=none. A failing check carries a reason, which is a fixed text; the details, which can name hosts or users, are only in the verifier’s log.

unavailable (503): the instance must not receive traffic.

CheckCauseFix
policyNo policy loadedCheck that the project’s policy is published and that the verifier reaches the TrustPin CDN. See Policy updates
storestore unreachable; see the verifier logRestore the Redis or Postgres connection named in TRUSTPIN_STORE_URL

degraded (200): the instance serves traffic but needs attention. Alert on it.

CheckCauseFix
signingKeysTRUSTPIN_TOKEN_SIGNING_KEYS is unset, so the keys are ephemeralSet TRUSTPIN_TOKEN_SIGNING_KEYS (attest-verifier keygen). Set TRUSTPIN_CHALLENGE_SECRETS too: its absence only shows as a startup warning
debugTokensTRUSTPIN_DEBUG_TOKEN_HASHES is set (the check itself reads configured)Expected on staging. Remove it anywhere else
policypolicy refresh not_found: the policy file was not found on refreshThe last good policy stays in use. Check that the project’s policy is still published
policypolicy refresh incompatible: a newer policy needs configuration this instance lacks, such as Play Integrity credentialsAdd the configuration and restart. Until then the instance stays on the previous version
policyThree consecutive failed refreshes, shown as policy refresh <outcome> (error, invalid or rollback_rejected)The last good policy stays in use. Check the outbound path to the TrustPin CDN, and TRUSTPIN_ATTEST_CONFIGURATION_URL if you set it
revocationListGoogle’s attestation revocation list is older than 7 daysAllow outbound HTTPS to android.googleapis.com. Key Attestation keeps working on the older list
revocationListNo revocation list at all (the check itself reads unavailable)Allow outbound HTTPS to android.googleapis.com. Until a list is downloaded, Key Attestation evidence answers 502 upstream_unavailable

A degraded policy check clears at the next successful refresh.

Metrics

GET /metrics serves the Prometheus text format. Every series is prefixed trustpin_attest_, labels carry no device or key IDs, and endpoint is always the route, such as /v1/attest.

MetricTypeLabels
trustpin_attest_build_infogauge (1)version, commit, go_version, fips140
trustpin_attest_http_requests_totalcounterendpoint, code
trustpin_attest_http_request_duration_secondshistogramendpoint
trustpin_attest_attestations_totalcounterplatform (apple, android, debug), evidence, result (pass: a token was issued; fail: refused), reason (the first reason code, or none)
trustpin_attest_tokens_issued_totalcounterplatform, mode, result (the token’s tp.result), bound (true, false)
trustpin_attest_challenges_issued_totalcounternone
trustpin_attest_challenge_rejections_totalcounterreason (expired, bad_mac, reused)
trustpin_attest_upstream_requests_totalcounterupstream (play_integrity, google_revocation_list, trustpin_cdn, attest_configuration_url), outcome (ok, not_modified, not_found, error)
trustpin_attest_upstream_request_duration_secondshistogramupstream
trustpin_attest_policy_versiongaugenone
trustpin_attest_policy_refresh_totalcounteroutcome (updated, unchanged, not_found, invalid, incompatible, rollback_rejected, error)
trustpin_attest_policy_last_success_timestamp_secondsgaugenone
trustpin_attest_revocation_list_age_secondsgaugenone
trustpin_attest_store_operations_totalcounteroperation, outcome

In monitor mode, an attestation that fails the policy still gets a token, so trustpin_attest_attestations_total counts it as result="pass", with its failing reason. Count policy failures with trustpin_attest_tokens_issued_total{result="fail"}, or filter trustpin_attest_attestations_total on reason!="none". Attestations that end in an upstream or store error (502, 503) don’t appear in trustpin_attest_attestations_total; see trustpin_attest_http_requests_total by code. The rollout page has the queries.

The Go runtime and process metrics are served too. In steady state, policy_refresh_total{outcome="unchanged"} and upstream_requests_total{outcome="not_modified"} grow together: the policy is fetched conditionally, and the CDN answers 304 while it is unchanged.

Scraping

Download prometheus.yml. It has two jobs:

  • A fixed address, such as a Docker Compose service:

    scrape_configs: - job_name: attest-verifier static_configs: - targets: ["verifier:9090"] basic_auth: username: prometheus password_file: /etc/prometheus/monitor-api-key # holds TRUSTPIN_MONITOR_API_KEY
  • Kubernetes pods, found through the prometheus.io/scrape, prometheus.io/port and prometheus.io/path annotations that the Kubernetes bundle puts on the verifier pods. Mount TRUSTPIN_MONITOR_API_KEY from the verifier’s Secret into Prometheus at the path the job names.

Prometheus sends the key as its basic-auth password; the user name is ignored. With TRUSTPIN_TLS_CERT_FILE set, the monitor port serves HTTPS too: add scheme: https to the jobs.

Check: the attest-verifier targets are UP in Prometheus, and trustpin_attest_build_info shows the version you deployed.

Alerts and dashboard

Add alerts.yml to Prometheus’s rule_files:

AlertFires whenWhat to do
AttestVerifierPolicyStaleNo successful policy refresh for over an hour, for 10 minutesThe verifier keeps serving its last good policy. Check the outbound path to the policy and trustpin_attest_policy_refresh_total by outcome
AttestVerifierPolicyIncompatibleA refresh found a policy that needs configuration this instance lacksAdd the missing configuration, such as Play Integrity credentials, and restart
AttestVerifierUpstreamErrorsMore than 20% of Play Integrity calls fail, for 10 minutesAttestations answer 502 upstream_unavailable meanwhile, and the SDKs back off and retry. Check the path to Google and the credentials
AttestVerifierForgeriesSustained binding failures: evidence that doesn’t match its device key or challengeReview the failing reasons, platforms and apps in the logs
AttestVerifierRevocationListStaleGoogle’s revocation list is older than 7 days, for an hourAllow outbound HTTPS to android.googleapis.com
AttestVerifierStoreErrorsStore operations fail, for 5 minutesCheck Redis or Postgres. Requests that need the store answer 503 meanwhile

Also alert on /readyz reporting degraded or unavailable, through your probe system.

dashboard.json is a Grafana dashboard that charts every metric: the policy version and age, attestations and tokens by platform, result and reason, challenges, HTTP traffic and latency, the store, and upstreams. In Grafana, open Dashboards, choose New, then Import, upload the file, and pick your Prometheus data source. The instance variable selects one verifier or all of them. The “Attestations with a reason, by reason and token outcome” panel shows every attestation that failed a check: token pass ones still got a token (monitor mode, or an informational reason such as verdict_unavailable), token fail ones were refused.

These files may be copied and modified freely, under the Code Samples clause of the verifier’s licence.

Logs and tracing

The verifier writes one JSON line per request (TRUSTPIN_LOG_FORMAT=json, the default) with event, platform, app, result, reasons, pv, upstream, latency_ms, request_id and sub_prefix (the first 8 characters of the device’s sub). Tokens, key certificates, client data, evidence, challenges and secrets are never logged, at any level.

Every response echoes X-Request-ID: your gateway’s value when it is at most 128 printable characters, a generated one otherwise. Use it to match the gateway’s log lines with the verifier’s.

With OTEL_EXPORTER_OTLP_ENDPOINT set, the verifier exports OpenTelemetry traces: one span per public request, and client spans for the policy fetch and Google calls. Log lines then carry trace_id and span_id.

Policy updates

Each publish on the Policy tab reaches every verifier within TRUSTPIN_POLICY_REFRESH_INTERVAL (5 minutes by default, ±10% per wait), with no restart. To confirm which version an instance applies:

  • trustpin_attest_policy_version, or checks.policy.version in /readyz;
  • policyVersion in GET /v1/challenge;
  • Check now under Verifier checks on the Status tab, which compares the applied version with the published one.

What each kind of change does to devices, and when, is in When changes take effect.

  • Deploy configuration before the policy that needs it. Before you publish a policy whose Evidence becomes Play Integrity only or Both, set TRUSTPIN_PLAY_INTEGRITY_CREDENTIALS on every instance. Otherwise running instances stay on the previous version and report degraded, and a restarted instance exits with code 2.
  • No rollback. A verifier never accepts a lower version than one it already loaded. To undo a change, publish a new version with the old settings.
  • CDN outages. A running verifier keeps its last good policy. A verifier that restarts during an outage starts from TRUSTPIN_POLICY_CACHE_DIR if it has a cached copy, and exits with code 1 otherwise.
  • Disabling attestation on the Status tab doesn’t stop your verifiers: they keep serving the last published policy, across restarts too.

Rotating keys and secrets

SecretWhenHow
TRUSTPIN_TOKEN_SIGNING_KEYSOn your schedule, or at once if leakedThree steps, over one key-certificate lifetime
TRUSTPIN_CHALLENGE_SECRETSOn your schedule, or at once if leakedThree steps, over a few minutes
TRUSTPIN_MONITOR_API_KEYOn your scheduleChange it on the verifiers and in Prometheus together. Scrapes fail until both match
TRUSTPIN_PLAY_INTEGRITY_CREDENTIALSWhen Google Cloud key policy requiresCreate a new JSON key for the same service account, deploy it, then delete the old key in Google Cloud
TRUSTPIN_DEBUG_TOKEN_HASHESWhen a developer leaves, or a token leaksReplace the hash and restart. Key certificates obtained with the old token stop refreshing
TRUSTPIN_TLS_CERT_FILE, TRUSTPIN_TLS_KEY_FILEBefore the certificate expiresReplace the files. The verifier reloads them without a restart
Store credentials in TRUSTPIN_STORE_URLOn your scheduleAdd the new credentials in the store, deploy the new URL, then revoke the old ones

The project public key never rotates: a new key means a new TrustPin project.

Signing keys

Every key listed in TRUSTPIN_TOKEN_SIGNING_KEYS verifies, and is published in the JWKS; only the first one signs. Rotate in three steps, each rolled out to every instance:

  1. Generate a key with attest-verifier keygen and add it last: old,new. The new key now appears in the JWKS but signs nothing yet.
  2. When every instance runs step 1, and your API’s and gateways’ JWKS caches have refreshed (5 minutes for the recipes on this site), move the new key first: new,old. It now signs every new token and key certificate.
  3. After the longest Key certificate lifetime your policy has had during the rotation (30 days by default), remove the old key: new. Key certificates it signed have all expired by then.

Removing the old key early makes every device holding a key certificate it signed attest again, which costs Apple and Google calls and Play Integrity quota. Each key’s kid is its RFC 7638 thumbprint, so every instance derives the same kid with no extra configuration.

With a single instance and an API that refetches the JWKS on an unknown kid, you can start at step 2.

Challenge secrets

The same pattern, over minutes instead of days: add the new secret last and roll out; move it first and roll out; remove the old one once TRUSTPIN_CHALLENGE_TTL (5 minutes) has passed. An instance that receives a challenge signed with a secret it doesn’t know refuses it, and the SDK fetches a new one.

Upgrading

Within 1.x, the wire protocol, reason codes and environment variables change only in a new major version, and a verifier upgrade never needs an app release.

  1. Change the image tag, or download the bundle again: it pins the current release. Verify the new image’s signature, and check the SDK compatibility table, as in Image, versions and licence.

  2. With Postgres, apply any new migrations first. A verifier whose schema is behind exits with code 1 and names the missing migration:

    docker run --rm trustpincloud/attest-verifier:<new version> migrations print --from <first missing version>
  3. Run attest-verifier check with the new image and your current configuration.

  4. Roll out one instance at a time. The Kubernetes bundle’s Deployment already does (maxUnavailable: 0, maxSurge: 1).

Check: trustpin_attest_build_info shows the new version on every instance, and /readyz is ok. A day later, the Verifier fleet card on the Status tab lists the build under “Builds seen on the last fetch day”.

From an image older than 1.0.0, rename TRUSTPIN_ADMIN_LISTEN_ADDR and TRUSTPIN_ADMIN_API_KEY to TRUSTPIN_MONITOR_LISTEN_ADDR and TRUSTPIN_MONITOR_API_KEY before upgrading. The old names are ignored with only a warning, so the monitor port falls back to 127.0.0.1 and probes from outside the container fail.

Scaling

The verifier is CPU-bound and scales horizontally behind your gateway.

  • Before adding a second instance, set TRUSTPIN_STORE_URL to a shared Redis or Postgres. Every instance of an environment uses the same TRUSTPIN_TOKEN_SIGNING_KEYS, TRUSTPIN_CHALLENGE_SECRETS and TRUSTPIN_STORE_URL. See Choose the store.
  • On Kubernetes, raise replicas, or add a HorizontalPodAutoscaler on CPU, and switch the PodDisruptionBudget to minAvailable: 1. The bundle requests 100m CPU and 64 MiB of memory per pod, with a 256 MiB memory limit.
  • Per-key limit: TRUSTPIN_KEY_RATE_LIMIT is counted per instance, so a device key may reach the limit once on each instance.
  • Capacity: measured on one core with debug-token evidence, no store and no network, the verifier serves about 7,000 operations a second, an operation being a challenge followed by an attestation or a refresh. Treat that as an upper bound: Apple and Android evidence add certificate-chain checks, Play Integrity adds a call to Google, and a shared store adds a round trip. Each active device refreshes about once per Access token lifetime, so one million active devices on 1-hour tokens make about 280 refreshes a second. Measure on your own infrastructure, and keep the verifier close to the gateway: latency usually matters more than CPU.
  • Play Integrity quota: each Android attestation with Play Integrity evidence is one call to Google. Check that your quota covers a day on which every Android device attests again, as after a leaked signing key.

Incident response

SituationDoWhat happens
A signing key leakedPut a new key first in TRUSTPIN_TOKEN_SIGNING_KEYS, remove the leaked one, and roll out at onceTokens and key certificates signed with the leaked key are refused. Every affected device attests again, and APIs fetch the new JWKS on the unknown kid
A challenge secret leakedReplace it and roll outOutstanding challenges are refused, and the SDKs fetch new ones
A debug token leakedRemove its hash from TRUSTPIN_DEBUG_TOKEN_HASHES and restartIts key certificates fail their next refresh
An app’s signing certificate or build is compromisedRemove it from the policy and publishWithin one Access token lifetime, refreshes fail with invalid_key_certificate and new attestations fail with app_not_allowed
An abusive deviceDeny-list its sub in your API for one Key certificate lifetimeThe verifier keeps no per-device block list; your API is where to block
Apple outageNothingThe verifier calls no Apple service. Devices can’t get a new key attested until App Attest is back, and the SDK retries. Existing tokens and attested keys keep working
Google outageNothingAttestations that use Play Integrity answer 502 upstream_unavailable, and the SDKs back off. Key Attestation keeps working on the cached revocation list. Existing tokens stay valid until they expire
TrustPin CDN outageNothingRunning verifiers keep the last good policy; /readyz turns degraded after three failed refreshes. See Policy updates for restarts
Store outageRestore the store/v1/attest and /v1/token answer 503 not_ready, and /readyz is unavailable, so Kubernetes stops routing to every pod. Existing tokens stay valid, and APIs keep verifying with their cached JWKS. With TRUSTPIN_STORE_FAILURE=open, requests are served without replay protection instead
Every verifier downRestore themApps keep their tokens until they expire, then send requests without the header. Your API’s rule for requests without the header applies

Troubleshooting

SymptomLikely causeFix
Connection refused on port 9090 from another host or containerThe monitor port binds 127.0.0.1 by defaultSet TRUSTPIN_MONITOR_LISTEN_ADDR=:9090 with TRUSTPIN_MONITOR_API_KEY
/metrics answers 401TRUSTPIN_MONITOR_API_KEY is set and the scrape carries no key, or the wrong oneGive Prometheus the key as its basic-auth password
/readyz shows only {"status": …}The request carries no keySend the key to see the checks
degraded with signingKeys right after deployingThe signing keys are unset, so each restart forces every device to attest againSet TRUSTPIN_TOKEN_SIGNING_KEYS and TRUSTPIN_CHALLENGE_SECRETS
A new policy version doesn’t show upThe refresh interval hasn’t passed, or the refresh is incompatibleWait 5 minutes, then read checks.policy in /readyz
A gateway refuses new tokens right after a key rotationIts JWKS cache doesn’t know the new key yetRotate in three steps, or wait for its next JWKS refresh
Every device attests again after a deployThe signing keys changed or were droppedRestore the previous list, and rotate in three steps

Next steps