본문으로 건너뛰기

Installation and Initialization

Overview

BotManager-Akamai-Agent is designed to easily apply BotManager's detection capabilities using Akamai's EdgeWorker platform without modifying the Origin server.

BotManager is a solution that detects bots and macro users through various analysis techniques (header analysis, behavior analysis, foreign IP blocking, access statistics, etc.). This protects web services and safely manages data from threats of malicious users and automated bots.

What is Akamai EdgeWorker?

Akamai EdgeWorker is a serverless computing platform that can execute JavaScript on Akamai CDN.

Key Features:

  • Supports fast response speed and large-scale traffic processing.
  • Can process directly at CDN, reducing Origin server load.
  • Provides high stability and scalability through global network.

For more information about Akamai EdgeWorker, refer to Akamai Official Documentation.

Installation Methods

1. Create EdgeWorker

  1. Navigate to EdgeWorkers menu in Akamai management console.
  2. Click Create EdgeWorker ID and select Dynamic Compute.
  3. EdgeWorker is created, so click the ID of the created worker.
  4. Click Create Version to create an EdgeWorker version.
  5. Download and upload the latest version of BotManager-Akamai-Agent.
  6. Return to EdgeWorker details screen and click Activate Version.
  7. Activate in Staging and Production environments to deploy.
  8. Check deployment status.

2. Configure Property Variables

Akamai Property is required to run EdgeWorkers. If you don't have an Akamai Property yet, you must create one by referring to Property Creation Guide.

  1. Navigate to Properties menu in Akamai management console.
  2. Select the Property in service.
  3. Select the currently applied Version and click Edit New Version.
  4. Click +Variables and add required variables according to the table below.

Select a domain and check the values to get the correct Value in the table below.

VariableRequiredValueDescription
PMUSER_DEFAULT_HOST (hidden)Yes%(AK_HOST)Host to send when EdgeWorker status is Failure
PMUSER_TRUE_CLIENT_IPYes(no value)Used to identify client IP
PMUSER_BM_SERVER_HOSTNAMEYeshttps://botmanager.stclab.comBotManager detection server address
PMUSER_BM_SERVERURLYes/api/v1/macroBotManager detection pathname
PMUSER_BM_TENANTIDYes{tenantId}Customer tenantId
PMUSER_BM_DOMAINNAMEYes{domainName}Selected customer domainName
PMUSER_BM_PROTECTION_SERVERURLYeshttps://cdn-botmanager.stclab.comAddress to redirect when determined to be bot
PMUSER_BM_SERVER_TIMEOUTNo3000Timeout to BotManager detection server
PMUSER_BM_BYPASSNofalseFlag to disable BotManager EW operation

3. Configure Rules

Properties must be added to run EdgeWorker. Create 3 Rules for BotManager-Akamai-Agent:

  1. BotManager EdgeWorker
  2. BotManager Verify Origin
  3. EdgeWorker Retry

BotManager EdgeWorker Rule

BotManager EdgeWorker processes detection requests for specific paths.

Rules:

  1. Select +Rules from Property Configuration Settings.
  2. Select Blank Rule Template and save as BotManager EdgeWorker.

Path Application:

Partial Application:

  1. Select +Match from Criteria.
  2. IF: Path matches one of /login.
  3. If additional paths are needed for detection, select +Match
  4. Change Match All in Criteria to Match Any
  5. IF: Path matches one of /logout.

Full Application:

  1. Select +Match from Criteria.
  2. IF: Path matches one of /*.
  3. Select +Match to add file extensions to exclude
  4. Change Match All in Criteria to Match All
  5. IF: File Extension is not one of static resource select.

Behaviors:

  1. Select +Behavior from Behaviors
  2. Select Standard property behavior
  3. In Add a Behavior for this Rule modal, select Set Variable then select Insert Behavior
  4. Set Variable:
    • Variable: PMUSER_TRUE_CLIENT_IP.
    • Expression: {{builtin.AK_CLIENT_REAL_IP}}.
  5. Select +Behavior from Behaviors
  6. Select Standard property behavior
  7. In Add a Behavior for this Rule modal, select EdgeWorkers then select Insert Behavior
  8. EdgeWorkers:
    • Enable: On.
    • Identifier: Select the created EdgeWorker ID.

BotManager Verify Origin Rule

This Rule sends data to the detection server. EdgeWorkers cannot make third-party HTTP requests, so some rules must be configured to allow external requests.

Rules:

  1. Select +Rules from Property Configuration Settings.
  2. Select Blank Rule Template and save as BotManager Verify Origin.

Criteria:

  1. Select +Match from Criteria.
  2. IF: Path matches one of /api/v1/macro/detect.

Behaviors:

  1. Select +Behavior from Behaviors
  2. Select Standard property behavior
  3. In Add a Behavior for this Rule modal, select Origin Server then select Insert Behavior
  4. Origin Server:
    • Origin Type: Your Origin.
    • Origin Server Hostname: botmanager.stclab.com.
    • True Client IP Header: Yes (True-Client-IP).

EdgeWorker Retry Rule

Processes requests through an alternate path when EdgeWorkers execution fails.

Rules:

  1. Select +Rules from Property Configuration Settings.
  2. Select Blank Rule Template and save as EdgeWorker Retry.

Criteria:

  1. Select +Match from Criteria.
  2. IF: EdgeWorkers Execution Status is Failure.

Behaviors:

  1. Select +Behavior from Behaviors
  2. Select Standard property behavior
  3. In Add a Behavior for this Rule modal, select Site Failover then select Insert Behavior
  4. Site Failover:
    • Alternate Hostname: {{user.PMUSER_DEFAULT_HOST}}.

4. Activate

  1. Activate in Staging environment:
    • Click Activate v1 on Staging and confirm.
  2. Activate in Production environment:
    • Click Activate v1 on Production and confirm.

Installation Complete!

BotManager-Akamai-Agent has been successfully installed. Check deployment status and settings in the console.