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

test: test requires keyword - v1 #1505

Closed
wants to merge 2 commits into from

Conversation

jasonish
Copy link
Member

@jasonish jasonish commented Dec 1, 2023

Also includes readme update for files to exists as a requirement.

@victorjulien
Copy link
Member

Can you add a test with the example rules I shared in the previous PR?

tests/requires/test.yaml Outdated Show resolved Hide resolved
@jasonish jasonish added the requires suricata pr Depends on a PR in Suricata label Dec 4, 2023
@jasonish jasonish force-pushed the requires-keyword/v1 branch 2 times, most recently from 547296a to f598d65 Compare December 5, 2023 20:50
@jasonish
Copy link
Member Author

jasonish commented Dec 5, 2023

Can you add a test with the example rules I shared in the previous PR?

Done.


# These rules have something invalid about them, but do follow the general rule
# structure, so should be eliminated by the requires statement.
alert vxlan any any -> any any (requires: version >= 10; sid:1;)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would put version 42 rather than 10 which is within our lifetimes I hope

alert http any any -> any any (msg:"TEST Suricata >= 7 and < 8"; content:"uid=0"; requires: version >= 7 < 8; sid:7; rev:1;)

# Rule for Suricata >= 7.0.3 but less than 8... Or >= 8.0.1
alert http any any -> any any (content:"uid=0"; requires: version >= 7.0.3 < 8 | >= 8.0.1; sid:9; 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.

Wow we allow complex "or" !

alert vxlan any any -> any any (requires: version >= 10; sid:1;)
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;)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we also test requires: version >= 10, superpower: notyet ? (superpower being an unknown key yet for the requires keyword

@victorjulien
Copy link
Member

Merged in #1558, thanks!

@jasonish jasonish deleted the requires-keyword/v1 branch December 19, 2023 18:16
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.

4 participants