Download the release bundle from Download Edge-Native Defender. New to Edge-Native Defender? Start with Edge-Native Defender overview.
Preview. Defender for Akamai is in preview: read Known limits before you protect production traffic with it.
At a glance
| Deployment | An Akamai EdgeWorker on your property, running in every Akamai edge server that serves your hostname, and a small Akamai Functions app beside it. One command installs both; you add two rules to your property. |
| Added latency | About 35 ms at the median, end to end (request and response), in our tests through Akamai. Defender's own work is about 2 ms of that; the rest is Akamai routing the request through the EdgeWorker and on to your origin. |
| Cost | Billed by Akamai under your contract: one EdgeWorker event per protected request, and a small number of Akamai Functions invocations. Nothing from Cequence for the infrastructure. |
| If something fails | No request waits on Cequence. If Cequence is unreachable, Defender keeps enforcing the last policies it received. |
| Upgrades |
defenderctl-akamai upgrade uploads and activates a new EdgeWorker version. Roll back by activating the previous version in Akamai Control Center. |
Deployment architecture
Defender runs as an EdgeWorker on your own Akamai property, in the edge server that receives each request. Allowed requests go on to your property's own origin, exactly as they do today. An Akamai Functions app in your account keeps your policies current and sends analytics to your Cequence tenant.
What stays the same. Your origin, your property's origin rules and your caching do not change. Defender forwards each allowed request to your own hostname, and your property serves it as it would without Defender. There is no second hostname, relay or allow-list to set up.
What Defender does with a request. Each Defender instance holds your policy set in memory, so a decision needs no network call. A blocked request is answered at the edge and never reaches your origin. An allowed request is forwarded with its method, path, query, headers and body, and your client receives your origin's response unchanged. Defender inspects a copy of the request and response bodies, and never changes what it forwards. Instances check for a new policy set every 10 seconds in the background, without holding any request. Your Akamai Functions app checks your tenant every 15 seconds while the edge is asking, so a policy edit reaches the edge in under a minute, with no redeploy.
What is sent to Cequence. For each request: its headers and URL, the response status and headers, the client address, the decision when a policy acted, and the inspected body copies. They go to your Akamai Functions app, which masks them with your tenant's Sensitive Data rules before sending them to Cequence. Until those rules have arrived, nothing is sent. Your traffic filters decide whether a request is reported at all. Analytics are sent after your client has its response, in batches.
Installation
Prerequisites
- An Akamai property serving the hostname you want to protect, which you can edit and activate.
- EdgeWorkers on your Akamai contract. Dynamic Compute is recommended, and needed for tenants of about 50 or more policies: ask your Akamai account team to enable it on the contract before you install. Basic Compute suits small tenants.
- An Akamai Functions account.
- An Akamai API client (EdgeGrid) with EdgeWorkers read-write and
Property Manager read, saved in
~/.edgerc. In Akamai Control Center, open Identity & access -> API clients -> Create API client. - The
spinCLI with its Akamai plugin, signed in:spin plugins install akathenspin aka login. - Your tenant's name (such as
acme.1), client ID and client secret. To create them: in your Cequence UI, open General Settings > User Management, click the Clients tab and then Add New Client. The client name you type is the client ID. Turn on Traffic Management, the same client type a managed Defender uses, and click Save. Copy the client secret from the dialog that opens: it is not shown again. - A POSIX shell, curl, tar and Node 20 or later.
1. Verify the bundle and fill in the config
sha256sum -c SHA256SUMS cp defender.conf.example defender.conf
Set these values:
| Key | What it is |
CEQUENCE_TENANT |
your tenant, as its name (acme.1) or its whole domain |
CEQUENCE_CLIENT_ID |
the client ID of the credential we issued you |
AKAMAI_FUNCTIONS_ACCOUNT_ID |
your Akamai Functions account (spin aka info shows it) |
AKAMAI_CONTRACT_ID, AKAMAI_GROUP_ID
|
the contract and group the EdgeWorker is created in |
AKAMAI_HOSTNAME |
the hostname your property serves, such as api.example.com
|
AKAMAI_PROPERTY |
the property's name, so the installer can check its rules (recommended) |
CEQUENCE_NAMESPACE names everything Defender creates and defaults to prod.
AKAMAI_NETWORK is staging until you change it, and
AKAMAI_RESOURCE_TIER defaults to Dynamic Compute. The other optional keys are
described in the Akamai section of the file.
2. Check and install
With your client secret in the environment (it is not read from the file):
export CEQUENCE_CLIENT_SECRET=PUT_YOUR_SECRET_HERE ./bin/defenderctl-akamai preflight ./bin/defenderctl-akamai install
preflight checks your Akamai API client, your Akamai Functions sign-in and
your Cequence credential. install shows what it is about to create, asks
before changing anything, and creates, touching nothing else:
- an Akamai Functions app named
defender-<namespace>, with a scheduled job - an EdgeWorker named
defender-<namespace>, activated onAKAMAI_NETWORK
Your property is never changed by the installer. It writes the two rules
your property needs to defender-akamai-rules.json.
3. Add the two rules to your property
In Property Manager, add both rules from defender-akamai-rules.json under
your property's default rule, in the order given, then activate the property on
staging:
-
Defender edge endpoints -- the path
/__cq/edge/*to your Akamai Functions app. Defender uses it to fetch policies and send analytics. Requests without Defender's token are refused. -
Defender -- runs the EdgeWorker on your hostname. Narrow its paths to
what you want inspected; it never covers
/__cq/edge/*.
Keep defender-akamai-rules.json private: it holds Defender's token.
4. Check it before you go live
- Set
CEQUENCE_DIAGNOSTICS=yesindefender.conf, runinstallagain, then:./bin/defenderctl-akamai verify
It checks that the EdgeWorker is active, that your property carries both
rules, that Defender can fetch its policies through your property, and that
your hostname answers through Defender. If the Defender rule does not cover
/, set AKAMAI_VERIFY_PATH to a path it covers.
2. Send a request that one of your policies blocks, and check it is blocked
while other paths reach your origin. Check your tenant shows the traffic.
If no policy of yours is safe to trigger, add one for the test: in Cequence, create a mitigation policy that matches the request header `test-block` with the value `true` and blocks, then send a few requests with that header to a path the Defender rule covers. The first can pass while the new policy reaches Defender; after that each is 403. Delete the test policy when you are done.
- Set
CEQUENCE_DIAGNOSTICS=noand runinstallagain. - When staging is right, set
AKAMAI_NETWORK=production, runinstall, and activate your property on production.
Upgrades and rollback
With the new bundle unpacked and the same defender.conf and secret:
./bin/defenderctl-akamai upgrade ./bin/defenderctl-akamai verify
upgrade deploys the new Akamai Functions app and uploads and activates a new
EdgeWorker version. If nothing changed, it activates nothing. To roll back,
activate the previous EdgeWorker version in Akamai Control Center: earlier
versions stay on the EdgeWorker.
Defender's token is derived from your client secret. If you rotate the secret,
run install again and update the token in your property's Defender edge
endpoints rule from the new defender-akamai-rules.json.
Performance and sizing
| Added latency, end to end (request and response) | about 35 ms at the median, measured with and without Defender through the same Akamai property |
| Defender's work per request | about 2 ms of CPU at the median |
| A new Defender instance's start | about 30-50 ms of CPU, once per instance |
There is nothing to size: the EdgeWorker runs in every edge server that serves your hostname, and Akamai scales it. Choose the EdgeWorker resource tier for your tenant's size: Basic Compute for small tenants, Dynamic Compute from about 50 policies.
Cost
Cequence charges nothing for the infrastructure. Akamai bills you under your contract for:
- One EdgeWorker event per protected request, at your contract's rate for the resource tier you chose.
- Akamai Functions invocations: one per batch of analytics (about one per 10 to 50 protected requests), and policy refreshes, which your property's cache absorbs.
Narrowing the Defender rule's paths narrows the events you pay for.
Availability
- If Cequence is slow or unreachable, your traffic is unaffected: no request waits on Cequence. Defender keeps enforcing the last policy set it fetched. A new Defender instance that has not yet fetched a policy set forwards requests without policy checks until it can. Analytics for requests made during an outage are not sent later.
-
If your origin cannot be reached, Defender answers
502. - If you need Defender off the path at once, disable the Defender rule in your property and activate it.
- A fresh install blocks nothing until your tenant's first policy publish arrives.
Known limits
-
block,add-headerandchallengepolicies are enforced. Response bodies are never enforced on. - Geo-match policies and JSONPath body conditions are not evaluated at the EdgeWorker.
- Challenges need token issuers that sign with RS256 or ES256, as Descope does.
- Binary request bodies (file uploads, protobuf) are not forwarded byte for byte. Keep upload paths out of the Defender rule.
- OPTIONS requests are not inspected: Akamai does not run the EdgeWorker for them. PUT, PATCH and DELETE are inspected where your property allows them, as it does if your API takes them today.
- On Basic Compute, a tenant of about 50 or more policies can exceed the EdgeWorker's memory on a new instance's first request. Use Dynamic Compute.
- Analytics are best effort: batched and not retried.
If something is wrong
The bundle's README.md has the full troubleshooting reference.
./bin/defenderctl-akamai status shows the app, the EdgeWorker version active
on each network, and the policy set Defender holds.
| Symptom | What to do |
Creating the EdgeWorker is refused: Permission Invalid
|
The resource tier is not enabled on your contract. Ask your Akamai account team for Dynamic Compute. |
install stops: an EdgeWorker of that name exists |
Choose another CEQUENCE_NAMESPACE. |
verify reports a missing rule |
Add the rules from defender-akamai-rules.json and activate the property on the network you are checking. |
/__cq/edge/policy answers 403 with the token |
The token in your property's rule is not current: copy it again from defender-akamai-rules.json. |
| Nothing is enforced | Before your tenant's first policy publish, this is expected. Otherwise run preflight, then check that the Defender rule's paths match your requests. |
If you contact support, include the installer's output. It contains no secret.
Removing it
Remove the two rules from your property and activate it first, then:
./bin/defenderctl-akamai uninstall
This deactivates and deletes the EdgeWorker and removes the Akamai Functions
app. Your property and origin are untouched. Delete
defender-akamai-rules.json: it holds Defender's token.