The legacy shared API key option requires anonymous REST clients to send a secret value in a request header. It is in Aegisify WAF → API & Application → Legacy API Key and Thresholds (Pro).
How it works
- Tick Require the legacy shared API key for unauthenticated REST requests.
- Choose a Header name. The default is
x-aegis-key. - Enter a value in Set a new key. The WAF stores only a SHA-256 hash of the key, never the key itself. Leave the field blank later to keep the current key; use Remove the saved legacy key hash to clear it.
- Save.
After that, every REST request from a visitor who is not logged in must include the header with the exact key. Requests with a missing or wrong key are blocked with HTTP 403 and logged with the reason api_key.
When it fits
- A headless or app-only site where every legitimate anonymous REST client is your own application.
- A private API used by a known partner.
When it does not fit
Public sites where plugins call the REST API from visitors’ browsers (forms, search, store blocks). Those browsers will not send your key, so those features break. Add those routes to the REST route allowlist or do not use this option.
Security notes
- A key embedded in public JavaScript is not secret. Only use this for server-side or native-app clients.
- Rotate the key if it may have leaked.
- For stronger identity controls, Pro also offers JWT validation and per-route Enterprise API key controls in the Identity and Token Validation section.
Related: Enable REST API protection, CORS allowlist.
