Git Product home page Git Product logo

zeek-kafka's Introduction

Logging Zeek Output to Kafka

A Zeek log writer that sends logging output to Kafka, providing a convenient means for tools to process the data generated by Zeek.

Installation

zkg Installation

zkg is the preferred mechanism for installing this plugin, as it will dynamically retrieve, build, test, and load the plugin. Note, that you will still need to activate and configure the plugin after your installation.

  1. Install librdkafka, a native client library for Kafka. This plugin has been tested against librdkafka v1.4.4.

    In order to use this plugin within a kerberized Kafka environment, you will also need libsasl2 installed and will need to pass --enable-sasl to the configure script.

    $ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.4.tar.gz | tar xvz
    $ cd librdkafka-1.4.4/
    $ ./configure
    $ make
    $ sudo make install
    
  2. Configure zkg by following the quickstart guide here.

  3. Install the plugin using zkg install.

    $ zkg install seisollc/zeek-kafka --version v1.2.0
    The following packages will be INSTALLED:
      zeek/seisollc/zeek-kafka (1.2.0)
    
    Verify the following REQUIRED external dependencies:
    (Ensure their installation on all relevant systems before proceeding):
      from zeek/seisollc/zeek-kafka (1.2.0):
        librdkafka ~1.4.2
    
    Proceed? [Y/n]
    zeek/seisollc/zeek-kafka asks for LIBRDKAFKA_ROOT (Path to librdkafka installation tree) ? [/usr/local]
    Saved answers to config file: /home/jonzeolla/.zkg/config
    Running unit tests for "zeek/seisollc/zeek-kafka"
    all 10 tests successful
    
    
    Installing "zeek/seisollc/zeek-kafka"........
    Installed "zeek/seisollc/zeek-kafka" (1.2.0)
    Loaded "zeek/seisollc/zeek-kafka"
    
  4. Run the following command to ensure that the plugin was installed successfully.

    $ zeek -N Seiso::Kafka
    Seiso::Kafka - Writes logs to Kafka (dynamic, version 1.2.0)
    

Manual Installation

Manually installing the plugin should only occur in situations where installing and configuring zkg is not reasonable. If you are running zeek in an environment where you do not have Internet connectivity, investigate bundles or creating an internal package source.

These instructions could also be helpful if you were interested in distributing this as a package (such as a deb or rpm).

  1. Install librdkafka, a native client library for Kafka. This plugin has been tested against librdkafka v1.4.4.

    In order to use this plugin within a kerberized Kafka environment, you will also need libsasl2 installed and will need to pass --enable-sasl to the configure script.

    $ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.4.tar.gz | tar xvz
    $ cd librdkafka-1.4.2/
    $ ./configure --enable-sasl
    $ make
    $ sudo make install
    
  2. Build the plugin using the following commands.

    $ ./configure --with-librdkafka=$librdkafka_root
    $ make
    $ sudo make install
    $ ldconfig
    
  3. Run the following command to ensure that the plugin was installed successfully.

    $ zeek -N Seiso::Kafka
    Seiso::Kafka - Writes logs to Kafka (dynamic, version 1.2.0)
    

Activation

The following examples highlight different ways that the plugin can be used. Simply add the Zeek script language to your local.zeek file (for example, /usr/share/zeek/site/local.zeek) as shown to demonstrate the example.

In addition to activating the plugin, when running Zeek in a cluster it is highly recommended to leverage one or more Zeek loggers as shown here to separate logging activities from the manager thread.

Example 1 - Send a list of logs to kafka

The goal in this example is to send all HTTP and DNS records to a Kafka topic named zeek.

  • Any configuration value accepted by librdkafka can be added to the kafka_conf configuration table.
  • The topic_name will default to send all records to a single Kafka topic called 'zeek'.
  • Defining logs_to_send will send the HTTP and DNS records to the brokers specified in your Kafka::kafka_conf.
@load packages/zeek-kafka
redef Kafka::logs_to_send = set(HTTP::LOG, DNS::LOG);
redef Kafka::kafka_conf = table(
    ["metadata.broker.list"] = "server1.example.com:9092,server2.example.com:9092"
);

Example 2 - Send all active logs

This plugin has the ability send all active logs to the "zeek" kafka topic with the following configuration.

@load packages/zeek-kafka
redef Kafka::send_all_active_logs = T;
redef Kafka::kafka_conf = table(
    ["metadata.broker.list"] = "localhost:9092"
);

Example 3 - Send all active logs with exclusions

You can also specify a blacklist of zeek logs to ensure they aren't being sent to kafka regardless of the Kafka::send_all_active_logs and Kafka::logs_to_send configurations. In this example, we will send all of the enabled logs except for the Conn log.

@load packages/zeek-kafka
redef Kafka::send_all_active_logs = T;
redef Kafka::logs_to_exclude = set(Conn::LOG);
redef Kafka::topic_name = "zeek";
redef Kafka::kafka_conf = table(
    ["metadata.broker.list"] = "localhost:9092"
);

Example 4 - Send each zeek log to a unique topic

It is also possible to send each log stream to a uniquely named topic. The goal in this example is to send all HTTP records to a Kafka topic named http and all DNS records to a separate Kafka topic named dns.

  • The topic_name value must be set to an empty string.
  • The $path value of Zeek's Log Writer mechanism is used to define the topic name.
  • Any configuration value accepted by librdkafka can be added to the $config configuration table.
  • Each log writer accepts a separate configuration table.
@load packages/zeek-kafka
redef Kafka::topic_name = "";
redef Kafka::tag_json = T;

event zeek_init() &priority=-10
{
    # handles HTTP
    local http_filter: Log::Filter = [
        $name = "kafka-http",
        $writer = Log::WRITER_KAFKAWRITER,
        $config = table(
                ["metadata.broker.list"] = "localhost:9092"
        ),
        $path = "http"
    ];
    Log::add_filter(HTTP::LOG, http_filter);

    # handles DNS
    local dns_filter: Log::Filter = [
        $name = "kafka-dns",
        $writer = Log::WRITER_KAFKAWRITER,
        $config = table(
                ["metadata.broker.list"] = "localhost:9092"
        ),
        $path = "dns"
    ];
    Log::add_filter(DNS::LOG, dns_filter);
}

Example 5 - Zeek log filtering

You may want to configure zeek to filter log messages with certain characteristics from being sent to your kafka topics. For instance, some tools may not support IPv6 source or destination IPs, so it may be helpful to filter those log messages from being sent to kafka (although there are multiple ways to approach this). In this example we will do that that, and are assuming a somewhat standard zeek kafka plugin configuration, such that:

  • All zeek logs are sent to the default zeek topic.
  • Each JSON message is tagged with the appropriate log type (such as http, dns, or conn), by setting Kafka::tag_json to true.
  • If the log message contains a 128 byte long source or destination IP address, the log is not sent to kafka.
@load packages/zeek-kafka
redef Kafka::tag_json = T;

