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

Fluentd

Fluentd هو أداة برمجية مفتوحة المصدر لجمع البيانات تعمل كآلية متعددة الاستخدامات وخفيفة الوزن لتجميع ونقل البيانات. يمكنك إعداد Wallarm لإرسال إشعارات عن الأحداث المكتشفة إلى Fluentd من خلال إنشاء تكامل مناسب في وحدة تحكم Wallarm.

صيغة الإشعار

ترسل Wallarm الإشعارات إلى Fluentd عبر الواب هوك بصيغة JSON. يعتمد مجموع الكائنات JSON على الحدث الذي تقوم Wallarm بإشعارك به.

مثال على إشعار الاكتشاف الجديد:

[
    {
        "summary": "[Wallarm] New hit detected",
        "details": {
        "client_name": "TestCompany",
        "cloud": "EU",
        "notification_type": "new_hits",
        "hit": {
            "domain": "www.example.com",
            "heur_distance": 0.01111,
            "method": "POST",
            "parameter": "SOME_value",
            "path": "/news/some_path",
            "payloads": [
                "say ni"
            ],
            "point": [
                "post"
            ],
            "probability": 0.01,
            "remote_country": "PL",
            "remote_port": 0,
            "remote_addr4": "8.8.8.8",
            "remote_addr6": "",
            "tor": "none",
            "request_time": 1603834606,
            "create_time": 1603834608,
            "response_len": 14,
            "response_status": 200,
            "response_time": 5,
            "stamps": [
                1111
            ],
            "regex": [],
            "stamps_hash": -22222,
            "regex_hash": -33333,
            "type": "sqli",
            "block_status": "monitored",
            "id": [
                "hits_production_999_202010_v_1",
                "c2dd33831a13be0d_AC9"
            ],
            "object_type": "hit",
            "anomaly": 0
            }
        }
    }
]

المتطلبات

يجب أن تلبي تكوينات Fluentd المتطلبات التالية:

  • تقبل طلبات POST أو PUT

  • تقبل الطلبات HTTPS

  • تمتلك URL عامّ

مثال على تكوين Fluentd:

<source>
  @type http # إضافة الإدخال لحركة المرور HTTP وHTTPS
  port 9880 # المنفذ للطلبات الواردة
  <transport tls> # تكوين لمعالجة الاتصالات
    cert_path /etc/ssl/certs/fluentd.crt
    private_key_path /etc/ssl/private/fluentd.key
  </transport>
</source>
<match **>
  @type copy
  <store>
     @type stdout # إضافة الخروج لطباعة سجلات Fluentd في خط الأوامر
     output_type json # صيغة السجلات المطبوعة في خط الأوامر
  </store>
</match>

يمكنك العثور على المزيد من التفاصيل في الوثائق رسمية Fluentd.

