-
Notifications
You must be signed in to change notification settings - Fork 2.4k
plugin/geoip: Add ASN schema support #7730
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
Conversation
|
Hi @case To start with
Also, I do expect by the time checks finish this change will hit the following issue #7731 (comment) unrelated to your change. |
Adds the ability to query ASN .mmdb databases, in addition to the existing City db functionality. Signed-off-by: Eric Case <[email protected]>
|
👋 Hi @snebel29, thank you for your reply here, I appreciate it. Re: "Do you mind signing off your work?" and "Nit: Tweaking your commit message to fit exiting style for plugin changes" These are both done, please accept my apologies for missing them initially. |
plugin/geoip/geoip_test.go
Outdated
| {"geoip/asn/number", "12345"}, | ||
| {"geoip/asn/org", "Test ASN Organization"}, |
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.
Why not to add those two, to the above struct table along with the city cases? This would reduce the amount of code duplication in this test function, at first glance I'd say the only thing that changes is a different DBpath, which could be added as another field in the table struct.
The same may apply to the not routed "edge" case below.
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.
Ah yes, good call, I'll push the change momentarily.
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.
Ok this is in; I can add this to the original commit if you'd prefer?
Addresses review feedback Signed-off-by: Eric Case <[email protected]>
|
LGTM, I squashed it before merging, thanks! |
Adds the ability to query ASN
.mmdbdatabases, in addition to the existing City db functionality.1. Why is this pull request needed and what does it do?
I've been working with ASN databases (in
.mmdbformat) lately, and wanted to use ASN data (AS Number and Org name) in CoreDNS, e.g. to enrich log lines and for improving general observability. But I noticed that thegeoipplugin currently only supports the MaxMind-City databases. The underlyingoschwald/geoip2-golangmmdb reader supports ASN dbs, so this pull request generalizes the existing.mmdbsupport to include ASN db support as well.I also added links to a few other GeoIP vendors besides MaxMind, though I am not affiliated with any of them. MMDB is an open source file format, and there are Public Domain-licensed vendors like iptoasn with freely available data.
2. Which issues (if any) are related?
None that I could find. I decided to submit a PR rather than filing an issue. I'd be happy to file a corresponding issue if needed though.
3. Which documentation changes (if any) need to be made?
The doc updates are included in this PR.
4. Does this introduce a backward incompatible change or deprecation?
No.