-
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/analyzer: add more details for the tcp ack keyword - v2 #9608
Conversation
Issue: OISF#6354 Added the DETECT_ACK case to detect-engine-analyzer.c
NOTE: This PR may contain new authors:
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #9608 +/- ##
==========================================
+ Coverage 82.28% 82.37% +0.08%
==========================================
Files 968 968
Lines 274275 274281 +6
==========================================
+ Hits 225700 225946 +246
+ Misses 48575 48335 -240
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.
Looking much better, as I indicated in the previous PR, we may need some discussion to define how will we settle on the output itself - but that's minor.
For this PR, it would be good to have an accompanying suricata-verify PR with a test similar to the ipopts one (see OISF/suricata-verify#1387).
Could you work on that, too? This will help us visualize that the changes you're adding here are the way we expect them to be.
If you do, make sure to add a check on the test.yaml for the actual values the ack flag has, in each rule ;)
Edited PR description to include link to SV PR, to see if CI checks run against it. |
const DetectAckData *cd = (const DetectAckData *)smd->ctx; | ||
|
||
jb_open_object(js, "ack"); | ||
jb_set_uint(js, "ack", cd->ack); |
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.
After considering our documentation, let's go with number
for this inner field.
So the expectation is that for the output, we will see not only the keyword name, but also what was set in the rule for the ack number.
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.
OK.
I'll check it out—you mean, I should do cd->number
right?
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.
No. There is no cd->number
. Your current object would look like ack.ack: 4
, you should instead make it ack.number: 4
as per Juliana's comments. Does this make sense?
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.
Ohhh! Yes it makes sense.
I understand now.
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.
Please see the inline comment for a suggestion on how to name the ack integer value we want to log out :)
Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/6354
Previous PR: #9605
Describe changes:
detect-tcp-ack.h
header to the file.ack
to the JsonBuilder.test.rules
signature.test.rules
:test.yaml
:output
:SV_BRANCH=OISF/suricata-verify#1423