Giter Site home page Giter Site logo

berthayes / cp-zeek Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 5.0 172.84 MB

Analyze Zeek IDS data with ksqlDB running on Confluent Platform via Docker on your laptop. Or spin up an arbitrary number of AWS hosts, each running Confluent Platform and ksqlDB for use in an instructor-led workshop.

Zeek 29.86% Python 58.97% Shell 11.17%
ksqldb kafka zeek

cp-zeek's Introduction

Streaming Zeek Events with Apache Kafka and ksqlDB

Custom Start

Custom Start - Download a 1GB PCAP (~ 60 minutes) file from S3 or supply your own

Quickstart

ksqlDB Walkthrough

ksqlDB Walkthrough - A guided walk through using ksqlDB to analyze Zeek and Syslog data.

Running on localhost

git clone https://github.com/berthayes/cp-zeek
cd cp-zeek
docker-compose up -d

Wait about 5 minutes or so for everything to start up, then point your web browser to http://localhost:9021

To start the Syslog and Spooldir connectors, see: Starting the Connectors

Running on an external host

To run this environment on a system that is not your laptop/workstation, edit the docker-compose.yml file.

Look for this line:

CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: "http://localhost:8088"

And change it to something like this:

CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: "http://yourhost.yourdomain.com:8088"

Then start up docker as above with:

docker-compose up -d

Wait about 5 minutes or so for everything to start up, then point your web browser to http://yourhost.yourdomain.com:9021

To start the Syslog and Spooldir connectors, see: Starting the Connectors

Starting the Connectors

If you also want to analyze streaming Syslog data, run:

curl localhost:8083/connectors -X POST -H "Content-Type: application/json" -d @syslog_connect.json

To start the Spooldir connector that consumes a sample URLHaus watchlist, run:

curl localhost:8083/connectors -X POST -H "Content-Type: application/json" -d @urlhaus_spooldir.json

To start the Spooldir connector that consumes a watchlist of ad servers, run:

curl localhost:8083/connectors -X POST -H "Content-Type: application/json" -d @adhosts_spooldir.json

Custom Start

This repository is a customization based on the Quick Start for Apache Kafka Using Confluent Platform (Docker) documentation available here: https://docs.confluent.io/current/quickstart/ce-docker-quickstart.html It focuses on analyzing Zeek and Syslog events with ksqlDB running on the Confluent Platform for Apache Kafka.

Customize Your Environment

This docker-compose.yml leverages an additional Docker image: bertisondocker/zeek-tcpreplay-kafka for generating Zeek data to stream to Apache Kafka in real time. When the image runs, tcpreplay automatically starts reading ./pcaps/zeek_streamer.pcap

To run this with the included packet capture simply run: docker-compose up -d

Analyze Your Own PCAP

To analyze your own packet capture, Copy your pcap file to ./cp-zeek/pcaps/zeek_streamer.pcap The zeek-streamer Docker image begins reading the zeek_streamer.pcap file automatically at startup.

A super-fun pcap for analysis is available here: s3://bhayes-pcaps/garage-2020-10-18.pcap

The get_pcap_from_s3.py script in the workshop_scripts directory will download this PCAP file and rename it to zeek_streamer.pcap for you.

Edit yak_shaving.conf to read:

download_pcap = True

Optionally, edit the S3 bucket and object name to point to your own PCAP file. Then run:

python3 get_pcap_from_s3.py

This packet capture is around 1GB in size and was originally captured over an hour or so. The local network is 192.168.1.0/24 and there are maybe a dozen or so hosts that are active. Some hosts are more active than others, and some hosts’ activities are more interesting than others.

Have fun!

cp-zeek's People

Contributors

berthayes avatar javabrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.