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/dataset: delay set operation after signature full match #11623

Closed

Conversation

catenacyber
Copy link
Contributor

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/5576

Describe changes:

  • detect/dataset: delay set operation after signature full match

SV_BRANCH=OISF/suricata-verify#2000

#11600 with patch working for multi buffers as well

Side note: the limitation described for flowvar in https://redmine.openinfosecfoundation.org/issues/7197 also applies here to dataset, and needs a bigger design...

The set operation of dataset keyword was done even if signature
did not fully match.

This patch changes the behavior of the dataset keyword to do a
match and a post match for the set operation. In the match, the
buffer data that needs to end up in the set is captured and in
post match the dataset is updated (if ever the signature is fully
matching).

Ticket: OISF#5576
@suricata-qa
Copy link

Information:

ERROR: QA failed on SURI_TLPW2_single_alerts_cmp.

ERROR: QA failed on SURI_TLPW2_autofp_alerts_cmp.

ERROR: QA failed on SURI_TLPR1_alerts_cmp.

ERROR: QA failed on IPS_AFP_drop_chk.

field baseline test %
IPS_AFP_stats_chk
.ips.accepted 367733210 342623210 93.17%
.ips.blocked 747360 25857360 3459.83%
.ips.drop_reason.flow_drop 680400 25736400 3782.54%
.ips.drop_reason.rules 66960 120960 180.65%
.flow.end.state.established 550799 604799 109.8%
.flow.end.state.closed 1048672 994672 94.85%
.flow.end.tcp_state.established 169560 223560 131.85%
.flow.end.tcp_state.closed 1048672 994672 94.85%
.detect.alert 185760 293760 158.14%
TREX_GENERIC_stats_chk
.detect.alert 86688 129368 149.23%

Pipeline 22065

@inashivb
Copy link
Member

Information:

ERROR: QA failed on SURI_TLPW2_single_alerts_cmp.

ERROR: QA failed on SURI_TLPW2_autofp_alerts_cmp.

ERROR: QA failed on SURI_TLPR1_alerts_cmp.

ERROR: QA failed on IPS_AFP_drop_chk.
field baseline test %
IPS_AFP_stats_chk
.ips.accepted 367733210 342623210 93.17%
.ips.blocked 747360 25857360 3459.83%
.ips.drop_reason.flow_drop 680400 25736400 3782.54%
.ips.drop_reason.rules 66960 120960 180.65%
.flow.end.state.established 550799 604799 109.8%
.flow.end.state.closed 1048672 994672 94.85%
.flow.end.tcp_state.established 169560 223560 131.85%
.flow.end.tcp_state.closed 1048672 994672 94.85%
.detect.alert 185760 293760 158.14%
TREX_GENERIC_stats_chk
.detect.alert 86688 129368 149.23%

Pipeline 22065

Are these stat deviations expected, @catenacyber ?

Comment on lines +46 to +47
uint32_t nb;
uint32_t cap;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: What do these indicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number of elements and capacity

/* Okay so far so good, lets get this into a SigMatch
* and put it in the Signature. */
if (cmd == DETECT_DATASET_CMD_SET) {
// for set operation, we need one match, and one postmatch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why can't it be just a postmatch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postmatch does not have a direct access to the content of the sticky buffer(s) (+ transforms)...

Does that answer your question ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postmatch does not have a direct access to the content of the sticky buffer(s) (+ transforms)...

oh.

Does that answer your question ?

yes. thank you very much! 🙇🏽‍♀️

@catenacyber
Copy link
Contributor Author

Continued in #11662

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants