-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect integers 6644 v14 #10246
Detect integers 6644 v14 #10246
Conversation
So that we can write enip.revision: 0x203 Ticket: 6645
Ticket: 6647 Allows keywords using integers to use strings in signature parsing based on a rust enumeration with a derive.
Ticket: 6648 Like &0x40=0x40 to test for a specific bit set
Ticket: 6628 Document the generic detection capabilities for integer keywords. and make every integer keyword pointing to this section.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #10246 +/- ##
==========================================
- Coverage 82.28% 82.28% -0.01%
==========================================
Files 977 978 +1
Lines 271950 272068 +118
==========================================
+ Hits 223784 223873 +89
- Misses 48166 48195 +29
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc changes look good to me.
Proposed changes are very welcome, imho.
Information: ERROR: QA failed on SURI_TLPW1_files_sha256.
Pipeline 17748 |
hey @catenacyber I had an question about the bitmask operation that went unanswered in a previous PR. (sorry, just now catching up on this feature) Currently bitmask operations supported by byte_test, byte_match, byte_jump (maybe not byte_jump??) does a right shift by the number of trailing 0 (zeros) after the AND operation. Does this bitmask option perform the same behavior? it might be worth noting it if does or does not within the bitmask section of the docs. |
@zoomequipd I had answered here #10179 (comment) ;-) You can do bsize:&0xc0=0x80. You should not do bsize:&0xc0=2. I can add a note about the difference with byte_test |
Merged in #10277, thanks! |
@zoomequipd do you see a reason for us to adopt that same approach here, as opposed to keeping it as-is and documenting it? |
Also, this bitmask for integer keywords is more like the "and" operator of byte_test ;-) |
I asked the newer rule writers with ET, they all agreed that consistency would be preferred. While the right shift behavior is a bit of a nuance itself, it's at least used, currently, everywhere bitmask is used. Not using it would create yet another nuance specific to one keyword's implementation. As a rule writer it is difficult to remember and track such nuances, even when documented. As such, it'd be our preference to be consistent and implement the right shift operation. |
Can you explain the use case of the right shift? I think we implemented it from the snort language, but I can't find any reasoning about it. |
It is not used in |
Correct? It's used with the 'bitmask' option, which i'm pretty sure can be applied to any operation, but is most frequently used with the
That'd be fine? If it's going to support the bitmask option, the bitmask option should support the right shift behavior. I will say, the bitmask option does come in hand when attempting to check values less than a whole byte.
byte_jump doesn't implement bitmask option at all https://redmine.openinfosecfoundation.org/issues/6693
I cannot, I just work with what the tools provide. |
Disclaimer : I am not sure we speak about the same things... |
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6644 and all subtickets
https://redmine.openinfosecfoundation.org/issues/6645
https://redmine.openinfosecfoundation.org/issues/6646
https://redmine.openinfosecfoundation.org/issues/6647
https://redmine.openinfosecfoundation.org/issues/6648
https://redmine.openinfosecfoundation.org/issues/6628
Describe changes:
#10241 rebased to get green CI again