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

Splunk Enterprise عبر Logstash

توفر لك هذه التعليمات مثالاً على دمج Wallarm مع جامع البيانات Logstash لإعادة توجيه الأحداث إلى نظام 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 وLogstash مثالية، فهي لا تستجيب.

تكوين Splunk Enterprise

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

تكوين HTTP Event Collector

للوصول إلى HTTP Event Controller، سيتم استخدام الرمز المولد 93eaeba4-97a9-46c7-abf3-4e0c545fa5cb.

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

تكوين Logstash

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

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

  • قبول طلبات HTTPS

  • وجود URL عام

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

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

  • يتم تكوين معالجة webhook الواردة في قسم input:

    • يتم إرسال الحركة إلى المنفذ 5044
    • Logstash مُكون لقبول الاتصالات HTTPS فقط
    • شهادة TLS لـ Logstash الموقعة من قِبل CA موثوق بها علنًا توجد ضمن الملف /etc/server.crt
    • المفتاح الخاص لشهادة TLS يوجد ضمن الملف /etc/server.key
  • يتم تكوين توجيه السجلات إلى Splunk وإخراج السجل في قسم output:

    • تتم إعادة توجيه السجلات من Logstash إلى Splunk بتنسيق JSON
    • يتم توجيه جميع سجلات الأحداث من Logstash إلى نقطة النهاية لـ API Splunk https://109.111.35.11:8088/services/collector/raw عبر طلبات POST. لتفويض الطلبات، يُستخدم رمز HTTPS Event Collector
    • بالإضافة إلى ذلك، يتم طباعة سجلات Logstash على سطر الأوامر (السطر 15 من الكود). يُستخدم الإعداد للتحقق من تسجيل الأحداث عبر Logstash
input {
  http { # إضافة مدخلات لحركة HTTP وHTTPS
    port => 5044 # المنفذ للطلبات الواردة
    ssl => true # معالجة حركة HTTPS
    ssl_certificate => "/etc/server.crt" # شهادة TLS لـ Logstash
    ssl_key => "/etc/server.key" # المفتاح الخاص لشهادة TLS
  }
}
output {
  http { # إضافة مخرجات لإعادة توجيه السجلات من Logstash عبر بروتوكول HTTP/HTTPS
    format => "json" # تنسيق السجلات المعاد توجيهها
    http_method => "post" # الطريقة الHTTP المستخدمة لإعادة توجيه السجلات
    url => "https://109.111.35.11:8088/services/collector/raw" # نقطة النهاية لإعادة توجيه السجلات إليها
    headers => ["Authorization", "Splunk 93eaeba4-97a9-46c7-abf3-4e0c545fa5cb"] # رؤوس HTTP لتفويض الطلبات
  }
  stdout {} # إضافة مخرجات لطباعة سجلات Logstash على سطر الأوامر
}

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

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

للتحقق من أن سجلات Logstash تم إنشاؤها وإرسالها إلى Splunk، يمكن إرسال طلب POST إلى Logstash.

مثال الطلب:

curl -X POST 'https://logstash.example.domain.com' -H "Content-Type: application/json" -H "Authorization: Splunk 93eaeba4-97a9-46c7-abf3-4e0c545fa5cb" -d '{"key1":"value1", "key2":"value2"}'

سجلات Logstash:
سجلات Logstash

حدث Splunk:
أحداث Splunk

تكوين دمج Logstash

  • Webhooks are sent to https://logstash.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 مع Logstash

المزيد من التفاصيل عن تكوين دمج Logstash

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

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

Adding user

سيقوم Logstash بتسجيل الحدث كما يلي:

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

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

بطاقة المستخدم الجديد في Splunk من Logstash

تنظيم الأحداث في لوحة بيانات

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.