-
Notifications
You must be signed in to change notification settings - Fork 91
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: add test for dns.rcode #1563
test: add test for dns.rcode #1563
Conversation
Feature #6621
This test is missing a pcap. Most of our existing DNS pcaps will have rcode values of 0 so are not that interesting. But |
You should use |
@@ -0,0 +1,8 @@ | |||
# Should alert in both directions as no flow is provided. | |||
alert dns any any -> any any (dns.rcode; content:"oisf"; sid:1; rev:1;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it not be something like dns.rcode:12
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and no content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's an integer keyword ;)
- filter: | ||
count: 1 | ||
match: | ||
alert.signature_id: 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can have only one filter per signature id, right ?
On the other hand, maybe we could have two tests, and use one of the pcaps with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few more comments to help you keep moving! :)
|
||
The PCAP here was a request created with Scapy to include answers in | ||
the request. However the response is from a real DNS server with the | ||
provided request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a reference to the redmine ticket :)
If you do re-use a pcap from a different test, you can indicate that here, too.
@@ -0,0 +1,8 @@ | |||
# Should alert in both directions as no flow is provided. | |||
alert dns any any -> any any (dns.rcode; content:"oisf"; sid:1; rev:1;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's an integer keyword ;)
alert.signature_id: 1 | ||
app_proto: dns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's important to add a check for the rcode field on the checks, too :)
New PR: #1567 |
Feature #6621
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/6621
Suricata PR: OISF/suricata#10087
Output from stdout file: