Commit Graph
702 Commits
Author SHA1 Message Date
124616e75b Add support for ASPA. (#847)
This PR adds support for ASPA to Routinator.

The PR adds a new config option ‘enable_aspa’ that is false by default. Only
if it is set to true will ASPAs be added to the payload set.

It adds support for processing ASPA objects to the engine, adds ASPA related
metrics, and completely refactors the payload storage to be able to deal
with the differing semantics of ASPA payload.

The PR adds a new "aspa" member to the jsonext format and the HTTP delta endpoint. It adds new members to the API status and adds new Prometheus
metrics.

It increases the minimum required Rust version to 0.65.

---------

Co-authored-by: Alex Band <[email protected]>
Co-authored-by: Luuk Hendriks <[email protected]>
2023-04-25 12:37:13 +02:00
Martin HoffmannandGitHub c085dccace Bump minimum Rust version to 1.64 and update dependencies. (#845)
This PR updates the dependencies and, in order to do that, needs to bump the
minimal supported Rust version to 1.64.
2023-03-27 13:20:04 +02:00
Martin HoffmannandGitHub 63511d0677 Print the error type if the RTR server exists. (#839) 2023-03-27 11:38:10 +02:00
Martin HoffmannandGitHub 294d716083 Clippy-suggested fixes. (#841) 2023-03-27 11:26:21 +02:00
Martin HoffmannandGitHub 22546b068c Fix the loop in reading private keys. (#832) 2022-12-13 13:37:39 +01:00
Martin HoffmannandGitHub 3353592756 Accept both PRIVATE KEY and RSA PRIVATE KEY items in PEM files. (#831)
This commit changes the code that reads the private key file for both HTTP
and RTR to accept both the PRIVATE KEY items from PKCS#8 and RSA PRIVATE KEY
items from PKCS#1.
2022-12-13 10:54:32 +01:00
238814549e Gracefully deal with failing timestamp conversions. (#826)
Co-authored-by: Luuk Hendriks <[email protected]>
2022-12-05 14:15:47 +01:00
Sander van DeldenandGitHub 5415d1e310 fix(http_listener): set correct error message on missing tls options (#824)
This commit fixes the error messages printed when the http-tls-key or
http-tls-cert options are missing to actually refer to HTTP rather than
RTR.
2022-12-01 11:14:42 +01:00
Martin HoffmannandGitHub 3be86c865e Chdir to chroot if no working dir is given. (#823)
This commit changes the behavior on Unix by setting the working directory to
the chroot directory if a chroot is requested but no working directory
is explicitly provided.
2022-12-01 11:11:48 +01:00
Martin HoffmannandGitHub c78deeaf64 Only set extra-tals-dir command line option if present. (#821) 2022-11-25 11:10:27 +01:00
Martin Hoffmann a364648cdf Improvements suggested by new Clippy. 2022-11-07 12:24:05 +01:00
Martin Hoffmann b6f33f4bf6 Remove stray newline in summary output. 2022-11-07 11:55:19 +01:00
Martin HoffmannandGitHub a1ddd13f46 Update dependencies. (#814) 2022-11-02 14:25:25 +01:00
22de300fa8 Restructure TAL configuration and remove init command. (#796)
This commit restructures the TAL configuration in response to the dropped
requirement to opt into the ARIN TAL.

Routinator will now use the bundled RIR TALs directly unless told otherwise
by the new --no-rir-tals command line and config option. The additional
bundled TALs can be added via the new --tal command line and config option.
Additionally, the TAL directory can still be used via the --extra-tals-dir
option. The tal-dir option has been removed but will still be accepted – and
ignored – in the config file only.

The init command has been removed.

Co-authored-by: Alex Band <[email protected]>
Co-authored-by: ximon18 <[email protected]>
Co-authored-by: Luuk Hendriks <[email protected]>
2022-11-02 11:44:16 +01:00
Martin HoffmannandGitHub 374af50c41 Fix RTR client metrics. (#811)
This commit fixes two issues with RTR client metrics: For one, we
accidentally used the local address to identify the client instead of the
peer address. And second, the collapsing of multiple client metrics objects
was broken.
2022-10-21 12:03:59 +02:00
Martin HoffmannandGitHub c8a09ce72a Allow limiting the prefix length of included VRPs. (#810)
This commit adds two new command line and config file options, limit-v4-len
and limit-v6-len, that allow limiting the prefix length of IPv4 or IPv6
prefixes, respectively, for which VRPs are to be included in the output data
set. By default, all valid VRPs are included.
2022-10-19 11:01:37 +02:00
593a58abce Add additional RTR client metrics. (#800)
This commit adds three new values to the RTR client metrics:

  o  last_reset contains the time of the last cache reset by the client,
  o  reset_queries contains the number of reset queries by the client, and
  o  serial_queries contains the number of serial queries by the client.

These values are available both in the status and metrics endpoints.

Co-authored-by: Alex Band <[email protected]>
Co-authored-by: Luuk Hendriks <[email protected]>
2022-10-18 10:39:35 +02:00
Martin HoffmannandGitHub df34041bdb Set TCP keepalive for the RRDP HTTP client. (#801)
This commit enables TCP keepalives for RRDP connections. The duration can be
set via the new rrdp-tcp-keepalive command line and config file option.
Setting this value to 0 disables
2022-10-18 10:36:50 +02:00
Martin HoffmannandGitHub 812aa6c9ee Don’t print error on EPIPE in vrps to stdout. (#807)
This commit suppresses the error message when the vrps command is outputting
the data set to stdout and receives a broken pipe error.
2022-10-18 10:34:36 +02:00
Martin HoffmannandGitHub fdf6559be4 Only use RRDP responses if the status code is 200. (#802)
This commit fixes an issue in the RRDP collector which was processing all
kinds of HTTP responses as valid. It now rejects everything that isn’t a
200 OK.
2022-10-17 15:58:08 +02:00
Martin HoffmannandGitHub 39ef576b45 Log 'falling back to rsync' only once per repository. (#804) 2022-10-17 15:57:18 +02:00
Martin HoffmannandGitHub eea7e425e7 Deal more graciously with broken files in the store. (#803)
This commit changes the behavior of Routinator when files are encountered in
the store that cannot be parsed (as opposed to reading failing for other
reasons). Now Routinator will just assume that the publication point stored
in that file doesn’t exist in the store and continue.
2022-10-17 15:55:22 +02:00
52430346b1 Add an rrdp-fallback option to configure fallback to rsync. (#799)
This commit introduces a new command line and config option "rrdp-fallback"
that decides when to fall back to rsync for a failed RRDP update. The
available policies are "never" for never, "stale" for fallback after a
certain time of falling the RRDP update, and "new" for fallback when RRDP has
never succeeded. The default is "stale" which reflects the current behavior.

Co-authored-by: Alex Band <[email protected]>
Co-authored-by: Luuk Hendriks <[email protected]>
2022-10-13 11:13:50 +02:00
Martin HoffmannandGitHub fd430b6d8f Include the log level in logged messages. (#797)
This commit adds the log level of a message to the output printed to files,
stderr, and the /log endpoint.
2022-10-13 10:59:26 +02:00
Martin HoffmannandGitHub 6eedb3fbca Setting rsync-timeout to 0 disables the timeout. (#798)
This commit adjust the rsync-timeout command line and config option to
disable the rsync timeout completely if set to 0. This way it behaves the
same way as rrdp-timeout.
2022-10-13 10:57:31 +02:00
Martin HoffmannandGitHub f5ca39212b Convert command line parsing to clap’s derive API. (#795) 2022-10-10 10:20:59 +02:00
Martin HoffmannandGitHub a6cba1416f Mention inodes on fatal ENOSPC errors. (#793)
This commit modifies the utils::fatal module to replace the standard ‘No
space left on device’ error message for ENOSPC errors on Unix to ‘No space
or inodes left on device‘.
2022-10-05 10:13:15 +02:00
Martin HoffmannandGitHub 280daa91cd Update clap to version 4. (#791) 2022-10-04 14:08:27 +02:00
Martin HoffmannandGitHub 06ff543ef2 Change the default and logging behaviour for unsafe-vrps (#761)
This commit changes the default configuration option for unsafe-vrps to accept
and removes all logging or mentioning of unsafe VRPs in this case. It also
adds a pointer to the manual page for unsafe VRPs if any are logged.
2022-10-03 13:37:59 +02:00
Martin HoffmannandGitHub c356087016 Do not exit on malformed RRDP Base 64 data. (#784)
This commit fixes an oversight in error handling in the RRDP collector that
cause Routinator to exit if it encountered malformed Base 64 in RRDP
snapshot and delta files.

It does this by re-appropriating the existing exception in MaxSizeRead to
not exit when data was too large and extending it to all other read errors
happening. This is fine because the encoded data is currently collected into
a vec before any of this happens, so reading cannot fail other than from
malformed Base 64 data.

This PR can be tested by using the TAL currently available at
https://routinator.do.nlnetlabs.nl/test/rrdp/ta.tal.

This is the same PR as #781 accept applied to the main branch. It fixes
CVE-2022-3029.
2022-10-03 13:11:36 +02:00
Martin HoffmannandGitHub 15eaf2bbf0 Remove rrdp-disable-gzip option. (#769) 2022-08-23 10:19:51 +02:00
Martin HoffmannandGitHub de49e0e10d Introduce WriteOrPanic trait for write!-ing without unwrap. (#771)
This commit introduces a new utility trait WriteOrPanic which provides the
method write_fmt that is used by write! macro and friends. But because it
doesn’t return a result, it allows using the macro without unwrap or
question mark.

The trait is implemented for String and Vec<u8> and used where needed.

Much like the trait’s name suggests, these implementations panic if
formatting fails. That’s fine, as we only use with data that can be
formatted and with types where writing itself can never fail (which I think
is the actual reason for returning a result). Also, we’ve been unwrapping
for quite some time so, clearly, this is working.
2022-08-19 14:04:42 +02:00
Martin HoffmannandGitHub e64f6ecc47 List TAL in jsonext format. Improve JSON string formatting in jsonext format. (#765)
This commit adds a new member "tal" to the source information for data
derived from RPKI objects in the extended JSON output format.

While at it, it also improves the formatting of user-provided strings in
this format by properly escaping them.
2022-08-17 14:24:40 +02:00
Martin Hoffmann fec3db89ed Clippy-suggested code improvement. 2022-08-15 12:35:19 +02:00
Martin Hoffmann fef0ef0dbc Remove (and clarify reasons for) unused code. 2022-08-09 15:56:09 +02:00
Martin Hoffmann bef9f60519 Fix typos. 2022-08-09 15:55:16 +02:00
Martin HoffmannandGitHub 540421de97 Adjust error handling to rpki-rs 0.15. (#755) 2022-08-09 15:47:09 +02:00
Martin HoffmannandGitHub d8481b3639 Switch to Rust edition 2021. (#760) 2022-08-08 16:56:22 +02:00
Martin HoffmannandGitHub b72bdf40d4 RTR server: Start with the first withdrawn element. (#747)
Fixes an issue in `payload::DeltaVrpIter` when switching from announced to withdrawn elements. Also adds a test for the type.
2022-04-20 12:20:54 +02:00
Martin HoffmannandGitHub ccbf1ec632 Dump the stored trust anchor certificates. (#740)
This copies all certificate stored under $(REPOSITORY_DIR)/store/ta to
$(TARGET_DIR)/ta using the same structure as the store itself. The
somewhat unexpected organization has been documented in the manual.
2022-04-04 13:20:47 +02:00
Martin HoffmannandGitHub ee14256f20 Bubble up error in server main loop. (#739) 2022-04-04 10:30:51 +02:00
Martin HoffmannandGitHub f9f7d633f8 Truncate PID file upon opening. (#738) 2022-04-04 10:29:36 +02:00
Martin HoffmannandGitHub a185c4714f Add commas where needed on the delta-json output. (#737) 2022-04-04 10:28:34 +02:00
Martin HoffmannandGitHub 3b40e94176 Also set TCP_KEEPIDLE when enable TCP keepalive. (#736) 2022-04-04 10:27:23 +02:00
Martin HoffmannandGitHub 430117c105 When dumping RRDP, don’t copy the hash at the beginning of objects. (#735) 2022-04-04 10:25:34 +02:00
Martin HoffmannandGitHub 8924496d1c Prepare for release 0.11.0. (#725) 2022-02-28 12:07:51 +01:00
Martin HoffmannandGitHub eac20d1264 Improve killing of timed out rsync processes. (#720)
When just dropping the Tokio child process object, the process is not
properly being waited for and may become a zombie. By explicitely
calling kill and awaiting the result, this shouldn’t happen.
2022-02-21 15:10:29 +01:00
Martin HoffmannandGitHub 76c50e6c36 Change media of /log to plain text. (#719) 2022-02-21 15:07:12 +01:00
c9da111ced Add a --more-specifics option to the vrps command. (#714)
Co-authored-by: Alex Band <[email protected]>
2022-02-10 10:52:52 +01:00
4288d0aed4 Various changes to the HTTP server. (#707)
* Refactor HTTP server and handle HEAD requests.

Introduces a new builder for HTTP responses that makes it unnecessary to
unwrap when finalizing.

Introduces handling of HEAD requests by returning a response early right
before constructing the body.

* Allow including more specifcs.

Adds a new URI parameter include=more_specifics that causes the
responses for payload HTTP requests to also include all route origins
for prefixes that are more specifics of the selected prefix.

Co-authored-by: Alex Band <[email protected]>
2022-02-10 09:34:49 +01:00