Coder Social home page Coder Social logo

syslog-replay's Introduction

syslog-replay

This repository is a combination Dockerfile and example docker-compose.yml file that demonstrates replaying the syslog UDP stream from a previously captured pcap file to an adjacent running Docker container.

This allows for a "live" syslog datastream that plays out over time, and is primarily useful in building custom demos, workshops, proving concepts, etc.

Why do this? When provisioning a demo environment with docker-compose, you won't know the IP address of any of the running containers ahead of time, and it's nice to have a something automatically start sending data over the wire when it starts up.

The rewrite_pcap.sh startup script does the heavy lifting:

  • Determines the private IP of an adjacent running Docker container and rewrites the destination IP and destination MAC of an arbitrary host in the pcap. This is determined by the hostname field for this host in docker-compose.yml

    • Note: this is strictly for delivering the packets (altering headers) and does NOT change the syslog content (altering payload).
  • It then uses tcpreplay to replay the edited pcap on a loop. It's kind of a parlor trick that won't work with syslog over TCP.

The docker-compose.yml file included as an example is from docs.cribl.io and uses a Cribl Worker node as a syslog receiver.

The included syslog.pcap file originally used 192.168.1.107:5140 as the UDP syslog listener. When using your own pcap, adjust the rewrite_pcap.sh script accordingly.

Example Usage

git clone https://github.com/berthayes/syslog-replay && cd syslog-replay

docker build -t syslog-replay .

docker-compose up -d

When using the included example pcap, configure your Cribl worker to listen on UDP 5140 for syslog. Events will flow like tap water, not a firehose.

Using your own pcap file

Ideally, capture packets on the listening interface of your syslog server.

  • Note that the rewrite_pcap.sh script does NOT change the destination port of syslog packets in the saved pcap.

sudo tcpdump -s0 udp and port 5140 -w syslog.pcap

syslog-replay's People

Contributors

berthayes avatar

Watchers

 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.