location/location-database.git
2 months agoadd networks with faked KP location master
Peter Müller [Thu, 16 Aug 2018 15:12:42 +0000 (17:12 +0200)]
add networks with faked KP location

These networks claim to be located in North Korea, but are mostly used
for VPN or other anonymisation purposes. Therefore they are added to
A1 or "others" override files.

See https://blog.trendmicro.com/trendlabs-security-intelligence/a-closer-look-at-north-koreas-internet/
for details. 57.73.224.0/19 was reassigned since then and contains
valid data now, causing it to be omitted.

The second version of this patch superseds the first
one which was broken due to bugs in the MUAs GPG implementation.

Fixes #11757.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoImport for import of LACNIC
Michael Tremer [Mon, 14 Jan 2019 09:33:16 +0000 (09:33 +0000)]
Import for import of LACNIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoAdd parser for LACNIC
Michael Tremer [Mon, 14 Jan 2019 09:33:03 +0000 (09:33 +0000)]
Add parser for LACNIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMigrate to a binary-encoded database format
Michael Tremer [Mon, 14 Jan 2019 07:58:49 +0000 (07:58 +0000)]
Migrate to a binary-encoded database format

This approach is very similar to the one that we used before, but instead of storing
IP addresses as two integers, they are encoded as a big-endian 128 bit long binary
"string".

This is then stored as the BLOB data type of sqlite which has fewer limitations in
length, can be indexed and uses memcmp() which should be at least as fast as comparing
integers.

This allows a slightly easier query and seems to me significantly faster than the
PostgreSQL approach.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoUpdate data for AFRINIC
Michael Tremer [Mon, 14 Jan 2019 04:29:33 +0000 (04:29 +0000)]
Update data for AFRINIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoFix merging the database with SQLite
Michael Tremer [Sun, 13 Jan 2019 22:38:41 +0000 (22:38 +0000)]
Fix merging the database with SQLite

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoRevert "Replace sqlite with PostgreSQL"
Michael Tremer [Sun, 13 Jan 2019 15:40:06 +0000 (15:40 +0000)]
Revert "Replace sqlite with PostgreSQL"

This reverts commit 44c781ac664bf0f6670651e0a721fe2ddc446e66.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 months agoUpdate ARIN
Michael Tremer [Sat, 30 Jun 2018 16:37:05 +0000 (17:37 +0100)]
Update ARIN

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 months agoUpdate AfriNIC
Michael Tremer [Sat, 30 Jun 2018 14:08:26 +0000 (15:08 +0100)]
Update AfriNIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 months agoIgnore some blocks in the source from AfriNIC
Michael Tremer [Sat, 30 Jun 2018 14:07:43 +0000 (15:07 +0100)]
Ignore some blocks in the source from AfriNIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoUpdate RIPE
Michael Tremer [Thu, 21 Jun 2018 15:11:18 +0000 (16:11 +0100)]
Update RIPE

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoA1 overrides: add missing PureVPN networks and clean up
Peter Müller [Sat, 9 Jun 2018 10:33:56 +0000 (12:33 +0200)]
A1 overrides: add missing PureVPN networks and clean up

GZ Systems Ltd. has some other networks which were not added to A1 overrides
by mistake. To clean up the list a little bit and make file processing faster,
some of the networks were allocated in bigger ones (>= /23).

Sorry for this large patch, but I guess it does not make much sense to add
a bunch of networks fist and then split them apart afterwards. :-|

Signed-off-by: Peter Müller
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoA1 overrides: add IAPS Security Services, L.L.C.
Peter Müller [Sat, 9 Jun 2018 08:36:57 +0000 (10:36 +0200)]
A1 overrides: add IAPS Security Services, L.L.C.

IAPS is a VPN provider claiming its networks to be located in VA.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoUpdate APNIC
Michael Tremer [Mon, 18 Jun 2018 09:58:59 +0000 (10:58 +0100)]
Update APNIC

These networks now contain the correct subnet

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agotools: Actually print the correct subnet to file
Michael Tremer [Mon, 18 Jun 2018 09:58:33 +0000 (10:58 +0100)]
tools: Actually print the correct subnet to file

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agotools: Commit to database only once when importing data
Michael Tremer [Sun, 17 Jun 2018 20:27:09 +0000 (21:27 +0100)]
tools: Commit to database only once when importing data

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoImport APNIC
Michael Tremer [Sun, 17 Jun 2018 20:26:37 +0000 (21:26 +0100)]
Import APNIC

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoReplace sqlite with PostgreSQL
Michael Tremer [Sun, 17 Jun 2018 20:25:55 +0000 (21:25 +0100)]
Replace sqlite with PostgreSQL

sqlite cannot match any subnets which makes it useless for us.

PostgreSQL has a data type for IP addresses which can be used
to match subnets against each other.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 months agoSet database vendor
Michael Tremer [Sun, 17 Jun 2018 14:13:59 +0000 (15:13 +0100)]
Set database vendor

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 months agoadd networks to overrides-other which must not be added
Peter Müller [Sun, 18 Mar 2018 14:35:03 +0000 (15:35 +0100)]
add networks to overrides-other which must not be added

These networks are covered for special use by some RFCs
and must not be added to the database.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 months agoadd A2 overrides
Peter Müller [Sun, 18 Mar 2018 14:13:33 +0000 (15:13 +0100)]
add A2 overrides