event zeek_init() &priority=-10
{
    # handles HTTP
    Log::add_filter(HTTP::LOG, [
        $name = "kafka-http",
        $writer = Log::WRITER_KAFKAWRITER,
        $pred(rec: HTTP::Info) = { return ! (( |rec$id$orig_h| == 128 || |rec$id$resp_h| == 128 )); },
        $config = table(
            ["metadata.broker.list"] = "localhost:9092"
        )
    ]);

    # handles DNS
    Log::add_filter(DNS::LOG, [
        $name = "kafka-dns",
        $writer = Log::WRITER_KAFKAWRITER,
        $pred(rec: DNS::Info) = { return ! (( |rec$id$orig_h| == 128 || |rec$id$resp_h| == 128 )); },
        $config = table(
            ["metadata.broker.list"] = "localhost:9092"
        )
    ]);

    # handles Conn
    Log::add_filter(Conn::LOG, [
        $name = "kafka-conn",
        $writer = Log::WRITER_KAFKAWRITER,
        $pred(rec: Conn::Info) = { return ! (( |rec$id$orig_h| == 128 || |rec$id$resp_h| == 128 )); },
        $config = table(
            ["metadata.broker.list"] = "localhost:9092"
        )
    ]);
}

Notes

  • logs_to_send is mutually exclusive with $pred, thus for each log you want to set $pred on, you must individually setup a Log::add_filter and refrain from including that log in logs_to_send.
  • The is_v6_addr() function can also be used in your $pred to identify if an IP address is IPv6.
  • Consider filtering IPv6 logs from the upstream consumer instead of in the log writer itself. The benefit to this approach is that kafka would receive an unfiltered set of logs, and other consumers which do suppot IPv6 would have access to those logs.

Example 6 - Sending a log to multiple topics

You are able to send a single zeek log to multiple different kafka topics in the same kafka cluster by overriding the default topic (configured with Kafka::topic_name) by creating a custom zeek Log::Filter. In this example, the DHCP, RADIUS, and DNS logs are sent to the "zeek" topic; the RADIUS log is duplicated to the "shew_zeek_radius" topic; and the DHCP log is duplicated to the "shew_zeek_dhcp" topic.

@load packages/zeek-kafka
redef Kafka::logs_to_send = set(DHCP::LOG, RADIUS::LOG, DNS::LOG);
redef Kafka::topic_name = "zeek";
redef Kafka::kafka_conf = table(
    ["metadata.broker.list"] = "server1.example.com:9092,server2.example.com:9092"
);
redef Kafka::tag_json = T;

event zeek_init() &priority=-10
{
    # Send RADIUS to the shew_zeek_radius topic
    local shew_radius_filter: Log::Filter = [
        $name = "kafka-radius-shew",
        $writer = Log::WRITER_KAFKAWRITER,
        $path = "shew_zeek_radius"
        $config = table(["topic_name"] = "shew_zeek_radius")
    ];
    Log::add_filter(RADIUS::LOG, shew_radius_filter);

    # Send DHCP to the shew_zeek_dhcp topic
    local shew_dhcp_filter: Log::Filter = [
        $name = "kafka-dhcp-shew",
        $writer = Log::WRITER_KAFKAWRITER,
        $path = "shew_zeek_dhcp"
        $config = table(["topic_name"] = "shew_zeek_dhcp")
    ];
    Log::add_filter(DHCP::LOG, shew_dhcp_filter);
}

Note: Because Kafka::tag_json is set to True in this example, the value of $path is used as the tag for each Log::Filter. If you were to add a log filter with the same $path as an existing filter, Zeek will append "-N", where N is an integer starting at 2, to the end of the log path so that each filter has its own unique log path. For instance, the second instance of conn would become conn-2.

Example 7 - Add static values to each outgoing Kafka message

It is possible to define name value pairs and have them added to each outgoing Kafka json message when tagged_json is set to true. Each will be added to the root json object. * the Kafka::additional_message_values table can be configured with each name and value * based on the following configuration, each outgoing message will have "FIRST_STATIC_NAME": "FIRST_STATIC_VALUE", "SECOND_STATIC_NAME": "SECOND_STATIC_VALUE" added.

@load packages/zeek-kafka
redef Kafka::logs_to_send = set(HTTP::LOG, DNS::LOG, Conn::LOG, DPD::LOG, FTP::LOG, Files::LOG, Known::CERTS_LOG, SMTP::LOG, SSL::LOG, Weird::LOG, Notice::LOG, DHCP::LOG, SSH::LOG, Software::LOG, RADIUS::LOG, X509::LOG, RFB::LOG, Stats::LOG, CaptureLoss::LOG, SIP::LOG);
redef Kafka::topic_name = "zeek";
redef Kafka::tag_json = T;
redef Kafka::kafka_conf = table(["metadata.broker.list"] = "kafka-1:9092,kafka-2:9092");
redef Kafka::additional_message_values = table(["FIRST_STATIC_NAME"] = "FIRST_STATIC_VALUE", ["SECOND_STATIC_NAME"] = "SECOND_STATIC_VALUE");
redef Kafka::logs_to_exclude = set(Conn::LOG, DHCP::LOG);
redef Known::cert_tracking = ALL_HOSTS;
redef Software::asset_tracking = ALL_HOSTS;

Settings

logs_to_send

A set of logs to send to kafka.

redef Kafka::logs_to_send = set(Conn::LOG, DHCP::LOG);

send_all_active_logs

If true, all active logs will be sent to kafka other than those specified in logs_to_exclude.

redef Kafka::send_all_active_logs = T;

logs_to_exclude

A set of logs to exclude from being sent to kafka.

redef Kafka::logs_to_exclude = set(Conn::LOG, DNS::LOG);

topic_name

The name of the topic in Kafka where all Zeek logs will be sent to.

redef Kafka::topic_name = "zeek";

kafka_conf

The global configuration settings for Kafka. These values are passed through directly to librdkafka. Any valid librdkafka settings can be defined in this table. The full set of valid librdkafka settings are available here.

redef Kafka::kafka_conf = table(
    ["metadata.broker.list"] = "localhost:9092",
    ["client.id"] = "zeek"
);

additonal_message_values

A table of of name value pairs. Each item in this table will be added to each outgoing message at the root level if tag_json is set to T.

redef Kafka::additional_message_values = table(
    ["FIRST_STATIC_NAME"] = "FIRST_STATIC_VALUE",
    ["SECOND_STATIC_NAME"] = "SECOND_STATIC_VALUE"
);

tag_json

If true, a log stream identifier is appended to each JSON-formatted message. For example, a Conn::LOG message will look like { 'conn' : { ... }}.

redef Kafka::tag_json = T;

json_timestamps

Uses Ascii log writer for timestamp format. Default is JSON::TS_EPOCH. Other options are JSON::TS_MILLIS and JSON::TS_ISO8601.

