Skip to main content

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

MIT License

Copyright (c) 2021 Ben Maddison

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for rpkimancer 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rpkimancer 0.2.2
File Size Uploaded Provenance Actions
rpkimancer-0.2.2.tar.gz 673.9 kB Without provenance Details for rpkimancer-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rpkimancer 0.2.2
File Interpreter ABI Platform Actions
rpkimancer-0.2.2-py3-none-any.whl Python 3 none any Details for rpkimancer-0.2.2-py3-none-any.whl

Total release size: 795.1 kB

Release files / rpkimancer-0.2.2.tar.gz

Download URL rpkimancer-0.2.2.tar.gz
Size 673.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7de0c2c5eb0a106cfa37639c1b868cf38060366d83da46c1f4631f6cb652f544
BLAKE2b-256 checksum
How to use checksums
55dbe2de0a1037ab78f30bd80589305a37caa8f6a816fee63c26919a471a33eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / rpkimancer-0.2.2-py3-none-any.whl

Download URL rpkimancer-0.2.2-py3-none-any.whl
Size 121.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba38e5479859338e211bdb12d307c37ede0b065bdf5bacf3270c242d0f64c7ee
BLAKE2b-256 checksum
How to use checksums
4cffbb15e1c2985e5376a27e1f8b91cfd704f64deb8f46c81559a60ef7735f3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for rpkimancer 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page