Install the Akamai EdgeWorker Enforcer v4
If your organization uses Akamai, you can use HUMAN’s Akamai EdgeWorker Enforcer to protect against malicious behavior. The Enforcer is installed using an Akamai EdgeWorker and deployed to your content delivery network (CDN). The Enforcer dictates how traffic should be handled per your organization’s standards.
You can learn how to install the Akamai EdgeWorker Enforcer with this article.
This process uses the Deploy Tool, HUMAN’s recommended method for installing and updating the Enforcer. If you prefer a manual method, see our manual installation article.
Prerequisites
- An Akamai account with editor access to the following:
- NetStorage services
- EdgeWorkers
- Property Manager
Sometimes, you may encounter a 500 error when the EdgeWorker initialization exceeds the CPU limit for your resource tier. For example, you may see response headers such as:
This error comes from Akamai EdgeWorker’s runtime limits and not HUMAN’s service. To resolve this, we recommend moving to a higher Akamai EdgeWorker resource tier.
- Docker or Script, depending on your preferred method to run the deploy tool.
- For Docker, see how to install Docker Desktop with their documentation.
- For Script, install the following:
- An Enforcer configuration file,
enforcerConfig.json, which you can download from the Platform Settings > Enforcers, clicking on the appropriate Enforcer, and clicking Download configuration file . This file has the basic information for Enforcer functionality, such as your Application ID and remote authorization token, already filled in. Be sure to save it in a directory you’ll remember, like/deploy.
Akamai setup
The Akamai setup consists of three parts. Be sure to complete each part in order.
- Create an API client
- If you do not have one already, create a NetStorage storage group
- If you do not have one already, create a NetStorage upload account
We recommend letting HUMAN set up your Akamai EdgeWorker, Property Manager, and NetStorage due to the manual nature of the process. This requires creating an API token so that the HUMAN CDN Enforcer Deploy Tool can access your Akamai environment.
Create an API client
The deploy tool must send API requests to Akamai to configure the EdgeWorker and the Property Manager. To send these requests, you must create a personal API client.
- Log in to the Akamai Control Center.
- From the main menu, select Account Admin > Identity and Access.
- Under Users and API Clients, click Create API client.
- Click Advanced.
- Update the following fields as specified below. Otherwise, you can complete fields as appropriate for your organization or leave them as their defaults.
- For the APIs selection, click Select APIs.
- Grant READ-WRITE access to the following:
- Property Manager (PAPI)
- EdgeWorkers
- NetStorage
- Click Submit
- For the Group selection, choose Same group as <user account name>.
- Click Create API Client.
- Save the generated API client credentials, including the host, client token, client secret, and access token, in a secure location. The deploy tool uses these credentials later on.
This will be the only time you’ll see your credentials, so be sure to save them before closing the page.
Create a NetStorage storage group
These steps are optional and only necessary if you do not already have a storage group. If you do, you can move on to Upload accounts.
- From your Akamai account’s main menu, navigate to Origin Services > NetStorage > Storage Groups.
- Select the + to Create a new storage group.
- Update the following fields as specified below. If not specified, you can complete fields as appropriate for your organization or leave them as their defaults.
- In Step 1, Basic Information:
- Set the storage group name as human-storage-group
- Set the domain name prefix as human-storage-group
- In Step 4, Upload Directories:
- Click Create a new upload directory
- Keep the default values and click Add. Then, click Next.
- In Step 6, Summary, review your settings and click Create.
- In Step 1, Basic Information:
The storage group will start to propagate, which may take up to two hours. Meanwhile, you can move on to creating an upload account.
Create a NetStorage upload account
These steps are optional and only necessary if you have not uploaded accounts yet. If you have, you can move on to Deploy the Enforcer.
- Navigate to Origin Services > NetStorage > Upload Accounts.
- Select the + to create a new upload account.
- Update the following fields as specified below. Otherwise, you can complete fields as appropriate for your organization or leave them as their defaults.
- In Step 1, Basic Information:
- Enter human-upload-account as the Upload Account ID.
- Provide a name and contact information for your account.
- In Step 2, Access Methods:
- Click the NetStorage HTTP CMS API, then click on the link to create a new HTTP API key.
- Click the File Manager tab, then enable File Manager access.
- In Step 3, Upload Directory Association, select the group you made in Create a storage group, human-storage-group.
- In Step 5, Summary, review your settings and click Create.
- In Step 1, Basic Information:
- Navigate to NetStorage > Storage Groups. Select the group you created, human-storage-group. Then, select File Manager.
- In File Manager Access, locate your user account. Then, locate the human-upload-account upload account and click the checkbox to select it.
- Click Save to apply changes.
The upload account will start to propagate, which may take up to two hours. Afterwards, you can move on to running the Deploy Tool.
Run the Deploy Tool
First, download and run the Deploy Tool. You can do this by either pulling a Docker image or running a script.
Docker method
Script method
Additional setup for Windows users
If you’re using Windows, you also need to complete additional steps to set up Docker:
- In your Windows search bar, search for and open Turn Windows features on or off.
- Find the Windows Hypervisor Platform feature and click its checkbox to enable it.
- Click OK to save your changes.
- Open Windows PowerShell as an Administrator.
- Copy and paste in
C:\Windows\System32\wsl.exe --update --web-download, then hit Enter.
- Pull the Docker image by running:
- Navigate to the directory where you saved
enforcerConfig.json. - Run the Deploy Tool with the following:
Deploy the Enforcer
After you run the Deploy Tool, you’ll be prompted with steps to deploy the Enforcer.
- When prompted, select Akamai EdgeWorker and hit Enter.
- Follow the prompts that appear to complete the setup process.
- After you complete the setup, confirm that the displayed details are correct, then enter
yto deploy the Enforcer.