praetorian-cli 2.2.17__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {praetorian_cli-2.2.17/praetorian_cli.egg-info → praetorian_cli-2.3.0}/PKG-INFO +57 -20
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/README.md +56 -19
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/add.py +9 -9
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/agent.py +4 -4
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/chariot.py +1 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/delete.py +2 -2
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/get.py +5 -3
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/imports.py +1 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/list.py +2 -2
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/search.py +1 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/update.py +1 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/main.py +23 -0
- praetorian_cli-2.3.0/praetorian_cli/sdk/guard.py +7 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_z_cli.py +7 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0/praetorian_cli.egg-info}/PKG-INFO +57 -20
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli.egg-info/SOURCES.txt +1 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli.egg-info/entry_points.txt +1 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/setup.cfg +2 -1
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/LICENSE +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/MANIFEST.in +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/aegis.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/cli_decorators.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/configure.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/enrich.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/link.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/script.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/ssh_utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/test.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/unlink.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/handlers/utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/scripts/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/scripts/commands/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/scripts/commands/nmap-example.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/scripts/utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/chariot.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/accounts.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/aegis.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/agents.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/assets.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/attributes.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/capabilities.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/configurations.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/credentials.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/definitions.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/files.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/integrations.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/jobs.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/keys.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/preseeds.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/risks.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/scanners.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/schema.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/search.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/seeds.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/settings.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/statistics.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/webhook.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/webpage.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/keychain.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/mcp_server.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/model/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/model/aegis.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/model/globals.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/model/query.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/model/utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/pytest.ini +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_account.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_agent.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_asset.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_attribute.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_capabilities.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_configuration.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_conversation.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_definition.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_extend.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_file.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_job.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_key.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_mcp.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_preseed.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_risk.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_search.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_seed.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_setting.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_webhook.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_webpage.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/ui_mocks.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/help.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/info.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/job.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/list.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/set.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/commands/ssh.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/constants.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/menu.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/aegis/utils.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/conversation/__init__.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/conversation/textual_chat.py +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli.egg-info/dependency_links.txt +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli.egg-info/requires.txt +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli.egg-info/top_level.txt +0 -0
- {praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: praetorian-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: For interacting with the Chariot API
|
|
5
5
|
Home-page: https://github.com/praetorian-inc/praetorian-cli
|
|
6
6
|
Author: Praetorian
|
|
@@ -31,7 +31,7 @@ Dynamic: license-file
|
|
|
31
31
|
[](https://opensource.org/)
|
|
32
32
|
[](https://github.com/praetorian-inc/chariot-ui/issues)
|
|
33
33
|
|
|
34
|
-
:link: [
|
|
34
|
+
:link: [Guard Platform](https://guard.praetorian.com)
|
|
35
35
|
:book: [Documentation](https://docs.praetorian.com)
|
|
36
36
|
:bookmark: [PyPI](https://pypi.org/project/praetorian-cli/)
|
|
37
37
|
|
|
@@ -48,14 +48,15 @@ Dynamic: license-file
|
|
|
48
48
|
- [Contributing](#contributing)
|
|
49
49
|
- [Support](#support)
|
|
50
50
|
- [License](#license)
|
|
51
|
+
- [Backwards Compatibility](#backwards-compatibility)
|
|
51
52
|
|
|
52
53
|
# Description
|
|
53
54
|
|
|
54
55
|
Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
|
|
55
|
-
access to [
|
|
56
|
+
access to [Guard](https://www.praetorian.com/proactive-cybersecurity-technology/), our
|
|
56
57
|
offensive security platform.
|
|
57
|
-
<br> The SDK exposes the full set of APIs that the
|
|
58
|
-
<br> The CLI is a fully-featured companion to the
|
|
58
|
+
<br> The SDK exposes the full set of APIs that the Guard UI uses.
|
|
59
|
+
<br> The CLI is a fully-featured companion to the Guard UI.
|
|
59
60
|
|
|
60
61
|
# Getting Started
|
|
61
62
|
|
|
@@ -74,14 +75,14 @@ pip install praetorian-cli
|
|
|
74
75
|
|
|
75
76
|
## Signing up
|
|
76
77
|
|
|
77
|
-
Register for an account for [
|
|
78
|
+
Register for an account for [Guard](http://guard.praetorian.com) using the instructions
|
|
78
79
|
in [our documentation](https://docs.praetorian.com/hc/en-us/articles/38048335323547-Account-Creation-and-Attack-Surface-Setup).
|
|
79
80
|
|
|
80
81
|
## Authentication
|
|
81
82
|
|
|
82
|
-
Once you can properly access
|
|
83
|
+
Once you can properly access Guard through the UI. You can obtain API credentials through the UI under
|
|
83
84
|
Settings -> User Settings -> API Keys. Be sure to careful copy the API credentials you created as
|
|
84
|
-
you will need to provide them to the CLI for interacting with
|
|
85
|
+
you will need to provide them to the CLI for interacting with Guard.
|
|
85
86
|
|
|
86
87
|
**Note**: SSO Organizations should provision access through API Keys as well.
|
|
87
88
|
|
|
@@ -123,49 +124,49 @@ For more advanced configuration options or managing access in SSO organizations
|
|
|
123
124
|
|
|
124
125
|
# Using the CLI
|
|
125
126
|
|
|
126
|
-
The CLI is a command and option utility for accessing the full suite of
|
|
127
|
+
The CLI is a command and option utility for accessing the full suite of Guard's API. You can see the documentation for commands
|
|
127
128
|
using the `help` option:
|
|
128
129
|
|
|
129
130
|
```zsh
|
|
130
|
-
|
|
131
|
+
guard --help
|
|
131
132
|
```
|
|
132
133
|
|
|
133
134
|
As an example, run the following command to retrieve the list of all assets in your account:
|
|
134
135
|
|
|
135
136
|
```zsh
|
|
136
|
-
|
|
137
|
+
guard --account guard+example@praetorian.com list assets
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
You can obtain the `account` argument by viewing the email of the first user on the Users page in your
|
|
140
|
+
You can obtain the `account` argument by viewing the email of the first user on the Users page in your Guard account, as shown below:
|
|
140
141
|
|
|
141
142
|
<img width="482" alt="image" src="https://github.com/user-attachments/assets/7c1024c9-7b74-46b1-87c5-af44671b1ec8" />
|
|
142
143
|
|
|
143
144
|
To get detailed information about a specific asset, run:
|
|
144
145
|
|
|
145
146
|
```zsh
|
|
146
|
-
|
|
147
|
+
guard --account guard+example@praetorian.com get asset <ASSET_KEY>
|
|
147
148
|
```
|
|
148
149
|
|
|
149
150
|
# Developers
|
|
150
151
|
|
|
151
152
|
Both CLI and SDK is open-source in this repository. The SDK is installed along with the `praetorian-cli`
|
|
152
|
-
package. You can extend
|
|
153
|
+
package. You can extend Guard by creating scripts using the SDK.
|
|
153
154
|
|
|
154
155
|
## SDK
|
|
155
156
|
|
|
156
157
|
Integrate the SDK into your own Python application with the following steps:
|
|
157
158
|
|
|
158
159
|
1. Include the dependency ``praetorian-cli`` in your project.
|
|
159
|
-
2. Import the
|
|
160
|
+
2. Import the Guard class ``from praetorian_cli.sdk.guard import Guard``.
|
|
160
161
|
3. Import the Keychain class ``from praetorian_cli.sdk.keychain import Keychain``.
|
|
161
|
-
4. Call any function of the
|
|
162
|
+
4. Call any function of the Guard class, which expose the full backend API. See example below:
|
|
162
163
|
|
|
163
164
|
```python
|
|
164
|
-
from praetorian_cli.sdk.
|
|
165
|
+
from praetorian_cli.sdk.guard import Guard
|
|
165
166
|
from praetorian_cli.sdk.keychain import Keychain
|
|
166
167
|
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
guard = Guard(Keychain(account='guard+example@praetorian.com'))
|
|
169
|
+
guard.add('asset', dict(name='example.com', dns='example.com'))
|
|
169
170
|
```
|
|
170
171
|
|
|
171
172
|
The best place to explore the SDK is the code of the CLI, especially
|
|
@@ -184,7 +185,7 @@ environment to point to directories where you store additional extension scripts
|
|
|
184
185
|
Those external scripts are available under the `script` commands. To see a list of them:
|
|
185
186
|
|
|
186
187
|
```zsh
|
|
187
|
-
|
|
188
|
+
guard --account guard+example@praetorian.com script --help
|
|
188
189
|
```
|
|
189
190
|
|
|
190
191
|
For developing scripts, you can refer to
|
|
@@ -209,3 +210,39 @@ If you have any questions or need support, please open an issue
|
|
|
209
210
|
## License
|
|
210
211
|
|
|
211
212
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
# Backwards Compatibility
|
|
217
|
+
|
|
218
|
+
**Guard** is a rebrand of **Chariot**.
|
|
219
|
+
|
|
220
|
+
### CLI
|
|
221
|
+
The `guard` command is the new primary CLI entry point. The legacy `praetorian chariot` command continues to work:
|
|
222
|
+
|
|
223
|
+
```zsh
|
|
224
|
+
# New (preferred):
|
|
225
|
+
guard list assets
|
|
226
|
+
guard --account example@praetorian.com list assets
|
|
227
|
+
guard configure
|
|
228
|
+
|
|
229
|
+
# Legacy (still supported):
|
|
230
|
+
praetorian chariot list assets
|
|
231
|
+
praetorian configure
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### SDK
|
|
235
|
+
Both `Guard` and `Chariot` classes are available and interchangeable:
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
# New (preferred):
|
|
239
|
+
from praetorian_cli.sdk.guard import Guard
|
|
240
|
+
guard = Guard(Keychain())
|
|
241
|
+
|
|
242
|
+
# Legacy (still supported):
|
|
243
|
+
from praetorian_cli.sdk.chariot import Chariot
|
|
244
|
+
chariot = Chariot(Keychain())
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Configuration
|
|
248
|
+
The keychain file and environment variables remain unchanged. Existing configurations will continue to work without modification.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://opensource.org/)
|
|
8
8
|
[](https://github.com/praetorian-inc/chariot-ui/issues)
|
|
9
9
|
|
|
10
|
-
:link: [
|
|
10
|
+
:link: [Guard Platform](https://guard.praetorian.com)
|
|
11
11
|
:book: [Documentation](https://docs.praetorian.com)
|
|
12
12
|
:bookmark: [PyPI](https://pypi.org/project/praetorian-cli/)
|
|
13
13
|
|
|
@@ -24,14 +24,15 @@
|
|
|
24
24
|
- [Contributing](#contributing)
|
|
25
25
|
- [Support](#support)
|
|
26
26
|
- [License](#license)
|
|
27
|
+
- [Backwards Compatibility](#backwards-compatibility)
|
|
27
28
|
|
|
28
29
|
# Description
|
|
29
30
|
|
|
30
31
|
Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
|
|
31
|
-
access to [
|
|
32
|
+
access to [Guard](https://www.praetorian.com/proactive-cybersecurity-technology/), our
|
|
32
33
|
offensive security platform.
|
|
33
|
-
<br> The SDK exposes the full set of APIs that the
|
|
34
|
-
<br> The CLI is a fully-featured companion to the
|
|
34
|
+
<br> The SDK exposes the full set of APIs that the Guard UI uses.
|
|
35
|
+
<br> The CLI is a fully-featured companion to the Guard UI.
|
|
35
36
|
|
|
36
37
|
# Getting Started
|
|
37
38
|
|
|
@@ -50,14 +51,14 @@ pip install praetorian-cli
|
|
|
50
51
|
|
|
51
52
|
## Signing up
|
|
52
53
|
|
|
53
|
-
Register for an account for [
|
|
54
|
+
Register for an account for [Guard](http://guard.praetorian.com) using the instructions
|
|
54
55
|
in [our documentation](https://docs.praetorian.com/hc/en-us/articles/38048335323547-Account-Creation-and-Attack-Surface-Setup).
|
|
55
56
|
|
|
56
57
|
## Authentication
|
|
57
58
|
|
|
58
|
-
Once you can properly access
|
|
59
|
+
Once you can properly access Guard through the UI. You can obtain API credentials through the UI under
|
|
59
60
|
Settings -> User Settings -> API Keys. Be sure to careful copy the API credentials you created as
|
|
60
|
-
you will need to provide them to the CLI for interacting with
|
|
61
|
+
you will need to provide them to the CLI for interacting with Guard.
|
|
61
62
|
|
|
62
63
|
**Note**: SSO Organizations should provision access through API Keys as well.
|
|
63
64
|
|
|
@@ -99,49 +100,49 @@ For more advanced configuration options or managing access in SSO organizations
|
|
|
99
100
|
|
|
100
101
|
# Using the CLI
|
|
101
102
|
|
|
102
|
-
The CLI is a command and option utility for accessing the full suite of
|
|
103
|
+
The CLI is a command and option utility for accessing the full suite of Guard's API. You can see the documentation for commands
|
|
103
104
|
using the `help` option:
|
|
104
105
|
|
|
105
106
|
```zsh
|
|
106
|
-
|
|
107
|
+
guard --help
|
|
107
108
|
```
|
|
108
109
|
|
|
109
110
|
As an example, run the following command to retrieve the list of all assets in your account:
|
|
110
111
|
|
|
111
112
|
```zsh
|
|
112
|
-
|
|
113
|
+
guard --account guard+example@praetorian.com list assets
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
You can obtain the `account` argument by viewing the email of the first user on the Users page in your
|
|
116
|
+
You can obtain the `account` argument by viewing the email of the first user on the Users page in your Guard account, as shown below:
|
|
116
117
|
|
|
117
118
|
<img width="482" alt="image" src="https://github.com/user-attachments/assets/7c1024c9-7b74-46b1-87c5-af44671b1ec8" />
|
|
118
119
|
|
|
119
120
|
To get detailed information about a specific asset, run:
|
|
120
121
|
|
|
121
122
|
```zsh
|
|
122
|
-
|
|
123
|
+
guard --account guard+example@praetorian.com get asset <ASSET_KEY>
|
|
123
124
|
```
|
|
124
125
|
|
|
125
126
|
# Developers
|
|
126
127
|
|
|
127
128
|
Both CLI and SDK is open-source in this repository. The SDK is installed along with the `praetorian-cli`
|
|
128
|
-
package. You can extend
|
|
129
|
+
package. You can extend Guard by creating scripts using the SDK.
|
|
129
130
|
|
|
130
131
|
## SDK
|
|
131
132
|
|
|
132
133
|
Integrate the SDK into your own Python application with the following steps:
|
|
133
134
|
|
|
134
135
|
1. Include the dependency ``praetorian-cli`` in your project.
|
|
135
|
-
2. Import the
|
|
136
|
+
2. Import the Guard class ``from praetorian_cli.sdk.guard import Guard``.
|
|
136
137
|
3. Import the Keychain class ``from praetorian_cli.sdk.keychain import Keychain``.
|
|
137
|
-
4. Call any function of the
|
|
138
|
+
4. Call any function of the Guard class, which expose the full backend API. See example below:
|
|
138
139
|
|
|
139
140
|
```python
|
|
140
|
-
from praetorian_cli.sdk.
|
|
141
|
+
from praetorian_cli.sdk.guard import Guard
|
|
141
142
|
from praetorian_cli.sdk.keychain import Keychain
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
guard = Guard(Keychain(account='guard+example@praetorian.com'))
|
|
145
|
+
guard.add('asset', dict(name='example.com', dns='example.com'))
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
The best place to explore the SDK is the code of the CLI, especially
|
|
@@ -160,7 +161,7 @@ environment to point to directories where you store additional extension scripts
|
|
|
160
161
|
Those external scripts are available under the `script` commands. To see a list of them:
|
|
161
162
|
|
|
162
163
|
```zsh
|
|
163
|
-
|
|
164
|
+
guard --account guard+example@praetorian.com script --help
|
|
164
165
|
```
|
|
165
166
|
|
|
166
167
|
For developing scripts, you can refer to
|
|
@@ -185,3 +186,39 @@ If you have any questions or need support, please open an issue
|
|
|
185
186
|
## License
|
|
186
187
|
|
|
187
188
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
# Backwards Compatibility
|
|
193
|
+
|
|
194
|
+
**Guard** is a rebrand of **Chariot**.
|
|
195
|
+
|
|
196
|
+
### CLI
|
|
197
|
+
The `guard` command is the new primary CLI entry point. The legacy `praetorian chariot` command continues to work:
|
|
198
|
+
|
|
199
|
+
```zsh
|
|
200
|
+
# New (preferred):
|
|
201
|
+
guard list assets
|
|
202
|
+
guard --account example@praetorian.com list assets
|
|
203
|
+
guard configure
|
|
204
|
+
|
|
205
|
+
# Legacy (still supported):
|
|
206
|
+
praetorian chariot list assets
|
|
207
|
+
praetorian configure
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### SDK
|
|
211
|
+
Both `Guard` and `Chariot` classes are available and interchangeable:
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
# New (preferred):
|
|
215
|
+
from praetorian_cli.sdk.guard import Guard
|
|
216
|
+
guard = Guard(Keychain())
|
|
217
|
+
|
|
218
|
+
# Legacy (still supported):
|
|
219
|
+
from praetorian_cli.sdk.chariot import Chariot
|
|
220
|
+
chariot = Chariot(Keychain())
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Configuration
|
|
224
|
+
The keychain file and environment variables remain unchanged. Existing configurations will continue to work without modification.
|
|
@@ -12,7 +12,7 @@ from praetorian_cli.sdk.model.globals import AddRisk, Asset, Seed, Kind
|
|
|
12
12
|
|
|
13
13
|
@chariot.group()
|
|
14
14
|
def add():
|
|
15
|
-
""" Add an entity to
|
|
15
|
+
""" Add an entity to Guard """
|
|
16
16
|
pass
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ def add():
|
|
|
27
27
|
def asset(sdk, name, dns, asset_type, status, surface):
|
|
28
28
|
""" Add an asset
|
|
29
29
|
|
|
30
|
-
Add an asset to the
|
|
30
|
+
Add an asset to the Guard database. This command requires a DNS name for the asset.
|
|
31
31
|
Optionally, a name can be provided to give the asset more specific information,
|
|
32
32
|
such as IP address. If no name is provided, the DNS name will be used as the name.
|
|
33
33
|
The DNS is the group and the name is the specific identifier. This is for legacy reasons.
|
|
@@ -55,12 +55,12 @@ def asset(sdk, name, dns, asset_type, status, surface):
|
|
|
55
55
|
@add.command()
|
|
56
56
|
@cli_handler
|
|
57
57
|
@click.argument('path')
|
|
58
|
-
@click.option('-n', '--name', help='The file name in
|
|
58
|
+
@click.option('-n', '--name', help='The file name in Guard. Default: the full path of the uploaded file')
|
|
59
59
|
def file(sdk, path, name):
|
|
60
60
|
""" Upload a file
|
|
61
61
|
|
|
62
62
|
This commands takes the path to a local file and uploads it to the
|
|
63
|
-
|
|
63
|
+
Guard file system. The Guard file system is where the platform
|
|
64
64
|
stores proofs of exploit, risk definitions, and other supporting data.
|
|
65
65
|
|
|
66
66
|
User files reside in the "home/" folder. Those files appear in the app
|
|
@@ -89,7 +89,7 @@ def definition(sdk, path, name):
|
|
|
89
89
|
""" Upload a risk definition
|
|
90
90
|
|
|
91
91
|
This commands takes the path to the local file and uploads it to the
|
|
92
|
-
|
|
92
|
+
Guard file system as risk definitions. Risk definitions reside
|
|
93
93
|
in the "definitions/" folder in the file system.
|
|
94
94
|
|
|
95
95
|
Risk definitions need to be in the Markdown format.
|
|
@@ -141,7 +141,7 @@ def webhook(sdk):
|
|
|
141
141
|
def risk(sdk, name, asset, status, comment, capability):
|
|
142
142
|
""" Add a risk
|
|
143
143
|
|
|
144
|
-
This command adds a risk to
|
|
144
|
+
This command adds a risk to Guard. A risk must have an associated asset.
|
|
145
145
|
The asset is specified by its key, which can be retrieved by listing and
|
|
146
146
|
searching the assets.
|
|
147
147
|
|
|
@@ -211,7 +211,7 @@ def attribute(sdk, key, name, value):
|
|
|
211
211
|
def seed(sdk, seed_type, status, field_list):
|
|
212
212
|
""" Add a seed
|
|
213
213
|
|
|
214
|
-
Add a seed to the
|
|
214
|
+
Add a seed to the Guard database. Seeds are now assets with special labeling.
|
|
215
215
|
You can specify the asset type and provide dynamic fields using --fields.
|
|
216
216
|
|
|
217
217
|
\b
|
|
@@ -247,7 +247,7 @@ def seed(sdk, seed_type, status, field_list):
|
|
|
247
247
|
def preseed(sdk, type, title, value, status):
|
|
248
248
|
""" Add a preseed
|
|
249
249
|
|
|
250
|
-
This command adds a preseed to the
|
|
250
|
+
This command adds a preseed to the Guard database.
|
|
251
251
|
Preseeds default to ACTIVE and cannot be added as PENDING.
|
|
252
252
|
|
|
253
253
|
\b
|
|
@@ -337,7 +337,7 @@ def key(sdk, name, expires):
|
|
|
337
337
|
def webpage(sdk, url, parent):
|
|
338
338
|
""" Add a Webpage
|
|
339
339
|
|
|
340
|
-
Add a web page to the
|
|
340
|
+
Add a web page to the Guard database. Webpages can optionally be associated
|
|
341
341
|
with a parent WebApplication or exist independently.
|
|
342
342
|
|
|
343
343
|
\b
|
|
@@ -29,14 +29,14 @@ def affiliation(sdk, key):
|
|
|
29
29
|
|
|
30
30
|
@agent.group()
|
|
31
31
|
def mcp():
|
|
32
|
-
"""
|
|
32
|
+
""" Guard's MCP server """
|
|
33
33
|
pass
|
|
34
34
|
|
|
35
35
|
@mcp.command()
|
|
36
36
|
@cli_handler
|
|
37
37
|
@click.option('--allowed', '-a', type=str, multiple=True, default=['search_by_query', '*_list', '*_get'])
|
|
38
38
|
def start(sdk, allowed):
|
|
39
|
-
""" Starts the
|
|
39
|
+
""" Starts the Guard MCP server
|
|
40
40
|
|
|
41
41
|
\b
|
|
42
42
|
Example usages:
|
|
@@ -73,9 +73,9 @@ def tools(sdk, allowed):
|
|
|
73
73
|
@agent.command()
|
|
74
74
|
@cli_handler
|
|
75
75
|
def conversation(sdk):
|
|
76
|
-
""" Interactive conversation with
|
|
76
|
+
""" Interactive conversation with Guard AI assistant
|
|
77
77
|
|
|
78
|
-
Start an interactive chat session with the
|
|
78
|
+
Start an interactive chat session with the Guard AI assistant.
|
|
79
79
|
The AI can help you query security data, understand findings,
|
|
80
80
|
and provide insights about your attack surface.
|
|
81
81
|
|
|
@@ -7,7 +7,7 @@ def chariot(click_context):
|
|
|
7
7
|
# import done here to avoid circular import errors in praetorian_cli/handlers/cli_decorators.py
|
|
8
8
|
from praetorian_cli.sdk.chariot import Chariot
|
|
9
9
|
|
|
10
|
-
""" Command group for interacting with the
|
|
10
|
+
""" Command group for interacting with the Guard product """
|
|
11
11
|
# Replace the click context (previously a Keychain instance) with a Chariot
|
|
12
12
|
# instance, after creating it using the Keychain instance.
|
|
13
13
|
keychain = click_context.obj['keychain']
|
|
@@ -7,7 +7,7 @@ from praetorian_cli.sdk.model.globals import Risk
|
|
|
7
7
|
|
|
8
8
|
@chariot.group()
|
|
9
9
|
def delete():
|
|
10
|
-
""" Delete an entity from
|
|
10
|
+
""" Delete an entity from Guard """
|
|
11
11
|
pass
|
|
12
12
|
|
|
13
13
|
|
|
@@ -106,7 +106,7 @@ def file(chariot, filepath):
|
|
|
106
106
|
|
|
107
107
|
\b
|
|
108
108
|
Arguments:
|
|
109
|
-
- FILEPATH: The
|
|
109
|
+
- FILEPATH: The Guard file path
|
|
110
110
|
|
|
111
111
|
\b
|
|
112
112
|
Example usage:
|
|
@@ -9,7 +9,7 @@ from praetorian_cli.handlers.utils import print_json
|
|
|
9
9
|
|
|
10
10
|
@chariot.group()
|
|
11
11
|
def get():
|
|
12
|
-
""" Get entity details from
|
|
12
|
+
""" Get entity details from Guard """
|
|
13
13
|
pass
|
|
14
14
|
|
|
15
15
|
|
|
@@ -319,13 +319,15 @@ def webpage(chariot, key):
|
|
|
319
319
|
"""
|
|
320
320
|
print_json(chariot.webpage.get(key))
|
|
321
321
|
|
|
322
|
+
@get.command()
|
|
323
|
+
@cli_handler
|
|
322
324
|
@click.option('-t', '--type', help='Optional specific entity type (e.g., asset, risk, attribute)')
|
|
323
325
|
@click.option('-d', '--details', is_flag=True, help='Further retrieve the details of the schema')
|
|
324
326
|
def schema(chariot, type, details):
|
|
325
|
-
""" Get
|
|
327
|
+
""" Get Guard entity schema
|
|
326
328
|
|
|
327
329
|
\b
|
|
328
|
-
Returns the JSON schema for
|
|
330
|
+
Returns the JSON schema for Guard entities. Optionally filter for a
|
|
329
331
|
specific entity type.
|
|
330
332
|
|
|
331
333
|
\b
|
|
@@ -7,7 +7,7 @@ from praetorian_cli.handlers.utils import render_offset, render_list_results, pa
|
|
|
7
7
|
|
|
8
8
|
@chariot.group()
|
|
9
9
|
def list():
|
|
10
|
-
""" Get a list of entities from
|
|
10
|
+
""" Get a list of entities from Guard """
|
|
11
11
|
pass
|
|
12
12
|
|
|
13
13
|
|
|
@@ -121,7 +121,7 @@ def jobs(chariot, filter, details, offset, page):
|
|
|
121
121
|
def files(chariot, filter, details, offset, page):
|
|
122
122
|
""" List files
|
|
123
123
|
|
|
124
|
-
Retrieve and display a list of files in the
|
|
124
|
+
Retrieve and display a list of files in the Guard file system.
|
|
125
125
|
|
|
126
126
|
\b
|
|
127
127
|
Example usages:
|
|
@@ -16,7 +16,7 @@ from praetorian_cli.sdk.model.globals import Kind
|
|
|
16
16
|
@click.option('-desc', '--desc', is_flag=True, default=False, help='Return data in descending order')
|
|
17
17
|
@click.option('-g', '--global', 'global_', is_flag=True, default=False, help='Use the global data set')
|
|
18
18
|
def search(chariot, term, count, kind, details, offset, page, desc, global_):
|
|
19
|
-
""" Query
|
|
19
|
+
""" Query Guard for matches or counts using the search syntax
|
|
20
20
|
|
|
21
21
|
\b
|
|
22
22
|
Search syntax:
|
|
@@ -36,3 +36,26 @@ def main(click_context, profile, account, debug, proxy):
|
|
|
36
36
|
|
|
37
37
|
main.add_command(chariot)
|
|
38
38
|
main.add_command(configure)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@click.group()
|
|
42
|
+
@click.option('--profile', default='United States', help='The profile to use in the keychain file', show_default=True)
|
|
43
|
+
@click.option('--account', default=None, help='Assume role into this account')
|
|
44
|
+
@click.option('--debug', is_flag=True, default=False, help='Run the CLI in debug mode')
|
|
45
|
+
@click.option('--proxy', default='', help='The proxy to use in the CLI')
|
|
46
|
+
@click.pass_context
|
|
47
|
+
@click.version_option()
|
|
48
|
+
def guard_main(click_context, profile, account, debug, proxy):
|
|
49
|
+
"""Guard CLI - Praetorian's offensive security platform."""
|
|
50
|
+
from praetorian_cli.sdk.chariot import Chariot
|
|
51
|
+
if debug:
|
|
52
|
+
click.echo('Running in debug mode.')
|
|
53
|
+
chariot.is_debug = debug
|
|
54
|
+
click_context.obj = Chariot(Keychain(profile, account), proxy=proxy)
|
|
55
|
+
praetorian_cli.handlers.script.load_dynamic_commands()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Add all chariot commands to guard_main
|
|
59
|
+
for cmd_name, cmd in chariot.commands.items():
|
|
60
|
+
guard_main.add_command(cmd, cmd_name)
|
|
61
|
+
guard_main.add_command(configure)
|
|
@@ -390,8 +390,14 @@ class TestZCli:
|
|
|
390
390
|
self.verify('agent --help', ignore_stdout=True)
|
|
391
391
|
self.verify('agent affiliation --help', ignore_stdout=True)
|
|
392
392
|
|
|
393
|
+
def test_guard_cli(self):
|
|
394
|
+
"""Test the 'guard' entry point works correctly."""
|
|
395
|
+
self.verify('configure --help', expected_stdout=['Configure the CLI'])
|
|
396
|
+
self.verify('--help', expected_stdout=['configure', 'list', 'add', 'delete', 'update'])
|
|
397
|
+
self.verify('list --help', expected_stdout=['assets', 'risks', 'accounts'])
|
|
398
|
+
|
|
393
399
|
def verify(self, command, expected_stdout=[], expected_stderr=[], ignore_stdout=False):
|
|
394
|
-
result = run(f'
|
|
400
|
+
result = run(f'guard --profile "{self.sdk.keychain.profile}" {command}', capture_output=True,
|
|
395
401
|
text=True, shell=True)
|
|
396
402
|
if expected_stdout:
|
|
397
403
|
for out in expected_stdout:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: praetorian-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: For interacting with the Chariot API
|
|
5
5
|
Home-page: https://github.com/praetorian-inc/praetorian-cli
|
|
6
6
|
Author: Praetorian
|
|
@@ -31,7 +31,7 @@ Dynamic: license-file
|
|
|
31
31
|
[](https://opensource.org/)
|
|
32
32
|
[](https://github.com/praetorian-inc/chariot-ui/issues)
|
|
33
33
|
|
|
34
|
-
:link: [
|
|
34
|
+
:link: [Guard Platform](https://guard.praetorian.com)
|
|
35
35
|
:book: [Documentation](https://docs.praetorian.com)
|
|
36
36
|
:bookmark: [PyPI](https://pypi.org/project/praetorian-cli/)
|
|
37
37
|
|
|
@@ -48,14 +48,15 @@ Dynamic: license-file
|
|
|
48
48
|
- [Contributing](#contributing)
|
|
49
49
|
- [Support](#support)
|
|
50
50
|
- [License](#license)
|
|
51
|
+
- [Backwards Compatibility](#backwards-compatibility)
|
|
51
52
|
|
|
52
53
|
# Description
|
|
53
54
|
|
|
54
55
|
Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
|
|
55
|
-
access to [
|
|
56
|
+
access to [Guard](https://www.praetorian.com/proactive-cybersecurity-technology/), our
|
|
56
57
|
offensive security platform.
|
|
57
|
-
<br> The SDK exposes the full set of APIs that the
|
|
58
|
-
<br> The CLI is a fully-featured companion to the
|
|
58
|
+
<br> The SDK exposes the full set of APIs that the Guard UI uses.
|
|
59
|
+
<br> The CLI is a fully-featured companion to the Guard UI.
|
|
59
60
|
|
|
60
61
|
# Getting Started
|
|
61
62
|
|
|
@@ -74,14 +75,14 @@ pip install praetorian-cli
|
|
|
74
75
|
|
|
75
76
|
## Signing up
|
|
76
77
|
|
|
77
|
-
Register for an account for [
|
|
78
|
+
Register for an account for [Guard](http://guard.praetorian.com) using the instructions
|
|
78
79
|
in [our documentation](https://docs.praetorian.com/hc/en-us/articles/38048335323547-Account-Creation-and-Attack-Surface-Setup).
|
|
79
80
|
|
|
80
81
|
## Authentication
|
|
81
82
|
|
|
82
|
-
Once you can properly access
|
|
83
|
+
Once you can properly access Guard through the UI. You can obtain API credentials through the UI under
|
|
83
84
|
Settings -> User Settings -> API Keys. Be sure to careful copy the API credentials you created as
|
|
84
|
-
you will need to provide them to the CLI for interacting with
|
|
85
|
+
you will need to provide them to the CLI for interacting with Guard.
|
|
85
86
|
|
|
86
87
|
**Note**: SSO Organizations should provision access through API Keys as well.
|
|
87
88
|
|
|
@@ -123,49 +124,49 @@ For more advanced configuration options or managing access in SSO organizations
|
|
|
123
124
|
|
|
124
125
|
# Using the CLI
|
|
125
126
|
|
|
126
|
-
The CLI is a command and option utility for accessing the full suite of
|
|
127
|
+
The CLI is a command and option utility for accessing the full suite of Guard's API. You can see the documentation for commands
|
|
127
128
|
using the `help` option:
|
|
128
129
|
|
|
129
130
|
```zsh
|
|
130
|
-
|
|
131
|
+
guard --help
|
|
131
132
|
```
|
|
132
133
|
|
|
133
134
|
As an example, run the following command to retrieve the list of all assets in your account:
|
|
134
135
|
|
|
135
136
|
```zsh
|
|
136
|
-
|
|
137
|
+
guard --account guard+example@praetorian.com list assets
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
You can obtain the `account` argument by viewing the email of the first user on the Users page in your
|
|
140
|
+
You can obtain the `account` argument by viewing the email of the first user on the Users page in your Guard account, as shown below:
|
|
140
141
|
|
|
141
142
|
<img width="482" alt="image" src="https://github.com/user-attachments/assets/7c1024c9-7b74-46b1-87c5-af44671b1ec8" />
|
|
142
143
|
|
|
143
144
|
To get detailed information about a specific asset, run:
|
|
144
145
|
|
|
145
146
|
```zsh
|
|
146
|
-
|
|
147
|
+
guard --account guard+example@praetorian.com get asset <ASSET_KEY>
|
|
147
148
|
```
|
|
148
149
|
|
|
149
150
|
# Developers
|
|
150
151
|
|
|
151
152
|
Both CLI and SDK is open-source in this repository. The SDK is installed along with the `praetorian-cli`
|
|
152
|
-
package. You can extend
|
|
153
|
+
package. You can extend Guard by creating scripts using the SDK.
|
|
153
154
|
|
|
154
155
|
## SDK
|
|
155
156
|
|
|
156
157
|
Integrate the SDK into your own Python application with the following steps:
|
|
157
158
|
|
|
158
159
|
1. Include the dependency ``praetorian-cli`` in your project.
|
|
159
|
-
2. Import the
|
|
160
|
+
2. Import the Guard class ``from praetorian_cli.sdk.guard import Guard``.
|
|
160
161
|
3. Import the Keychain class ``from praetorian_cli.sdk.keychain import Keychain``.
|
|
161
|
-
4. Call any function of the
|
|
162
|
+
4. Call any function of the Guard class, which expose the full backend API. See example below:
|
|
162
163
|
|
|
163
164
|
```python
|
|
164
|
-
from praetorian_cli.sdk.
|
|
165
|
+
from praetorian_cli.sdk.guard import Guard
|
|
165
166
|
from praetorian_cli.sdk.keychain import Keychain
|
|
166
167
|
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
guard = Guard(Keychain(account='guard+example@praetorian.com'))
|
|
169
|
+
guard.add('asset', dict(name='example.com', dns='example.com'))
|
|
169
170
|
```
|
|
170
171
|
|
|
171
172
|
The best place to explore the SDK is the code of the CLI, especially
|
|
@@ -184,7 +185,7 @@ environment to point to directories where you store additional extension scripts
|
|
|
184
185
|
Those external scripts are available under the `script` commands. To see a list of them:
|
|
185
186
|
|
|
186
187
|
```zsh
|
|
187
|
-
|
|
188
|
+
guard --account guard+example@praetorian.com script --help
|
|
188
189
|
```
|
|
189
190
|
|
|
190
191
|
For developing scripts, you can refer to
|
|
@@ -209,3 +210,39 @@ If you have any questions or need support, please open an issue
|
|
|
209
210
|
## License
|
|
210
211
|
|
|
211
212
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
# Backwards Compatibility
|
|
217
|
+
|
|
218
|
+
**Guard** is a rebrand of **Chariot**.
|
|
219
|
+
|
|
220
|
+
### CLI
|
|
221
|
+
The `guard` command is the new primary CLI entry point. The legacy `praetorian chariot` command continues to work:
|
|
222
|
+
|
|
223
|
+
```zsh
|
|
224
|
+
# New (preferred):
|
|
225
|
+
guard list assets
|
|
226
|
+
guard --account example@praetorian.com list assets
|
|
227
|
+
guard configure
|
|
228
|
+
|
|
229
|
+
# Legacy (still supported):
|
|
230
|
+
praetorian chariot list assets
|
|
231
|
+
praetorian configure
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### SDK
|
|
235
|
+
Both `Guard` and `Chariot` classes are available and interchangeable:
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
# New (preferred):
|
|
239
|
+
from praetorian_cli.sdk.guard import Guard
|
|
240
|
+
guard = Guard(Keychain())
|
|
241
|
+
|
|
242
|
+
# Legacy (still supported):
|
|
243
|
+
from praetorian_cli.sdk.chariot import Chariot
|
|
244
|
+
chariot = Chariot(Keychain())
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Configuration
|
|
248
|
+
The keychain file and environment variables remain unchanged. Existing configurations will continue to work without modification.
|
|
@@ -37,6 +37,7 @@ praetorian_cli/scripts/commands/__init__.py
|
|
|
37
37
|
praetorian_cli/scripts/commands/nmap-example.py
|
|
38
38
|
praetorian_cli/sdk/__init__.py
|
|
39
39
|
praetorian_cli/sdk/chariot.py
|
|
40
|
+
praetorian_cli/sdk/guard.py
|
|
40
41
|
praetorian_cli/sdk/keychain.py
|
|
41
42
|
praetorian_cli/sdk/mcp_server.py
|
|
42
43
|
praetorian_cli/sdk/entities/__init__.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = praetorian-cli
|
|
3
|
-
version = 2.
|
|
3
|
+
version = 2.3.0
|
|
4
4
|
author = Praetorian
|
|
5
5
|
author_email = support@praetorian.com
|
|
6
6
|
description = For interacting with the Chariot API
|
|
@@ -32,6 +32,7 @@ install_requires =
|
|
|
32
32
|
[options.entry_points]
|
|
33
33
|
console_scripts =
|
|
34
34
|
praetorian = praetorian_cli.main:main
|
|
35
|
+
guard = praetorian_cli.main:guard_main
|
|
35
36
|
|
|
36
37
|
[egg_info]
|
|
37
38
|
tag_build =
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/scripts/commands/nmap-example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/entities/configurations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/sdk/test/test_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{praetorian_cli-2.2.17 → praetorian_cli-2.3.0}/praetorian_cli/ui/conversation/textual_chat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|