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 rule to check for tcp/ack - v1 #1423

Closed
wants to merge 1 commit into from

Conversation

0xEniola
Copy link
Contributor

Test for rule type for tcp-ack keyword.

Related to
Issue: #6354

Redmine ticket: https://redmine.openinfosecfoundation.org/issues/6354

Suricata PR: OISF/suricata#9608

Related to
Issue: #6354
@jufajardini jufajardini added the outreachy Contributions made by Outreachy applicants label Oct 16, 2023
Copy link
Contributor

@jufajardini jufajardini left a comment

Choose a reason for hiding this comment

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

Nice! One comment from my end.

I've linked this PR on your Suricata PR description, so that our CI checks will tests your changes against it. Let's see how that goes!

Meanwhile, I'll try to give some thought on naming for the ack value. Maybe we could have just number, to follow with our documentation uses. 🤔 I'll add that suggestion to the Suri PR, and then you can update the SV test accordingly :)

count: 1
match:
id: 1
lists.packet.matches[0].name: "tcp.ack"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have another line check here with the actual value that ack has in the line, (cf https://github.com/OISF/suricata-verify/tree/master/tests/rules/ipopts or other tests there, many of them check not only for the keyword itself, but also any value assigned to it.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! I wanted to do that, but looking at the codes, I didn't see any parameter that would be used for it.

So I assumed it didn't exist.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this test tests what you have done in your Suricata PR. That should have made this test fail. tcp.ack already exists in Suricata's matches which is why the rules as you have written work.
You should have checked for (alongwith what you already have) lists.packet....ack.ack: 273.

I didn't see any parameter that would be used for it.

Because you just added it in your Suricata PR ;)

@0xEniola 0xEniola closed this Oct 17, 2023
@0xEniola 0xEniola deleted the sv-task-6354-v1 branch October 22, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outreachy Contributions made by Outreachy applicants
Development

Successfully merging this pull request may close these issues.

3 participants