انتقل إلى المحتوى

ترقية الوحدة النمطية postanalytics

يرجى اتباع هذه الإرشادات لترقية وحدة postanalytics النمطية الإصدار 4.x المركبة على الخادم المستقل. يكون عليك ترقية الوحدة النمطية postanalytics قبل ترقية وحدات Wallarm NGINX.

لترقية الوحدة النمطية التي بلغت نهاية العمر (3.6 أو أقل )، يرجى استخدام التعليمات الأخرى.

طرق الترقية

You can upgrade in two different ways:

  • Migrate to the all-in-one installer usage during the upgrade procedure. This is the recommended approach as it automates various node installation and upgrade activities, such as NGINX and OS version identification, adding appropriate Wallarm repositories, installing packages, and others.

  • Keep using the current manual installation method via individual DEB/RPM packages. However, it's important to note that in further upgrades this approach will require additional effort and manual configuration in comparison to the new method.

ترقية باستخدام المثبت الشامل

استخدم الإجراء أدناه لتحديث وحدة postanalytics النمطية 4.x المركبة على الخادم المستقل إلى الإصدار 4.10 باستخدام المثبت الشامل.

متطلبات ترقية باستخدام المثبت الشامل

  • 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 below 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.

    34.96.64.17
    34.110.183.149
    35.235.66.155
    34.102.90.100
    34.94.156.115
    35.235.115.105
    
    34.160.38.183
    34.144.227.90
    34.90.110.226
    

الخطوة 1: إعداد الجهاز النظيف

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

  • 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.

الخطوة 2: إعداد الرمز المميز لـ Wallarm

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.

الخطوة 3: تنزيل المثبت الشامل لـ Wallarm

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.1/wallarm-6.1.0.x86_64-glibc.sh
curl -O https://meganode.wallarm.com/6.1/wallarm-6.1.0.aarch64-glibc.sh

الخطوة 4: تشغيل المثبت الشامل لـ Wallarm لتثبيت postanalytics

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.1.0.x86_64-glibc.sh postanalytics

# If using the ARM64 version:
sudo env WALLARM_LABELS='group=<GROUP>' sh wallarm-6.1.0.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.1.0.x86_64-glibc.sh postanalytics

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

الخطوة 5: ترقية وحدة NGINX-Wallarm على الخادم المستقل

بمجرد تثبيت وحدة postanalytics على الخادم المستقل، قم بترقية وحدة NGINX-Wallarm المرتبطة بها التي تعمل على خادم آخر.

دمج طرق الترقية

يمكن استخدام الأساليب اليدوية والتلقائية لترقية الوحدة النمطية NGINX-Wallarm المرتبطة.

الخطوة 6: إعادة ربط وحدة NGINX-Wallarm بوحدة postanalytics

On the machine with the NGINX-Wallarm module, in the NGINX configuration file, specify the postanalytics module server address:

upstream wallarm_tarantool {
    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;
    }

    # omitted

wallarm_tarantool_upstream wallarm_tarantool;
  • max_conns value must be specified for each of the upstream Tarantool servers to prevent the creation of excessive connections.

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

  • The # wallarm_tarantool_upstream wallarm_tarantool; 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

الخطوة 7: التحقق من تفاعل وحدات NGINX‑Wallarm وpostanalytics المستقلة

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/tarantool-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 →

الخطوة 8: إزالة وحدة postanalytics القديمة

  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
    

الترقية اليدوية

استخدم الإجراء أدناه لترقية الوحدة النمطية postanalytics 4.x المثبتة على الخادم المستقل إلى الإصدار 4.8 يدويًا.

الدعم لـ 4.10

لم يتم تحديث حزم DEB/RPM لتثبيت العقدة يدويًا إلى الإصدار 4.10 بعد.

متطلبات

  • الوصول إلى الحساب بدور المدير في واجهة Wallarm عبر السحابة الأمريكية أو السحابة الأوروبية

  • الوصول إلى https://us1.api.wallarm.com عند العمل مع سحابة Wallarm الأمريكية أو إلى https://api.wallarm.com عند العمل مع سحابة Wallarm الأوروبية. يُرجى التأكد من عدم حجب الوصول بواسطة جدار الحماية

الخطوة 1: إضافة مستودع Wallarm الجديد

قم بحذف عنوان مستودع Wallarm السابق وأضف مستودعًا به حزم نسخة العُقدة Wallarm الجديدة. يرجى استخدام الأوامر المناسبة للبرنامج المناسب.

CentOS و Amazon Linux 2.0.2021x وأقل

sudo yum remove wallarm-node-repo
sudo yum clean all
sudo rpm -i https://repo.wallarm.com/centos/wallarm-node/7/4.8/x86_64/wallarm-node-repo-4.8-0.el7.noarch.rpm
sudo yum remove wallarm-node-repo
sudo yum clean all
sudo rpm -i https://repo.wallarm.com/centos/wallarm-node/8/4.8/x86_64/wallarm-node-repo-4.8-0.el8.noarch.rpm
sudo yum remove wallarm-node-repo
sudo yum clean all
sudo rpm -i https://repo.wallarm.com/centos/wallarm-node/8/4.8/x86_64/wallarm-node-repo-4.8-0.el8.noarch.rpm

