For interacting with the Chariot API
Project description
Praetorian CLI and SDK
:link: Chariot Platform :book: Documentation :bookmark: PyPI
Table of Contents
Description
Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
access to Chariot, our
offensive security platform.
The SDK exposes the full set of APIs that the Chariot UI uses.
The CLI is a fully-featured companion to the Chariot UI.
Getting Started
Prerequisites
- Python v3.9 or above
- pip v23.0 or above
Installation
Install the Python package using this command:
pip install praetorian-cli
Signing up and configuration
- Register for an account for Chariot using the instructions in our documentation.
- Run
praetorian configure
and follow the prompts. - It creates
~/.praetorian/keychain.ini
, which should read like this:
[United States]
name = chariot
client_id = 795dnnr45so7m17cppta0b295o
api = https://d0qcl2e18h.execute-api.us-east-2.amazonaws.com/chariot
username = lara.lynch@acme.com
password = 8epu9bQ2kqb8qwd.GR
For more advanced configuration options, as well as SSO. See the documentation on configuration.
Using the CLI
The CLI is a command and option utility for access to the full suite of Chariot API. See documentation for commands
using the help
option:
praetorian chariot --help
As an example, run the following command to retrieve the list of all assets in your account:
praetorian chariot list assets
To get detailed information about a specific asset, run:
praetorian chariot get asset <ASSET_KEY>
Using scripts
The CLI has a scripting engine for implementing more complex workflows. They add end-to-end
functions as commands grouped under script
. To see a list of them:
praetorian chariot script --help
For example the following command is used to ingest scan results from Nessus XML export files:
praetorian chariot script nessus-xml
You can find the list of scripts that comes with the CLI in this directory
Loading more extension scripts
In addition to scripts that are packaged with the CLI, you can point CLI to directories
with scripts to further extend the CLI with those scripts. Set the PRAETORIAN_SCRIPTS_PATH
environment to point to directories where you store additional extension scripts.
Developers
Both CLI and SDK is open-source in this repository. The SDK is installed along with the praetorian-cli
package. You can extend Chariot by creating scripts using the SDK.
SDK
Integrate the SDK into your own Python application with the following steps:
- Include the dependency
praetorian-cli
in your project. - Import the Chariot class
from praetorian_cli.sdk.chariot import Chariot
. - Import the Keychain class
from praetorian_cli.sdk.keychain import Keychain
. - Call any function of the Chariot class, which expose the full backend API. See example below:
from praetorian_cli.sdk.chariot import Chariot
from praetorian_cli.sdk.keychain import Keychain
chariot = Chariot(Keychain())
chariot.add('asset', dict(name='example.com', dns='example.com'))
The best place to explore the SDK is the code of the CLI, especially the handlers of the CLI
You can inspect the handler code to see how each CLI command is implemented with the SDK.
Developing scripts
If you want to take advantage of the scaffolding of the CLI, you can write fully fledged functions using the scripting engine. For developing scripts, you can refer to this readme file.
Contributing
We welcome contributions from the community, from scripts, to the core CLI and SDK. To contribute, fork this repository and following the GitHub instructions to create pull requests.
By contributing, you agree to our Code of Conduct.
Support
If you have any questions or need support, please open an issue here or reach out via support@praetorian.com.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file praetorian_cli-1.5.4.tar.gz
.
File metadata
- Download URL: praetorian_cli-1.5.4.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceee08d634bde9ccfa8b05046f527eb0d5fe71434022beefdd423a591e5dfc2e |
|
MD5 | 1a13be61e9be3d6dd83d6200c7250649 |
|
BLAKE2b-256 | 1589d97681442d95817c9886854de415131ad876e92f168cdf64e4976b2d2209 |
File details
Details for the file praetorian_cli-1.5.4-py3-none-any.whl
.
File metadata
- Download URL: praetorian_cli-1.5.4-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69416911fac2b37c877d51fcd275824adb0c0d6f41a6838b99cf0bd0584813e2 |
|
MD5 | 5fe6ef27b48cea3e02db328618743f1b |
|
BLAKE2b-256 | 722492941f3f74e1a14a11f8e49922f561526795384a564b3c98eea7584d6a48 |