Module routinator::store[][src]

Expand description

A store for correctly published RPKI objects.

To be more resistant against accidental or malicious errors in the data published by repositories, we retain a separate copy of all RPKI data that has been found to be covered by a valid manifest in what we call the store. The types in this module provide access to this store.

The store is initialized and configured via Store. During validation, Run is used which can be aquired from the store via the start method. It provides access to the trust anchor certificates via the load_ta and update_ta methods and individual repositories via repository. These repositories are represented by the Repository type and allow loading manifests and objects. They can only be updated at once.

Error Handling

Pretty much all methods and functions provided by this module can return an error. This is because the underlying database may produce an error at any time. The concrete error reason is logged and our generic Failed is returned. When this happens, the store should be considered broken and not be used anymore.

Data Storage

The store uses a sled database to store RPKI data. For each RPKI repository accessed via RRDP, two separate trees are used.

The manifest tree contains all the manifests published via that repository keyed by their rsync URI. The manifests are stored as StoredManifest objects, which include the raw manifest, the raw CRL referenced by the manifest plus some additional meta data.

The object tree contains all other objects. These objects are keyed by a concatenation of the rsync URI of the manifest and their file name on the manifest. This makes it possible to retain multiple versions of an object that appeared on multiple manifests for some reasons. It also makes it easier to iterate over all objects of a manifest for instance during cleanup. Objects are stored as StoredObject.

For an RRDP repository, the rpkiNotify URI of the repository is prefixed by “store:manifest:” for constructing the name of the manifest tree, while the object tree uses this URI prefixed by "store:object:".

There is only one pair of manifest and object tree for rsync since the name of the repository is part of the object URIs. The manifest tree is named "store:manifest:rsync" and the object tree "store:objectrsync".

In addition, the default tree of the database is used for trust anchor certificates. These are keyed by their URI. Only their raw bytes are stored.

Structs

ObjectError

A stored object cannot be decoded correctly.

Repository

Access to a single repository during a validation run.

RepositoryUpdate

An atomic update to a publication point in a repository.

Run

A single validation run on using the store.

Store

A store for correctly published RPKI objects.

StoredManifest

The content of a manifest placed in the store.

StoredObject

The content of an object placed in the store.

UpdateError

An update of a publication point has failed.