Debian و Ubuntu

  1. افتح الملف الذي يُطابق عنوان المستودع Wallarm في المحرر النصي المثبت. vim يُستخدم في هذا التعليم.

    sudo vim /etc/apt/sources.list.d/wallarm.list
    
  2. علق على عنوان المستودع السابق أو احذفه.

  3. أضف عنوان المستودع الجديد:

    غير مدعوم من قبل NGINX stable و NGINX Plus

    لا يمكن تثبيت الإصدارات الرسمية لـ NGINX (المستقرة و Plus) و، على التوالي، العُقدة Wallarm 4.4 وما فوق على Debian 10.x (buster). الرجاء استخدم هذا OS فقط إذا تم تثبيت NGINX من مستودعات Debian/CentOS.

    deb https://repo.wallarm.com/debian/wallarm-node buster/4.8/
    
    deb https://repo.wallarm.com/debian/wallarm-node bullseye/4.8/
    
    deb https://repo.wallarm.com/ubuntu/wallarm-node bionic/4.8/
    
    deb https://repo.wallarm.com/ubuntu/wallarm-node focal/4.8/
    

الخطوة 2: ترقية حزم Tarantool

sudo apt update
sudo apt dist-upgrade

The error "signatures couldn't be verified"

If added GPG keys expired, the following error would be returned:

W: GPG error: https://repo.wallarm.com/ubuntu/wallarm-node focal/4.8/ Release:The following
signatures couldn't be verified because the public key is not available: NO_PUBKEY 1111FQQW999
E: The repository 'https://repo.wallarm.com/ubuntu/wallarm-node focal/4.8/ Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

To fix the problem, please import new GPG keys for the Wallarm packages and then upgrade the packages using the following commands:

curl -fsSL https://repo.wallarm.com/wallarm.gpg | sudo apt-key add -
sudo apt update
sudo apt dist-upgrade

Upgrading Wallarm dependencies

The sudo apt dist-upgrade command upgrades both the Wallarm packages and filtering node dependencies. It is the recommended upgrade option providing correct operation of the newer filtering node version.

sudo apt update
sudo apt dist-upgrade

The error "signatures couldn't be verified"

If added GPG keys expired, the following error would be returned:

W: GPG error: https://repo.wallarm.com/ubuntu/wallarm-node focal/4.8/ Release:The following
signatures couldn't be verified because the public key is not available: NO_PUBKEY 1111FQQW999
E: The repository 'https://repo.wallarm.com/ubuntu/wallarm-node focal/4.8/ Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

To fix the problem, please import new GPG keys for the Wallarm packages and then upgrade the packages using the following commands:

curl -fsSL https://repo.wallarm.com/wallarm.gpg | sudo apt-key add -
sudo apt update
sudo apt dist-upgrade

Upgrading Wallarm dependencies

The sudo apt dist-upgrade command upgrades both the Wallarm packages and filtering node dependencies. It is the recommended upgrade option providing correct operation of the newer filtering node version.

sudo yum update
sudo yum update
sudo yum update

الخطوة 3: تحديث نوع العقدة

فقط للعقد التي تم تثبيتها باستخدام نص البرنامج النصي addnode

اتبع هذه الخطوة فقط إذا كانت عقدة نسخة سابقة متصلة بـ Cloud Wallarm باستخدام النص البرنامجي addnode. تم إزالة هذا النص البرنامجي واستبدل بـ register-node ، الذي يتطلب رمزًا لتسجيل العقدة في السحابة.

  1. تأكد من أن حسابك Wallarm لديه دور المشرف عن طريق الانتقال إلى قائمة المستخدمين في سحابة الولايات المتحدة أو سحابة الاتحاد الأوروبي.

    قائمة المستخدمين في واجهة Wallarm

  2. افتح Wallarm Console → العقد في السحابة الأمريكية أو السحابة الأوروبية وأنشئ عقدة من نوع عقدة Wallarm.

    خلق Wallarm node

  3. انسخ الرمز المميز الذي تم إنشاؤه.

  4. نفذ النص البرنامجي register-node لتشغيل العقدة:

    sudo /usr/share/wallarm-common/register-node -t <TOKEN> -H us1.api.wallarm.com --force --no-sync --no-sync-acl
    
    sudo /usr/share/wallarm-common/register-node -t <TOKEN> --force --no-sync --no-sync-acl
    
    • <TOKEN> هو القيمة المنسوخة من الرمز المميز للعقدة أو الرمز المميز لواجهة برمجة التطبيقات ذو طابع "إنشاء".
    • خيار --force يجبر التحديث لبيانات الاعتماد الخاصة بـ Wallarm Cloud المنصوص عليها في الملف /etc/wallarm/node.yaml.

الخطوة 4: اعد تشغيل وحدة postanalytics النمطية

sudo systemctl restart wallarm-tarantool
sudo service wallarm-tarantool restart
sudo systemctl restart wallarm-tarantool
sudo systemctl restart wallarm-tarantool
sudo systemctl restart wallarm-tarantool

ترقية وحدات Wallarm NGINX