# Installation and Configuration

### Prerequisites

To successfully integrate using Netacea, please ensure you have:

1. A Fastly version or 1.2.131+ or higher.
2. Access to the relevant API keys and log shipping endpoints in the [Netacea portal](https://docs.netacea.com/netacea-plugin-information/accessing-your-integration-settings).
3. [Monitoring ](https://docs.netacea.com/netacea-plugin-information/fastly/monitoring-configuration)has been configured.

Customers will also need to open a support ticket with Fastly to enable POST within their environment. We need to ensure that there are 2 pragmas enabled on your Fastly account that are not enabled by default.

Required Pragmas:

```
Pragma optional_param fix_unsent_body_drain true;
Pragma optional_param no_body_if_bereq_is_get_or_head true;
```

To enable the Pragmas raise a support ticket with [Fastly Support](https://support.fastly.com).

### Implementation Steps

* Log in to the Fastly web interface.
* From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
* Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.

All configuration changes below will be made to the newly cloned version.

{% hint style="info" %}
Make a note of the currently active version should you need to roll back in the future.
{% endhint %}

### Host

To allow the Netacea VCL to make calls to the Protector API 2 new hosts must be configured with Netacea's details, to be called in the [VCL snippets](#vcl-snippets).

* Click the Origins link. The Origins page appears.
* Click the "Create a Host" button. The Host field appears.

Populate a new host with the following URL and click "Add":

```
mitigations-lbr.netacea.net
```

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-b7c4ea80005bb4ee1bea3868966b361aab551e4a%2FMitSvc2.PNG?alt=media" alt=""><figcaption></figcaption></figure>

Edit the new host by clicking the pencil icon and change the name to:

```
MitSvc
```

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-ebf7b118465ac7bef8c82bb7bbd51f4b245fdcf3%2FMitSvc.PNG?alt=media" alt=""><figcaption></figcaption></figure>

In the Override host field, enter the same URL as the original host.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-7275cea7605b5ffa73dd1f752c9b97abd22a6928%2FScreenshot%202025-04-02%20161507.png?alt=media" alt=""><figcaption></figcaption></figure>

Repeat the process, populate the new host with the following URL and click "Add" :

```
assets.ntcacdn.net
```

Edit the new host by clicking the pencil icon and change the name to:

```
CaptchaAssets
```

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-49a8907b485611ce27805cb9722cd40221b0e63b%2Fimage%20(72).png?alt=media" alt=""><figcaption></figcaption></figure>

### VCL Snippets

For Netacea to trigger and offer protection, the solution needs to be added to the Fastly environment in the form of a custom VCL.

The Netacea VCL is divided into 7 key snippets, INIT, DELIVER, RECV, ERROR, RECV\_CONFIGURE, PASS and MISS. Each needs to be added to the VCL Snippets configuration within Fastly.

{% hint style="info" %}
Netacea will provide the VCL separately.
{% endhint %}

**INIT:**

* Navigate to VCL snippets within Fastly.
* Click the "Create snippet" button.
* Give the snippet a suitable name, such as Netacea\_INIT
* Set the type to "init"

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-1ea5a795993c72beb810dc8aa93f9b8ae91b663f%2Fimage%20(1)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* Paste the INIT code into the VCL
* On line 4 - 24 you will find a set fields unique to each deployment to define, set integration\_type to the suitable mode.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-5b28e67307423fa52a04b5e02bdfdf56d56508e7%2Fimage%20(74).png?alt=media" alt=""><figcaption></figcaption></figure>

**Required Fields**

<table data-full-width="true"><thead><tr><th width="338">Field</th><th>Value</th></tr></thead><tbody><tr><td>integration_type</td><td>fastly</td></tr><tr><td>integration_version</td><td>&#x3C;Integration Version></td></tr><tr><td>integration_mode</td><td><p>BYPASS - Disables the Netacea integration entirely</p><p>INGEST - Passive mode to allow Netacea to collect and analyse traffic</p><p>MITIGATE - Active mode that will mitigate based on Netacea's Intent Analytics®</p><p>INJECT - Active mode for customers who wish to receive Netacea analytics at their backend and decide actions to take.</p></td></tr><tr><td>api_key</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>secret_key</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>encryption_key</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>cookie_name</td><td><p>A suitable name for your mitigation cookie.</p><p><strong>For added security, do not include Netacea or Mitigation in this name.</strong></p></td></tr><tr><td>captcha_cookie_name</td><td><p>A suitable name for your Captcha tracking cookie.</p><p><strong>For added security, do not include Netacea or Mitigation in this name.</strong></p></td></tr><tr><td>ignore_list</td><td>Comma separated list of subdirectories where mitigation shouldn't be applied. You can set up to 5 subdirectories here. All resources under such directory will be ignored by the integration.<br>Add <code>/media/,/static/</code> by default to ensure full integration coverage whilst not triggering on media content.</td></tr></tbody></table>

**Optional Fields - Can be set to blank unless discussed with the Netacea team**

<table data-full-width="true"><thead><tr><th width="330">Field</th><th>Value</th></tr></thead><tbody><tr><td>real_ip_header_name</td><td><p>Allows users to customise which header is used for the request's IP.</p><p>Leave <strong>blank by</strong> default to use Fastly standard <code>client.IP</code> field.</p></td></tr><tr><td>use_relative_path_captcha_assets</td><td>If set to <code>true</code>, it ensures Captcha is served without references to the Netacea CDN. Otherwise it will embed full URL to Netacea CDN in Captcha HTML.<br>Leave <strong>blank by</strong> default to use HTML sitewide.</td></tr><tr><td>captcha_path</td><td>Allows users to create an endpoint which always serve Captcha HTML. Useful when implementing captcha challenge for mobile apps.<br>Leave <strong>blank by</strong> default to use /ATAverify pathway.</td></tr><tr><td>captcha_header</td><td>Custom header that indicates if the response is Captcha page. Has to be in format of <code>name={{header name}}&#x26;value={{header value}}.</code></td></tr><tr><td>enable_captcha_content_negotiation</td><td>Handles the format of the Captcha page. when set to <code>true</code> then it's possible to for the integration to return get the Captcha page in form of JSON.<br>Leave <strong>blank by</strong> default to use HTML sitewide.</td></tr></tbody></table>

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-525038b624bb0310dbd4fb6300b7e9aaa97de335%2Fimage%20(75).png?alt=media" alt=""><figcaption><p>Example of valid configuration</p></figcaption></figure>

Under advanced options, set the priority to 45.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-12a5a2fad7d4b0e708596b3fff9f04279f7e7fbd%2Fimage%20(3)%20(1)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

**RECV**:

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_RECV
* Set the type to "within subroutine" & "recv (vcl\_recv)"
* Paste the RECV code into the VCL
* Set the priority to 45

**DELIVER**

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_DELIVER
* Set the type to "within subroutine" & "deliver (vcl\_deliver)"
* Paste the DELIVER code into the VCL
* Set the priority to 45

**ERROR:**

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_ERROR
* Set the type to "within subroutine" & "error (vcl\_error)"
* Paste the ERROR code into the VCL
* Set the priority to 45

**RECV\_CONFIGURE:**

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_RECV\_CONFIGURE
* Set the type to "within subroutine" & "recv (vcl\_recv)"
* Paste the RECV\_CONFIGURE code into the VCL
* Set the priority to 46

PASS:

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_PASS
* Set the type to "within subroutine" & "pass (vcl\_pass)"
* Paste the PASS code into the VCL
* Set the priority to 45

MISS:

* Click the "Create snippet" button
* Give the snippet a suitable name, such as Netacea\_MISS
* Set the type to "within subroutine" & "miss (vcl\_miss)"
* Paste the MISS code into the VCL
* Set the priority to 45

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-4b410c84a4546af31f346acfdbe2f9596a6e11cb%2FScreenshot%202025-03-26%20165113.png?alt=media" alt=""><figcaption></figcaption></figure>

### Dictionary

* Navigate to Data -> Dictionaries within Fastly.
* Click the "Create dictionary" button.
* Give the snippet the name "netacea\_edge\_config"
* Click Add

{% hint style="info" %}
The dicitionary should be left blank unless instructed by the Netacea Team
{% endhint %}

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-ebe7c40de8e3778f3bd2ac5a9d18f4b9adc93c7e%2Fimage%20(81).png?alt=media" alt=""><figcaption></figcaption></figure>

### Finishing Up

Check you have completed the following steps:

* Created the new [hosts for the Netacea Protector API endpoint](#host)
* Deployed the [Netacea VCL](#vcl-snippets)
* Configured [log streaming](https://docs.netacea.com/netacea-plugin-information/monitoring-configuration#log-streaming) to the S3 bucket provided
* Ensure no error messages are appearing

You are now ready to deploy the version you have been editing by clicking "Activate"

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-d8a873b16f5962dbf29435aaa23055f7cca33664%2Fimage%20(12)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

The Netacea plug-in will now be deployed on the service it was configured against. You can test the deployment is active by:

* Checking for the presence of the Netacea named cookie on the website
* Viewing your reporting dashboard for traffic and mitigation
* Requesting Netacea review internal metrics