redef Kafka::json_timestamps = JSON::TS_ISO8601;

max_wait_on_shutdown

The maximum number of milliseconds that the plugin will wait for any backlog of queued messages to be sent to Kafka before forced shutdown.

redef Kafka::max_wait_on_shutdown = 3000;

debug

A comma separated list of debug contexts in librdkafka which you want to enable. The available contexts are:

  • all
  • generic
  • broker
  • topic
  • metadata
  • feature
  • queue
  • msg
  • protocol
  • cgrp
  • security
  • fetch
  • feature
  • interceptor
  • plugin
  • consumer
  • admin

Kerberos

This plugin supports producing messages from a kerberized kafka. There are a couple of prerequisites and a couple of settings to set.

SASL

If you are using SASL as a security protocol for kafka, then you must have libsasl or libsasl2 installed. You can tell if sasl is enabled by running the following from the directory in which you have build librdkafka:

examples/rdkafka_example -X builtin.features
builtin.features = gzip,snappy,ssl,sasl,regex

Producer Config

As stated above, you can configure the producer kafka configs in ${ZEEK_HOME}/share/zeek/site/local.zeek. There are a few configs necessary to set, which are described here. For an environment where the following is true:

  • The broker is node1:6667
  • This kafka is using SASL_PLAINTEXT as the security protocol
  • The keytab used is the example keytab
  • The service principal for example is [email protected]

The kafka topic zeek has been given permission for the example user to write:

# login using the example user
kinit -kt /etc/security/keytabs/example.headless.keytab [email protected]
${KAFKA_HOME}/kafka-broker/bin/kafka-acls.sh --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=node1:2181 --add --allow-principal User:example --topic zeek

The following is how the ${ZEEK_HOME}/share/zeek/site/local.zeek looks:

@load packages/zeek-kafka
redef Kafka::logs_to_send = set(HTTP::LOG, DNS::LOG);
redef Kafka::topic_name = "zeek";
redef Kafka::tag_json = T;
redef Kafka::kafka_conf = table( ["metadata.broker.list"] = "node1:6667"
                               , ["security.protocol"] = "SASL_PLAINTEXT"
                               , ["sasl.kerberos.keytab"] = "/etc/security/keytabs/example.headless.keytab"
                               , ["sasl.kerberos.principal"] = "[email protected]"
                               );

Contributing

If you are interested in contributing to this plugin, please see our CONTRIBUTING.md.

zeek-kafka's People

Contributors

awelzel avatar cestella avatar ckreibich avatar dcode avatar dependabot[bot] avatar derekseisollc avatar ericseiso avatar javabrett avatar jonzeolla avatar mattf-apache avatar nickwallen avatar ottobackwards avatar z0r0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeek-kafka's Issues

Installation failure in all ways

Summary of the issue

I have tried installing on my bare metal RHEL 8 with zkg and with make; sudo make install and all results end in failure.

Environment

  • Zeek 6.0
$ rpm -qa | grep zeek
zeek-6.0-devel-6.0.3-1.1.x86_64
zeek-6.0-btest-data-6.0.3-1.1.x86_64
zeek-6.0-core-6.0.3-1.1.x86_64
zeekctl-6.0-6.0.3-1.1.x86_64
zeek-6.0-zkg-6.0.3-1.1.x86_64
zeek-6.0-btest-6.0.3-1.1.x86_64
zeek-6.0-client-6.0.3-1.1.x86_64
zeek-6.0-spicy-devel-6.0.3-1.1.x86_64
zeek-6.0-6.0.3-1.1.x86_64
  • Version or commit hash of the zeek-kafka package: Git Tag v1.2.0
wget https://github.com/SeisoLLC/zeek-kafka/archive/refs/tags/v1.2.0.zip
  • Operating System and version: RHEL 8.9
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 (Ootpa)
  • Librdkafka Version: 1.4.4
