]> git.ipfire.org Git - people/ms/libloc.git/log
people/ms/libloc.git
7 days agoimporter: Drop EDROP as it has been merged into DROP master
Michael Tremer [Thu, 11 Apr 2024 17:45:18 +0000 (17:45 +0000)] 
importer: Drop EDROP as it has been merged into DROP

https://www.spamhaus.org/resource-hub/network-security/spamhaus-drop-and-edrop-to-become-a-single-list/

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 days agolua: Add method to access database creation time
Michael Tremer [Mon, 8 Apr 2024 10:24:21 +0000 (10:24 +0000)] 
lua: Add method to access database creation time

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 days agolua: Add function that returns subnets of a network
Michael Tremer [Sat, 6 Apr 2024 11:11:28 +0000 (11:11 +0000)] 
lua: Add function that returns subnets of a network

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 days agonetwork: Add function to return a reverse pointer for networks
Michael Tremer [Sat, 6 Apr 2024 10:49:41 +0000 (10:49 +0000)] 
network: Add function to return a reverse pointer for networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 days agotests: Set LD_LIBRARY_PATH
Michael Tremer [Sat, 6 Apr 2024 10:33:33 +0000 (10:33 +0000)] 
tests: Set LD_LIBRARY_PATH

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 days agoaddress: Add functions to access a specific byte/nibble in an address
Michael Tremer [Sat, 6 Apr 2024 10:33:06 +0000 (10:33 +0000)] 
address: Add functions to access a specific byte/nibble in an address

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 days agolua: Cleanup any database iterators
Michael Tremer [Fri, 5 Apr 2024 15:58:53 +0000 (15:58 +0000)] 
lua: Cleanup any database iterators

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 days agolua: Create a simple iterator for all networks
Michael Tremer [Fri, 5 Apr 2024 15:36:14 +0000 (15:36 +0000)] 
lua: Create a simple iterator for all networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 days agotests: Fix bit length tests
Michael Tremer [Fri, 5 Apr 2024 15:31:31 +0000 (15:31 +0000)] 
tests: Fix bit length tests

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agolua: Don't raise an error if a network cannot be found
Michael Tremer [Sun, 31 Mar 2024 16:33:34 +0000 (16:33 +0000)] 
lua: Don't raise an error if a network cannot be found

The lookup function now returns nil which is easier to handle than
catching a Lua error.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agolua: Add compatibility function to compile with Lua >= 5.1
Michael Tremer [Sun, 31 Mar 2024 14:16:14 +0000 (14:16 +0000)] 
lua: Add compatibility function to compile with Lua >= 5.1

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 weeks agotests: Add tests for #13236
Michael Tremer [Fri, 22 Mar 2024 14:45:41 +0000 (14:45 +0000)] 
tests: Add tests for #13236

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 weeks agonetwork: Fix handling bit length on merge
Michael Tremer [Fri, 22 Mar 2024 14:42:30 +0000 (14:42 +0000)] 
network: Fix handling bit length on merge

The check was kind of useless because of incorrect values from the bit
length function.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 weeks agoaddress: Fix bit length calculation
Michael Tremer [Fri, 22 Mar 2024 14:41:44 +0000 (14:41 +0000)] 
address: Fix bit length calculation

I have no idea what the previous version computed, but it wasn't the
right thing.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Permit Geofeeds for everything instead of ignoring
Michael Tremer [Tue, 19 Mar 2024 10:45:41 +0000 (10:45 +0000)] 
importer: Permit Geofeeds for everything instead of ignoring

This seems to become the default and so we should avoid making the
overrides file too verbose.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Drop even more indexes
Michael Tremer [Mon, 18 Mar 2024 17:12:57 +0000 (17:12 +0000)] 
importer: Drop even more indexes

We have gone a little bit wild on this but should not need them.

This patch also migrates any GIST indexes to SP-GIST.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Drop any indexes we no longer need
Michael Tremer [Mon, 18 Mar 2024 17:05:36 +0000 (17:05 +0000)] 
importer: Drop any indexes we no longer need

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Make the export 200x faster
Michael Tremer [Mon, 18 Mar 2024 16:56:50 +0000 (16:56 +0000)] 
importer: Make the export 200x faster

The export became a huge problem here as it was very slow. One large
query produced one very large output which was difficult to test and
validate as the total export could easily take 17-20 hrs.

This patch fixes this so that the export now takes around ~5min. Sadly
we are still not using more than one processor core, because PostgreSQL
thinks its faster with just the one, but we trade a lot of CPU time for
a little bit of extra memory instead.

We create a new temporary table that holds all networks that we are
interested in. We then run a couple of broken down queries that perform
one thing instead of multiple at the same time.

First, we add all AS numbers, then all countries which are the longest
queries taking now around 20-30s. Then we apply any data from the
external feeds and our own overrides.

The final export requires about 1.7 GiB of memory because we don't
perform any deduplication in the database any more. That has been a lot
better implemented in our own code and I don't think that < 2 GiB is a
reason for concern.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Replace all GIST indexes with SP-GIST
Michael Tremer [Mon, 18 Mar 2024 16:56:08 +0000 (16:56 +0000)] 
importer: Replace all GIST indexes with SP-GIST

They are a lot faster for our application.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: ANALYZE all tables before we are running the export
Michael Tremer [Mon, 18 Mar 2024 16:52:26 +0000 (16:52 +0000)] 
importer: ANALYZE all tables before we are running the export

This should help the query planner to make better decisions when
planning the large queries.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoimporter: Remove more traces of the Geofeed overrides table
Michael Tremer [Sat, 16 Mar 2024 11:34:21 +0000 (11:34 +0000)] 
importer: Remove more traces of the Geofeed overrides table

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoimporter: Convert networks back to string
Michael Tremer [Tue, 12 Mar 2024 11:24:47 +0000 (11:24 +0000)] 
importer: Convert networks back to string

psycopg3 returns inet types as IP networks.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoimporter: Allow storing multiple Geofeeds for the same network
Michael Tremer [Tue, 12 Mar 2024 11:17:50 +0000 (11:17 +0000)] 
importer: Allow storing multiple Geofeeds for the same network

This is very likely not required except for a couple of overrides.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoimporter: Currently update the source when encountering a conflict
Michael Tremer [Tue, 12 Mar 2024 11:14:13 +0000 (11:14 +0000)] 
importer: Currently update the source when encountering a conflict

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoimporter: Unify the way we check Geofeed URLs
Michael Tremer [Tue, 12 Mar 2024 11:12:01 +0000 (11:12 +0000)] 
importer: Unify the way we check Geofeed URLs

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoimporter: Import Geofeed overrides with other Geofeeds
Michael Tremer [Tue, 12 Mar 2024 11:06:22 +0000 (11:06 +0000)] 
importer: Import Geofeed overrides with other Geofeeds

The previous approach neglegted that we check if a Geofeed is permitted
to change the location for a subnet so that Geofeeds cannot overwrite
any subnets they don't belong to.

That means that we will have to add those networks to the Geofeeds as
well.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Remove a debugging line
Michael Tremer [Thu, 7 Mar 2024 14:03:50 +0000 (14:03 +0000)] 
importer: Remove a debugging line

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Convert the file handle to text before passing to the CSV parser
Michael Tremer [Thu, 7 Mar 2024 14:03:16 +0000 (14:03 +0000)] 
importer: Convert the file handle to text before passing to the CSV parser

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Fix another variable error in CSV parser
Michael Tremer [Thu, 7 Mar 2024 13:56:36 +0000 (13:56 +0000)] 
importer: Fix another variable error in CSV parser

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Skip ASN lines in extended format
Michael Tremer [Thu, 7 Mar 2024 13:56:20 +0000 (13:56 +0000)] 
importer: Skip ASN lines in extended format

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Fix another incorrect variable name
Michael Tremer [Thu, 7 Mar 2024 13:52:01 +0000 (13:52 +0000)] 
importer: Fix another incorrect variable name

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Fix incorrect variable name
Michael Tremer [Thu, 7 Mar 2024 13:49:58 +0000 (13:49 +0000)] 
importer: Fix incorrect variable name

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Use database pipelining when parsing feeds
Michael Tremer [Thu, 7 Mar 2024 12:39:09 +0000 (12:39 +0000)] 
importer: Use database pipelining when parsing feeds

Pipelining should allow us to parse feeds faster since we no longer wait
for a response from the database for each row that we are inserting.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Timeout if fetching a Geofeed takes longer than 5 seconds
Michael Tremer [Thu, 7 Mar 2024 12:24:18 +0000 (12:24 +0000)] 
importer: Timeout if fetching a Geofeed takes longer than 5 seconds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Wrap everything into asyncio
Michael Tremer [Thu, 7 Mar 2024 12:18:14 +0000 (12:18 +0000)] 
importer: Wrap everything into asyncio

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agodatabase: Create a connection pool for async operation
Michael Tremer [Thu, 7 Mar 2024 12:16:30 +0000 (12:16 +0000)] 
database: Create a connection pool for async operation

This is very useful when we want to run multiple tasks concurrently
using asyncio.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Ignore comments in Geofeeds
Michael Tremer [Wed, 6 Mar 2024 23:47:25 +0000 (23:47 +0000)] 
importer: Ignore comments in Geofeeds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Check imported Geofeed override URLs
Michael Tremer [Wed, 6 Mar 2024 23:22:30 +0000 (23:22 +0000)] 
importer: Check imported Geofeed override URLs

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Add structure to add Geofeed overrides
Michael Tremer [Wed, 6 Mar 2024 23:16:44 +0000 (23:16 +0000)] 
importer: Add structure to add Geofeed overrides

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agotree: Don't check if we need to fill the stack
Michael Tremer [Wed, 6 Mar 2024 22:46:44 +0000 (22:46 +0000)] 
tree: Don't check if we need to fill the stack

If the stack is empty, the for loop won't run and we will straight go to
where we push the network onto the stack.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agotree: Be smarter when removing networks from the stack
Michael Tremer [Wed, 6 Mar 2024 22:45:28 +0000 (22:45 +0000)] 
tree: Be smarter when removing networks from the stack

Since we are working through a sorted tree, we will either only see
subnets of a network or we won't. Once we see a network that isn't a
subnet, we remove the supernet until nothing is left on the stack.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agotree: Fix memory leak in dedup code
Michael Tremer [Wed, 6 Mar 2024 22:44:29 +0000 (22:44 +0000)] 
tree: Fix memory leak in dedup code

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoAdd README.md
Michael Tremer [Mon, 4 Mar 2024 12:39:23 +0000 (12:39 +0000)] 
Add README.md

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoUpdate translations
Michael Tremer [Mon, 4 Mar 2024 12:21:23 +0000 (12:21 +0000)] 
Update translations

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Merge the downloader into our main downloader
Michael Tremer [Mon, 4 Mar 2024 12:20:10 +0000 (12:20 +0000)] 
importer: Merge the downloader into our main downloader

I don't know why we ended up with duplicated code here, but there seems
to be no reason whatsoever for this.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Move the split functions into the main importer
Michael Tremer [Mon, 4 Mar 2024 12:10:37 +0000 (12:10 +0000)] 
importer: Move the split functions into the main importer

This has no functional changes, but moved the functions into a different
file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agodatabase: Migrate to psycopg3
Michael Tremer [Mon, 4 Mar 2024 12:07:21 +0000 (12:07 +0000)] 
database: Migrate to psycopg3

Fixes: #12953
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: No longer import Geofeeds concurrently
Michael Tremer [Mon, 4 Mar 2024 12:06:33 +0000 (12:06 +0000)] 
importer: No longer import Geofeeds concurrently

This is kind of a problem since many servers have gone away, respond
very slowly, etc. But since we are moving towards psycopg3, we cannot do
this the old way any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Drop the geofeed sources when updating RIR data
Michael Tremer [Mon, 4 Mar 2024 11:47:10 +0000 (11:47 +0000)] 
importer: Drop the geofeed sources when updating RIR data

This is a cleaner way to drop any previously imported content and should
also be faster because we can drop a lot of DELETE staments for objects
without Geofeeds.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Create a better structure to import RIRs
Michael Tremer [Mon, 4 Mar 2024 11:42:04 +0000 (11:42 +0000)] 
importer: Create a better structure to import RIRs

All information about all RIRs will now be imported in one large
database transaction per RIR which should bring us better integrity and
help us to phase out any stale data.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Add option to only import specific RIRs
Michael Tremer [Mon, 4 Mar 2024 10:29:38 +0000 (10:29 +0000)] 
importer: Add option to only import specific RIRs

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Also import networks that are smaller than /48 or /24
Michael Tremer [Mon, 4 Mar 2024 10:23:49 +0000 (10:23 +0000)] 
importer: Also import networks that are smaller than /48 or /24

These cannot appear in the global routing table, but that does not mean
that there isn't any value in importing them into our database.

In case they are just noise, we will filter them out later on.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Improve checks for unspecified networks
Michael Tremer [Mon, 4 Mar 2024 10:22:22 +0000 (10:22 +0000)] 
importer: Improve checks for unspecified networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Improve check for network objects
Michael Tremer [Mon, 4 Mar 2024 10:19:51 +0000 (10:19 +0000)] 
importer: Improve check for network objects

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Change country code logic
Michael Tremer [Mon, 4 Mar 2024 10:12:42 +0000 (10:12 +0000)] 
importer: Change country code logic

If we have imported something without valid country codes, we still need
to import that network object into the database. Further information
could come from a Geofeed. Otherwise we still want to have this network
here for later processing.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Skip any countries that we don't know
Michael Tremer [Mon, 4 Mar 2024 09:56:48 +0000 (09:56 +0000)] 
importer: Skip any countries that we don't know

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: When storing country codes, make the code more straight-forward
Michael Tremer [Mon, 4 Mar 2024 09:52:38 +0000 (09:52 +0000)] 
importer: When storing country codes, make the code more straight-forward

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Return known countries as a set()
Michael Tremer [Mon, 4 Mar 2024 09:50:44 +0000 (09:50 +0000)] 
importer: Return known countries as a set()

It should be possible to search through sets quicker.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Make translating country codes more extensible
Michael Tremer [Mon, 4 Mar 2024 09:49:43 +0000 (09:49 +0000)] 
importer: Make translating country codes more extensible

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Ignore certain country codes
Michael Tremer [Mon, 4 Mar 2024 09:48:19 +0000 (09:48 +0000)] 
importer: Ignore certain country codes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Fail if no countries have been imported, yet
Michael Tremer [Mon, 4 Mar 2024 09:41:14 +0000 (09:41 +0000)] 
importer: Fail if no countries have been imported, yet

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Remove superfluous function call
Michael Tremer [Mon, 4 Mar 2024 09:34:14 +0000 (09:34 +0000)] 
importer: Remove superfluous function call

Normally a function call doesn't have that much overhead in Python, but
since we are calling all these that many times I am sure this is all
adding up.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Use the downloader to import Geofeeds
Michael Tremer [Sat, 2 Mar 2024 19:53:49 +0000 (19:53 +0000)] 
importer: Use the downloader to import Geofeeds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Drop any data from feeds we no longer support
Michael Tremer [Sat, 2 Mar 2024 11:35:37 +0000 (11:35 +0000)] 
importer: Drop any data from feeds we no longer support

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Drop source field from overrides table
Michael Tremer [Sat, 2 Mar 2024 11:26:43 +0000 (11:26 +0000)] 
importer: Drop source field from overrides table

Since we now import all feeds into a separate table including their own
source, we can drop this from the *_overrides tables as we only import
our own data here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Refactor parsing Spamhaus ASNDROP
Michael Tremer [Sat, 2 Mar 2024 11:20:13 +0000 (11:20 +0000)] 
importer: Refactor parsing Spamhaus ASNDROP

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Refactor parsing Spamhaus DROP feeds
Michael Tremer [Sat, 2 Mar 2024 11:13:53 +0000 (11:13 +0000)] 
importer: Refactor parsing Spamhaus DROP feeds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Add the option to only update one feed
Michael Tremer [Sat, 2 Mar 2024 11:00:26 +0000 (11:00 +0000)] 
importer: Add the option to only update one feed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Completely rewrite the AWS parser
Michael Tremer [Sat, 2 Mar 2024 10:54:08 +0000 (10:54 +0000)] 
importer: Completely rewrite the AWS parser

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Reformat AWS dictionary
Michael Tremer [Sat, 2 Mar 2024 10:43:42 +0000 (10:43 +0000)] 
importer: Reformat AWS dictionary

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Simplify fetching countries
Michael Tremer [Sat, 2 Mar 2024 10:36:00 +0000 (10:36 +0000)] 
importer: Simplify fetching countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Refactor feed parsing
Michael Tremer [Sat, 2 Mar 2024 10:28:02 +0000 (10:28 +0000)] 
importer: Refactor feed parsing

This adds a bit of common code across all feeds, but is only implemented
for AWS at the moment.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Create a new subcommand to import feeds
Michael Tremer [Sat, 2 Mar 2024 10:11:09 +0000 (10:11 +0000)] 
importer: Create a new subcommand to import feeds

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Reformat the large SQL query
Michael Tremer [Sat, 2 Mar 2024 09:57:40 +0000 (09:57 +0000)] 
importer: Reformat the large SQL query

There are no functional changes here. This is just to be able to extend
the script more easily.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Fix typo in SQL query
Michael Tremer [Sat, 2 Mar 2024 09:57:25 +0000 (09:57 +0000)] 
importer: Fix typo in SQL query

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Import AWS IP feed into the new feeds table
Michael Tremer [Sat, 2 Mar 2024 09:50:23 +0000 (09:50 +0000)] 
importer: Import AWS IP feed into the new feeds table

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Import Spamhaus DROP feeds into the new feeds table
Michael Tremer [Sat, 2 Mar 2024 09:45:19 +0000 (09:45 +0000)] 
importer: Import Spamhaus DROP feeds into the new feeds table

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Don't import any AS names from Spamhaus
Michael Tremer [Sat, 2 Mar 2024 09:43:25 +0000 (09:43 +0000)] 
importer: Don't import any AS names from Spamhaus

