Ana içeriğe geç

Logstash ile Splunk Enterprise

Bu talimatlar, Wallarm'ın Logstash veri toplayıcısı ile entegrasyon örneğini sunarak olayların Splunk SIEM sistemine iletilmesini sağlamaktadır.

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 flow

Kullanılan kaynaklar

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 ve Logstash servislerine ait bağlantılar örnek olarak verildiğinden, yanıt vermemektedir.

Splunk Enterprise yapılandırması

Logstash günlükleri, Wallarm Logstash logs adı ve diğer varsayılan ayarlarla Splunk HTTP Event Controller'a gönderilmektedir:

HTTP Event Collector Configuration

HTTP Event Controller'a erişmek için oluşturulan 93eaeba4-97a9-46c7-abf3-4e0c545fa5cb token'ı kullanılacaktır.

Splunk HTTP Event Controller kurulumu hakkında daha ayrıntılı açıklama resmi Splunk dokümantasyonunda mevcuttur.

Logstash yapılandırması

Wallarm, günlükleri webhooks aracılığıyla Logstash ara veri toplayıcısına gönderdiğinden, Logstash yapılandırması aşağıdaki gereksinimleri karşılamalıdır:

  • POST veya PUT isteklerini kabul etmek

  • HTTPS isteklerini kabul etmek

  • Genel URL'ye sahip olmak

  • Günlükleri Splunk Enterprise'a iletmek; bu örnekte günlükleri iletmek için http eklentisi kullanılmaktadır

Logstash, logstash-sample.conf dosyasında yapılandırılmıştır:

  • Gelen webhook işlemesi input bölümünde yapılandırılır:

    • Trafik port 5044'e gönderilir
    • Logstash yalnızca HTTPS bağlantılarını kabul edecek şekilde yapılandırılmıştır
    • Genel olarak güvenilir bir CA tarafından imzalanan Logstash TLS sertifikası /etc/server.crt dosyasında yer almaktadır
    • TLS sertifikası için özel anahtar /etc/server.key dosyasında yer almaktadır
  • Günlüklerin Splunk'a iletilmesi ve log çıktısı output bölümünde yapılandırılır:

    • Günlükler Logstash'dan Splunk'a JSON formatında iletilir
    • Tüm olay günlükleri, POST istekleri aracılığıyla Logstash'dan Splunk API uç noktasına https://109.111.35.11:8088/services/collector/raw iletilir. İstekleri yetkilendirmek için HTTPS Event Collector token'ı kullanılır
    • Logstash günlükleri ayrıca komut satırında (15. kod satırında) yazdırılır. Bu ayar, olayların Logstash üzerinden kaydedildiğini doğrulamak için kullanılır
input {
  http { # input plugin for HTTP and HTTPS traffic
    port => 5044 # port for incoming requests
    ssl => true # HTTPS traffic processing
    ssl_certificate => "/etc/server.crt" # Logstash TLS certificate
    ssl_key => "/etc/server.key" # private key for TLS certificate
  }
}
output {
  http { # output plugin to forward logs from Logstash via HTTP/HTTPS protocol
    format => "json" # format of forwarded logs
    http_method => "post" # HTTP method used to forward logs
    url => "https://109.111.35.11:8088/services/collector/raw" # ednpoint to forward logs to
    headers => ["Authorization", "Splunk 93eaeba4-97a9-46c7-abf3-4e0c545fa5cb"] # HTTP headers to authorize requests
  }
  stdout {} # output plugin to print Logstash logs on the command line
}

Yapılandırma dosyaları hakkında daha detaylı açıklama resmi Logstash dokümantasyonunda mevcuttur.

Logstash yapılandırmasının test edilmesi

Logstash günlüklerinin oluşturulduğunu ve Splunk'a iletildiğini kontrol etmek için, POST isteği Logstash'e gönderilebilir.

İstek örneği:

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 günlükleri:
Logstash logs

Splunk olayı:
Splunk events

Logstash entegrasyonunun yapılandırılması

  • 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 integration with Logstash

Logstash entegrasyon yapılandırması hakkında daha fazla ayrıntı

Örnek test

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

Adding user

Logstash, olayı aşağıdaki gibi kaydedecektir:

Log about new user in Splunk from Logstash

Splunk olaylarında aşağıdaki kayıt görüntülenecektir:

New user card in Splunk from Logstash

Olayların bir gösterge panelinde düzenlenmesi

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.