{"id":25625306,"url":"https://github.com/tenzir/dockerized-zeek","last_synced_at":"2025-04-14T10:43:07.029Z","repository":{"id":40506901,"uuid":"388760223","full_name":"tenzir/dockerized-zeek","owner":"tenzir","description":"Dockerized Zeek","archived":false,"fork":false,"pushed_at":"2024-03-09T12:52:51.000Z","size":56,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-28T00:01:35.667Z","etag":null,"topics":["docker","zeek"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenzir.png","metadata":{"funding":{"github":["tenzir"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-23T10:13:35.000Z","updated_at":"2024-07-16T02:18:13.000Z","dependencies_parsed_at":"2023-01-24T17:17:03.243Z","dependency_job_id":null,"html_url":"https://github.com/tenzir/dockerized-zeek","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenzir%2Fdockerized-zeek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenzir%2Fdockerized-zeek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenzir%2Fdockerized-zeek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenzir%2Fdockerized-zeek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenzir","download_url":"https://codeload.github.com/tenzir/dockerized-zeek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248867561,"owners_count":21174748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","zeek"],"created_at":"2025-02-22T14:56:54.757Z","updated_at":"2025-04-14T10:43:07.008Z","avatar_url":"https://github.com/tenzir.png","language":"Dockerfile","funding_links":["https://github.com/sponsors/tenzir"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Dockerized Zeek\n\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \n**A flexible Docker distribution of the [Zeek][zeek] network monitor.**\n\n[![Chat][chat-badge]][chat-url]\n[![License][license-badge]][license-url]\n\u003c/div\u003e\n\n## Usage\n\nThis [Zeek][zeek] Docker setup supports both live and trace-based monitoring.\nThe following environment variables control the runtime behavior of Zeek:\n\n- `$ZEEK_SCRIPT_DIR`: a directory with custom scripts. It is added to\n  `$ZEEKPATH` so that you can load scripts directly (by adjusting\n  `$ZEEK_SCRIPTS` below) without needing to specify an absolute path.\n\n- `$ZEEK_ARGS`: additional command-line arguments to append to the Zeek\n  invocation, before loading scripts.\n\n- `$ZEEK_SCRIPTS`: the set of loaded scripts, after `$ZEEK_ARGS`.\n\n- `$ZEEK_DISABLE_CHECKSUMS`: appends `-C` to invocation to disable computation\n  of IP checksums. Set this variable to a non-empty string when Zeek\n  unvoluntarily skips packets.\n\n- `$ZEEK_INTERFACE`: the name of the interface to read packets from.\n\nThe following mount points control the behavior of this container:\n\n- `/logs`: when mounted, Zeek will write logs into this directory.\n\n  When not mounted, Zeek disables logging to the local file system. You can\n  still use log shipping via Broker (see below).\n\n- `/traces`: when mounted, Zeek will analyze all traces in this directory. The\n  directory must not be empty, otherwise the container exits prematurely. Every\n  file in the directory must be a valid PCAP trace.\n\n  When not mounted, Zeek will listen on interface `$ZEEK_INTERFACE`, or on\n  `af_packet::$ZEEK_INTERFACE` when the AF_PACKET plugin is installed (which is\n  the default).\n\n### Analyze a PCAP file\n\nTo perform a one-shot Zeek run over a given trace file, mount a volume\nwith PCAP traces to `/traces` and a directory for logs to `/logs`.\n\n```sh\ndocker run -it -v pcap-dir:/traces -v log-dir:/logs zeek\n```\n\nThis only works if `/traces` contains at least one trace. If the directory\ncontains multiple traces, `ipsumdump` concatenates the packets from all traces\nand sorts them by their PCAP packet timestamp prior to shoving them into Zeek.\nIf `/traces` is empty or is not mounted, Zeek attempts to analyze live traffic\n(see below).\n\n### Analyze live traffic\n\nTo analyze packets on an interface, simply do not mount `/traces`.\n\nTo capture packets on an interface on the host, pass `--network host` to the\ninvocation. Zeek listens on the interface from the environment variable\n`ZEEK_INTERFACE` (default: `eth0`):\n\n```sh\ndocker run -it -v log-dir:/logs --network host --cap-add net_admin zeek\n```\n\nThe runtime attempts drops privileges to user `zeek` (via `runuser`) before\nrunning `zeek`. If you do not pass `--cap-add net_admin`, then the `zeek`\nprocess will run as root.\n\nThe image will transparently use the `AF_PACKET` plugin for `$ZEEK_INTERFACE` if\navailable, i.e., prefix `$ZEEK_INTERFACE` with `af_packet::`.\n\nA small annoyance for testing: `--network host` doesn't work with Docker\nDesktop for Mac.\n\n### Execute custom scripts\n\nYou can easily provide custom scripts by mounting a script directory to\n`$ZEEK_SCRIPT_DIR` (default: `/zeek`). The directory will be added to\n`$ZEEKPATH` such that you load scripts simply by adding the filename to the\nenvironment variable `$ZEEK_SCRIPTS`.\n\nSay you have a file `magic.zeek` in a local directoy `analysis`. You can load\nit as follows:\n\n```sh\ndocker run -it -v my-scripts:/zeek -e ZEEK_SCRIPTS=magic --network host zeek\n```\n\nNote that this overrides the default value of `$ZEEK_SCRIPTS`.\n\n### Enabling log shipping via Broker\n\nThis Docker image makes it possible to avoid writing logs to disk and ship them\nto a third party via Broker instead. This feature is always available,\nregardless of whether you mounted `/logs`. But it comes in particularly handy\n*without* mounting `/logs` so that Zeek can be seen as a side-effect-free\nfunction streaming logs.\n\nHow does it work? Zeek comes with out-of-the-box functionality to ship logs via\nBroker. Clusterized setups already operate this way, where the master node\nopens a TCP socket and waits for Broker peers to connect, and then to subscribe\nto events.\n\nThis Docker setup doesn't run in cluster mode, but instead executes `zeek`\nbinary right away. (In the future, it will use the [Supervisor\nframework](https://docs.zeek.org/en/master/frameworks/supervisor.html).) The\n[docker-entrypoint script](scripts/docker-entrypoint.zeek) enables the Broker\nconnection so that clients can connect. In particular, subscribing to the topic\n`zeek/logs` allows for tapping into the full feed of logs. Zeek logger nodes\nconsume log events this way and then write them out to their local disk. But\nthird-party applications, such as [VAST](https://github.com/tenzir/vast), can\nconsume this log stream as well.\n\n## Development\n\nTo build the Docker image, run `docker build` from the repository root as\nfollows:\n\n```sh\ndocker build -t zeek .\n```\n\nYou can select a specific Zeek version by adjusting the `ZEEK_VERSION` build\nargument:\n\n```sh\ndocker build -t zeek --build-arg ZEEK_VERSION=5.1.1-0 .\n```\n\nFor the Zeek 5.x series, you can also choose a long-term support (LTS) version\nby setting `ZEEK_LTS`:\n\n```sh\ndocker build -t zeek --build-arg ZEEK_LTS=1 .\n```\n\n\u003cp align=\"center\"\u003e\n  Developed with ❤️ by \u003cstrong\u003e\u003ca href=\"https://tenzir.com\"\u003eTenzir\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n[zeek]: https://www.zeek.org\n[chat-badge]: https://img.shields.io/badge/Slack-Tenzir%20Community%20Chat-brightgreen?logo=slack\u0026color=purple\u0026style=flat\n[chat-url]: http://slack.tenzir.com\n[license-badge]: https://img.shields.io/badge/license-BSD-blue.svg\n[license-url]: https://raw.github.com/vast-io/vast/master/COPYING\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenzir%2Fdockerized-zeek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenzir%2Fdockerized-zeek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenzir%2Fdockerized-zeek/lists"}