GithubHelp home page GithubHelp logo

lolepezy / rpki-prover Goto Github PK

View Code? Open in Web Editor NEW
11.0 6.0 6.0 12.45 MB

Yet another RPKI validator

License: BSD 3-Clause "New" or "Revised" License

Haskell 99.37% Shell 0.34% CSS 0.29%
rpki rtr roa docker-image rsync cryptography routing-security

rpki-prover's Introduction

Contents

Introduction

RPKI prover is an implementation of the RPKI relying party software with the focus on a reasonable compromise between resource utilisation and ease of introducing changes.

Issues are tracked here, any questions can be asked there as well.

This implementation seeks to address potential security vulnerabilites by utilising process isolation, memory and time constraints and other ways of preventing resource exhaustion attacks and make sure that "it keeps going" regardless of unstable or potentially maliciouly constructed RPKI repositories.

Features

  • Fetching from both rsync and RRDP repositories
  • X509 validation and validation of EE certificates
  • Validation of resource sets, including support for RFC8360 "validation reconsidered"
  • UI for reporting metrics and found problems
  • REST API for pretty much everything the validator does
  • Output of VRPs in CSV and JSON formats
  • Support for RTR protocol, both version 0 and 1
  • Support of SLURM (RFC 8416)
  • Support of ASPA object validation and output
  • Support of BGPSec certificates validation and RTR
  • Support of RPKI Signed Checklists
  • Support of RPKI Prefix Lists
  • Static binaries for Linux
  • Docker image

Usage

Running rpki-prover --help gives some reasonable help on CLI options.

The only dependency needed for rpki-prover to run is rsync client.

rpki-prover is a daemon that runs periodic re-validation of all TAs in the RPKI hierachy. The results of these runs are exposes in UI, JSON API and Prometheus metrics. Also the --with-rtr option enables RTR server pushing VRP updates to RTR clients.

There is no config file and all the configuration is provided with CLI (most of the defaults are pretty reasonable, so normally you don't need to adjust a lot of parameters). Typical command line could look like this

/opt/bin/rpki-prover-linux.exe --rpki-root-directory /var/rpki/ --cpu-count 4 --http-api-port 8080 --log-level debug

There is an initialise step necessary to start after downloading or building the executable: you need to run something like rpki-prover.exe --initialise --rpki-root-directory /var/where-you-want-data-to-be to create the necessary FS layout in /var/where-you-want-data-to-be. It will download the TAL files to /var/where-you-want-data-to-be/tals as well.

Static Linux binary

Every release includes statically linked Linux x64 executable, just download and run it.

Docker image

It is possible to run rpki-prover as docker run lolepezy/rpki-prover:latest. The image is available on Docker Hub.

It is also possible to build your own image using docker build . --file Dockerfile.prover --tag rpki-prover.

Since rpki-prover needs to have some persistent directory to use for TALs, caches, temporary files, etc. (the aforementioned /var/where-you-want-data-to-be), there needs to be a persistent volume configured for it, so typical sequence of commands could be something like this

docker volume create rpki-data
docker pull lolepezy/rpki-prover:latest
docker run --mount source=rpki-data,target=/rpki-data lolepezy/rpki-prover:latest --initialise
docker run -p 9999:9999 --mount source=rpki-data,target=/rpki-data lolepezy/rpki-prover:latest --cpu-count 4 --revalidation-interval 300

The important part here is target=/rpki-data, this directory is created by default inside of the docker container. Otherwise it can be adjusted as in

docker run -p 9999:9999 --mount source=rpki-data,target=/something-else lolepezy/rpki-prover:latest --rpki-root-directory /something-else

Building from sources

The software is a daemon written in Haskell and can be built using stack.

The instruction below is for linux, but it can work equally for *BSD or Mac (Windows support is not planned or tested).

  • The prerequisites are a few libraries (lmdb, lzma, expat and gmp) and the rsync client. It can be done

    • On Linux using apt-get, that will be : sudo apt-get install rsync libz-dev libexpat1-dev liblmdb-dev liblzma-dev libgmp-dev.
    • On MacOS using brew, that will be: brew install rsync lmdb xz expat.
    • It should be trivial to find the corresponding commands for other UNIX-like OSes or package managers.
  • Install stack as described here

  • Clone https://github.com/lolepezy/rpki-prover/

  • Run ./build-local.sh inside of the rpki-prover directory. It should take quite some time (30-50 minutes as it has to build all the required libraries)

  • Run rpki-prover from the ~/.local/bin when repeating steps from the usage section above.

Normally it prints quite a lot of logs about what it's doing to the stdout. After it prints "Validated all TAs, took ..." (it should take 2-4 minutes depending on how fast the CPU and network are) VRPs can be fetched by executing curl -s http://localhost:9999/api/vrps.csv (or curl -s http://localhost:9999/api/vrps.json).

Main page http://localhost:9999 is the UI that reports some metrics about trust anchorts, repositories and the list of errors and warnings.

HTTP API

There are a bunch of API endpoints. The easiest way to find out what is available is to go to the /swagger-ui URL and explore the Swager UI.

Prometheus metrics

Prometheus metrics are accessible via the standard /metrics path.

Support of RSC

RPKI prover supports validating RPKI Signed Checklists (https://datatracker.ietf.org/doc/draft-ietf-sidrops-rpki-rsc/).

In order to validate a set of files with an RSC object it is necessary to have a running rpki-prover instance to be able to use its cache of validated object. In the examples below it is assumed that there's an instance of rpki-prover (the same version) running with /var/prover set as --rpki-root-directory option. It is also possible to skip --rpki-root-directory parameter assuming that the default (~/.rpki) with be used.

The following example validates two files foo.txt and bar.bin against the checklist.sig object:

rpki-prover  --rpki-root-directory /var/prover --verify-signature --signature-file checklist.sig --verify-files foo.txt bar.bin

The following example validates all files in the dir directory against the checklist.sig object:

rpki-prover  --rpki-root-directory /var/prover --verify-signature --signature-file checklist.sig --verify-directory ./dir

Resource consumption

Cold start, i.e. the first start without cache takes at least 2 minutes and consumes around 3 minutes of CPU time. This time can be slightly reduced by setting higher --cpu-count value in case multiple CPUs are available. While CPU-intensive tasks scale pretty well (speed-up is sublinear up to 8-10 CPU cores), the total warm up time is moslty limited by the download time of the slowest of RPKI repositories and cannot be reduced drastically.

After initial warmup, it's not a very CPU-bound application. With default settings RPKI Prover consumes about 1 hour of CPU time every 18 hours on a typical modern CPU, creating load average of 5-10%. Smaller revalidation interval will increase the load.

The amount of memory needed for a smooth run for the current state of the repositories (6 trust anchors, including AS0 TA of APNIC with about 330K of VRPs in total) is somewhere around 1.5-2GB for all processes in total. Adding or removing TAs can increase or reduce this amount. What can be confusing about memory usage is the figures given by top/htop.

An example of a server, running for a few days:

VIRT  RES    SHR
1.0T  4463M  3920M

Here SHR is largely dominated by the LMDB cache and other mmap-ed files (temporary files used to download RRDP repositories, etc.). That means that actual heap of the process is about 4463-3920=543M.

Every validation or repository fetch runs as a separate process with its own heap, with typical heap size for the validator up to 600-700M and up to 100-200MB for a fetching process.

Note that memory consumption is mostly determined by how big the biggest objects are and not that much by how many there are objects in total, so the growth of repositories is not such a big issue for rpki-prover. It it recommended to have 3GB of RAM available on the machine mostly to reduce the IOPS related to reading objects from the LMDB cache. Since every validation typically goes through 230K of objects (at the moment of writing), each of them being 3Kb in size on average, it would be benificial to have at least few hundred of megabytes in FS page cache.

Disk space usage depends on the --cache-lifetime-hours parameter. The default is 72 hours and it results in a cache size about 2Gb. 72 hours is a little bit on a big side, so lower values would reduce the amount of data stored. However, LMDB is not very good in reusing the free space in its file, so physical size of the cache directory can be 2 or more times bigger than the total size of data in it. There is a compaction procedure that kicks in when the LMDB file size is 2 or more times bigger than the total size of all data. So overall, in the worst case scenario, it would need approximately 1GB of disk space for every 10 hours of --cache-lifetime-hours.

Known issues

  • From time to time a message 'rpki-prover: Thread killed by timeout manager' may be printed to stderr. It's the result of a bug in the HTTP server used for API and UI and is harmless. It will be fixed one way or the other in future versions.
  • As mentioned before, total RSS of the process can go up to several gigabytes even though most of it mapped to LMDB cache and not in RAM. It may, however, be that rpki-prover is killed by OOM and some configuration adjustments would be needed to prevent it.

Why Haskell?

  • Relatively small code-base. Currently the size of it is around 10KLOC, including a lot of functionality implemented from scratch, such as CMS-parsing.
  • Fast prototyping and smooth refactoring.
  • Ease of introducing changes and very short time-to-market.
  • Reasonable performance while the language is very high-level (GC, immutable data, powerful type system).
  • Original motivation was "because it's cool", everything else came later.

rpki-prover's People

Contributors

dadepo avatar lolepezy avatar wibisono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rpki-prover's Issues

Store all locations for every object

There are still TODOs to fix that: an object (defined by hash) can have multiple locations but only one is stored. It would be very useful to store them all to see duplication.

Ctrl+C doesn't always stop the process

Implement proper signal handling so that the process reliably stops. Review exception propagation in concurrent/parallel code. That is required for systemd integration.

Segfault in LMDB

Messages like (on Linux)
rpki-prover:w[2193433]: segfault at 179 ip 00007f9c8878602d sp 00007f9b48ff4db0 error 4 in liblmdb.so.0.0.0[7f9c88783000+10000]

The same happens on macos.

It can be reproduced by sending an async exception to a thread running RO lmdb transaction. Doesn't happen every time, but happens pretty reliably. Workaround -- do not cancel asyncs running transactions. It probably need to be fixed in the lmdb-high-level library.

Implement RRDP -> rsync fall-back

Maybe as a CLI option?

Generally, it would be beneficial to have

fetchURI uri1 <|> ... fetchURI uriN logic regardless of which one is RRDP and which one is rsync to support all potential extensions of the RFCs, multi-URL repositories or whatever comes up over time.

Error occurs while compiling

Hello,

i wanted to update my instance of rpki-prover to the latest changes in this repository. I used the same environment as one month before, but a failure occurs. Should I use a completely new installation for the compilation? Does the last compilation affect this new compilation?

Here's the error output of stack:

[59 of 60] Compiling RPKI.TopDown
/home/ubuntu/rpki-prover/src/RPKI/TopDown.hs:63:1: error:
    Could not find module ‘RPKI.Fetch’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
63 | import           RPKI.Fetch
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^


Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/AppContext.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/AppMonad.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/AppState.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/CommonTypes.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Config.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Domain.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Http/Api.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Http/HttpServer.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Http/Messages.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Http/Types.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Http/UI.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Logging.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Metrics.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Orphans/Generics.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Orphans/Serialise.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parallel.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/Cert.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/Common.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/CRL.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/GBR.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/MFT.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/ROA.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Internal/SignedObject.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Parse/Parse.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Reporting.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Repository.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Resources/IntervalSet.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Resources/Resources.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Resources/Types.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RRDP/Http.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RRDP/Parse.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RRDP/RrdpFetch.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RRDP/Types.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Rsync.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RTR/Pdus.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RTR/RtrServer.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RTR/RtrState.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/RTR/Types.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/AppLmdbStorage.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/AppStorage.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/InMemory.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/LMDB.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/Map.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/MultiMap.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/Storable.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Base/Storage.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Database.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/MakeInMemory.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/MakeLmdb.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Repository.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Store/Sequence.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/TAL.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Time.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Util.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Validation/Crypto.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Validation/ObjectValidation.hi Decoding failure: Invalid magic: e49ceb0f

Warning: Failed to decode module interface: /home/ubuntu/rpki-prover/.stack-work/dist/aarch64-linux/Cabal-3.2.1.0/build/RPKI/Validation/ResourceValidation.hi Decoding failure: Invalid magic: e49ceb0f
Completed 208 action(s).

--  While building package rpki-prover-0.1.0.0 using:
      /home/ubuntu/.stack/setup-exe-cache/aarch64-linux/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.4 --builddir=.stack-work/dist/aarch64-linux/Cabal-3.2.1.0 build lib:rpki-prover exe:rpki-prover --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

Introduce DB versioning

It should understand that the data in cache cannot be deserialised by an updated version. In this case it should automatically wipe the whole DB (or just the relevant part?), complain about it in the log, re-dowload repositories and continue instead of complaining about weird deserialisation errors.

Add validation result history with search

  1. Decouple VRP history from validation result history -- it doesn't make so much sense to store 100 versions of VRPs
  2. Add API calls to search through validation result history, there's an obvious use case for it "figure out if and when a problem with this URL/prefix/hash happened"
  3. Add some UI for it

Fix memory issue on Linux, reduce RSS

RSS of the process on Linux looks like it indefinitely(?) growing and it's hard to say why.
Haskell heap seems to be perfectly fine, but the total RSS grows over time.

That does not seem to happen on MacOS, so there's a chance that it's some sort of misinterpretation.

Replace Options.Generic with something simpler

Options.Generic uses type-level descriptions and it's not possible to lift default values to type level. Replace it with something more classical like optparse-applicative, using term level only.

GC-ing unused objects can lead to invalid repositories

In the following scenario things can go really wrong.

  • A RRDP repository publishes a ROA and a manifest that doesn't refer to the ROA.
  • After time defined by --cache-lifetime the ROA is GC-ed, because it was never touched by a top-down validation.
  • After that the repository publishes a new manifest that now refers to the ROA
  • Top-down validation considers the manifest and the CA invalid, since it has a dangling reference.
  • Earth collapses to a black hole.

While in practice this scenario doesn't make any sense, it is still technically valid behaviour of a RRDP repository and must be taken into consideration.

Document requirement for rsync

For installations that don't have rsync, rpki-prover builds and starts fine, but will not function. This error will be seen in the output

[Error]   [21 Apr 2021 15:33:59.193 +00:00] [<unknown loc>] [ThreadId 11] Something weird happened rsync: startProcess: runInteractiveProcess: exec: does not exist (No such file or directory), exiting.

Recommendation: document requirement in README.md. Probably obvious; opening this issue in case others search for this error.

Fix the 'invalid cursor' problem

That happens after copying the data to a new environment, i.e. using
RPKI.Store.AppStorage.defragmentStorageWithTmpDir. New environment is

  • successfully created
  • filled in with data
  • old env is closed
  • new one is re-opened
  • new one is unusable (with LMDB code 22)

After restarting the process the new environment is perfectly usable.

It probably has to do with some LMDB quirks when one has more than one environment in one process.

Replace `streaming-utils` and `json-stream` with something more alive.

These libraries are used in RPKI.RRDP.Http.
They are present in the Stackage 16.27 LTS, but not in nightly and are not updated for long time.
Since we don't really care how to stream-download files, just replace it with http-conduit or pipes, ]
or anything that is better supported.

Test/benchmark different serialisation libraries

Current implementation uses serialise and it's pretty not bad. The hot-spot in profiling is deserialising objects read from LMDB, so it's better to chose a library that does it with least CPU time necessary.

  • try store instead of serialise and benchmark
  • try TH instead of Generic deriving and benchmark

Does mkdirs.sh require an arguement?

Should the script mkdirs.sh be run with an argument?

#!/bin/sh

ROOT=$1

mkdir -p ${ROOT}/cache
...

run without an argument, the script tries to make directories in /

Handle IPv6/IPv4 fallbacks

Example: https://rpki.caramelfox.net/rrdp/notification.xml doesn't respond to a connection using IPV6 address, but DNS returns IPv6 as the first one. As a result connection times out and we fall back to rsync. Http client should use "happy eyeballs DNS" or something similar to handle this case.

Fix "reference cycle"

If an object is referenced multiple times it will be marked as creating "reference cycle" which is not necessary true. Reference cycles can only happen between certificates and manifests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.