-
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 v3 #1574
test: add test for dns.rcode v3 #1574
Conversation
Feature #6621
Feature #6621
# Should alert in both directions as no flow is provided. | ||
alert dns any any -> any any (dns.rcode:3; 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.
This should only alert in one direction, the reply. As the request has an rcode of 0.
# Should only alert in the request direction. | ||
alert dns any any -> any any (dns.rcode:3; flow:to_server; sid:2; 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.
This should not alert at all. As an rcode of 3 in the to server direction does not exist in this pcap.
# Should only alert in the response direction. | ||
alert dns any any -> any any (dns.rcode:3; flow:to_client; sid:3; 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.
This one is good, we should see one alert for this.
# Should only alert in the response direction. | ||
alert dns any any -> any any (dns.rcode:!3; flow:to_client; sid:4; 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.
This won't alert either. I'd suggest a simpler rule like:
alert dns any any -> any any (dns.rcode: !3; sid:4; rev:1;)
which should alert one, with the DNS request as it has an rcode of 0.
New PR: #1578 |
Feature #6621
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/6621
Previous PR: #1567
Suricata PR: OISF/suricata#10126
Changes made:
rcode:12
torcode:3
which caused the schema.json error shown below. Changing the rcode value back to 12 got rid of this errorOutput from console after running the sv test:
Output after running
cat output/eve.json | jq 'select(.dns) | .dns' output/eve.json
:Output from stdout file: