Deploying Wallarm OOB from GCP Machine Image¶
This article provides instructions for deploying Wallarm OOB on Google Cloud Platform using the official Machine Image. The solution described here is designed to analyze traffic mirrored by a web or proxy server.
Among all supported Wallarm deployment options, GCP Machine Image is recommended for Wallarm deployment in these use cases:
Your existing infrastructure resides on GCP.
You aim to deploy a security solution as a separate cloud instance, rather than installing it directly on frontend systems like NGINX.
A GCP account
https://us1.api.wallarm.com:444for working with US Wallarm Cloud or to
https://api.wallarm.com:444for working with EU Wallarm Cloud. If access can be configured only via the proxy server, then use the instructions
Executing all commands on a Wallarm instance as a superuser (e.g.
1. Launch a filtering node instance¶
Launch the instance via the Google Cloud UI¶
To launch the filtering node instance via the Google Cloud UI, please open the Wallarm node image on the Google Cloud Marketplace and click LAUNCH.
The instance will launch with a preinstalled filtering node. To see detailed information on launching instances in the Google Cloud, please proceed to the official Google Cloud Platform documentation.
Launch the instance via Terraform or other tools¶
When using a tool like Terraform to launch the filtering node instance using Wallarm GCP image, you may need to provide the name of this image in the Terraform configuration.
Image name has the following format:
To launch the instance with the filtering node version 4.8, please use the following image name:
To get the image name, you can also follow these steps:
Install Google Cloud SDK.
Execute the command
gcloud compute images listwith the following parameters:
Copy the version value from the name of the latest available image and paste the copied value into the provided image name format. For example, the filtering node version 4.8 image will have the following name:
2. Configure the filtering node instance¶
Perform the following actions to configure the launched filtering node instance:
Navigate to the VM instances page in the Compute Engine section of the menu.
Select the launched filtering node instance and click the Edit button.
Allow the required types of incoming traffic by ticking the corresponding checkboxes in the Firewalls setting.
If necessary, you can restrict connecting to the instance with the project SSH keys and use a custom SSH key pair for connecting to this instance. To do this, perform the following actions:
- Tick the Block project-wide checkbox in the SSH Keys setting.
- Click the Show and edit button in the SSH Keys setting to expand the field for entering an SSH key.
Generate a pair of public and private SSH keys. For example, you can use the
Copy an open key in OpenSSH format from the interface of the used key generator (in the current example, the generated public key should be copied from the Public key for pasting into OpenSSH authorized_keys file area of the PuTTYgen interface) and paste it into the field containing the Enter entire key data hint.
- Save the private key. It will be required for connecting to the configured instance in the future.
Click the Save button at the bottom of the page to apply the changes.
3. Connect to the filtering node instance via SSH¶
To see detailed information about ways of connecting to instances, proceed to this link.
Connecting to the instance via a custom private key
If during base instance creation process you have enabled connection to the instance via a custom SSH key pair, make sure you have access to the private key from this key pair.
4. Connect the filtering node to the Wallarm Cloud¶
The Wallarm filtering node interacts with the Wallarm Cloud. You need to connect the node to the Cloud.
When connecting node to the Cloud, you can set the node name, under which it will be displayed in the Wallarm Console UI and put the node into the appropriate node group (used to logically organize nodes in UI).
To connect the node to the Cloud, use a Wallarm token of the appropriate type:
- Open Wallarm Console → Settings → API tokens in the US Cloud or EU Cloud.
- Find or create API token with the
- Copy this token.
register-nodescript on a machine where you install the filtering node:
<TOKEN>is the copied value of the API token with the
--labels 'group=<GROUP>'parameter puts your node to the
<GROUP>node group (existing, or, if does not exist, it will be created).
- Open Wallarm Console → Nodes in the US Cloud or EU Cloud.
- Do one of the following:
- Create the node of the Wallarm node type and copy the generated token.
- Use existing node group - copy token using node's menu → Copy token.
register-nodescript on a machine where you install the filtering node:
<TOKEN>is the copied value of the node token.
- You may add
-n <HOST_NAME>parameter to set a custom name for your node instance. Final instance name will be:
5. Enable Wallarm to analyze the mirrored traffic¶
By default, the deployed Wallarm node does not analyze incoming traffic.
To start traffic analysis, change the
/etc/nginx/sites-enabled/default file on the Wallarm instance as follows:
For the Wallarm node to accept mirrored traffic, set the following configuration in the
wallarm_force server_addr $http_x_server_addr; wallarm_force server_port $http_x_server_port; # Change 18.104.22.168 to the address of the mirroring server set_real_ip_from 22.214.171.124; real_ip_header X-Forwarded-For; real_ip_recursive on; wallarm_force response_status 0; wallarm_force response_time 0; wallarm_force response_size 0;
real_ip_headerdirectives are required to have Wallarm Console display the IP addresses of the attackers.
wallarm_force_response_*directives are required to disable analysis of all requests except for copies received from the mirrored traffic.
For the Wallarm node to analyze the mirrored traffic, set the
Since malicious requests cannot be blocked, the only mode Wallarm accepts is monitoring. For in-line deployment, there are also safe blocking and blocking modes but even if you set the
wallarm_modedirective to a value different from monitoring, the node continues to monitor traffic and only record malicious traffic (aside from the mode set to off).
6. Restart NGINX¶
To apply the settings, restart NGINX on the Wallarm instance:
Each configuration file change requires NGINX to be restarted to apply it.
7. Configure your web or proxy server to mirror traffic to the Wallarm node¶
Configure your web or server (e.g. NGINX, Envoy) to mirror incoming traffic to the Wallarm node. For configuration details, we recommend to refer to your web or proxy server documentation.
Inside the link, you will find the example configuration for the most popular of web and proxy servers (NGINX, Traefik, Envoy).
8. Test the Wallarm operation¶
The request with test Path Traversal attack to an address of either the web or proxy server mirroring traffic or the machine with the Wallarm node:
Since Wallarm OOB operates in the monitoring mode, the Wallarm node does not block the attack but registers it.
9. Fine-tune the deployed solution¶
The deployment is now complete. The filtering node may require some additional configuration after deployment.
Wallarm settings are defined using the NGINX directives or the Wallarm Console UI. Directives should be set in the following files on the Wallarm instance:
/etc/nginx/sites-enabled/defaultdefines the configuration of NGINX
/etc/nginx/conf.d/wallarm.confdefines the global configuration of Wallarm filtering node
/etc/nginx/conf.d/wallarm-status.confdefines the filtering node monitoring service configuration
/etc/sysconfig/wallarm-tarantoolwith the Tarantool database settings
You can modify the listed files or create your own configuration files to define the operation of NGINX and Wallarm. It is recommended to create a separate configuration file with the
server block for each group of the domains that should be processed in the same way (e.g.
example.com.conf). To see detailed information about working with NGINX configuration files, proceed to the official NGINX documentation.
Creating a configuration file
When creating a custom configuration file, make sure that NGINX listens to the incoming connections on the free port.
Below there are a few of the typical settings that you can apply if needed: