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

dns: add missing dns keywords to schema.json #10193

Closed
wants to merge 1 commit into from

Conversation

hadiqaalamdar
Copy link
Contributor

Feature #5642

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/5642

Describe changes:

  • Added dns tc, aa and z boolean fields to dns.answer in schema.json file
  • Added sshfp field in dns.authorities in schema.json

@catenacyber catenacyber added the typo/doc update No code change : only doc or typo fixes label Jan 18, 2024
@@ -1156,6 +1171,15 @@
"opcode": {
"description": "DNS opcode as an integer",
"type": "integer"
},
"aa": {
"type": "boolean"
Copy link
Contributor

Choose a reason for hiding this comment

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

@jasonish should we add description for these added fields ?

Copy link
Contributor

Choose a reason for hiding this comment

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

aa is already present !

Copy link
Member

Choose a reason for hiding this comment

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

@jasonish should we add description for these added fields ?

Yes, will help with documentation generation.

@catenacyber
Copy link
Contributor

Looks good to me.

Commit message could mention how you found them (manual code review, correct ? )

Question for us : do we want to have SV tests exercising these ?

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6896a93) 82.12% compared to head (f946f94) 82.14%.
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10193      +/-   ##
==========================================
+ Coverage   82.12%   82.14%   +0.01%     
==========================================
  Files         975      975              
  Lines      271724   271724              
==========================================
+ Hits       223151   223198      +47     
+ Misses      48573    48526      -47     
Flag Coverage Δ
fuzzcorpus 62.79% <ø> (+0.07%) ⬆️
suricata-verify 61.40% <ø> (-0.02%) ⬇️
unittests 62.83% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@inashivb
Copy link
Member

Question for us : do we want to have SV tests exercising these ?

That was the plan, yes. This is why you gave the sshfp pcap

@hadiqaalamdar
Copy link
Contributor Author

Looks good to me.

Commit message could mention how you found them (manual code review, correct ? )

Question for us : do we want to have SV tests exercising these ?

yes, I can change the commit message.
Should I be creating the SV tests on this? I was under the impression that I should share the branch and then someone else might handle the SV tests.

"type": "boolean"
},
"z": {
"type": "boolean"
Copy link
Contributor

Choose a reason for hiding this comment

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

z is already present as well.

@jasonish do you know how to test in CI for duplicate keys in this schema.json ?

Copy link
Member

Choose a reason for hiding this comment

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

Extract the code out of check-eve.py back into a standalone script could be one option.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Adding things to the schema in alphabetic order could also be useful for catching this on review.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the first version of the schema had all key alphabetically order, but that was a pain, and I did not know how to enforce it (or even if it should be enforced)

Copy link
Member

Choose a reason for hiding this comment

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

Once done, its easy to keep done right? Then its pretty obvious. I think you can only enforce with review though, or doing a custom JSON parser of sorts, as most throw order out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Once done, its easy to keep done right? Then its pretty obvious. I think you can only enforce with review though, or doing a custom JSON parser of sorts, as most throw order out.

Does not look easy to me...

  • I think I would have a 10% failure, so 1 out of 10 additions to the schema would, especially when you have objects with many fields in between
  • There has already been additions to the schema not following this
  • Maybe the order is more complex than alphabetical (first simple fields such as string integer and bool, then objects and arrays)

Automation looks more trustworthy to me

Copy link
Member

Choose a reason for hiding this comment

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

Automation looks more trustworthy to me

Ok. Out of scope for this PR tho.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Out of scope for this PR tho.

Sure cf https://redmine.openinfosecfoundation.org/issues/6691

@jufajardini
Copy link
Contributor

Question for us : do we want to have SV tests exercising these ?

imho, yes. Also document those fields, somehow.

@catenacyber
Copy link
Contributor

OISF/suricata-verify#1588 is there

@catenacyber catenacyber added the needs rebase Needs rebase to master label Jan 25, 2024
Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

See inline requested changes

@catenacyber
Copy link
Contributor

Was merged with commit 6c193b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase Needs rebase to master typo/doc update No code change : only doc or typo fixes
5 participants