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

tests: add keyword check to requires test #2133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonish
Copy link
Member

Only for 8.0 for now.

requires-fail: With the change to unknown requires statements treated as
not meeting requirements, update the rule to use an unknown keyword to
make it fail out.

Ticket: #7403

@@ -14,4 +14,4 @@ alert udp any any -> any any (vxlan_vni:10; requires: version >= 10; sid:2;)
alert http any any => any any (requires: version >= 10; sid:3;)
alert tcp any any -> any any (frame:smtp.not_supported; requires: version >= 10; sid:4;)

alert asdf any any -> any any (requires: version >= 6, foo bar; sid:102; rev:1;)
alert asdf any any -> any any (requires: version >= 6; foo: bar; sid:102; rev:1;)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we change this existing test ?

Copy link
Member Author

@jasonish jasonish Nov 28, 2024

Choose a reason for hiding this comment

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

We want the test to fail parsing.

Copy link
Member Author

Choose a reason for hiding this comment

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

More details. In master, requires: version >= 6, foo bar is considered as all requirements met. So this rule fails out as asdf is unknown. With the PR, this rule is considered without requirements met, so the asdf is never parsed. This is to test somewhat of an edge case documented in ticket https://redmine.openinfosecfoundation.org/issues/6710, which I've added to the README now as well.

Only for 8.0 for now.

requires-fail: With the change to unknown requires statements treated as
not meeting requirements, update the rule to use an unknown keyword to
make it fail out.

This is to test an edge case from ticket #6710.

Ticket: #7403
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires suricata pr Depends on a PR in Suricata
Development

Successfully merging this pull request may close these issues.

2 participants