Coder Social home page Coder Social logo

rpkimancer's Introduction

rpkimancer

animated rpkimancer

rpkimancer /ɑː-piː-keɪ-aɪ-mænsə/

"One who may be called upon to perform those secret rites and incantations necessary for the creation or interpretation of the mystical artifacts of the RPKI."

CI/CD codecov Updates

About

A library and associated command line utility for quickly creating and reading arbitrary RPKI signed objects.

The primary motivation was to be able to construct new RPKI signed object types directly from an ASN.1 CONTENT-TYPE instance definition with minimal boilerplate and zero custom encoding logic.

The base distribution comes with the necessary plumbing to read and write the currently standardised object types:

  • Manifests (RFC6486)
  • ROAs (RFC6482)
  • Ghostbuster Records (RFC6493)

Additional signed objects can be supported via a plug-in system.

This is not an RP or a CA.

Minimal validation is done on object creation. This is intentional, since a valid use-case is to create almost valid objects to recreate RP bugs.

Similarly, the de-serialisation code contains no crypto validation at all.

Installation

Python version 3.8 or greater is required.

A package is available on PyPI. You can:

python3 -m pip install rpkimancer

Usage

The CLI tools (in the rpkimancer.cli package) provide examples of library usage.

The rpkincant CLI tool ships with two subcommands:

  • rpkincant conjure:

    Creates a simple example repo with a TA and a single sub-ordinate CA.

    All the CRLs and Manifests are generated, along with a ROA and a GBR issued by the CA. A TAL for the TA is also generated.

  • rpkimancer perceive:

    Reads DER encoded signed objects from disk, and deserialises them based on the type indicated by the file extension.

    The result is written to STDOUT by default, in a variety of selectable formats.

Writing Plug-ins

Plug-ins implementing new signed object types can advertise the required components to rpkimancer using the following entry points:

  • rpkimancer.asn1.modules:

    A python package containing ASN.1 modules (which must be named *.asn) to be compiled to python code at run time.

    Each ASN.1 module will end up being available as a class in rpkimancer.asn1.mod.

  • rpkimancer.sigobj:

    A class inheriting from rpkimancer.sigobj.base.SignedObject. The SignedObject class will usually only need to set the econtent_cls attribute to a class inheriting from rpkimancer.sigobj.base.EncapsulatedContent.

    See the implementations in the rpkimancer.sigobj package for examples.

    The entry point is used to map file extensions to implementations by tools like rpkincant perceive.

  • rpkimancer.cli:

    Used to add additional subcommands to the rpkincant CLI tool.

    The target should be a class inheriting from rpkimancer.cli.BaseCommand, and implementing the .init_parser(...) and .run(...) methods.

  • rpkimancer.cli.conjure:

    Used to add CLI arguments and object construction code to the rpkincant conjure subcommand.

    The target should be a class inheriting from rpkimancer.cli.conjure.ConjurePlugin, and implementing the .init_parser(...) and .run(...) methods.

Contributing

Both feature contributions and bug fixes are very welcome.

Please open an issue for discussion before expending energy on an implementation.

Pre-standard RPKI object implementations will not be accepted into the main library. These should be implemented in a standalone plug-in distribution while still in the I-D phase.

To set up a development environment:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r packaging/requirements-dev.txt

And to run the tests and other CI jobs locally:

tox

rpkimancer's People

Contributors

benmaddison avatar job avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

job ties sumkincpp

rpkimancer's Issues

Add helper class for cli argument defaults

Built-in container types (e.g. list) call __repr__() on elements
when converted to str.

As a result, default values for multivalued options are shown using
repr rather than str in help output.

Add a list subclass with overridden __str__() to make this prettier.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Support for reading resource certificates from DER

A number of internal attributes on subclasses of cert.base.BaseResouceCertificate
are set during __init__(...), and cannot be recovered from the DER encoding of
the underlying X.509 certificate.

An alternate constructor, e.g. .from_der(cls, data: bytes) should allow the
construction of a new instance, with only RSA private key missing from the internal
data.

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.