Ana içeriğe geç

Fluentd/Logstash üzerinden Datadog

Wallarm’ı, tespit edilen olaylara ilişkin bildirimleri Fluentd veya Logstash ara veri toplayıcısı üzerinden Datadog’a gönderecek şekilde yapılandırabilirsiniz.

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

Veri toplayıcı üzerinden Wallarm’dan Datadog’a bildirim gönderme

Datadog ile yerel entegrasyon

Wallarm ayrıca Datadog API aracılığıyla Datadog ile yerel entegrasyonu destekler. Yerel entegrasyon, ara veri toplayıcının kullanılmasını gerektirmez.

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
35.235.100.79
34.102.45.38
34.94.241.21
34.102.90.100
34.94.203.193
34.94.238.221
34.94.9.23
34.141.230.156
34.91.138.113
34.90.114.134
35.204.127.78
34.90.24.155

Gereksinimler

Wallarm, günlükleri webhook’lar aracılığıyla ara veri toplayıcıya gönderdiğinden, Fluentd veya Logstash yapılandırması aşağıdaki gereksinimleri karşılamalıdır:

  • POST veya PUT isteklerini kabul etmelidir

  • HTTPS isteklerini kabul etmelidir

  • Genel bir URL’ye sahip olmalıdır

  • Günlükleri, datadog_logs Logstash eklentisi veya fluent-plugin-datadog Fluentd eklentisi aracılığıyla Datadog’a iletmelidir

  1. Günlükleri Datadog’a iletmek için datadog_logs eklentisini yükleyin.
  2. Gelen istekleri okumak ve günlükleri Datadog’a iletmek için Logstash’i yapılandırın.

Örnek logstash-sample.conf yapılandırma dosyası:

input {
  http { # HTTP ve HTTPS trafiği için input eklentisi
    port => 5044 # Gelen istekler için port
    ssl => true # HTTPS trafiğinin işlenmesi
    ssl_certificate => "/etc/server.crt" # Logstash TLS sertifikası
    ssl_key => "/etc/server.key" # TLS sertifikası için özel anahtar
  }
}
filter {
  mutate {
    add_field => {
        "ddsource" => "wallarm" # Wallarm günlüklerinin daha sonra filtrelenebilmesi için Datadog günlük kaydına source alanını ekleyen mutate filtresi
    }
  }
}
output {
  stdout {} # Logstash günlüklerini komut satırında yazdıran output eklentisi
  datadog_logs { # Logstash günlüklerini Datadog’a ileten output eklentisi
      api_key => "XXXX" # Datadog’daki organizasyon için üretilen API anahtarı
      host => "http-intake.logs.datadoghq.eu" # Datadog uç noktası (kayıt bölgesine bağlıdır)
  }
}
  1. Günlükleri Datadog’a iletmek için fluent-plugin-datadog eklentisini yükleyin.
  2. Gelen istekleri okumak ve günlükleri Datadog’a iletmek için Fluentd’i yapılandırın.

Örnek td-agent.conf yapılandırma dosyası:

<source>
  @type http # HTTP ve HTTPS trafiği için input eklentisi
  port 9880 # Gelen istekler için port
  <transport tls> # bağlantıların işlenmesi için yapılandırma
    cert_path /etc/ssl/certs/fluentd.crt
    private_key_path /etc/ssl/private/fluentd.key
  </transport>
</source>
<match datadog.**>
  @type datadog # Fluentd’den Datadog’a günlük ileten output eklentisi
  @id awesome_agent
  api_key XXXX # Datadog’daki organizasyon için üretilen API anahtarı
  host 'http-intake.logs.datadoghq.eu' # Datadog uç noktası (kayıt bölgesine bağlıdır)

  # İsteğe bağlı
  include_tag_key true
  tag_key 'tag'

  # İsteğe bağlı etiketler
  dd_source 'wallarm' # Wallarm günlüklerinin daha sonra filtrelenebilmesi için Datadog günlük kaydına source alanını ekleme
  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 veya Logstash ile entegrasyonun yapılandırılması

  1. Wallarm Console → IntegrationsFluentd/Logstash içinde Datadog entegrasyonu kurulumuna gidin.

  2. Entegrasyon adını girin.

  3. Hedef Fluentd veya Logstash URL’sini belirtin (Webhook URL).

  4. Gerekirse gelişmiş ayarları yapılandırın:

    • 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. Belirtilen URL’ye bildirim gönderimini tetikleyecek olay türlerini seçin. Olaylar seçilmezse bildirimler gönderilmez.

  6. Entegrasyonu test edin ve ayarların doğru olduğundan emin olun.

  7. Add integration’a tıklayın.

Fluentd entegrasyon örneği:

Fluentd ile entegrasyon ekleme

Entegrasyonun test edilmesi

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 veya Logstash ara veri toplayıcısındaki test günlüğü:

[
    {
        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"
            }
        }
    }
]

Test Datadog günlüğü:

Test Datadog günlüğü

Diğer kayıtlar arasında Wallarm günlüklerini bulmak için Datadog Logs servisinde source:wallarm_cloud arama etiketini kullanabilirsiniz.