Ana içeriğe geç

EOL postanalytics modülünü yükseltme

Bu talimatlar, ayrı bir sunucuya kurulmuş olan kullanım ömrü sonu (EOL) postanalytics modülünü (sürüm 3.6 ve altı) yükseltme adımlarını açıklar. Postanalytics modülü, Wallarm NGINX modüllerini yükseltmeden önce yükseltilmelidir.

Wallarm nodes 3.6 and lower are not supported

You are recommended to upgrade the Wallarm nodes 3.6 and lower since these versions are not supported, they are end-of-life.

Node configuration and traffic filtration have been significantly simplified in the Wallarm node of the latest versions. Before upgrading the modules, please carefully review the list of changes and general recommendations. Please note that some settings of the latest node are incompatible with the nodes 3.6 and lower.

All-in-one installer ile yükseltme

Yükseltme, bireysel Linux paketleri kullanım dışı bırakıldığından Wallarm'ın all-in-one installer kullanılarak gerçekleştirilir. Bu yöntem, önceki yaklaşıma kıyasla yükseltme sürecini ve sürekli dağıtım bakımını basitleştirir.

Yükleyici aşağıdaki işlemleri otomatik olarak gerçekleştirir:

  1. İşletim sisteminizi ve NGINX sürümünüzü kontrol etme.
  2. Algılanan işletim sistemi ve NGINX sürümü için Wallarm depolarını ekleme.
  3. Bu depolardan Wallarm paketlerini yükleme.
  4. Yüklenen Wallarm modülünü NGINX'inize bağlama.
  5. Sağlanan belirteç ile filtreleme düğümünü Wallarm Cloud'a bağlama.

    Bireysel Linux paketleriyle manuel yükseltme artık desteklenmemektedir.

Manuel ile All-in-one karşılaştırması

Gereksinimler

  • Access to the account with the Administrator role in Wallarm Console for the US Cloud or EU Cloud.

  • Access to https://meganode.wallarm.com to download all-in-one Wallarm installer. Ensure the access is not blocked by a firewall.

  • Access to https://us1.api.wallarm.com for working with US Wallarm Cloud or to https://api.wallarm.com for working with EU Wallarm Cloud. If access can be configured only via the proxy server, then use the instructions.

  • Executing all commands as a superuser (e.g. root).

  • Access to the IP addresses and their corresponding hostnames (if any) listed below. This is needed for downloading updates to attack detection rules and API specifications, as well as retrieving precise IPs for your allowlisted, denylisted, or graylisted countries, regions, or data centers.

    node-data0.us1.wallarm.com - 34.96.64.17
    node-data1.us1.wallarm.com - 34.110.183.149
    us1.api.wallarm.com - 35.235.66.155
    34.102.90.100
    34.94.156.115
    35.235.115.105
    
    node-data1.eu1.wallarm.com - 34.160.38.183
    node-data0.eu1.wallarm.com - 34.144.227.90
    api.wallarm.com - 34.90.110.226
    

Adım 1: Temiz makineyi hazırlayın

When upgrading modules with all-in-one installer, you cannot upgrade an old package installation - instead you need to use a clean machine. Thus, as step 1, prepare a machine with one of the supported OS:

  • Debian 10, 11 and 12.x

  • Ubuntu LTS 18.04, 20.04, 22.04

  • CentOS 7, 8 Stream, 9 Stream

  • Alma/Rocky Linux 9

  • RHEL 8.x

  • RHEL 9.x

  • Oracle Linux 8.x

  • Oracle Linux 9.x

  • Redox

  • SuSe Linux

  • Others (the list is constantly widening, contact Wallarm support team to check if your OS is in the list)

Using new clean machine will lead to that at some moment you will have both old and new node, which is good: you can test the new one working properly without stopping the old one.

Adım 2: Wallarm belirtecini hazırlayın

To install node, you will need a Wallarm token of the appropriate type. To prepare a token:

  1. Open Wallarm Console → SettingsAPI tokens in the US Cloud or EU Cloud.
  2. Find or create API token with the Node deployment/Deployment usage type.
  3. Copy this token.
  1. Open Wallarm Console → Nodes in the US Cloud or EU Cloud.
  2. 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.

Adım 3: All-in-one Wallarm yükleyicisini indirin

Wallarm suggests all-in-one installations for the following processors:

  • x86_64

  • ARM64 (beta)

To download all-in-one Wallarm installation script, execute the command:

curl -O https://meganode.wallarm.com/6.6/wallarm-6.6.1.x86_64-glibc.sh
curl -O https://meganode.wallarm.com/6.6/wallarm-6.6.1.aarch64-glibc.sh

Adım 4: Postanalytics'i yüklemek için all-in-one Wallarm yükleyicisini çalıştırın

To install postanalytics separately with all-in-one installer, use:

# If using the x86_64 version:
sudo env WALLARM_LABELS='group=<GROUP>' sh wallarm-6.6.1.x86_64-glibc.sh postanalytics

# If using the ARM64 version:
sudo env WALLARM_LABELS='group=<GROUP>' sh wallarm-6.6.1.aarch64-glibc.sh postanalytics

The WALLARM_LABELS variable sets group into which the node will be added (used for logical grouping of nodes in the Wallarm Console UI).

# If using the x86_64 version:
sudo sh wallarm-6.6.1.x86_64-glibc.sh postanalytics

# If using the ARM64 version:
sudo sh wallarm-6.6.1.aarch64-glibc.sh postanalytics

Adım 5: API portunu güncelleyin

Starting with version 4.0, the filtering node uploads data to the Cloud using the us1.api.wallarm.com:443 (US Cloud) and api.wallarm.com:443 (EU Cloud) API endpoints instead of us1.api.wallarm.com:444 and api.wallarm.com:444.

If you upgrade the node from the version 3.x or lower and your server with the deployed node has a limited access to the external resources and the access is granted to each resource separately, then after upgrade the synchronization between the filtering node and the Cloud will stop.

To restore the synchronization, in your configuration, change port 444 to 443 for API endpoint for each resource.

Adım 6: Ayrı bir sunucudaki NGINX‑Wallarm modülünü yükseltin

postanalytics modülü ayrı sunucuya kurulduktan sonra, farklı bir sunucuda çalışan ilgili NGINX‑Wallarm modülünü yükseltin.

Adım 7: NGINX‑Wallarm modülünü postanalytics modülüne yeniden bağlayın

On the machine with the NGINX-Wallarm module, in the NGINX configuration file (typically located at /etc/nginx/nginx.conf), specify the postanalytics module server address:

http {
    # omitted
    upstream wallarm_wstore {
        server <ip1>:3313 max_fails=0 fail_timeout=0 max_conns=1;
        server <ip2>:3313 max_fails=0 fail_timeout=0 max_conns=1;

        keepalive 2;
    }

    wallarm_wstore_upstream wallarm_wstore;

    # omitted
}
  • max_conns value must be specified for each of the upstream wstore servers to prevent the creation of excessive connections.

  • keepalive value must not be lower than the number of the wstore servers.

  • The # wallarm_wstore_upstream wallarm_wstore; string is commented by default - please delete #.

Once the configuration file changed, restart NGINX/NGINX Plus on the NGINX-Wallarm module server:

sudo systemctl restart nginx
sudo service nginx restart
sudo systemctl restart nginx
sudo systemctl restart nginx
sudo systemctl restart nginx

Adım 8: NGINX‑Wallarm ve ayrı postanalytics modüllerinin etkileşimini kontrol edin

To check the NGINX‑Wallarm and separate postanalytics modules interaction, you can send the request with test attack to the address of the protected application:

curl http://localhost/etc/passwd

If the NGINX‑Wallarm and separate postanalytics modules are configured properly, the attack will be uploaded to the Wallarm Cloud and displayed in the Attacks section of Wallarm Console:

Attacks in the interface

If the attack was not uploaded to the Cloud, please check that there are no errors in the services operation:

  • Analyze the postanalytics module logs

    sudo cat /opt/wallarm/var/log/wallarm/wstore-out.log
    

    If there is the record like SystemError binary: failed to bind: Cannot assign requested address, make sure that the server accepts connection on specified address and port.

  • On the server with the NGINX‑Wallarm module, analyze the NGINX logs:

    sudo cat /var/log/nginx/error.log
    

    If there is the record like [error] wallarm: <address> connect() failed, make sure that the address of separate postanalytics module is specified correctly in the NGINX‑Wallarm module configuration files and separate postanalytics server accepts connection on specified address and port.

  • On the server with the NGINX‑Wallarm module, get the statistics on processed requests using the command below and make sure that the value of tnt_errors is 0

    curl http://127.0.0.8/wallarm-status
    

    Description of all parameters returned by the statistics service →

Adım 9: Eski postanalytics modülünü kaldırın

  1. Delete old postanalytics module in Wallarm Console → Nodes by selecting your postanalytics module node and clicking Delete.

  2. Confirm the action.

    When the postanalytics module node is deleted from Cloud, it will stop participation in filtration of requests to your applications. Deleting cannot be undone. The postanalytics module node will be deleted from the list of nodes permanently.

  3. Delete machine with the old postanalytics module or just clean it from Wallarm postanalytics module components:

    sudo apt remove wallarm-node-tarantool
    
    sudo apt remove wallarm-node-tarantool
    
    sudo yum remove wallarm-node-tarantool
    
    sudo yum remove wallarm-node-tarantool
    
    sudo yum remove wallarm-node-tarantool