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

Datadog عبر Fluentd/Logstash

يمكنك تعيين Wallarm لإرسال إشعارات الأحداث المكتشفة إلى Datadog عبر Fluentd أو Logstash كمُجمِّع بيانات وسيط.

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 إلى Datadog عبر مُجمِّع البيانات

التكامل المباشر مع Datadog

يدعم Wallarm أيضًا التكامل المباشر مع Datadog عبر واجهة برمجة تطبيقات Datadog. التكامل المباشر لا يتطلب استخدام مُجمِّع البيانات الوسيط.

الموارد المستخدمة

Wallarm Cloud IP addresses

To provide Wallarm Cloud access to your system, you may need a list of its public IP addresses:

35.235.66.155
34.102.90.100
34.94.156.115
35.235.115.105
34.94.85.217
34.94.51.234
34.102.59.122
34.94.238.72
34.141.230.156
34.91.138.113
34.90.114.134
35.204.127.78

المتطلبات

بما أن Wallarm ترسل السجلات إلى مُجمِّع البيانات الوسيط عبر الويبهوك، يجب أن تلبي تكوينات Fluentd أو Logstash المتطلبات التالية:

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

  • قبول طلبات HTTPS

  • توفر رابط URL عام

  • توجيه السجلات إلى Datadog عبر إضافة datadog_logs لLogstash أو إضافة fluent-plugin-datadog لFluentd

  1. تثبيت إضافة datadog_logs لتوجيه السجلات إلى Datadog.
  2. تكوين Logstash لقراءة الطلبات الواردة وتوجيه السجلات إلى Datadog.

مثال ملف التكوينlogstash-sample.conf:

input {
  http { #  إضافة الإدخال للترافيك HTTP و HTTPS
    port => 5044 # منفذ للطلبات الواردة
    ssl => true # معالجة الترافيك HTTPS
    ssl_certificate => "/etc/server.crt" # شهادة TLS لLogstash
    ssl_key => "/etc/server.key" # المفتاح الخاص لشهادة TLS
  }
}
filter {
  mutate {
    add_field => {
        "ddsource" => "wallarm" # إضافة عنصر لمصدر السجل في Datadog لتصفية سجلات Wallarm
    }
  }
}
output {
  stdout {} # إضافة الإخراج لطباعة سجلات Logstash عبر الأمر
  datadog_logs { # إضافة الإخراج لتوجيه سجلات Logstash إلى Datadog
      api_key => "XXXX" # المفتاح البرمجي المولد للمنظمة في Datadog
      host => "http-intake.logs.datadoghq.eu" # نقطة النهاية في Datadog (تعتمد على منطقة التسجيل)
  }
}
  1. تثبيت إضافة fluent-plugin-datadog لتوجيه السجلات إلى Datadog.
  2. تكوين Fluentd لقراءة الطلبات الواردة وتوجيه السجلات إلى Datadog.

مثال ملف التكوين td-agent.conf:

<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 datadog.**>
  @type datadog # إضافة الإخراج لتوجيه السجلات من Fluentd إلى Datadog
  @id awesome_agent
  api_key XXXX # المفتاح البرمجي المولد للمنظمة في Datadog
  host 'http-intake.logs.datadoghq.eu' # نقطة النهاية في Datadog (تعتمد على منطقة التسجيل)

  # اختياري
  include_tag_key true
  tag_key 'tag'

  # علامات اختيارية
  dd_source 'wallarm' # إضافة عنصر المصدر إلى سجل Datadog لتصفية سجلات Wallarm
  dd_tags 'integration:fluentd'

  <buffer>
          @type memory
          flush_thread_count 4
          flush_interval 3s
          chunk_limit_size 5m
          chunk_limit_records 500
  </buffer>
</match>

إعداد التكامل مع Fluentd أو Logstash

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

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

  3. حدد رابط URL لFluentd أو Logstash المستهدف (رابط الويبهوك).

  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. اختر أنواع الأحداث لتفعيل إرسال الإشعارات إلى الرابط المحدد. إذا لم يتم اختيار الأحداث، فلن يتم إرسال الإشعارات.

  6. اختبر التكامل وتأكد من صحة الإعدادات.

  7. انقر على إضافة التكامل.

مثال على التكامل مع Fluentd:

إضافة التكامل مع Fluentd

اختبار التكامل

Integration testing allows checking configuration correctness, availability of the Wallarm Cloud, and the notification format. To test the integration, you can use the button Test integration when creating or editing the integration.

The integration is tested as follows:

  • Test notifications with the prefix [Test message] are sent to the selected system.

  • Test notifications cover the following events (each in a single record):

    • New user in the company account
    • Newly detected hit
    • Newly discovered IP in the company scope
    • New trigger in the company account
    • Newly discovered security vulnerability
  • Test notifications include test data.

السجل التجريبي في مُجمِّع البيانات الوسيط لFluentd أو Logstash:

[
    {
        summary:"[رسالة تجريبية] [شريك تجريبي(US)] اكتشاف ثغرة جديدة",
        description:"نوع الإشعار: ثغرة

                    تم اكتشاف ثغرة جديدة في نظامك.

                    معرّف: 
                    العنوان: تجريبي
                    النطاق: example.com
                    المسار: 
                    الطريقة: 
                    المكتشف بواسطة: 
                    البارامتر: 
                    النوع: معلومات
                    التهديد: متوسط

                    المزيد من التفاصيل: https://us1.my.wallarm.com/object/555


                    العميل: شركة التجريب
                    السحابة: US
                    ",
        details:{
            client_name:"شركة التجريب",
            cloud:"US",
            notification_type:"ثغرة",
            vuln_link:"https://us1.my.wallarm.com/object/555",
            vuln:{
                domain:"example.com",
                id:null,
                method:null,
                parameter:null,
                path:null,
                title:"تجريبي",
                discovered_by:null,
                threat:"متوسط",
                type:"معلومات"
            }
        }
    }
]

السجل التجريبي في Datadog:

السجل التجريبي في Datadog

للعثور على سجلات Wallarm بين السجلات الأخرى، يمكن استخدام علامة البحث source:wallarm_cloud في خدمة سجلات Datadog.