Skip to content

Commit 8dc607e

Browse files
Allow asn header to be populate from isp_db in MaxMind geoip provider. (#39303)
Allows the asn header to be populated from the isp_db when it is defined. If both asn_db and isp_db are defined, we fetch the asn header from the asn DB. Looking back at the proposed change that got approved https://github.com/envoyproxy/envoy/pull/38714/files and reading the documentation for the databases: https://dev.maxmind.com/geoip/docs/databases/asn/ https://dev.maxmind.com/geoip/docs/databases/isp/ While we have clear separation of database names, there is an overlap of fields between asn and isp dbs. Since the subscription model of Maxmind doesn't include all dbs, if you have access only to the isp db, you can still get the autonomous_system_number from it. I believe this also help users that are using the isp db on the geoip filter that haven't been able to migrate from version 1.33 but want to. --------- Signed-off-by: Leonardo da Mata <[email protected]> Signed-off-by: Julien Bisconti <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ a5dbcbe81a54910c02aa76854d1396244d65d584
1 parent 553ac3b commit 8dc607e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

envoy/extensions/geoip_providers/maxmind/v3/maxmind.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ message MaxMindConfig {
3232

3333
// Full file path to the Maxmind ASN database, e.g. /etc/GeoLite2-ASN.mmdb.
3434
// Database file is expected to have .mmdb extension.
35+
// When is defined the ASN information will always be fetched from the ``asn_db``.
3536
string asn_db_path = 2 [(validate.rules).string = {pattern: "^$|^.*\\.mmdb$"}];
3637

3738
// Full file path to the Maxmind anonymous IP database, e.g. /etc/GeoIP2-Anonymous-IP.mmdb.
@@ -40,6 +41,8 @@ message MaxMindConfig {
4041

4142
// Full file path to the Maxmind ISP database, e.g. /etc/GeoLite2-ISP.mmdb.
4243
// Database file is expected to have .mmdb extension.
44+
// If ``asn_db_path`` is not defined, ASN information will be fetched from
45+
// ``isp_db`` instead.
4346
string isp_db_path = 5 [(validate.rules).string = {pattern: "^$|^.*\\.mmdb$"}];
4447

4548
// Common provider configuration that specifies which geolocation headers will be populated with geolocation data.

0 commit comments

Comments
 (0)