> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Deploy Tool

> Learn to use the Deploy Tool to quickly upload and customize your Enforcer.

The **Deploy Tool** is HUMAN’s setup assistant for installing, updating, and customizing an Enforcer. It guides you through the required steps, validates your inputs, and deploys the integration without you having to build the configuration manually. If you use a supported Enforcer framework, we highly recommend using the Deploy Tool to manage changes to your Enforcer whenever possible.

> **Note**
>
> The Deploy Tool only works with the latest version of each Enforcer. It does not support downgrades or deployments on older versions.

#### Supported Enforcer frameworks

* [Akamai EdgeWorker](/applications/akamai-edgeworker/v4/installation)
* [AWS Lambda@Edge](/applications/aws-lambdaedge/v4/installation)
* [Azure Front Door](/applications/azure-front-door/installation)
* [Cloudflare Workers](/applications/install-the-cloudflare-enforcer)
* [Fastly VCL](/applications/fastly-vcl/v12/installation)

## Install an Enforcer

The Deploy Tool works together with the Enforcer's `enforcerConfig.json` file, which has important information like your **Application ID** and remote authorization token already filled in, to quickly compile and set up your Enforcer configuration. You can download this file from the **HUMAN Console > Platform Settings > Enforcers**, clicking on the appropriate Enforcer, and clicking **Download configuration file** .

> **Note**
>
> Each Enforcer framework has additional unique prerequisites that may be required while using the Deploy Tool. Refer to your Enforcer's specific documentation for the full list of requirements.

Generally, after you prepare the unique prerequisites for your Enforcer, the installation follows this process:

### 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

#### Additional setup for Windows users

If you're using Windows, you also need to complete additional steps to set up Docker:

1. In your Windows search bar, search for and open **Turn Windows features on or off**.
2. Find the **Windows Hypervisor Platform** feature and click its checkbox to enable it.
3. Click **OK** to save your changes.
4. Open **Windows PowerShell** as an Administrator.
5. Copy and paste in `C:\Windows\System32\wsl.exe --update --web-download`, then hit Enter.

1) Pull the Docker image by running:

```bash
docker pull us-docker.pkg.dev/hmn-registry/docker-public/cdn-enforcer-deploy-tool
```

2. Navigate to the directory where you saved `enforcerConfig.json`.
3. Run the Deploy Tool with the following:

```bash
docker run --rm -v $PWD:/app/local -it us-docker.pkg.dev/hmn-registry/docker-public/cdn-enforcer-deploy-tool
```

#### Script method

1. Navigate to the directory where you created `enforcerConfig.json`.
2. Pull the HUMAN Deploy Tool zip from Google Artifact Registry using:

**`Windows`**

```shell title="Windows"
wget 'https://artifactregistry.googleapis.com/v1/projects/hmn-registry/locations/us/repositories/enforcers-public/files/cdn-enforcer-deploy-tool_win:1.7.1:cdn-enforcer-deploy-tool_win.zip:download?alt=media' -O cdn-enforcer-deploy-tool.zip
```

**`Mac and Linux`**

```shell title="Mac and Linux"
wget 'https://artifactregistry.googleapis.com/v1/projects/hmn-registry/locations/us/repositories/enforcers-public/files/cdn-enforcer-deploy-tool_unix:1.7.1:cdn-enforcer-deploy-tool_unix.zip:download?alt=media' -O cdn-enforcer-deploy-tool.zip
```

3. Unzip `cdn-enforcer-deploy-tool.zip` to the same directory you saved `enforcerConfig.json` in.
4. Navigate to the folder you unzipped and double click the script file to run the Deploy Tool. Depending on your operating system, the folder and script file are named differently:
   * **Windows**: Open the `cdn-enforcer-deploy-tool_win` folder and double click `run.bat`.
   * **Mac or Linux**: Open the `cdn-enforcer-deploy-tool_unix` folder and double click `run.command`.

### Deploy the Enforcer

After you run the Deploy Tool, you'll be prompted with steps to deploy the Enforcer.

1. When prompted, select the appropriate Enforcer framework and hit **Enter.**

```bash
🚀 HUMAN CDN Enforcer Deploy Tool 🚀
? Which platform do you want to deploy to? (Use arrow keys)
  Fastly VCL
❯ Cloudflare Workers
  ...
```

2. Follow the prompts that appear to complete the setup process.
3. After you complete the setup, confirm that the displayed details are correct, then enter `y` to deploy the Enforcer.

## Update an Enforcer version

The Deploy Tool automatically detects if you're using an older version of an Enforcer and prompts you to update to the latest version whenever you attempt to deploy an Enforcer again. To update, simply rerun the Deploy Tool similarly to when you installed it:

1. Run the Deploy Tool using your preferred method:
   #### Docker method
   In the same directory as `enforcerConfig.json`, run the following:
   ```bash
   docker run --rm -v $PWD:/app/local -it us-docker.pkg.dev/hmn-registry/docker-public/cdn-enforcer-deploy-tool
   ```
   #### Script method
   Navigate to the appropriate folder and double click the script file to run the Deploy Tool:
   * **Windows**: Open the `cdn-enforcer-deploy-tool_win` folder and double click `run.bat`.
   * **Mac or Linux**: Open the `cdn-enforcer-deploy-tool_unix` folder and double click `run.command`.

2. When prompted, select the appropriate Enforcer framework and hit **Enter.**

3. Follow the prompts that appear. If you just want to update to the latest version, you can provide the same information as you did when you first installed the Enforcer.

4. After you complete the setup, if an update is available, the Deploy Tool will display the new version and ask you to confirm that you want to deploy. Below is an example of what you might see for the Cloudflare Enforcer. To confirm and update, enter `y`.

```bash {7}
...
ℹ Found 1 existing routes for this worker.
✔ Successfully prepared deployment plan.
Before deployment, please ensure these details are correct:

* HUMAN Enforcer Type: Cloudflare Workers
* HUMAN Enforcer Version: 6.12.0 → 6.15.0 # The new version that the Deploy Tool will upgrade the Enforcer to
* HUMAN Application ID: PX1234567
...
```

## Customize an Enforcer

Each Enforcer framework has its own **configuration options** that you can use to customize the Enforcer's behavior. These configuration options are typically parameters that you can add directly to the `enforcerConfig.json` file or custom functions that need to be uploaded as separate files. You can use the Deploy Tool in both cases to deploy these changes to the Enforcer.

> **Note**
>
> Refer to your Enforcer's specific **configuration** documentation for a full list of supported customizations.

#### Add customizations with enforcerConfig.json

1. Add your customizations to the `enforcerConfig.json` file.

2. Run the Deploy Tool using your preferred method:
   #### Docker method
   In the same directory as `enforcerConfig.json`, run the following:
   ```bash
   docker run --rm -v $PWD:/app/local -it us-docker.pkg.dev/hmn-registry/docker-public/cdn-enforcer-deploy-tool
   ```
   #### Script method
   Navigate to the appropriate folder and double click the script file to run the Deploy Tool:
   * **Windows**: Open the `cdn-enforcer-deploy-tool_win` folder and double click `run.bat`.
   * **Mac or Linux**: Open the `cdn-enforcer-deploy-tool_unix` folder and double click `run.command`.

3. When prompted, select the appropriate Enforcer framework and hit **Enter.**

4. Follow the prompts that appear. When you're asked whether to use HUMAN's default configuration or provide your own custom one, select **Default** and hit **Enter.** Below is an example of what you might see for the Cloudflare Enforcer.

```bash
...
✔ Successfully downloaded sample project repository.
? Would you like to deploy a custom worker or use HUMAN's default bundle? (Use arrow keys)
❯ Default
  Custom
```

5. Follow the prompts that appear to complete the setup process.
6. After you complete the setup, confirm that the displayed details are correct, then enter `y` to deploy the Enforcer.

#### Add customizations with custom files

1. Ensure your custom file or files are saved in the same directory as your `enforcerConfig.json` file.

2. Run the Deploy Tool using your preferred method:
   #### Docker method
   In the same directory as `enforcerConfig.json`, run the following:
   ```bash
   docker run --rm -v $PWD:/app/local -it us-docker.pkg.dev/hmn-registry/docker-public/cdn-enforcer-deploy-tool
   ```
   #### Script method
   Navigate to the appropriate folder and double click the script file to run the Deploy Tool:
   * **Windows**: Open the `cdn-enforcer-deploy-tool_win` folder and double click `run.bat`.
   * **Mac or Linux**: Open the `cdn-enforcer-deploy-tool_unix` folder and double click `run.command`.

3. When prompted, select the appropriate Enforcer framework and hit **Enter.**

4. Follow the prompts that appear. When you're asked whether to use HUMAN's default configuration or provide your own custom one, select **Custom** and hit **Enter.** Below is an example of what you might see for the Cloudflare Enforcer.

```bash
...
✔ Successfully downloaded sample project repository.
? Would you like to deploy a custom worker or use HUMAN's default bundle? (Use arrow keys)
  Default
❯ Custom
```

5. Select your custom file or files and hit **Enter.** The accepted file types vary depending on the Enforcer framework and are specified by the Deploy Tool. For example, the Cloudflare Enforcer accepts an `index.js` file.

> **Note**
>
> The Deploy Tool checks whether the custom files use valid function names and uses a version number that matches the latest Enforcer version. This means that you cannot upload a blank file and you must match the latest Enforcer version, which you can check while [updating the Enforcer](#update-an-enforcer-version).

6. Follow the rest of the prompts that appear to complete the deployment process.