Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/detect-engine-analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "util-time.h"
#include "util-validate.h"
#include "util-conf.h"
#include "detect-tcp-ack.h"

static int rule_warnings_only = 0;

Expand Down Expand Up @@ -861,6 +862,14 @@ static void DumpMatches(RuleAnalyzer *ctx, JsonBuilder *js, const SigMatchData *
jb_close(js);
break;
}
case DETECT_ACK: {
const DetectAckData *cd = (const DetectAckData *)smd->ctx;

jb_open_object(js, "ack");
jb_set_uint(js, "ack", cd->ack);
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

jb_close(js);
break;
}
}
jb_close(js);

Expand Down
Loading