Skip to content

Commit 449df30

Browse files
committed
Update readme
1 parent 1b4c626 commit 449df30

File tree

1 file changed

+79
-32
lines changed

1 file changed

+79
-32
lines changed

README.md

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,124 @@
11
# Zeek Summarizer
22

3-
**Zeek Summarizer** is a command-line tool to analyze and summarize Zeek log files. It supports connection logs, DNS, HTTP, and SSL/TLS logs and provides global statistics as well as detailed per-IP or per-port summaries.
3+
`zeek-summarizer` digests a full Zeek log directory (plain TSV or JSON, compressed or not) and produces:
44

5-
## 🔧 Installation
5+
- Global statistics for connections, DNS, HTTP, TLS/SSL, SMB, and SMTP activity.
6+
- Rich per-host drill downs (protocol mix, ports, DNS/HTTP targets, TLS issuers, SMB shares, SMTP senders/recipients, etc.).
7+
- Optional per-port view to see which services are most active or targeted.
8+
- Export to JSON or a self-contained HTML dashboard with interactive charts, search, and filters.
9+
10+
The screenshot above shows the dashboard cards that highlight the busiest DNS queries and HTTP hosts in a capture.
11+
12+
---
13+
14+
## 1. Requirements
15+
16+
- Python 3.10+ (tested with 3.11/3.12/3.13)
17+
- Zeek logs on disk (e.g. `conn.log`, `dns.log`, `http.log`, `ssl.log`, `smtp.log`)
18+
- Packages listed in `requirements.txt`
19+
20+
---
21+
22+
## 2. Installation
623

724
```bash
8-
git clone https://github.com/stratosphereips/zeek-summarizing.git
25+
# Clone the repository
26+
git clone https://github.com/stratosphereips/zeek-summarizer.git
927
cd zeek-summarizer
28+
29+
# Create and activate a virtual environment
1030
python3 -m venv venv
1131
source venv/bin/activate
32+
33+
# Install dependencies
34+
pip install --upgrade pip
1235
pip install -r requirements.txt
1336
```
1437

15-
## 📦 Requirements
38+
To leave the environment later, run `deactivate`.
1639

17-
See `requirements.txt`.
40+
---
1841

19-
## 🚀 Usage
42+
## 3. Quick Start (text summary)
2043

2144
```bash
22-
python zeek-summarizer.py -d <zeek_log_directory> [options]
45+
./zeek-summarizer.sh -d /path/to/zeek/logs
46+
# or python venv/bin/python zeek-summarizer.py -d /path/to/zeek/logs
2347
```
2448

25-
### Options:
49+
Useful CLI flags:
2650

27-
- `-d, --directory` (**required**): Path to the directory containing Zeek logs.
28-
- `-r, --require-activity`: Show only IPs that appear in non-conn logs.
29-
- `-o, --only-conn`: Show only IPs that appear only in conn logs.
30-
- `-p, --per-port`: Show summary per port instead of per IP.
31-
- `--debug`: Show debug information for internal operations.
51+
| Flag | Description |
52+
| --- | --- |
53+
| `-d DIR` | Directory containing Zeek logs (supports rotated `*.log*` and `*.log.gz`). |
54+
| `-r`, `--require-activity` | Only list hosts that appear in non-`conn` logs. |
55+
| `-o`, `--only-conn` | Only list hosts that have `conn` activity and nothing else. |
56+
| `-p`, `--per-port` | Switch to per-port aggregated view. |
57+
| `--local-only` | Keep statistics for private/local IPs only (v4/v6). |
58+
| `--output-format {text,json,html}` | Choose output renderer (default `text`). |
59+
| `--output-file PATH` | Write JSON/HTML to file instead of STDOUT (ignored for `text`). |
3260

33-
## Screenshots
61+
The helper script `zeek-summarizer.sh` simply activates the bundled `venv/` and forwards every argument to the Python entry point (`"$@"`).
3462

35-
![image](https://github.com/user-attachments/assets/b2564745-bb3e-4780-9064-f9606f8c532a)
63+
---
3664

37-
![image](https://github.com/user-attachments/assets/400b673f-6e95-4c61-994b-6a56f1d30619)
65+
## 4. Generate the interactive dashboard
3866

67+
```bash
68+
./zeek-summarizer.sh -d /path/to/zeek/logs \
69+
--output-format html \
70+
--output-file zeek-dashboard.html
3971

40-
## 📊 Examples
72+
# Open the report locally (macOS example)
73+
open zeek-dashboard.html
74+
```
4175

42-
### Basic usage
76+
The HTML uses embedded data: no web server or backend required. Charts cover protocol mix, top DNS/HTTP targets, port targeting, SMTP TLS usage, and SMTP error codes. The search bar and filters let you jump straight to local hosts, specific /24 or /64 networks, or hosts that triggered non-connection logs.
4377

44-
```bash
45-
python zeek-summarizer.py -d ./logs
46-
```
78+
---
4779

48-
### Only show IPs that have non-connection activity:
80+
## 5. Export machine-readable JSON
4981

5082
```bash
51-
python zeek-summarizer.py -d ./logs -r
83+
./zeek-summarizer.sh -d /path/to/zeek/logs \
84+
--output-format json \
85+
--output-file zeek-summary.json
5286
```
5387

54-
### Show per-port summary:
88+
Each host entry includes counters for protocols, flows, DNS queries, HTTP hosts, TLS issuers/subjects, SMB shares, SMTP metadata, and port usage. The `global` section mirrors the top cards in the dashboard.
5589

56-
```bash
57-
python zeek-summarizer.py -d ./logs -p
58-
```
90+
---
5991

60-
### Show only connection logs and debug info:
92+
## 6. Example workflows
6193

6294
```bash
63-
python zeek-summarizer.py -d ./logs -o --debug
95+
# Baseline summary (text)
96+
./zeek-summarizer.sh -d ./sample-logs
97+
98+
# Focus on local assets that touched non-connection logs
99+
./zeek-summarizer.sh -d ./sample-logs -r --local-only
100+
101+
# Investigate service exposure (per-port view)
102+
./zeek-summarizer.sh -d ./sample-logs -p
103+
104+
# Produce HTML and JSON in one go
105+
./zeek-summarizer.sh -d ./sample-logs --output-format html --output-file report.html
106+
./zeek-summarizer.sh -d ./sample-logs --output-format json --output-file report.json
64107
```
65108

66-
## 📁 Supported Logs
109+
---
110+
111+
## 7. Supported log families
67112

68113
- `conn.log`
69114
- `dns.log`
70115
- `http.log`
71116
- `ssl.log`
117+
- `smb_mapping.log`
118+
- `smtp.log`
72119

73-
Logs may be compressed with `.gz` and can use rotated filenames like `conn.01:00:00-02:00:00.log.gz`.
120+
The parser accepts TSV (default Zeek format) and JSON, with optional `.gz` compression and rotated filenames such as `dns.2024-10-05-00-00-00.log.gz`.
74121

75122
---
76123

77-
Created with ❤️ for Zeek network traffic analysis.
124+
Made with ❤️ for network defenders who want fast situational awareness from Zeek captures.

0 commit comments

Comments
 (0)