lolepezy / rpki-prover

Yet another RPKI validator
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

GC-ing unused objects can lead to invalid repositories #33

Open lolepezy opened 3 years ago

lolepezy commented 3 years ago

In the following scenario things can go really wrong.

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.

job commented 3 years ago

Unsure if the validators should 'fix' this, validator's dont have infinite memory.

RRDP servers should be encouraged to publish RPKI objects as concise coherent bundles. If a signer updates the manifest but does not provide the ROA at the same time, the signer messed up and the validator should reject the manifest. Nor can the signer expect validators to indefinitely cache ROA objects which are not referenced from any valid manifest.

Similarly to how rsync server operators are expected to atomically and gracefully update the rsync server's module contents, I'd expect RRDP server operators to publish in an atomically coherent fashion.

I think GC-ing unused objects is correct behavior, after all, they are unused. :)

lolepezy commented 3 years ago

I am not planning to change the cache cleanup behaviour on some fundamental level, I wouldn't want RRDP replacements and withdraws to be the only thing controlling lifetime of objects in the local cache.

But some extra heuristics of a kind "if there was an referential integrity problem in the tree, next time download the snapshot instead of deltas" would probably make sense. Or at least a better error message would do.