Add override entries for A2 networks (satellite internet providers).

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 months agoadd missing A1 overrides
Peter Müller [Sun, 18 Mar 2018 13:07:40 +0000 (14:07 +0100)]
add missing A1 overrides

Add missing A1 overrides (mostly GZ Systems Ltd./PureVPN).

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoadd missing A1 overrides
Peter Müller [Sun, 11 Feb 2018 19:16:32 +0000 (20:16 +0100)]
add missing A1 overrides

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoUse the organisation's name as AS name
Michael Tremer [Wed, 31 Jan 2018 00:43:01 +0000 (00:43 +0000)]
Use the organisation's name as AS name

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoImport data from AFRINIC, APNIC, ARIN & RIPE
Michael Tremer [Tue, 30 Jan 2018 16:47:31 +0000 (16:47 +0000)]
Import data from AFRINIC, APNIC, ARIN & RIPE

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoAdd script to export data into a location database
Michael Tremer [Tue, 30 Jan 2018 16:44:56 +0000 (16:44 +0000)]
Add script to export data into a location database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoutil: Remove any inline comments
Michael Tremer [Tue, 30 Jan 2018 16:44:25 +0000 (16:44 +0000)]
util: Remove any inline comments

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoSkip any mntner: blocks
Michael Tremer [Tue, 30 Jan 2018 15:49:53 +0000 (15:49 +0000)]
Skip any mntner: blocks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoEnsure that country codes are uppercase and fix some bugs in the ARIN database
Michael Tremer [Tue, 30 Jan 2018 15:47:54 +0000 (15:47 +0000)]
Ensure that country codes are uppercase and fix some bugs in the ARIN database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoSkip any blocks where IP addresses could not be parsed
Michael Tremer [Tue, 30 Jan 2018 15:47:33 +0000 (15:47 +0000)]
Skip any blocks where IP addresses could not be parsed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoutil: In the RIPE database, % is a comment, too
Michael Tremer [Tue, 30 Jan 2018 15:17:12 +0000 (15:17 +0000)]
util: In the RIPE database, % is a comment, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoMove some commonly used functions to util submodule
Michael Tremer [Tue, 30 Jan 2018 15:14:36 +0000 (15:14 +0000)]
Move some commonly used functions to util submodule

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agotools: Move filename generation into RIR class
Michael Tremer [Tue, 30 Jan 2018 14:35:27 +0000 (14:35 +0000)]
tools: Move filename generation into RIR class

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoAdd parser to parse database formats that are in RIPE format
Michael Tremer [Tue, 30 Jan 2018 14:29:35 +0000 (14:29 +0000)]
Add parser to parse database formats that are in RIPE format

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agodownloader: Only return blocks with content in them
Michael Tremer [Tue, 30 Jan 2018 14:01:38 +0000 (14:01 +0000)]
downloader: Only return blocks with content in them

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agodownloader: Skip commented lines
Michael Tremer [Tue, 30 Jan 2018 14:01:08 +0000 (14:01 +0000)]
downloader: Skip commented lines

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agodownloader: Only strip right hand side of lines
Michael Tremer [Tue, 30 Jan 2018 14:00:12 +0000 (14:00 +0000)]
downloader: Only strip right hand side of lines

This should make stripping a bit faster

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agodownloader: Seperate downloaded files into blocks and iterate over those
Michael Tremer [Mon, 29 Jan 2018 20:33:21 +0000 (20:33 +0000)]
downloader: Seperate downloaded files into blocks and iterate over those

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoAdd downloader which decodes files downloaded from the RIRs on-the-fly
Michael Tremer [Mon, 29 Jan 2018 19:26:48 +0000 (19:26 +0000)]
Add downloader which decodes files downloaded from the RIRs on-the-fly

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 months agoadd override country code to A1 overrides
Peter Müller [Thu, 18 Jan 2018 14:51:20 +0000 (15:51 +0100)]
add override country code to A1 overrides

Adding a "newcountry" flag for each AS (no IP ranges currently
listed here) in the A1 override file. This makes parsing of
several override files much easier, since we do not need to
care about file names, for example.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agoA1 overrides: Sort them by ASN
Peter Müller [Tue, 16 Jan 2018 19:30:18 +0000 (20:30 +0100)]
A1 overrides: Sort them by ASN

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agoA1 override: add AS396507 (Emerald Onion)
Peter Müller [Tue, 19 Dec 2017 15:33:06 +0000 (16:33 +0100)]
A1 override: add AS396507 (Emerald Onion)

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agoA1 override: add AS51852 (Private Layer INC)
Peter Müller [Tue, 19 Dec 2017 15:30:36 +0000 (16:30 +0100)]
A1 override: add AS51852 (Private Layer INC)

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agoA1 override: add AS10914 (Cypherpunk Privacy Network)
Peter Müller [Tue, 19 Dec 2017 15:28:29 +0000 (16:28 +0100)]
A1 override: add AS10914 (Cypherpunk Privacy Network)

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agoA1 override: add AS37560 (Cyberdyne S.A.)
Peter Müller [Tue, 19 Dec 2017 15:25:46 +0000 (16:25 +0100)]
A1 override: add AS37560 (Cyberdyne S.A.)

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 months agocountry override files: inital checkin
Peter Müller [Tue, 19 Dec 2017 15:16:32 +0000 (16:16 +0100)]
country override files: inital checkin

Initially create manual override files for country data.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>