$ grep RD_KAFKA_VERSION /usr/local/include/librdkafka/*
/usr/local/include/librdkafka/rdkafkacpp.h:#define RD_KAFKA_VERSION  0x010404ff
/usr/local/include/librdkafka/rdkafkacpp.h: * @sa See RD_KAFKA_VERSION for how to parse the integer format.
/usr/local/include/librdkafka/rdkafka.h:#define RD_KAFKA_VERSION  0x010404ff
/usr/local/include/librdkafka/rdkafka.h: * @sa See RD_KAFKA_VERSION for how to parse the integer format.

[preston@skid librdkafka-1.4.4]$ examples/rdkafka_example
Usage: examples/rdkafka_example -C|-P|-L -t <topic> [-p <partition>] [-b <host1:port1,host2:port2,..>]

librdkafka version 1.4.4 (0x010404ff)

Installation attempts

Happy Path with zkg .. test fail

$ zkg  install seisollc/zeek-kafka --version v1.2.0
The following packages will be INSTALLED:
  zeek/seisollc/zeek-kafka (v1.2.0)

Verify the following REQUIRED external dependencies:
(Ensure their installation on all relevant systems before proceeding):
  from zeek/seisollc/zeek-kafka (v1.2.0):
    librdkafka ~1.4.2

Proceed? [Y/n] y
"zeek/seisollc/zeek-kafka" requires a "LIBRDKAFKA_ROOT" value (Path to librdkafka installation tree root):
LIBRDKAFKA_ROOT: /usr/local
Saved answers to config file: /opt/zeek/etc/zkg/config
Running unit tests for "zeek/seisollc/zeek-kafka"
error: failed to run tests for zeek/seisollc/zeek-kafka: test_command failed with exit code 1
Proceed to install anyway? [N/y] n
Abort.

Rebuild and try .. test fail

$ cd zeek-kafka-1.2.0/
[preston@skid zeek-kafka-1.2.0]$ make test
make -C tests
make[1]: Entering directory '/home/preston/homeLab/zeek/zeek-kafka/zeek-kafka-1.2.0/tests'
[  0%] kafka.l2s-l2e-no-overlap ... failed
[  7%] kafka.l2s-set-l2e-set ... failed
[ 14%] kafka.l2s-set-l2e-unset ... failed
[ 21%] kafka.l2s-unset-l2e-set ... failed
[ 28%] kafka.l2s-unset-l2e-unset ... failed
[ 35%] kafka.resolved-topic-config ... failed
[ 42%] kafka.resolved-topic-default ... failed
[ 50%] kafka.resolved-topic-override-and-config ... failed
[ 57%] kafka.resolved-topic-override-only ... failed
[ 64%] kafka.send-all-active-logs-l2e-set ... failed
[ 71%] kafka.send-all-active-logs-l2e-unset ... failed
[ 78%] kafka.send-all-active-logs-l2s-set-l2e-set ... failed
[ 85%] kafka.send-all-active-logs-l2s-set-l2e-unset ... failed
[ 92%] kafka.show-plugin ... failed
14 of 14 tests failed
make[1]: *** [Makefile:19: test] Error 1
make[1]: Leaving directory '/home/preston/homeLab/zeek/zeek-kafka/zeek-kafka-1.2.0/tests'
make: *** [Makefile:52: test] Error 2

YOLO

Force the install; hell to the test results.

$ sudo make install
$ zeek -N
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/lib/zeek/plugins/SEISO_KAFKA//lib/SEISO-KAFKA.linux-x86_64.so: /opt/zeek/lib/zeek/plugins/SEISO_KAFKA//lib/SEISO-KAFKA.linux-x86_64.so: undefined symbol: _ZN4zeek6plugin6Plugin12HookLoadFileENS1_8LoadTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

Remove the install and zeek works again

$ rm -Rf /opt/zeek/lib/zeek/plugins/SEISO_KAFKA/
$ zeek -N
Zeek::AF_Packet - Packet acquisition via AF_Packet (built-in)
Zeek::ARP - ARP packet analyzer (built-in)
Zeek::AsciiReader - ASCII input reader (built-in)
Zeek::AsciiWriter - ASCII log writer (built-in)
Zeek::AYIYA - AYIYA packet analyzer (built-in)

Assistance Request

  • I believe I have followed the instructions in the README.
  • I have verified I have installed librdkafka 1.4.4, and I tried 1.4.2 also.
  • On slack, the zeek-kafka 1.2.0 was mentioned as supporting zeek 6.0.

What else could I be doing wrong?

typo in README.md: seiso instead of seisollc

Summary of the issue

Documentations says, under install the plugin using zkg install

zkg install seiso/zeek-kafka --version main

when it should say

zkg install seisollc/zeek-kafka --version main

plus all the dependent text below it which says seiso instead of seisollc.
A global search and replace will fix it.

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version

Update copyright to fix linting errors

Summary of the issue

listing checks against current year, and we have 2022 in the files

Expected behavior

linting passes

Steps to reproduce

run actions or ci/lint.sh

Installing zeek-Kafka error

Summary of the issue

I am trying to install zeek-kafka
But facing error

Expected behavior

...
I expect it to get installed

Steps to reproduce

...
$ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.2.tar.gz | tar xvz
$ cd librdkafka-1.4.2/
$ ./configure --enable-sasl
$ make
$ sudo make install

/opt/zeek/bin/zkg install seisollc/zeek-kafka
Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...
`root@CT:/opt/zeek/bin# ./zkg install seisollc/zeek-kafka
The following packages will be INSTALLED:
zeek/seisollc/zeek-kafka (v1.0.0)

Verify the following REQUIRED external dependencies:
(Ensure their installation on all relevant systems before proceeding):
from zeek/seisollc/zeek-kafka (v1.0.0):
librdkafka ~1.4.2-RC1

Proceed? [Y/n] Y
zeek/seisollc/zeek-kafka asks for LIBRDKAFKA_ROOT (Path to librdkafka installation tree root) ? [/usr/local]
Saved answers to config file: /opt/zeek/etc/zkg/config
Running unit tests for "zeek/seisollc/zeek-kafka"
error: "zeek/seisollc/zeek-kafka" tests failed, inspect contents of /opt/zeek/var/lib/zkg/testing/zeek-kafka for details, especially any "zkg.test_command.{stderr,stdout}" files within /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka
Proceed to install anyway? [N/y] y
Installing "zeek/seisollc/zeek-kafka"...................................................
Installed "zeek/seisollc/zeek-kafka" (v1.0.0)
Loaded "zeek/seisollc/zeek-kafka"
root@CT:/opt/zeek/bin# ./zeek -N Seiso::Kafka
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/lib/zeek/plugins/packages/zeek-kafka//lib/SEISO-KAFKA.linux-x86_64.so: /usr/local/lib/librdkafka++.so.1: undefined symbol: rd_kafka_commit_transaction
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors
root@CT:/opt/zeek/bin# ^C
`

zkg.test_command.stderr

kafka.l2s-l2e-no-overlap ... failed
% 'zeek ../../../scripts/Seiso/Kafka/ /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/tests/.tmp/kafka.l2s-l2e-no-overlap/l2s-l2e-no-overlap.zeek > output' failed unexpectedly (exit code 1)
% cat .stderr
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/build//lib/SEISO-KAFKA.linux-x86_64.so: /usr/local/lib/librdkafka++.so.1: undefined symbol: rd_kafka_commit_transaction
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

kafka.l2s-set-l2e-set ... failed
% 'zeek ../../../scripts/Seiso/Kafka/ /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/tests/.tmp/kafka.l2s-set-l2e-set/l2s-set-l2e-set.zeek > output' failed unexpectedly (exit code 1)
% cat .stderr
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/build//lib/SEISO-KAFKA.linux-x86_64.so: /usr/local/lib/librdkafka++.so.1: undefined symbol: rd_kafka_commit_transaction
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

kafka.l2s-set-l2e-unset ... failed
% 'zeek ../../../scripts/Seiso/Kafka/ /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/tests/.tmp/kafka.l2s-set-l2e-unset/l2s-set-l2e-unset.zeek > output' failed unexpectedly (exit code 1)
% cat .stderr
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/var/lib/zkg/testing/zeek-kafka/clones/zeek-kafka/build//lib/SEISO-KAFKA.linux-x86_64.so: /usr/local/lib/librdkafka++.so.1: undefined symbol: rd_kafka_commit_transaction
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

Your environment

  • Version of Zeek : 4.0.5
  • Version or commit hash of the zeek-kafka package : latest
  • Operating System and version Ubuntu 18.04

@load package/zeek-kafka can‘t find

I installed zeek-kafka via Manual Installation and it successfully outputs as follows
[root@securitypublicservicestest-bj-1 172.16.252.5 bin]# . /zeek -N Seiso::Kafka
Seiso::Kafka - Writes logs to Kafka (dynamic, version 0.3.0)

I followed up by writing local.zeek by referring to the documentation, which looks like this
@load packages/zeek-kafka
redef Kafka::send_all_active_logs = T;
redef Kafka::kafka_conf = table(
["metadata.broker.list"] = "localhost:9092"
).

At this point an error message is given
[ZeekControl] > deploy
checking configurations ...
zeek scripts failed.
fatal error in /opt/zeek/share/zeek/site/local.zeek, line 121: can't find packages/zeek-kafka

[ZeekControl] > quit

Fix README instructions to not include sasl

Summary of the issue

Currently we specify to run ./configure --enable-sasl, but many environments (and most of our users) do not have kerberized kafka clusters. We should default to the most typical setup instructions, but keep the note about enabling sasl.

Refactor docker/ to e2e/

Summary of the issue

The docker/ directly has evolved since its initial creation, and is really a framework for e2e testing. It should be more clearly labelled and documented.

support for zeek 5.0

Summary of the issue

Support for the latest 5.0 release

Expected behavior

...

Steps to reproduce

...

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version

Kakfa plugin fails under FreeBSD 13.1

Summary of the issue

Kafka install plugin works ok but when I run "zeekctl deploy" returns the following error:

==== stderr.log
error in /nsm/zeek/spool/installed-scripts-do-not-touch/site/packages/./zeek-kafka/./logs-to-kafka.zeek, line 25: unknown identifier logs_to_send, at or near "logs_to_send"
internal error in /nsm/zeek/spool/installed-scripts-do-not-touch/site/packages/./zeek-kafka/./logs-to-kafka.zeek, line 25: Failed to find variable named: Kafka::kafka_conf
/opt/zeek/share/zeekctl/scripts/run-zeek: line 110: 27422 Abort trap nohup "$myzeek" "$@"

Expected behavior

That it works

Steps to reproduce

  • Install Zeek 4.0.6 under FreeBSD 13.1 with the following zkgs:

zeek/corelight/zeek-community-id (installed: 3.2.1) - "Community ID" flow hash support in conn.log
zeek/corelight/zeek-long-connections (installed: v1.2.0) - Find and log long-lived connections into a "conn_long" log.
zeek/salesforce/hassh (installed: master) - HASSH is used to identify specific Client and Server SSH implementations.
zeek/salesforce/ja3 (installed: master) - JA3 creates 32 character SSL client fingerprints and logs them as a field in ssl.log.
zeek/zeek/zeek-netmap (installed: v2.0.0) - Packet source plugin that provides native Netmap support.

  • Install librdkafka-1.8.2 from FreeBSD ports and install zeek/seisollc/zeek-kafka using zkg.
  • Configure Kafka plugin in Zeek with the following options:

redef Kafka::tag_json = T;
redef Kafka::send_all_active_logs = T;
redef Kafka::topic_name = "zeek";
redef Kafka::kafka_conf = table(
["metadata.broker.list"] = "172.22.58.8:9092"
);

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

==== stderr.log
error in /nsm/zeek/spool/installed-scripts-do-not-touch/site/packages/./zeek-kafka/./logs-to-kafka.zeek, line 25: unknown identifier logs_to_send, at or near "logs_to_send"
internal error in /nsm/zeek/spool/installed-scripts-do-not-touch/site/packages/./zeek-kafka/./logs-to-kafka.zeek, line 25: Failed to find variable named: Kafka::kafka_conf
/opt/zeek/share/zeekctl/scripts/run-zeek: line 110: 27422 Abort trap nohup "$myzeek" "$@"

Your environment

  • Zeek 4.0.6
  • zeek/seisollc/zeek-kafka (v1.0.0)
  • FreeBSD 13.1

metron-bro-plugin-kafka doesn't build with Zeek 4.0.0

Summary of the issue

metron-bro-plugin-kafka doesn't build with zeek 4.00 RC2

Expected behavior

zkg install metron-bro-plugin kafka should result in 0 error code.

Steps to reproduce

zkg install metron-bro-plugin kafka

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

in ~/.zkg/testing/metron-bro-plugin-kafka/clones/metron-bro-plugin-kafka/zkg.test_command.stderr:

kafka.l2s-l2e-no-overlap ... failed
% 'bro ../../../scripts/Apache/Kafka/ /home/nahum/.zkg/testing/metron-bro-plugin-kafka/clones/metron-bro-plugin-kafka/tests/.tmp/kafka.l2s-l2e-no-overlap/l2s-l2e-no-overlap.bro > output' failed unexpectedly (exit code 134)
% cat .stderr
error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 15: identifier not defined: PacketAnalyzer::Tag
error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 15: identifier not defined: PacketAnalyzer::Tag
internal error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 29: internal variable peer_description missing
/home/nahum/zeek-3.0.12/build/src/bro: line 32: 69816 Aborted (core dumped) "${base}/${new}" "$@"

kafka.l2s-set-l2e-set ... failed
% 'bro ../../../scripts/Apache/Kafka/ /home/nahum/.zkg/testing/metron-bro-plugin-kafka/clones/metron-bro-plugin-kafka/tests/.tmp/kafka.l2s-s
et-l2e-set/l2s-set-l2e-set.bro > output' failed unexpectedly (exit code 134)
% cat .stderr
error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 15: identifier not defined: PacketAnalyzer::Tag
error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 15: identifier not defined: PacketAnalyzer::Tag
internal error in /usr/local/zeek/share/zeek/base/bif/packet_analysis.bif.zeek, line 29: internal variable peer_description missing
/home/nahum/zeek-3.0.12/build/src/bro: line 32: 69836 Aborted (core dumped) "${base}/${new}" "$@"
etc.

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version
    zeek 4.0 RC 2
    metron-bro-plugin-kafka
    Ubuntu 20.04

Automate the testing of the kafka plugin examples

We provide a fair number of example code blocks in the README.md which are not appropriately tested. We should dynamically extract each example from the markdown and insert them into individual e2e runs.

Is there a docker image I can pull from?

Summary of the issue

Is there a container registry with a docker image that has zeek and the kafka plugin built-in? And hopefully with a multistage build to separate build dependencies from runtime dependencies, perhaps using e.g. broplayground/bro:<tag> as a base? I am having a poor experience compiling zeek and installing/compiling the kafka plugin into my own docker image (I'll record that as a separate issue).

I know there are dockerfiles used as a part of CI testing, but I'd rather pull a ready-made image off the shelf if it exists. Thank you for your work on this plugin!

Zeek-Kafka not installed properly , error in tests

Summary of the issue

...
I tried to install zeek-kafka but it failed

Expected behavior

...
It should get installed and work

Steps to reproduce

...
installed librdkafka and libsasl2-dev

Then
$ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.2.tar.gz | tar xvz
$ cd librdkafka-1.4.2/
$ ./configure --enable-sasl
$ make
$ sudo make install
Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...
root@admin:/usr/local/zeek/bin# ./zkg install seisollc/zeek-kafka
The following packages will be INSTALLED:
zeek/seisollc/zeek-kafka (v1.0.0)

Verify the following REQUIRED external dependencies:
(Ensure their installation on all relevant systems before proceeding):
from zeek/seisollc/zeek-kafka (v1.0.0):
librdkafka ~1.4.2-RC1

Proceed? [Y/n] y
"zeek/seisollc/zeek-kafka" requires a "LIBRDKAFKA_ROOT" value (Path to librdkafka installation tree root):
LIBRDKAFKA_ROOT: /usr/local
Saved answers to config file: /usr/local/zeek/etc/zkg/config
Running unit tests for "zeek/seisollc/zeek-kafka"
error: failed to run tests for zeek/seisollc/zeek-kafka: test_command failed with exit code 1
Proceed to install anyway? [N/y]

Your environment

  • Version of Zeek 4.0.5
  • Version or commit hash of the zeek-kafka package main
  • Operating System and version ubuntu 20.04

SEISO-KAFKA.linux-x86_64.so can not link librdkafka.so.1

Summary of the issue

SEISO-KAFKA.linux-x86_64.so can not link librdkafka.so.1, but can link librdkafka++.so.1

Expected behavior

zeek can load this kafka-plugin

Steps to reproduce

ubuntu desktop 20.04
librdkafka 1.6.x branch
./configure --enable-sasl
make install librdkafka in /usr/local/lib
zeek-kafka main branch
./configure --with-librdkafka=/usr/local/lib --zeek-dist=$zeek_root
make && make install

ldd SEISO-KAFKA.linux-x86_64.so
linux-vdso.so.1 (0x00007fff71fc1000)
librdkafka++.so.1 => /usr/local/lib/librdkafka++.so.1 (0x00007f56967a7000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f56965b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5696599000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f56963a7000)
librdkafka.so.1 => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5696258000)

readelf -d SEISO-KAFKA.linux-x86_64.so

Dynamic section at offset 0x20c68 contains 28 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [librdkafka++.so.1]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [/usr/local/lib]
0x000000000000000c (INIT) 0x11000
0x000000000000000d (FINI) 0x1bd14

root@frank-HP-Notebook:/usr/local/lib# pwd
/usr/local/lib
root@frank-HP-Notebook:/usr/local/lib# ls -l
total 51084
-rw-r--r-- 1 root root 3174658 11月 21 14:58 libparaglob.a
-rwxr-xr-x 1 root root 7000146 11月 25 11:08 librdkafka++.a
-rwxr-xr-x 1 root root 25705810 11月 25 11:08 librdkafka.a
lrwxrwxrwx 1 root root 17 11月 25 11:08 librdkafka++.so -> librdkafka++.so.1
lrwxrwxrwx 1 root root 15 11月 25 11:08 librdkafka.so -> librdkafka.so.1
-rwxr-xr-x 1 root root 2466528 11月 25 11:08 librdkafka++.so.1
-rwxr-xr-x 1 root root 13940528 11月 25 11:08 librdkafka.so.1

I know I can copy librdkafka.so.1 to PATH of /usr/lib to avoid this issue,
but I don't know what's the runpath to load librdkafka.so.1 when load this plugin

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

  • Version of Zeek
    [frank] 5.0.2
  • Version or commit hash of the zeek-kafka package
    [frank] b632187
  • Operating System and version
  • [frank] ubuntu desktop 20.04

Update MAINTAINERS.md release instructions

Summary of the issue

We have some missing instructions in the MAINTAINERS.md. You need to run pipenv install --deploy --ignore-pipfile --dev in order to setup your environment, and you need to push to a feature branch and open a PR for releases because we have a branch policy that prevents directly pushing to main.

Also, currently the instructions have you push the v tag to the feature branch, but we don't want this. It should only get pushed to the main branch.

Logger crashes when sending large amounts of data through kafka

Summary of the issue

Logger crashes when sending large amounts of data through kafka

Expected behavior

Logger should not crash, just work

Steps to reproduce

compile zeek,
zkg install zeek-kafka
set up a cluster (details below)
wait about 5-10 minutes
logger crashes with following output from zeekctl:

=== reporter.log
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)
1619025854.806638 Reporter::ERROR conn/Log::WRITER_KAFKAWRITER: Kafka send failed: Local: Queue full (empty)

the "Kafka send failed" is from line 270 of KafkaWriter.cc in the zeek-kafka source.

node.cfg:

[logger]
type=logger
host=localhost

[manager]
type=manager
host=localhost

[proxy-1]
type=proxy
host=localhost

[worker-1]
type=worker
host=localhost
interface=ens1f0
lb_method=pf_ring
lb_procs=22
pin_cpus=1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24

[worker-2]
type=worker
host=localhost
interface=ens1f1
lb_method=pf_ring
lb_procs=22
pin_cpus=25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

zeek-3.0.12
zeek-kafka version 0.3.0 (whatever is installled over zkg)
librdkafka ~1.4.2
Ubuntu 20.04.02 (Linux 5.4.0-70-generic x86_64)
pf_ring 7.8

Automate releases

Summary of the issue

Releases should:

  • Be simple and automated
  • Use GitHub's release mechanism
  • Include a changelog
  • Ensure zkg.meta points to that release's version, allowing us to change our main's zkg.meta to indicate main as the version.

Consider backfilling releases for 0.1, 0.2, and 0.3.

Release automation doesn't wait for PR merge

Summary of the issue

When cutting a release, if you follow the current instructions the v tag gets pushed to a feature branch, which triggers the .github/workflows/release.yml workflow and cuts a release before e2e testing and PR review is complete.

[Requirements] zeek-kafka supports compression

Summary of the issue

[Requirements] zeek-kafka supports compression

Expected behavior

The expectation is that message bodies can be compressed in transit, which reduces the consumption of network bandwidth resources and Kafka's read and write consumption
expect the addition of snappy as a type of compression

Thanks you!

Add RPMs and DEBs to releases

We should be able to automatically include artifacts such as RPMs and DEBs to our releases, using tags from the versions specified in the package.

This would provide an install method independent of zkg.

@load packages/zeek-kafka can't find

I installed zeek-kafka via Manual Installation and it successfully outputs as follows
[root@securitypublicservicestest-bj-1 172.16.252.5 bin]# . /zeek -N Seiso::Kafka
Seiso::Kafka - Writes logs to Kafka (dynamic, version 0.3.0)

I followed up by writing local.zeek by referring to the documentation, which looks like this
@load packages/zeek-kafka
redef Kafka::send_all_active_logs = T;
redef Kafka::kafka_conf = table(
["metadata.broker.list"] = "localhost:9092"
).

At this point an error message is given
[ZeekControl] > deploy
checking configurations ...
zeek scripts failed.
fatal error in /opt/zeek/share/zeek/site/local.zeek, line 121: can't find packages/zeek-kafka

[ZeekControl] > quit

Update librdkafka?

The version of librdkafka seems fixed at 1.4.2, which is about a year and a half old at this point. Any reason not to use a newer version? Maybe this can be incorporated into CI?

Also, all the examples show compiling librdkafka from source. Any reason not to install it with a package manager?

Security Policy violation SECURITY.md

This issue was automatically created by Allstar.

Security Policy Violation
Security policy not enabled.
A SECURITY.md file can give users information about what constitutes a vulnerability and how to report one securely so that information about a bug is not publicly visible. Examples of secure reporting methods include using an issue tracker with private issue support, or encrypted email with a published key.

To fix this, add a SECURITY.md file that explains how to handle vulnerabilities found in your repository. Go to https://github.com/SeisoLLC/zeek-kafka/security/policy to enable.

For more information, see https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository.


This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Support for zeek 4.2

Summary of the issue

Before 5.0 releases there should be support for the last 4.x feature release

Expected behavior

...

Steps to reproduce

...

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version

Installation fails on 4.0.4 (TypeError: cannot unpack non-iterable UserVar object)

Summary of the issue

The plugin fails to install on zeek 4.0.4, throwing the following error:

TypeError: cannot unpack non-iterable UserVar object

Expected behavior

The plugin installs properly with zkg

Steps to reproduce

cd /usr/src/zeek-${ZEEK_VERSION}/ && ./configure --with-pcap=/usr/local --prefix=/opt/zeek && make -j4 && make install
zkg autoconfig --force
zkg install seisollc/zeek-kafka --version v1.0.0 --force

Logs, errors, etc.

# zkg install seisollc/zeek-kafka --version v1.0.0 --force
Traceback (most recent call last):
  File "/opt/zeek/bin/zkg", line 2511, in <module>
    main()
  File "/opt/zeek/bin/zkg", line 2508, in main
    args.run_cmd(manager, args, config, configfile)
  File "/opt/zeek/bin/zkg", line 603, in cmd_install
    [info for info, _, _ in package_infos])
  File "/opt/zeek/bin/zkg", line 120, in prompt_for_user_vars
    for key, value, desc in requested_user_vars:
TypeError: cannot unpack non-iterable UserVar object

Your environment

  • Zeek 4.0.4 (LTS)
  • 1.0.0
  • Debian stable

How to configure Bucket size , message size and message per second rate

Summary of the issue

...
I want to measure the rate at which Kafka will be processing for 1G or 10G /s rate
So How to configure Bucket size , message size and message per second rate to check the sizing of kafka
in this plugin anyway to modify or check that

Your environment

  • Version of Zeek 4.0.5
  • Version or commit hash of the zeek-kafka package current
  • Operating System and version 20.04 LTS

Add GitHub Actions for CI

We should configure GitHub Actions to run the end to end testing script, and configure the repo to block PRs that fail.

How to stop local Logging and just send to Kafka

Summary of the issue

I want this plugin to send data to kafka only , not write logs in /zeek/logs/current folder on disk.
How to do that , I tried one method but it failed.

Expected behavior

Should send logs only to kafka

Steps to reproduce

Installed as mentioned in Read me of this plugin
Then I edited local.zeek with

redef Log::enable_local_logging=F

To disable local logging but it also stoppped sending data to kafka

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

Not able to stop local logging

Your environment

  • Version of Zeek 4.0.5
  • Version or commit hash of the zeek-kafka package current
  • Operating System and version 20.04 ubuntu

Update documentation to show log filtering configuration for Zeek 5.x

Summary of the issue

Current documentation for applying a filter to a zeek stream before it is sent to Kafka is using the "$pred" feature. This feature was depreciated in Zeek version 4.x in favor of using the "hook" feature (https://docs.zeek.org/en/master/frameworks/logging.html#filter-log-records) but was still supported, but in version 5.x a "zeekctl check" will fail with:

error in /usr/local/zeek/share/zeek/site/local.zeek, lines 150-158: orphaned field "pred" in record coercion ((coerce [$name=kafka-ssl, $writer=Log::WRITER_KAFKAWRITER, $config=table(metadata.broker.list = cikafka.my-company.com:9093), $pred=no_ssl_int, $path=DC2_Network_Monitor_Zeek_SSL_Raw] to Log::Filter))

The above referenced Zeek documentation shows how to filter using hooks with the ASCII writer, but it is unclear how to implement a hook filter specific to a Kafka topic in a local.zeek configuration file.

Your environment

  • Version of Zeek - 5.0.8
  • Version or commit hash of the zeek-kafka package - v1.1.0
  • Operating System and version - Ubuntu Server 20.04

Error in Sending logs

Summary of the issue

...
It is not sending logs also It can't find package

Expected behavior

...
Should send logs

Steps to reproduce

...
Install librdkafka, a native client library for Kafka. This plugin has been tested against librdkafka v1.4.2.

In order to use this plugin within a kerberized Kafka environment, you will also need libsasl2 installed and will need to pass --enable-sasl to the configure script.

$ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.2.tar.gz | tar xvz
$ cd librdkafka-1.4.2/
$ ./configure --enable-sasl
$ make
$ sudo make install
Build the plugin using the following commands.

$ ./configure --with-librdkafka=$librdkafka_root --zeek-dist=/home/ashok/zeek
$ make
$ sudo make install
$ ldconfig
Run the following command to ensure that the plugin was installed successfully.

$ zeek -N Seiso::Kafka
Seiso::Kafka - Writes logs to Kafka (dynamic, version 1.0.0)

I am able to complete all steps till now

Logs, errors, etc.

...
But when i run zeekctl deploy , I get error as
fatal error in /usr/local/zeek/share/zeek/site/local.zeek, line 110: can't find packages/zeek-kafka

Also I can't find any package folder
So I did this @load /usr/local/zeek/lib/zeek/plugins/SEISO_KAFKA/scripts
I don't know this path is right or wrong because I am not getting packages/zeek-kafka
I can see logs created in current folder

Your environment

  • Version of Zeek 4.0.5
  • Version or commit hash of the zeek-kafka package as given in commands
  • Operating System and version 18.04 ubuntu

Improve e2e caching

Summary of the issue

Right now there is always a cache hit per-runner OS, so the cache is never updated. Example here.

Expected behavior

Caches used in GitHub Actions are updated when changes are made to the docker images used for e2e testing.

Steps to reproduce

Run CI and observe the Post Run actions/cache@v2 step.

zeek-kafka installation causes zeek startup failure

Hi, I installed zeek-6.0.2 via rpm package on a centos8 machine, and then proceeded to install librdkafka and zeek-kafka, which were successful, but reported errors when running zeek. Without installing zeek-kafka, zeek is working fine.The same operation is possible to install and use zeek-kafka on the previous centos7 machines.I hope you can give some help, thank you!

[ZeekControl] > deploy
checking configurations ...
zeek scripts failed.
error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: cannot load plugin library /opt/zeek/lib/zeek/plugins/SEISO_KAFKA//lib/SEISO-KAFKA.linux-x86_64.so: /opt/zeek/lib/zeek/plugins/SEISO_KAFKA//lib/SEISO-KAFKA.linux-x86_64.so: undefined symbol: ZN4zeek6plugin6Plugin12HookLoadFileENS1_8LoadTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA
fatal error in /opt/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

Still can't get zeek-kafka to work

Summary of the issue

zeek-kafka doesn't work, either via zkg or manual install

Expected behavior

...

Steps to reproduce

  1. zkg install:
    zkg install seiso/zeek-kafka --version main
    error: invalid package "seiso/zeek-kafka": package name not found in sources and also not a usable git URL (invalid or inaccessible, use -vvv for details)

  2. manual install:
    ./configure --with-librdkafka=$LIBRDKAFKA_ROOT
    make
    sudo make install
    zeek -N Seiso::Kafka
    Seiso::Kafka - Writes logs to Kafka (dynamic, version 0.3.0)
    zeek -r file.pcap /usr/local/zeek/share/zeek/site/local.zeek
    fatal error in /usr/local/zeek/share/zeek/site/kafka.zeek, line 2: can't find packages/zeek-kafka/Seiso/Kafka
    looking in /usr/local/zeek/share/zeek/site/packages, there is nothing there

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

...

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version

zeek 4.0.0-rc2
version 0.3
Ubuntu 20.04

How to add Partition in local.zeek configuration

Summary of the issue

I want to add Partition in local.zeek file that contain configuration for kafka.

Expected behavior

To create a x number of partition in all files

Steps to reproduce

...

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

I am trying ["partition"]=10 in Kafka::Config
But it is not working

Your environment

  • Version of Zeek
  • Version or commit hash of the zeek-kafka package
  • Operating System and version

zeek log send to kafka with differnet topic per module

Summary of the issue

it works all module with same topic.
but it doest work with different topic,
I test this scenario case based on example 4 in README file

Expected behavior

...

Steps to reproduce

1 module Kafka;
2
3
4 #redef Kafka::logs_to_send = set(HTTP::LOG, DNS::LOG);
5 redef Kafka::topic_name = "";
6 #redef Kafka::send_all_active_logs = T;
7 redef Kafka::tag_json = T;

event zeek_init() &priority=-10
{
local pop_filter: Log::Filter = [
$name = "kafka-pop",
$writer = Log::WRITER_KAFKAWRITER,
$config = table(
["metadata.broker.list"] = "192.168.31.138:9092"
),
$path = "zeek_pop3"
];
Log::add_filter(HM_POP3::LOG, pop_filter);
}

Where applicable, consider providing a patch that uses the end to end testing environment.

Logs, errors, etc.

%3|1669597397.563|FAIL|rdkafka#producer-1| [thrd:localhost:9092/bootstrap]: localhost:9092/bootstrap: Connect to ipv4#127.0.0.1:9092 failed: Connection refused (after 0ms in state CONNECT)
%3|1669597397.563|ERROR|rdkafka#producer-1| [thrd:localhost:9092/bootstrap]: localhost:9092/bootstrap: Connect to ipv4#127.0.0.1:9092 failed: Connection refused (after 0ms in state CONNECT)
%3|1669597397.563|ERROR|rdkafka#producer-1| [thrd:localhost:9092/bootstrap]: 1/1 brokers are down
1377201785.011707 error: zeek_pop3/Log::WRITER_KAFKAWRITER: Unable to deliver 21 message(s)
1377201785.011707 error: zeek_pop3/Log::WRITER_KAFKAWRITER: terminating thread

Your environment

  • Version of Zeek
  • 5.0.2
  • Version or commit hash of the zeek-kafka package
  • b632187
  • Operating System and version
  • ubuntu 20.04

Zeek-Kafka not work , error in tests

Summary of the issue

...
The plugin installation failed and the test could not be passed.

Expected behavior

...
Pass the test and complete the installation.

Steps to reproduce

...
$ curl -L https://github.com/edenhill/librdkafka/archive/v1.4.2.tar.gz | tar xvz
$ cd librdkafka-1.4.2/
$ ./configure --enable-sasl
$ make
$ sudo make install

$ zkg install seisollc/zeek-kafka

Logs, errors, etc.

...
$ zkg install seisollc/zeek-kafka
The following packages will be INSTALLED:
zeek/seisollc/zeek-kafka (v1.0.0)

Verify the following REQUIRED external dependencies:
(Ensure their installation on all relevant systems before proceeding):
from zeek/seisollc/zeek-kafka (v1.0.0):
librdkafka ~1.4.2-RC1

Proceed? [Y/n] y
"zeek/seisollc/zeek-kafka" requires a "LIBRDKAFKA_ROOT" value (Path to librdkafka installation tree root):
LIBRDKAFKA_ROOT: /usr/local
Saved answers to config file: /usr/local/zeek/etc/zkg/config
Running unit tests for "zeek/seisollc/zeek-kafka"
error: failed to run tests for zeek/seisollc/zeek-kafka: test_command failed with exit code 1
Proceed to install anyway? [N/y] n
Abort.

$ zeek -N Seiso::Kafka
error in /usr/local/zeek/share/zeek/base/init-bare.zeek, line 1: plugin Seiso::Kafka is not available
fatal error in /usr/local/zeek/share/zeek/base/init-bare.zeek, line 1: aborting after plugin errors

Your environment

  • Version of Zeek:zeek version 4.2.0
  • Version or commit hash of the zeek-kafka package
  • Operating System and version:Ubuntu 20.04.4 LTS

I had installed zeek-kafka zeek-kafka-1.1.0,but I got (dynamic, version 0.3.0) when I show version

My server version is centos 7,please help me.
How can I change plugin version 1.1.0 to zeek zeek version 5.0.10

CentOS Linux release 7.2.1511 (Core)

3.10.0-327.el7.x86_64

x86_64

[ 37%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/src/Plugin.cc.o
[ 43%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/src/TaggedJSON.cc.o
[ 50%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/kafka.bif.cc.o
[ 56%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/kafka.bif.init.cc.o
[ 62%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/kafka.bif.register.cc.o
[ 68%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/events.bif.cc.o
[ 75%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/events.bif.init.cc.o
[ 81%] Building CXX object CMakeFiles/SEISO-KAFKA.linux-x86_64.dir/events.bif.register.cc.o
[ 87%] Linking CXX shared module lib/SEISO-KAFKA.linux-x86_64.so
make[3]: 离开目录“/zeek-kafka-1.1.0/build”
[ 93%] Built target SEISO-KAFKA.linux-x86_64
make[3]: 进入目录“/zeek-kafka-1.1.0/build”
Scanning dependencies of target dist
make[3]: 离开目录“/zeek-kafka-1.1.0/build”
make[3]: 进入目录“/zeek-kafka-1.1.0/build”
[100%] Building binary plugin package: SEISO_KAFKA.tgz
make[3]: 离开目录“/zeek-kafka-1.1.0/build”
[100%] Built target dist
make[2]: 离开目录“/zeek-kafka-1.1.0/build”
Install the project...
-- Install configuration: "RelWithDebInfo"
make[1]: 离开目录“/zeek-kafka-1.1.0/build”
[1]+ 退出 2 make
[root@localhost zeek-kafka-1.1.0]# ldconfig

[root@localhost zeek-kafka-1.1.0]# zeek -N Seiso::Kafka
Seiso::Kafka - Writes logs to Kafka (dynamic, version 0.3.0)

Security Policy violation Outside Collaborators

This issue was automatically created by Allstar.

Security Policy Violation
Found 1 outside collaborators with admin access.
This policy requires all users with this access to be members of the organisation. That way you can easily audit who has access to your repo, and if an account is compromised it can quickly be denied access to organization resources. To fix this you should either remove the user from repository-based access, or add them to the organization.

OR

If you don't see the Settings tab you probably don't have administrative access. Reach out to the administrators of the organisation to fix this issue.


This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.