Repository navigation
fix(types): also expand IPv6 CIDRs to the uncompressed form written by Sysmon - #610
Merged
Merged
Conversation
thomaspatzke
approved these changes
Nov 8, 2026
Contributor
Author
|
The CI failure was a real bug that my local run missed, because I only tested on Python 3.12.3. Current Python versions write the last groups of IPv4-mapped addresses in dotted notation in The groups now come from the address's integer value in both functions, with tests for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #609.
For backends without
cidr_expression,SigmaCIDRExpression.expand()now also emits patterns for the uncompressed IPv6 text that Sysmon network events write (all eight groups, no leading zeros, no::, e.g.0:0:0:0:0:0:0:1for::1), unless the RFC 5952 patterns already cover it._expand_ipv6_subnet_uncompressedhandles a partially covered group the same way as_expand_ipv6_subnet([medium] Fix over-broad IPv6 cidr wildcard expansion #563).::1/128→['::1', '0:0:0:0:0:0:0:1'],64:ff9b::/96→['64:ff9b::*', '64:ff9b:0:0:0:0:*'].fe80::/10,fc00::/7and2001:db8::/64are unchanged.Tests: exact expansions for the affected cases, plus a match test that checks addresses inside the network against both text forms and addresses outside it against both forms.
I also checked this outside the test suite:
mainis kept, in the same order. No added pattern matches an address outside the network./128s with::gain one pattern.black --check .,mypyandpytestpass. The only failures are the twotest_pluginsinstallation tests, which also fail onmainhere (nopipin my venv).