Appearance
Mobile app attestation Since v0.2
On the paths you list, every call must carry a token in a request header. The token is checked on the node itself; nothing is sent to Google or Apple. Paths you do not list, and browsers calling them, are never asked for a token. The section is off until Paths that need attestation is set, and it starts in detect like everything else. Three kinds of token are supported: Play Integrity (Android), App Attest (iOS) and a signed JWT from your own attestation service or SDK.
Before you begin
- Role:
operatorfor the application. Storing Play Integrity keys needsadmin. - A mobile app that sends the token in a header (default
X-App-Attestation). - For Play Integrity: in the Play Console, turn on managing your own response encryption keys, and download the decryption key (base64 AES-256) and the verification key (base64 EC public key).
- Test with a real build of your app before switching to
block. The verifiers are tested with our own generated keys and a test certificate authority, not on real devices.
Turn on attestation and add a verifier
text
1. Open Applications > All applications > the application > Request checks > API protection.
2. Open the Mobile attestation tab.
3. Enter Paths that need attestation, for example /api/mobile/*.
4. Add a verifier: choose the platform and fill in the package names and certificate
digests (Play Integrity), team ID and bundle IDs (App Attest), or key set, issuer and
audience (JWT).
5. Select Preview changes, add a comment and select Apply.sh
waap api set -app shop -m "attestation paths" attestation.paths=/api/mobile/*
waap api list set -app shop -list attestation.verifiers -f verifiers.yaml -m "verifiers"yaml
# applications[].policy.api.attestation
attestation:
paths: [/api/mobile/*]
header: X-App-Attestation
on_missing: refuse
verifiers:
- name: android
platform: play_integrity
package_names: [com.example.app]
certificate_digests: ["<SHA-256 of the app signing certificate, base64 or hex>"]
device_verdicts: [MEETS_DEVICE_INTEGRITY]
app_verdict: PLAY_RECOGNIZED
binding: request_hash
- name: ios
platform: app_attest
team_id: ABCDE12345
bundle_ids: [com.example.app]
environment: production
binding: challenge
- name: sdk
platform: jwt
key_set: sdk-keys.json
issuer: https://attest.example.com
audience: example-api
algorithms: [ES256]
claims: {app_id: com.example.app}The token's form decides the verifier: five dot-separated parts is Play Integrity, three is a signed JWT, and aa1.KEYID.ASSERTION[.CHALLENGE] is an App Attest assertion. With several verifiers of one platform, each is tried and the first that accepts wins. The accepting verifier's name is passed on to later modules.
Roll out gradually
Set Call without a token to log while old app versions run. Calls without the header are then only recorded, while invalid tokens are still refused.
Store Play Integrity keys
text
1. On the Mobile attestation tab, open Keys.
2. For the verifier, store the decryption key and the verification key.sh
waap api attest key set -app shop -verifier android -kind play-decrypt -f decrypt.key
waap api attest key set -app shop -verifier android -kind play-verify -f verify.pem
waap api attest keys -app shopKeys are write-only and never shown again. Until both exist, every token of that verifier is refused with a message saying which key is missing.
Bind tokens to the call
| Binding | What the app does | Use for |
|---|---|---|
request_hash | Puts base64url (no padding) of SHA-256 over METHOD, a newline, PATH (plus ?QUERY), a newline and the hex SHA-256 of the body in the token (Play Integrity requestHash, JWT claim rh, or the App Attest client data). | Most calls. A token copied onto another call no longer fits. |
challenge | First fetches GET /.well-known/waap/attest/challenge (answer: {"challenge": "...", "expires_in": 300}) and puts it in the token (Play Integrity nonce, JWT claim nonce, or the fourth part of an App Attest token). | Upload paths, because bodies larger than the inspected body limit cannot be hashed. |
none | Nothing. The token is checked on its own. | JWT and Play Integrity only. |
Challenges are signed with a per-application key that the active control node creates and rotates weekly (two kept), and live 5 minutes. Play Integrity and JWT tokens are single use by default: a token seen again on the same node within its age is refused as a replay. Turn Single use off if the app retries calls with the same token. App Attest assertions carry a counter that must grow instead.
Register App Attest devices
Each app instance registers its key once: fetch a challenge, call attestKey with the SHA-256 of the challenge as client data, and post {"key_id": "...", "attestation": "<base64 attestation object>", "challenge": "..."} to POST /.well-known/waap/attest/register (add "verifier" when you have several App Attest verifiers). The product checks the chain to Apple's App Attestation root (built in), the nonce, the app ID (TEAMID.bundle), the environment and that the counter starts at 0, then stores the public key (replicated to the standby and backed up).
Review and revoke devices
text
1. On the Mobile attestation tab, open Registered devices.
2. Filter by verifier, environment and idle days. Select Load more for the next page.
3. Select Revoke on a device and confirm.sh
waap api attest devices -app shop -environment development -idle-days 90
waap api attest device revoke -app shop -id IDA revoked device's next call is refused with attest.unknown_key until the app registers again. Other nodes see it within a minute. Use it for a lost or compromised phone, or to clear development registrations. Viewers see the ID clipped and no key fingerprint.
Check a token
text
1. On the Mobile attestation tab, select Check a token.
2. Paste the token. For request-hash tokens, also enter the method, path, query and body.sh
waap api attest check -app shop -f token.txt -method POST -path /api/mobile/orders -body-file body.jsonThe answer says whether the verifiers accept the token, or names the attest.* rule and the decoded field that failed, and states the module mode (in detect, a refused token is only logged). The check changes nothing: no counter is raised, no token is marked used, no event is written, and the token is neither stored nor echoed.
Settings reference
Module settings
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Mobile attestation mode (attestation.mode) | Whether failures refuse or only log. | empty (same as API protection) | detect, block, empty | detect wins over the application's block |
Paths that need attestation (attestation.paths) | API paths only the genuine app may call. | none (off) | path list | all |
Methods (attestation.methods) | Methods that need a token on those paths. | none (every method) | uppercase methods | all |
Token header (attestation.header) | The header that carries the token. | X-App-Attestation | header name | all |
Call without a token (attestation.on_missing) | What happens to a call without the header. | refuse | refuse, log | refuses only in block mode |
Verifier
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
name | Identifies the verifier. | none (required) | lowercase letters, digits, dashes | all |
platform | The token type. | none (required) | play_integrity, app_attest, jwt | all |
package_names | Accepted Android package names. | none | list | play_integrity |
certificate_digests | SHA-256 of the app signing certificate. | none | base64 or hex | play_integrity |
device_verdicts | Required device integrity; any one of them. | MEETS_DEVICE_INTEGRITY | MEETS_BASIC_INTEGRITY, MEETS_DEVICE_INTEGRITY, MEETS_STRONG_INTEGRITY, MEETS_VIRTUAL_INTEGRITY | play_integrity |
app_verdict | Required app recognition. | none | PLAY_RECOGNIZED, UNRECOGNIZED_VERSION, any | play_integrity |
licensed | Requires a Play licence. | false | true, false | play_integrity |
team_id, bundle_ids | Apple team and bundle IDs. | none | list | app_attest |
environment | Apple environment. | none | production, development | app_attest |
key_set, issuer, audience | The JWKS file (stored with the version), issuer and audience. | none | file, URL, text | jwt |
algorithms, claims | Accepted algorithms and required claims. | none | algorithm list; up to 16 claims | jwt |
binding | How the token is tied to the call. | none | none, request_hash, challenge | all |
max_age | Oldest token accepted. | 5m | 10s to 1h | play_integrity, jwt |
single_use | Refuses a token seen again as a replay. | true | true, false | play_integrity, jwt |
Rules
| Rule | Meaning |
|---|---|
attest.missing | No header. |
attest.invalid | The token does not decrypt, has a bad signature or chain, is malformed, or keys are missing. |
attest.expired | The token or challenge is too old. |
attest.binding | The request hash or challenge does not fit. |
attest.app | Package, bundle, certificate digest, app verdict, licence, issuer, audience or claims do not match. |
attest.device | The device verdict is below the required one. |
attest.counter | The App Attest counter did not grow. |
attest.unknown_key | No registration for the key. |
attest.replay | A single-use token was seen again. |
Each event names the header and the decoded field that failed.
Limits
| Limit | Value |
|---|---|
| Verifiers per application | 8 |
| Entries in a verifier list | 32 |
| Token size | 16 KiB |
| App Attest assertion | 4 KiB |
| Attestation object | 64 KiB (CBOR nested at most 8 deep) |
| Certificate chain | 4 |
| Used tokens remembered per node | 200,000 |
| Registered keys cached per node | 100,000 (re-read after a minute) |
| Registrations | 10 per minute per client address; 1,000,000 keys per application |
| Unused registered keys | removed after 180 days |
| Device list page | up to 500 |
Replay protection is per node: between nodes, one replayed token can pass on a second node before it learns of the first use.
Troubleshooting
Every Android call is refused as attest.invalid
- Cause: the Play Integrity keys are not stored for that verifier.
- Check: the event message names the missing key.
waap api attest keys -app shop. - Fix: store both keys.
Calls fail with attest.unknown_key after a revoke
- Cause: the device was revoked or never registered.
- Fix: the app registers again.