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 rundocker compose up -d. The container is recreated. - Kubernetes: update the
attest-verifierSecret or ConfigMap, then runkubectl 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.
| Endpoint | Returns |
|---|---|
GET /healthz | Liveness: 200 with {"status":"ok"} while the process serves HTTP. Also on the public port |
GET /readyz | Readiness: the overall status and one block per check. See Readiness |
GET /metrics | Prometheus metrics. See Metrics |
GET /openapi.yaml | The 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/metricsWith the key set, a request without it gets:
| Endpoint | Without the key |
|---|---|
/healthz | Unchanged |
/readyz | The same status code, with only {"status": …}, so orchestrator probes keep working |
/metrics, /openapi.yaml | 401 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.
| Check | Cause | Fix |
|---|---|---|
policy | No policy loaded | Check that the project’s policy is published and that the verifier reaches the TrustPin CDN. See Policy updates |
store | store unreachable; see the verifier log | Restore the Redis or Postgres connection named in TRUSTPIN_STORE_URL |
degraded (200): the instance serves traffic but needs attention. Alert on it.
| Check | Cause | Fix |
|---|---|---|
signingKeys | TRUSTPIN_TOKEN_SIGNING_KEYS is unset, so the keys are ephemeral | Set TRUSTPIN_TOKEN_SIGNING_KEYS (attest-verifier keygen). Set TRUSTPIN_CHALLENGE_SECRETS too: its absence only shows as a startup warning |
debugTokens | TRUSTPIN_DEBUG_TOKEN_HASHES is set (the check itself reads configured) | Expected on staging. Remove it anywhere else |
policy | policy refresh not_found: the policy file was not found on refresh | The last good policy stays in use. Check that the project’s policy is still published |
policy | policy refresh incompatible: a newer policy needs configuration this instance lacks, such as Play Integrity credentials | Add the configuration and restart. Until then the instance stays on the previous version |
policy | Three 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 |
revocationList | Google’s attestation revocation list is older than 7 days | Allow outbound HTTPS to android.googleapis.com. Key Attestation keeps working on the older list |
revocationList | No 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.
| Metric | Type | Labels |
|---|---|---|
trustpin_attest_build_info | gauge (1) | version, commit, go_version, fips140 |
trustpin_attest_http_requests_total | counter | endpoint, code |
trustpin_attest_http_request_duration_seconds | histogram | endpoint |
trustpin_attest_attestations_total | counter | platform (apple, android, debug), evidence, result (pass: a token was issued; fail: refused), reason (the first reason code, or none) |
trustpin_attest_tokens_issued_total | counter | platform, mode, result (the token’s tp.result), bound (true, false) |
trustpin_attest_challenges_issued_total | counter | none |
trustpin_attest_challenge_rejections_total | counter | reason (expired, bad_mac, reused) |
trustpin_attest_upstream_requests_total | counter | upstream (play_integrity, google_revocation_list, trustpin_cdn, attest_configuration_url), outcome (ok, not_modified, not_found, error) |
trustpin_attest_upstream_request_duration_seconds | histogram | upstream |
trustpin_attest_policy_version | gauge | none |
trustpin_attest_policy_refresh_total | counter | outcome (updated, unchanged, not_found, invalid, incompatible, rollback_rejected, error) |
trustpin_attest_policy_last_success_timestamp_seconds | gauge | none |
trustpin_attest_revocation_list_age_seconds | gauge | none |
trustpin_attest_store_operations_total | counter | operation, 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/portandprometheus.io/pathannotations that the Kubernetes bundle puts on the verifier pods. MountTRUSTPIN_MONITOR_API_KEYfrom 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:
| Alert | Fires when | What to do |
|---|---|---|
AttestVerifierPolicyStale | No successful policy refresh for over an hour, for 10 minutes | The verifier keeps serving its last good policy. Check the outbound path to the policy and trustpin_attest_policy_refresh_total by outcome |
AttestVerifierPolicyIncompatible | A refresh found a policy that needs configuration this instance lacks | Add the missing configuration, such as Play Integrity credentials, and restart |
AttestVerifierUpstreamErrors | More than 20% of Play Integrity calls fail, for 10 minutes | Attestations answer 502 upstream_unavailable meanwhile, and the SDKs back off and retry. Check the path to Google and the credentials |
AttestVerifierForgeries | Sustained binding failures: evidence that doesn’t match its device key or challenge | Review the failing reasons, platforms and apps in the logs |
AttestVerifierRevocationListStale | Google’s revocation list is older than 7 days, for an hour | Allow outbound HTTPS to android.googleapis.com |
AttestVerifierStoreErrors | Store operations fail, for 5 minutes | Check 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, orchecks.policy.versionin/readyz;policyVersioninGET /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_CREDENTIALSon every instance. Otherwise running instances stay on the previous version and reportdegraded, and a restarted instance exits with code2. - 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_DIRif it has a cached copy, and exits with code1otherwise. - 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
| Secret | When | How |
|---|---|---|
TRUSTPIN_TOKEN_SIGNING_KEYS | On your schedule, or at once if leaked | Three steps, over one key-certificate lifetime |
TRUSTPIN_CHALLENGE_SECRETS | On your schedule, or at once if leaked | Three steps, over a few minutes |
TRUSTPIN_MONITOR_API_KEY | On your schedule | Change it on the verifiers and in Prometheus together. Scrapes fail until both match |
TRUSTPIN_PLAY_INTEGRITY_CREDENTIALS | When Google Cloud key policy requires | Create a new JSON key for the same service account, deploy it, then delete the old key in Google Cloud |
TRUSTPIN_DEBUG_TOKEN_HASHES | When a developer leaves, or a token leaks | Replace the hash and restart. Key certificates obtained with the old token stop refreshing |
TRUSTPIN_TLS_CERT_FILE, TRUSTPIN_TLS_KEY_FILE | Before the certificate expires | Replace the files. The verifier reloads them without a restart |
Store credentials in TRUSTPIN_STORE_URL | On your schedule | Add 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:
- Generate a key with
attest-verifier keygenand add it last:old,new. The new key now appears in the JWKS but signs nothing yet. - 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. - 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.
-
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.
-
With Postgres, apply any new migrations first. A verifier whose schema is behind exits with code
1and names the missing migration:docker run --rm trustpincloud/attest-verifier:<new version> migrations print --from <first missing version> -
Run
attest-verifier checkwith the new image and your current configuration. -
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_URLto a shared Redis or Postgres. Every instance of an environment uses the sameTRUSTPIN_TOKEN_SIGNING_KEYS,TRUSTPIN_CHALLENGE_SECRETSandTRUSTPIN_STORE_URL. See Choose the store. - On Kubernetes, raise
replicas, or add a HorizontalPodAutoscaler on CPU, and switch the PodDisruptionBudget tominAvailable: 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_LIMITis 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
| Situation | Do | What happens |
|---|---|---|
| A signing key leaked | Put a new key first in TRUSTPIN_TOKEN_SIGNING_KEYS, remove the leaked one, and roll out at once | Tokens 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 leaked | Replace it and roll out | Outstanding challenges are refused, and the SDKs fetch new ones |
| A debug token leaked | Remove its hash from TRUSTPIN_DEBUG_TOKEN_HASHES and restart | Its key certificates fail their next refresh |
| An app’s signing certificate or build is compromised | Remove it from the policy and publish | Within one Access token lifetime, refreshes fail with invalid_key_certificate and new attestations fail with app_not_allowed |
| An abusive device | Deny-list its sub in your API for one Key certificate lifetime | The verifier keeps no per-device block list; your API is where to block |
| Apple outage | Nothing | The 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 outage | Nothing | Attestations 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 outage | Nothing | Running verifiers keep the last good policy; /readyz turns degraded after three failed refreshes. See Policy updates for restarts |
| Store outage | Restore 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 down | Restore them | Apps keep their tokens until they expire, then send requests without the header. Your API’s rule for requests without the header applies |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Connection refused on port 9090 from another host or container | The monitor port binds 127.0.0.1 by default | Set TRUSTPIN_MONITOR_LISTEN_ADDR=:9090 with TRUSTPIN_MONITOR_API_KEY |
/metrics answers 401 | TRUSTPIN_MONITOR_API_KEY is set and the scrape carries no key, or the wrong one | Give Prometheus the key as its basic-auth password |
/readyz shows only {"status": …} | The request carries no key | Send the key to see the checks |
degraded with signingKeys right after deploying | The signing keys are unset, so each restart forces every device to attest again | Set TRUSTPIN_TOKEN_SIGNING_KEYS and TRUSTPIN_CHALLENGE_SECRETS |
| A new policy version doesn’t show up | The refresh interval hasn’t passed, or the refresh is incompatible | Wait 5 minutes, then read checks.policy in /readyz |
| A gateway refuses new tokens right after a key rotation | Its JWKS cache doesn’t know the new key yet | Rotate in three steps, or wait for its next JWKS refresh |
| Every device attests again after a deploy | The signing keys changed or were dropped | Restore the previous list, and rotate in three steps |
Next steps
- Rolling out: monitor to enforce
- Verifier API reference
- Deploying the verifier
- Troubleshooting attestation, for failures that start in the verifier and show up in the app or your API