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 bidir 5665 v11 #11246

Closed
wants to merge 5 commits into from
Closed

Conversation

catenacyber
Copy link
Contributor

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

Describe changes:

  • allows bidirectional signature matching !

SV_BRANCH=OISF/suricata-verify#1889

Draft again because of second commit
General feedback expected :-)

TODO :

  • Give me better names
  • Where should I document these new keywords bidir.toclient ?
  • more tests !!!! Throw me rules examples ! negative and positive...

@victorjulien is there now a protocol with bidirectional frames ? (Enip rust has it in #11184)

#10904 rebased with some new test in SV

Ticket: 5665

This is done with `alert ip any any => any any`
The => operator means that we will need both directions
By using keywords bidir.toclient and bidir.toserver, the following
keywords are forced to the direction even if they can match
on both directions.

Ticket: 5665
Do not require a rule to use bidir.toserver after the usage of
bidir.toclient for unambiguous keywords, where the rule writer
does not want to explicit the redundant direction.
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 89.21569% with 22 lines in your changes missing coverage. Please review.

Project coverage is 83.00%. Comparing base (8781e93) to head (81185e9).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11246      +/-   ##
==========================================
+ Coverage   82.99%   83.00%   +0.01%     
==========================================
  Files         942      942              
  Lines      249358   249510     +152     
==========================================
+ Hits       206951   207112     +161     
+ Misses      42407    42398       -9     
Flag Coverage Δ
fuzzcorpus 61.08% <55.88%> (-0.02%) ⬇️
livemode 18.78% <9.31%> (-0.06%) ⬇️
pcap 44.33% <45.09%> (+0.01%) ⬆️
suricata-verify 61.72% <85.29%> (+0.04%) ⬆️
unittests 60.49% <51.96%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 20971

s->dir_state[i].filestore_cnt = 0;
s->dir_state[i].flags = 0;
/* reset 'cur' back to the list head */
s->dir_state[i].cur = s->dir_state[0].head;
Copy link
Member

Choose a reason for hiding this comment

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

dir_state[i]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the detail, nice catch.

Hope to read something more about the overview of this PR ;-)

@catenacyber
Copy link
Contributor Author

Try to look at git grep flowbits tests/test-ruleparse-etopen-01/emerging-all.rules | grep -v ":#" | grep -v "alert http " | grep -v "alert tcp " | grep -v "alert tcp-pkt" | grep -v "alert udp "

@victorjulien victorjulien self-assigned this Jun 6, 2024
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 21010

@catenacyber
Copy link
Contributor Author

Continued in #11293

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.

3 participants