arinrest-client


Namearinrest-client JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/jdhall75/arinrest-client
Summaryclient to interact with the arinrest API
upload_time2023-01-04 22:09:19
maintainer
docs_urlNone
authorJason Hall
requires_python
licenseThe Unlicense (Unlicense)
keywords arinrest setuptools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ARINREST LIB

The purpose of this package is to manage and query resources hosted by ARIN.
ARIN has 3 different services that you can query and manage records on. 

- whois, only the RDAP interface is supported by this library
- IRR, This still needs to be implemented 
- RPKI, The reason I start this library os to manage ROA objects hosted in
  ARINs repository.

## Usage
The entry point into this library is the `ArinRest` class. The class only takes
an API Key from ARIN to instantiate.

```python
from arinrest import ArinRest
from arinrest.rpki import ROA

arinclient = ArinRest('your-api-key-here')

# arinclient.rdap() creates a rdap session with ARIN
whois_client = arinclient.rdap()

# You can manage resources in the IRR and RPKI endpoints so currently the classes
# require an API key to instantiate them.

# create an rpki session with signing capabilities, private key required
rpki_client = arin.rpki("/path/to/private/key")

# add a ROA to the queue to be submitted as well as signing it.
rpki_client.add_roa(roa: ROA)

# submit the ROA to ARIN
rpki_clinet.submit_roas()

```
## TODO
Break out the rpki client and the ROA object into 2 separate classes.

 ~~- ROA object will have getters and setters for the attributes with validation~~
  ~~of values.~~

- rpki client will have the connection and url's needed to submit and fetch
  information about ROAs.

- ARIN may have created certificate with the wrong public key in it that is
  used to identify the resources we have the right to manage. 

  - Certificate creation ticket ARIN-20221019-X541735
    - The public key in this ticket is the same as the stored key in pwdb
    - I have used the key pair to sign a message and verify the signature
      locally
    - The public key in the ticket does not match the public key in the
      x.509 certificate.
    - When submitting an ROA request it complains about a bad Public Key.

    ```xml
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <error xmlns="http://www.arin.net/regrws/core/v1">
            <additionalInfo/><code>E_ENTITY_VALIDATION</code>
            <components>
                <component>
                    <message>The public key you entered is invalid.</message>
                    <name>signedRoaRequest</name>
                </component>
            </components>
            <message>Payload entity failed to validate; see component messages for details.</message>
        </error>
    ```



## Resources
Manually signed ROA: Implemented in Python
[ARIN Manually signed ROA](https://www.arin.net/resources/manage/rpki/roa_request/#manually-sign)

RSA Signing with cryptography python lib
[RSA](https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#signing)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jdhall75/arinrest-client",
    "name": "arinrest-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "arinrest,setuptools",
    "author": "Jason Hall",
    "author_email": "jdhall75@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/c7/6ef9f2cbf00d4bab8b4369fd794e9f06a3b35c50f5d7c0e94030d555c772/arinrest-client-0.3.1.tar.gz",
    "platform": null,
    "description": "# ARINREST LIB\r\n\r\nThe purpose of this package is to manage and query resources hosted by ARIN.\r\nARIN has 3 different services that you can query and manage records on. \r\n\r\n- whois, only the RDAP interface is supported by this library\r\n- IRR, This still needs to be implemented \r\n- RPKI, The reason I start this library os to manage ROA objects hosted in\r\n  ARINs repository.\r\n\r\n## Usage\r\nThe entry point into this library is the `ArinRest` class. The class only takes\r\nan API Key from ARIN to instantiate.\r\n\r\n```python\r\nfrom arinrest import ArinRest\r\nfrom arinrest.rpki import ROA\r\n\r\narinclient = ArinRest('your-api-key-here')\r\n\r\n# arinclient.rdap() creates a rdap session with ARIN\r\nwhois_client = arinclient.rdap()\r\n\r\n# You can manage resources in the IRR and RPKI endpoints so currently the classes\r\n# require an API key to instantiate them.\r\n\r\n# create an rpki session with signing capabilities, private key required\r\nrpki_client = arin.rpki(\"/path/to/private/key\")\r\n\r\n# add a ROA to the queue to be submitted as well as signing it.\r\nrpki_client.add_roa(roa: ROA)\r\n\r\n# submit the ROA to ARIN\r\nrpki_clinet.submit_roas()\r\n\r\n```\r\n## TODO\r\nBreak out the rpki client and the ROA object into 2 separate classes.\r\n\r\n ~~- ROA object will have getters and setters for the attributes with validation~~\r\n  ~~of values.~~\r\n\r\n- rpki client will have the connection and url's needed to submit and fetch\r\n  information about ROAs.\r\n\r\n- ARIN may have created certificate with the wrong public key in it that is\r\n  used to identify the resources we have the right to manage. \r\n\r\n  - Certificate creation ticket ARIN-20221019-X541735\r\n    - The public key in this ticket is the same as the stored key in pwdb\r\n    - I have used the key pair to sign a message and verify the signature\r\n      locally\r\n    - The public key in the ticket does not match the public key in the\r\n      x.509 certificate.\r\n    - When submitting an ROA request it complains about a bad Public Key.\r\n\r\n    ```xml\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n        <error xmlns=\"http://www.arin.net/regrws/core/v1\">\r\n            <additionalInfo/><code>E_ENTITY_VALIDATION</code>\r\n            <components>\r\n                <component>\r\n                    <message>The public key you entered is invalid.</message>\r\n                    <name>signedRoaRequest</name>\r\n                </component>\r\n            </components>\r\n            <message>Payload entity failed to validate; see component messages for details.</message>\r\n        </error>\r\n    ```\r\n\r\n\r\n\r\n## Resources\r\nManually signed ROA: Implemented in Python\r\n[ARIN Manually signed ROA](https://www.arin.net/resources/manage/rpki/roa_request/#manually-sign)\r\n\r\nRSA Signing with cryptography python lib\r\n[RSA](https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#signing)\r\n",
    "bugtrack_url": null,
    "license": "The Unlicense (Unlicense)",
    "summary": "client to interact with the arinrest API",
    "version": "0.3.1",
    "split_keywords": [
        "arinrest",
        "setuptools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ec76ef9f2cbf00d4bab8b4369fd794e9f06a3b35c50f5d7c0e94030d555c772",
                "md5": "16ae1d4332af223ba66ecfa86ef56313",
                "sha256": "ac1e7145f7a5ed8586f872b99b0c655c5536d4e1d66504a3a229256d052e725c"
            },
            "downloads": -1,
            "filename": "arinrest-client-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "16ae1d4332af223ba66ecfa86ef56313",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12421,
            "upload_time": "2023-01-04T22:09:19",
            "upload_time_iso_8601": "2023-01-04T22:09:19.121920Z",
            "url": "https://files.pythonhosted.org/packages/6e/c7/6ef9f2cbf00d4bab8b4369fd794e9f06a3b35c50f5d7c0e94030d555c772/arinrest-client-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-04 22:09:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "jdhall75",
    "github_project": "arinrest-client",
    "lcname": "arinrest-client"
}
        
Elapsed time: 0.03231s