Skip to content

Add Zeek Intel Framework export module - #949

Merged
adulau merged 2 commits into
mainfrom
codex/zeek-intel-export
Oct 18, 2026
Merged

adulau merged 2 commits into
mainfrom
codex/zeek-intel-export

Conversation

@adulau

@adulau adulau commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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 #fields header and indicator, indicator_type, meta.source, meta.desc, and meta.url columns. 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.

  • Decode HTTP request-target escapes once using Zeek-compatible byte semantics, preserving literal plus signs, binary bytes and empty query delimiters. Emit Host-header/responder-port variants for explicit or non-default ports.
  • Validate and normalize indicators; default to IDS-marked attributes and always exclude deleted data. Count malformed/unsupported attributes separately. Port-qualified indicators are skipped so port constraints are not silently lost.
  • Match Zeek's case-insensitive string keys and IPv4-mapped address identities when deduplicating. Preserve all original values and contributing MISP references as deterministic JSON metadata rather than overwriting another attribute's provenance.
  • Escape controls, UTF-8 bytes, backslashes, comment characters and reader markers for the ASCII input reader. Support a stable source namespace, optional MISP event links and an explicit non-IDS override.
  • Include API, deployment and lifecycle documentation and generated module catalog entries. Existing file, domain-ip and x509 objects 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

  • 132 tests cover mappings, malformed input, existing object templates, deterministic provenance, case/mapped-address aliases, field injection and literal escaping, configuration, and discovery/query endpoints.
  • Native integration with Zeek 8.0.5 loaded and matched 15 exported indicators across all nine emitted Intel types, verifying the real ASCII reader, Intel matcher, UTF-8/control/backslash handling, reserved markers and metadata round trips. The test is optional when no Zeek executable is installed; set ZEEK or put zeek on PATH to enable it.
  • Native HTTP traffic regression replays 14 requests through Zeek’s actual HTTP analyzer and standard Intel URL observer, covering decoded paths/queries, Host headers with and without ports, binary/control bytes, nested escapes and legacy escapes. All observations find a matching exported key.
  • With ZEEK pointing 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.
  • Black, isort, scoped flake8 and git diff --check pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T19:05:23.650250Z e0eb536 PR opened
🔒 Security Review ✅ Completed 2026-10-18T19:07:35.208292Z e0eb536 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@adulau
adulau merged commit ec4fce7 into main Oct 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant