plugin/geoip: Add ASN schema support#7730
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 <eric.case@gmail.com>
|
👋 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. |
| {"geoip/asn/number", "12345"}, | ||
| {"geoip/asn/org", "Test ASN Organization"}, |
There was a problem hiding this comment.
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.
Ah yes, good call, I'll push the change momentarily.
There was a problem hiding this comment.
Ok this is in; I can add this to the original commit if you'd prefer?
Addresses review feedback Signed-off-by: Eric Case <eric.case@gmail.com>
|
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.