Shield
Shield is the part of the Temps proxy that decides, for every request, whether to let it through, record it, block it or make the visitor solve a proof-of-work challenge. It looks at the client's address, its TLS fingerprint and what the request itself contains, and it acts per environment according to a mode.
Shield is in Temps from v0.1.0-beta.58 and this page describes v0.1.0-beta.62. Attack Mode is now one of Shield's four modes (attack). In the console, the Attack Mode card in the project's security settings became the Shield card, and the console calls a project a "service". The feature maturity registry still has one entry for it, "Attack-mode CAPTCHA", labelled Experimental.
By default Shield only records what it would have done (log mode). Nothing is blocked or challenged until you choose a mode that acts.
Modes
| Mode | What Shield does |
|---|---|
off | Nothing. Every request passes and nothing is recorded. |
log (the default) | Records the verdict with the request. Nothing is blocked or challenged. |
selective | A block verdict gets a 403. A challenge verdict gets a challenge. Everyone else passes. |
attack | As selective, and every other visitor is challenged too. |
A project has a mode and each environment can set its own. An environment with no mode of its own follows the project. In the environment's Shield tab, a summary shows what selective would have blocked or challenged in the last hour, day or week, so you can read it in log mode before you turn enforcement on.
What produces a verdict
Each request gets one verdict, the strictest of what these sources say: pass, log, challenge or block.
| Source | Verdict |
|---|---|
| Reputation lists. Temps downloads public lists from their publishers every hour: Spamhaus DROP, Feodo Tracker and the Team Cymru full bogons. | Spamhaus DROP and Feodo Tracker: block. Full bogons: log. |
| DShield block list. Off by default, because its licence (CC BY-NC-SA) does not allow commercial use. | challenge |
| Entries you add for an address, a range or a JA4 fingerprint (see Entries). | The verdict you set: allow, log, challenge or block. |
| Exploit signatures. Well-known attack requests, matched on the path, query, method and some headers, including double-encoded ones. | block. A probe for leaked files such as /.env is only log, unless the address is already listed with challenge or worse, which makes it block. |
A browser that is not one. A User-Agent that says it is a browser, sent by a client whose TLS fingerprint belongs to a known tool (curl, openssl s_client, Python) or that offers no ALPN. | challenge, never block. A browser behind a TLS-inspecting middlebox can look like this. |
netwatch. Where the host monitor netwatch runs and TEMPS_NETWATCH is set to 1 or true, Shield reads its bans. | block |
| Approved learned proposals (see Fleet learning). | block or challenge |
An allow entry passes the client before anything else in its request is looked at. Beta.62 has no console or API setting to turn off an individual reputation list. To let an address through, add an allow entry for it with the API (see Entries), or give a client you control a bypass token.
JA4 is a fingerprint of the TLS ClientHello that identifies the client software. Temps computes it itself for clients that connect directly, and takes it from the CDN when Cloudflare or Bunny forwards one.
What happens to a request
Shield runs after the project's edge rules, the IP access list and rate limits, and before a password wall. A request that an IP deny rule or a spent rate limit already answered is not a Shield decision. See Request flow.
In selective and attack mode, for a request whose verdict is block or challenge (or any request in attack mode):
- A valid bypass token lets it through, whatever the verdict.
- A
blockverdict gets a403and nothing else is checked. Exempt paths do not rescue a blocked request. - A path on the environment's exempt paths list is never challenged.
- A visitor who already holds a valid clearance is let through.
- A request from a verified crawler is let through (see below).
- Otherwise the visitor is challenged. What they get depends on the request:
| Request | Response |
|---|---|
A page load: GET or HEAD that accepts text/html | 403 with the challenge page. |
Anything else (an API call, a POST, an image) | 429 with a Retry-After header and a problem body. Scripts and API clients cannot solve a challenge. |
| A page load over plain HTTP | 426 Upgrade Required. The clearance cookie is Secure, so it cannot be set over HTTP. |
| The challenge cannot be issued | 503 with Retry-After: 5. |
Verified crawlers. A request that claims to be Googlebot, Bingbot, Applebot, YandexBot, Baiduspider, Amazonbot or PetalBot is not challenged if the address checks out: its reverse DNS name must end in a domain the operator publishes, and that name must resolve back to the same address. The result is cached for a day, and a check that takes more than 2 seconds counts as "not verified". A blocked address is still blocked.
Shield never challenges its own verify and solver paths or ACME HTTP-01 validation.
Worker nodes with their own public ingress make the same decision as the control plane.
Challenges
The challenge is a proof of work the visitor's browser solves in a few seconds with no third-party CAPTCHA service. Compared with the older attack mode, in v0.1.0-beta.62:
- The server signs the challenge, and nothing is stored in the database. It binds the environment, the visitor and the difficulty, and is valid for 5 minutes.
- The visitor is identified from the connection, never from what the page sends: the first part of the address (the /24 of an IPv4 address or the /64 of an IPv6 one), the User-Agent and the JA4 fingerprint (or the way the client reached the proxy, if there is none).
- Solving it earns a clearance cookie,
__Host-temps_clr_<environment id>, which isSecureandHttpOnly, valid for 24 hours and bound to that environment and visitor. Each clearance can make up to 3000 requests per hour on each ingress, page assets included. A visitor who uses them up is challenged again. - Difficulty depends on why the visitor is challenged: 18 leading zero bits when a list or signal asked for it, 20 in
attackmode or after a spent clearance, 22 after three failed attempts in an hour. During a spike in traffic or errors the proxy adds up to 4 bits, and never goes past 24.
The challenge page posts its solution to /api/_temps/captcha/verify on your own host.
Set the mode and exempt paths
In the console:
- Project mode: open the project, then Settings then Security, and choose a mode in the Shield card.
- Environment mode and exempt paths: open the project's Settings then Environments, choose the environment, and use Shield mode and the exempt paths field in its Security section. Choose Inherit to follow the project.
Exempt paths are paths Shield never challenges, one per line, at most 64. /api/* exempts /api and everything under /api/. Any other value must start with / and is one exact path. A path with a . or .. segment, even encoded, is never exempt, so /api/../admin is not.
With the API:
# Project mode: off, log, selective or attack
curl -X POST "https://your-temps-instance.com/api/projects/{project_id}/settings" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"shield_mode": "selective"}'
# One environment: its own mode and exempt paths
curl -X PUT "https://your-temps-instance.com/api/projects/{project_id}/environments/{environment_id}/settings" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"shield_mode": "attack", "shield_exempt_paths": ["/api/*", "/healthz"]}'
# Make the environment follow the project again
curl -X PUT "https://your-temps-instance.com/api/projects/{project_id}/environments/{environment_id}/settings" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"shield_mode": null}'
The older attack_mode field still works: true sets the mode to attack, and false sets it back to log (not off). When a request sends both, shield_mode wins. The CLI has no Shield command. temps projects settings --attack-mode and --no-attack-mode use the older field, so they switch between attack and log.
Entries
An entry is a rule for one address, one range or one JA4 fingerprint, with a verdict. Entries act in selective and attack mode.
| Verdict | Meaning |
|---|---|
allow | Always passes, whatever else matches |
log | Recorded, never acted on |
challenge | Challenged |
block | Refused with a 403 |
- Project entries apply to every environment of the project. They are in the project's Settings then Security, under Shield entries.
- Platform entries apply to every project. Changing them needs the
settings:writepermission. - An entry can have a note of up to 500 characters and an expiry. A range cannot be wider than /8 for IPv4 or /16 for IPv6. Each project, and the platform, can hold 500 entries.
- A change reaches every ingress with the next snapshot, usually within minutes.
- The console offers
challengeandlogfor address entries, and all four verdicts for fingerprints. The API accepts all four for addresses too. - To block an address in every mode, use IP access instead. Its block rules act in
offandlogmode too. Its allow rules are not enforced in beta.62.
An entry names exactly one of network and ja4, and can carry a note and an expires_at:
# Let a partner's range through Shield for this project, until the end of the year
curl -X POST "https://your-temps-instance.com/api/projects/{project_id}/shield/entries" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"network": "203.0.113.0/24", "verdict": "allow", "note": "Partner webhooks", "expires_at": "2026-12-31T23:59:59Z"}'
The platform's entries use /api/settings/shield/entries. GET lists entries, PUT .../entries/{entry_id} changes the verdict, note and expiry, and DELETE removes one.
Bypass tokens
A bypass token lets a monitor, a CI job or an API client through without a challenge, even in attack mode. The client sends it in the X-Temps-Shield-Token header, and a request that carries a valid one is never challenged or blocked by Shield. IP access rules still apply.
curl https://app.example.com/health -H "X-Temps-Shield-Token: tst_..."
- Create one in the environment's Shield tab under Bypass tokens. Name it for what uses it. Turn on Valid in every environment to make it work in the whole project.
- The token is shown once. Only its hash is stored. Anyone who has it skips Shield, so keep it out of browsers and public repositories.
- Revoke it from the same list. It stops working on every ingress once they reload their routes, which the revoke triggers.
- A project can hold 100 active tokens.
See what Shield decided
The environment's Shield tab shows:
- Summary: the environment's mode and where it is set, requests by verdict and by source list, what
selectivewould have blocked or challenged, and challenge solve times. - Recent events: every request Shield had a verdict for, and the challenges it served, solved and refused. Events keep the address, host, path and User-Agent, cut to a fixed length. They are kept 7 days in PostgreSQL and 30 days when ClickHouse stores them.
- Address lookup: enter an address, a JA4 fingerprint or both to see what Shield would decide for this environment, and why, for example
spamhaus_drop (185.93.89.0/24). - Bypass tokens and a link to the project's entries.
The project's security settings also show how many requests each environment would have blocked or challenged in selective mode over the last 24 hours.
Fleet learning
Shield can propose rules from what it saw across all services of your instance. Nothing leaves your server, and nothing applies until an instance admin approves it.
| Evidence in the last hour | Proposed | For |
|---|---|---|
| An exploit hit from an address | Block the address | 7 days |
| Three or more failed or abandoned challenges from an address | Challenge the address | 24 hours |
| One JA4 fingerprint with exploit hits from 20 or more addresses, and not a known browser's | Challenge the fingerprint | 24 hours |
An admin reviews them in Settings then Shield proposals, and can approve a proposal (it then applies on every ingress within about a minute) or reject it (it is not proposed again until it expires). Only the address or fingerprint and a short reason are stored, never a path or a host.
The switch is under Settings then Security, Learn from attacks across all services. It is on by default. Off, Shield proposes nothing and acts only on the lists and your entries.
Permissions and audit
| Action | Permission |
|---|---|
| View the summary, events, lookup, tokens and project entries | projects:read |
| Create or revoke bypass tokens, change project entries | projects:write |
| View platform settings, entries and proposals | settings:read |
| Change platform settings and entries, approve or reject proposals | settings:write |
These actions are recorded in the audit log: SHIELD_BYPASS_TOKEN_CREATED, SHIELD_BYPASS_TOKEN_REVOKED, SHIELD_ENTRY_CREATED, SHIELD_ENTRY_UPDATED, SHIELD_ENTRY_DELETED, SHIELD_SETTINGS_UPDATED, SHIELD_PROPOSAL_APPROVED and SHIELD_PROPOSAL_REJECTED. A change to a project's or environment's mode appears in the settings change for that project or environment.
Limits and what leaves your server
- Outbound downloads. Every hour a control plane fetches each enabled list from its publisher (
spamhaus.org,team-cymru.org,abuse.ch, anddshield.orgif enabled). The requests carry no data about your apps or visitors. A list that fails to parse is refused and the last good copy is kept, and a list older than its limit (30 days, 7 for Feodo, 3 for DShield) only logs. A server that cannot reach those hosts keeps working with the lists it has. - Not DDoS protection. Shield works at the HTTP layer on your own server. It does not absorb volumetric network floods. See Attack Mode and Data Ownership and Privacy.
- Shield and IP access are different. IP access rules act in every mode and first. Shield entries act only in
selectiveandattackmode. - Start in
logmode. Read the "would have" counts for a few days, addallowentries or bypass tokens for your monitors and partners, then move one environment toselective.