Skip to content
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

Extend RIPE import with route information #15

Open
bernhard-herzog opened this issue May 7, 2021 · 1 comment
Open

Extend RIPE import with route information #15

bernhard-herzog opened this issue May 7, 2021 · 1 comment
Assignees

Comments

@bernhard-herzog
Copy link
Member

For the tuency project we
want to extend the RIPE importer with routing information so that IP
addresses can be mapped to related ASNs. In particular, we want to
import the ripe route files (ripe.db.route.gz and ripe.db.route6.gz)
which contain a mapping from network addresses to ASNs.

Overview

My plan for implementing this in intelmq-certbund-contact is

  • Start a new branch for this: wip-import-routes

  • Work out the datamodel and implement the import

  • Importing the route information is optional as for now it's nonly
    needed by tuency.

Data model

The table for this will likely be the following:

CREATE TABLE route_automatic (
    route_automatic_id SERIAL PRIMARY KEY,
    address CIDR NOT NULL,
    asn BIGINT NOT NULL,
    LIKE automatic_templ INCLUDING ALL,

    UNIQUE (address, asn, import_source)
);

The routing data from RIPE does have cases where an address is
associated with multiple ASNs, so the UNIQUE constraint cannot be just
(address, import_source) as one might perhaps expect.

Optional route import

Since not all users need the routing information, the actual import is
optional and has to be explicitly activated by a command line flag.

The changes to the data model and e.g. the ripe_download script do not
have top be optional, though. The ripe.db.inetnum.gz alone is much
bigger than the route files so downloading the route files even if
they're not needed should not be much of a problem in practice.

Also, having the route_automatic table in all databases makes dealing
with future updates easier as there are fewer differences between the
installiations that need to be taken into account.

@bernhard-herzog bernhard-herzog self-assigned this May 7, 2021
@bernhardreiter
Copy link
Member

the actual import is optional and has to be explicitly activated

If we put in the tables in any case, why not make it default to import it and use explicit deactivation?

bernhard-herzog added a commit that referenced this issue May 10, 2021
The ripe importer can now optionally import RIPE route data. In the
context of IntelMQ, this information is useful to e.g. map IP addresses
to ASNs which in turn can be mapped to contact information for
notifications.

This commit contains the changes for main part of this:

 * The download script also downloads the ripe.db.route.gz
   and ripe.db.route6.gz files

 * The database schema has a new table and index for the route
   information

 * The import code optionally loads these files and saves it into the
   database

Notably missing is the database upgrade.

Related to #15
bernhard-herzog added a commit that referenced this issue May 20, 2021
This adds an update script for the new route_automatic table. The name
script file does not include a version number like the other update
scripts because it's not clear yet which version this file will be
included in.

Related to #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants