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

Splunk Enterprise عبر Fluentd

توفر لك هذه التعليمات مثالًا لدمج Wallarm مع جمع البيانات Fluentd لإعادة توجيه الأحداث إلى نظام Splunk SIEM.

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

تدفق Webhook

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

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

بما أن الروابط المشار إليها لخدمات Splunk Enterprise وFluentd هي أمثلة، فهي لا تستجيب.

تكوين Splunk Enterprise

يتم إرسال سجلات Fluentd إلى Splunk HTTP Event Controller بالاسم Wallarm Fluentd logs والإعدادات الافتراضية الأخرى:

تكوين HTTP Event Collector

للوصول إلى HTTP Event Controller، سيتم استخدام الرمز المُنشأ f44b3179-91aa-44f5-a6f7-202265e10475.

وصف أكثر تفصيلًا لإعداد Splunk HTTP Event Controller متوفر في وثائق Splunk الرسمية.

تكوين Fluentd

بما أن Wallarm يرسل السجلات إلى جامع البيانات الوسيط Fluentd عبر webhooks، فيجب أن يلبي تكوين Fluentd المتطلبات التالية:

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

  • قبول طلبات HTTPS

  • الحصول على عنوان URL عام

  • إعادة توجيه السجلات إلى Splunk Enterprise، يستخدم هذا المثال الإضافة splunk_hec لإعادة توجيه السجلات

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

  • يتم تكوين معالجة الويب الوارد في التوجيه source:

    • يتم إرسال الحركة إلى المنفذ 9880
    • يُكون Fluentd لقبول الاتصالات HTTPS فقط
    • شهادة TLS Fluentd الموقعة من قبل CA موثوق بها علنًا موجودة ضمن الملف /etc/ssl/certs/fluentd.crt
    • المفتاح الخاص لشهادة TLS موجود ضمن الملف /etc/ssl/private/fluentd.key
  • يتم تكوين إعادة توجيه السجلات إلى Splunk وطباعة السجلات في التوجيه match:

    • جميع سجلات الأحداث يتم نسخها من Fluentd وإعادة توجيهها إلى Splunk HTTP Event Collector عبر إضافة الإخراج fluent-plugin-splunk-hec
    • يتم طباعة سجلات Fluentd أيضًا على خط الأوامر بتنسيق JSON (أسطر الكود 19-22). يُستخدم الإعداد للتحقق من تسجيل الأحداث عبر 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 splunk_hec # إضافة الإخراج fluent-plugin-splunk-hec لإعادة توجيه السجلات إلى Splunk API عبر HTTP Event Controller
      hec_host 109.111.35.11 # مضيف Splunk
      hec_port 8088 # منفذ Splunk API
      hec_token f44b3179-91aa-44f5-a6f7-202265e10475 # رمز HTTP Event Controller
    <format>
      @type json # تنسيق السجلات المُعاد توجيهها
    </format>
  </store>
  <store>
     @type stdout # إضافة الإخراج لطباعة سجلات Fluentd على خط الأوامر
     output_type json # تنسيق السجلات المطبوعة على خط الأوامر
  </store>
</match>

وصف أكثر تفصيلًا لملفات التكوين متوفر في وثائق Fluentd الرسمية.

اختبار تكوين Fluentd

للتحقق من إنشاء سجلات Fluentd وإعادة توجيهها إلى Splunk، يمكن إرسال طلب PUT أو POST إلى Fluentd.

مثال الطلب:

curl -X POST 'https://fluentd-example-domain.com' -H "Content-Type: application/json" -H "Authorization: Splunk f44b3179-91aa-44f5-a6f7-202265e10475" -d '{"key1":"value1", "key2":"value2"}'

سجلات في Fluentd:
سجلات في Fluentd

سجلات في Splunk:
سجلات في Splunk

تكوين دمج Fluentd

  • Webhooks are sent to https://fluentd-example-domain.com

  • Webhooks are sent via POST requests

  • The webhook integration has default advanced settings

  • Webhooks sent to Webhook URLs are all available events: hits, system events, vulnerabilities, scope changes

دمج Webhook مع Fluentd

مزيد من التفاصيل حول تكوين دمج Fluentd

اختبار المثال

To test the configuration, a new user is added in Wallarm Console:

Adding user

سيقوم Fluentd بتسجيل الحدث على النحو التالي:

سجل عن مُستخدم جديد في Splunk من Fluentd

سيتم عرض الإدخال التالي في أحداث Splunk:

بطاقة مُستخدم جديد في Splunk من Fluentd

تنظيم الأحداث في Splunk Enterprise ضمن لوحة تحكم

To get Wallarm events organized into a ready-to-use dashboard in Splunk 9.0 or later, you can install the Wallarm application for Splunk.

This application provides you with a pre-configured dashboard that is automatically filled with the events received from Wallarm. In addition to that, the application enables you to proceed to detailed logs on each event and export the data from the dashboard.

Splunk dashboard

To install the Wallarm application for Splunk:

  1. In the Splunk UI ➝ Apps find the Wallarm API Security application.

  2. Click Install and input the Splunkbase credentials.

If some Wallarm events are already logged in Splunk, they will be displayed on the dashboard, as well as further events Wallarm will discover.

In addition, you can fully customize the ready-to-use dashboard, e.g. its view or search strings used to extract data from all Splunk records.