إعداد التكامل

  1. انتقل إلى إعداد تكامل Fluentd في وحدة تحكّم Wallarm → التكاملاتFluentd.

  2. أدخل اسم التكامل.

  3. حدد URL Fluentd الهدف (URL الواب هوك).

  4. إذا لزم الأمر، قم بتكوين الإعدادات المتقدمة:

    • Request method: POST or PUT. By default, POST requests are sent.
    • Request header and its value if the server requires a non-standard header to execute the request. The number of headers is not limited.
    • CA certificate: certificate of CA that signed a server certificate. If CA is publicly trusted, this field is optional. If a server certificate is self-signed, this field is required and must contain a certificate of your own CA that signed a server certificate.
    • Verify TLS certificate: this setting allows to disable verification of the specified server certificate. By default, Wallarm verifies whether a server certificate is signed by a publicly trusted CA. We do not recommend disabling the verification of production server certificates. If your server uses a self-signed TLS certificate, you can add a self-signed CA certificate to allow sending requests to this server.
    • Request timeout, in seconds: if the server does not respond to the request within the specified time, the request fails. By default: 15 seconds.
    • Connection timeout, in seconds: if the connection to the server cannot be established during the specified time, the request fails. By default: 20 seconds.
    • Wallarm data format: either a JSON Array (default) or a New Line Delimited JSON (NDJSON).
  5. اختر أنواع الأحداث لتشغيل الإشعارات.

    تكامل Fluentd

    التفاصيل على الأحداث المتاحة:

    • Hits detected except for:

    • System related:

    • Vulnerabilities detected, all by default or only for the selected risk level(s) - high, medium or low.
    • Rules and triggers changed (creating, updating, or deleting the rule or trigger)
    • On an hourly basis, you can get a notification with the number of requests processed during the previous hour
  6. انقر على اختبار التكامل للتحقق من صحة التكوين، توافر وحدة تحكم Wallarm وصيغة الإشعار.

    سجل الاختبار Fluentd:

    [
        {
            summary:"[Test message] [Test partner(US)] New vulnerability detected",
            description:"Notification type: vuln
    
                        New vulnerability was detected in your system.
    
                        ID: 
                        Title: Test
                        Domain: example.com
                        Path: 
                        Method: 
                        Discovered by: 
                        Parameter: 
                        Type: Info
                        Threat: Medium
    
                        More details: https://us1.my.wallarm.com/object/555
    
    
                        Client: TestCompany
                        Cloud: US
                        ",
            details:{
                client_name:"TestCompany",
                cloud:"US",
                notification_type:"vuln",
                vuln_link:"https://us1.my.wallarm.com/object/555",
                vuln:{
                    domain:"example.com",
                    id:null,
                    method:null,
                    parameter:null,
                    path:null,
                    title:"Test",
                    discovered_by:null,
                    threat:"Medium",
                    type:"Info"
                }
            }
        }
    ]
    
  7. انقر على إضافة التكامل.

إعداد التنبيهات الإضافية

Besides the notifications you have already set up through the integration card, Wallarm triggers allow you to select additional events for notifications:

For condition detailing, you can add one or more filters. As soon, as condition and filters are set, select the integration through which the selected alert should be sent. You can select several integrations simultaneously.

Choosing an integration

استخدام Fluentd كجامع بيانات وسيط

The most common logging scheme in complex systems consists of the following components:

  • Data collector: accepts logs from several sources and forwards logs to the SIEM system

  • SIEM system or log management systems: used to analyze logs and monitor the system status

على سبيل المثال:

مخطط الواب هوك

لتسجيل أحداث Wallarm باستخدام هذا المخطط:

  1. تكوين جامع البيانات لقراءة الواب هوكات الواردة وتوجيه السجلات إلى النظام التالي. ترسل Wallarm الأحداث إلى جامعي البيانات عبر الواب هوك.

  2. تكوين نظام SIEM للحصول على السجلات وقراءتها من جامع البيانات.

  3. تكوين Wallarm لإرسال السجلات إلى جامع البيانات.

    يمكن لـ Wallarm إرسال السجلات إلى أي جامع بيانات عبر الواب هوك.

    للدمج مع Fluentd أو Logstash، يمكنك استخدام بطاقات التكامل المقابلة في واجهة مستخدم Wallarm Console.

    للدمج مع جامعات البيانات الأخرى، يمكنك استخدام بطاقة التكامل الواب هوك في واجهة مستخدم Wallarm Console.

وصفنا بعض الأمثلة على كيفية تهيئة الاندماج مع جامعات البيانات الشهيرة التي تنقل السجلات إلى أنظمة SIEM:

تعطيل وحذف التكامل

You can delete or temporarily disable the integration. While deleting stops sending notificatioins and completely deletes all configuration, disabling just stops sending notifications which you can at any moment re-enable with the same settings.

If for the integration the System related events are selected to trigger notifications, Wallarm will notify about both of these actions.

عدم توافر النظام ومعلمات التكامل غير الصحيحة

Notifications to the system are sent via requests. If the system is unavailable or integration parameters are configured incorrectly, the error code is returned in the response to the request.

If the system responds to Wallarm request with any code other than 2xx, Wallarm resends the request with the interval until the 2xx code is received:

  • The first cycle intervals: 1, 3, 5, 10, 10 seconds

  • The second cycle intervals: 0, 1, 3, 5, 30 seconds

  • The third cycle intervals: 1, 1, 3, 5, 10, 30 minutes

If the percentage of unsuccessful requests reaches 60% in 12 hours, the integration is automatically disabled. If you receive system notifications, you will get a message about automatically disabled integration.