Those are not very human readable and we should usually have a better
source.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Create a feeds table for networks, too
Michael Tremer [Sat, 2 Mar 2024 09:42:29 +0000 (09:42 +0000)] 
importer: Create a feeds table for networks, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Import the Spamhaus ASN feed into the new feeds table
Michael Tremer [Sat, 2 Mar 2024 09:36:05 +0000 (09:36 +0000)] 
importer: Import the Spamhaus ASN feed into the new feeds table

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 weeks agoimporter: Create an extra table for feeds
Michael Tremer [Sat, 2 Mar 2024 09:23:30 +0000 (09:23 +0000)] 
importer: Create an extra table for feeds

We are currently using the overrides table to import any third-party
feeds. That creates the problem that those tables can only hold one row
for each AS which we cannot easily merge without losing the source of
the information.

Therefore this patch creates a new table which allow us to store this
information per feed and we will use that information if there is no
overrides information.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
7 weeks agoimporter: Pass downloader to the ARIN import
Michael Tremer [Fri, 23 Feb 2024 15:36:44 +0000 (15:36 +0000)] 
importer: Pass downloader to the ARIN import

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
7 weeks agoconfigure: Don't check for Lua when --disable-lua is passed
Michael Tremer [Fri, 23 Feb 2024 14:08:49 +0000 (14:08 +0000)] 
configure: Don't check for Lua when --disable-lua is passed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: network: Implement checking flags
Michael Tremer [Thu, 22 Feb 2024 16:25:21 +0000 (16:25 +0000)] 
lua: network: Implement checking flags

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Export network flags
Michael Tremer [Thu, 22 Feb 2024 16:20:38 +0000 (16:20 +0000)] 
lua: Export network flags

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Export default database path
Michael Tremer [Thu, 22 Feb 2024 16:16:53 +0000 (16:16 +0000)] 
lua: Export default database path

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agoconfigure: Check for luaunit
Michael Tremer [Thu, 22 Feb 2024 16:11:56 +0000 (16:11 +0000)] 
configure: Check for luaunit

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: database: Implement verify()
Michael Tremer [Thu, 22 Feb 2024 15:55:16 +0000 (15:55 +0000)] 
lua: database: Implement verify()

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: database: Export description/license/vendor
Michael Tremer [Thu, 22 Feb 2024 15:46:57 +0000 (15:46 +0000)] 
lua: database: Export description/license/vendor

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: database: Implement fetching countries
Michael Tremer [Thu, 22 Feb 2024 15:43:07 +0000 (15:43 +0000)] 
lua: database: Implement fetching countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: database: Implementing fetching AS objects
Michael Tremer [Thu, 22 Feb 2024 15:39:25 +0000 (15:39 +0000)] 
lua: database: Implementing fetching AS objects

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Add AS object
Michael Tremer [Thu, 22 Feb 2024 15:31:40 +0000 (15:31 +0000)] 
lua: Add AS object

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: country: Export remaining properties
Michael Tremer [Thu, 22 Feb 2024 15:18:21 +0000 (15:18 +0000)] 
lua: country: Export remaining properties

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Don't try to free memory that was allocated by Lua
Michael Tremer [Thu, 22 Feb 2024 15:13:41 +0000 (15:13 +0000)] 
lua: Don't try to free memory that was allocated by Lua

The userdata that we have allocated cannot be freed as we don't have
control over it.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Force testing garbage collection for countries
Michael Tremer [Thu, 22 Feb 2024 15:13:25 +0000 (15:13 +0000)] 
lua: Force testing garbage collection for countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Create Country objects
Michael Tremer [Thu, 22 Feb 2024 15:10:51 +0000 (15:10 +0000)] 
lua: Create Country objects

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Force garbage collection to test those methods
Michael Tremer [Thu, 22 Feb 2024 14:50:49 +0000 (14:50 +0000)] 
lua: Force garbage collection to test those methods

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Check if we can read the network's properties
Michael Tremer [Thu, 22 Feb 2024 14:45:19 +0000 (14:45 +0000)] 
lua: Check if we can read the network's properties

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: Fix calling methods that belong to an object
Michael Tremer [Thu, 22 Feb 2024 14:43:20 +0000 (14:43 +0000)] 
lua: Fix calling methods that belong to an object

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 weeks agolua: network: Add a __close method
Michael Tremer [Thu, 22 Feb 2024 14:16:29 +0000 (14:16 +0000)] 
lua: network: Add a __close method

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>