Skip to content

Ignore PCAPNG format suffixes in automatic capture tags - #1240

Merged
mmguero merged 1 commit into
cisagov:contributor-prsfrom
sylvesterkaczmarek:fix/pcapng-filename-tags-20261015
Oct 15, 2026
Merged

mmguero merged 1 commit into
cisagov:contributor-prsfrom
sylvesterkaczmarek:fix/pcapng-filename-tags-20261015

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Description

The PCAP watcher derives automatic metadata tags by splitting uploaded filenames and removing recognized capture/log format tokens. The filter omits the PCAPNG extension, even though the same module recognizes application/x-pcapng. PCAPNG uploads consequently acquire an unintended pcapng metadata tag.

Add pcapng to the existing case-insensitive exact-token format exclusions. Preserve all other filename, path, and user-defined tag behavior, including substrings such as pcapnglab.

Related issue(s)

None; independently reproduced against the latest contributor-prs code, with no overlapping open PR.

Type of change

  • Bug fix
  • New feature or enhancement
  • Documentation
  • Other

How has this been tested?

  • 10 focused pytest cases using the real shared/bin/pcap_utils.py tags_from_filename function.
  • On unchanged upstream code, eight cases failed due to the unwanted format token; all ten pass with the fix.
  • Case-insensitive PCAPNG formats, existing PCAP behavior, exact-token filtering, mixed separators, and retention of legitimate tags.
  • Ruff E4/E7/E9/F, Black --line-length 120 --skip-string-normalization, Python syntax, and git diff --check all pass.

This is focused metadata testing, not an end-to-end PCAP ingest or Malcolm Docker/ISO deployment.

Documentation

  • No update needed; this restores the existing behavior of excluding format suffixes from useful filename tags.

Was AI used in writing the code, tests, or description for this pull request?

  • No
  • Yes: ChatGPT (GPT-6) helped identify the defect and author the code, tests, and PR description. Pre-fix regression failures and post-fix passing tests were verified against the current contributor-prs branch. The contribution remains subject to maintainer review.

Additional context

Based directly on contributor-prs as requested by Malcolm maintainers. No new dependencies or runtime settings.

@mmguero mmguero self-assigned this Oct 15, 2026
@mmguero mmguero added the upload Relating to PCAP and/or Zeek log ingestion label Oct 15, 2026
@mmguero mmguero added this to Malcolm Oct 15, 2026
@mmguero mmguero added this to the v26.10.0 milestone Oct 15, 2026
@mmguero mmguero moved this to Review in Malcolm Oct 15, 2026
@mmguero
mmguero merged commit e43025e into cisagov:contributor-prs Oct 15, 2026
@github-project-automation github-project-automation Bot moved this from Review to Done in Malcolm Oct 15, 2026
@mmguero mmguero mentioned this pull request Oct 29, 2026
@mmguero mmguero moved this from Done to Released in Malcolm Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upload Relating to PCAP and/or Zeek log ingestion

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

2 participants