Repository navigation
Add Zeek Intel Framework export module - #949
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0eb5362fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raise ValueError("URL must be absolute HTTP(S), without credentials or whitespace.") | ||
| parsed.port | ||
| # Zeek's default HTTP observer reports host[:port]/path?query, without a scheme or fragment. | ||
| return "Intel::URL", urlunsplit(("", parsed.netloc, parsed.path or "/", parsed.query, ""))[2:] |
There was a problem hiding this comment.
Decode URL escapes before emitting Intel keys
When a URL contains percent-encoded path or query characters, urlunsplit preserves those escapes, but Zeek stores the decoded unescaped_URI in its HTTP record before the URL observer calls HTTP::build_url. For example, http://example.org/a%2Fb is exported as example.org/a%2fb, while Zeek checks example.org/a/b, so this valid URL indicator silently never matches. Decode %xx sequences in the path and query using Zeek-compatible semantics before emitting the key.
Useful? React with 👍 / 👎.
| raise ValueError("URL must be absolute HTTP(S), without credentials or whitespace.") | ||
| parsed.port | ||
| # Zeek's default HTTP observer reports host[:port]/path?query, without a scheme or fragment. | ||
| return "Intel::URL", urlunsplit(("", parsed.netloc, parsed.path or "/", parsed.query, ""))[2:] |
There was a problem hiding this comment.
Emit port-qualified URLs as Zeek observes them
For a direct request to a non-default port where the normal Host header includes that port, such as http://example.org:8080/a with Host: example.org:8080, this emits example.org:8080/a. Zeek preserves the original Host header including its port, then HTTP::build_url appends the responder port whenever it is not 80, so the standard observer checks example.org:8080:8080/a instead. Generate the observer-compatible key, or both possible Host-header forms, so supported non-default-port URLs can actually match.
Useful? React with 👍 / 👎.
Summary
Add
zeek_intel_export, a standalone misp-modules export that converts supplied MISP events and object attributes into a native Zeek Intel Framework ASCII file.The export writes a tab-separated
#fieldsheader andindicator,indicator_type,meta.source,meta.desc, andmeta.urlcolumns. It supports IPv4/IPv6 addresses and subnets, domains/hostnames, HTTP(S) URLs, emails, filenames, MD5/SHA-1/SHA-256/SHA-512 file hashes, certificate SHA-1 fingerprints and SSH MD5 fingerprints, including supported composites.file,domain-ipandx509objects suffice; no new dependencies are required.MISP's built-in Bro/Zeek export remains available. This adds a module-server export with explicit validation, object traversal and provenance aggregation. Zeek's standard Intel ingestion uses files, so this PR implements an export and documents deployment to the manager.
Matching and lifecycle
The guide covers atomic file replacement, standard observation scripts, analyzer requirements, case-insensitive matching, encrypted URL visibility and independent source namespaces. It also explains that removing rows from a feed does not automatically withdraw loaded Intel state; expiry/removal remains controlled by Zeek policy. The feed does not install policy, enable notices, enforce blocking or change running sensors.
Contracts were checked against Zeek's Intel documentation, native Intel/input/HTTP observer scripts and its ASCII reader.
Validation
ZEEKor putzeekon PATH to enable it.ZEEKpointing to Zeek 8.0.5,pytest -q tests/test_zeek_intel_export.py tests/test_qradar_reference_set.py tests/test_sentinelone_ioc_publish.py tests/test_crowdstrike_ioc_publish.py tests/test_elastic_ecs_export.py tests/test_splunk_export.py: 661 passed, with one pre-existing Python deprecation warning.git diff --checkpass.