praetorian-cli 2.2.15__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.
Files changed (110) hide show
  1. praetorian_cli-2.2.15/LICENSE +21 -0
  2. praetorian_cli-2.2.15/MANIFEST.in +1 -0
  3. praetorian_cli-2.2.15/PKG-INFO +211 -0
  4. praetorian_cli-2.2.15/README.md +187 -0
  5. praetorian_cli-2.2.15/praetorian_cli/__init__.py +0 -0
  6. praetorian_cli-2.2.15/praetorian_cli/handlers/__init__.py +0 -0
  7. praetorian_cli-2.2.15/praetorian_cli/handlers/add.py +387 -0
  8. praetorian_cli-2.2.15/praetorian_cli/handlers/aegis.py +107 -0
  9. praetorian_cli-2.2.15/praetorian_cli/handlers/agent.py +100 -0
  10. praetorian_cli-2.2.15/praetorian_cli/handlers/chariot.py +17 -0
  11. praetorian_cli-2.2.15/praetorian_cli/handlers/cli_decorators.py +83 -0
  12. praetorian_cli-2.2.15/praetorian_cli/handlers/configure.py +28 -0
  13. praetorian_cli-2.2.15/praetorian_cli/handlers/delete.py +196 -0
  14. praetorian_cli-2.2.15/praetorian_cli/handlers/enrich.py +16 -0
  15. praetorian_cli-2.2.15/praetorian_cli/handlers/get.py +345 -0
  16. praetorian_cli-2.2.15/praetorian_cli/handlers/imports.py +58 -0
  17. praetorian_cli-2.2.15/praetorian_cli/handlers/link.py +60 -0
  18. praetorian_cli-2.2.15/praetorian_cli/handlers/list.py +392 -0
  19. praetorian_cli-2.2.15/praetorian_cli/handlers/script.py +57 -0
  20. praetorian_cli-2.2.15/praetorian_cli/handlers/search.py +71 -0
  21. praetorian_cli-2.2.15/praetorian_cli/handlers/ssh_utils.py +154 -0
  22. praetorian_cli-2.2.15/praetorian_cli/handlers/test.py +29 -0
  23. praetorian_cli-2.2.15/praetorian_cli/handlers/unlink.py +55 -0
  24. praetorian_cli-2.2.15/praetorian_cli/handlers/update.py +96 -0
  25. praetorian_cli-2.2.15/praetorian_cli/handlers/utils.py +97 -0
  26. praetorian_cli-2.2.15/praetorian_cli/main.py +38 -0
  27. praetorian_cli-2.2.15/praetorian_cli/scripts/__init__.py +0 -0
  28. praetorian_cli-2.2.15/praetorian_cli/scripts/commands/__init__.py +0 -0
  29. praetorian_cli-2.2.15/praetorian_cli/scripts/commands/nmap-example.py +74 -0
  30. praetorian_cli-2.2.15/praetorian_cli/scripts/utils.py +20 -0
  31. praetorian_cli-2.2.15/praetorian_cli/sdk/__init__.py +0 -0
  32. praetorian_cli-2.2.15/praetorian_cli/sdk/chariot.py +368 -0
  33. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/__init__.py +0 -0
  34. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/accounts.py +130 -0
  35. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/aegis.py +437 -0
  36. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/agents.py +45 -0
  37. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/assets.py +153 -0
  38. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/attributes.py +83 -0
  39. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/capabilities.py +58 -0
  40. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/configurations.py +108 -0
  41. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/credentials.py +158 -0
  42. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/definitions.py +73 -0
  43. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/files.py +142 -0
  44. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/integrations.py +69 -0
  45. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/jobs.py +217 -0
  46. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/keys.py +140 -0
  47. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/preseeds.py +219 -0
  48. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/risks.py +204 -0
  49. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/scanners.py +13 -0
  50. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/schema.py +27 -0
  51. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/search.py +431 -0
  52. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/seeds.py +166 -0
  53. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/settings.py +68 -0
  54. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/statistics.py +173 -0
  55. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/webhook.py +167 -0
  56. praetorian_cli-2.2.15/praetorian_cli/sdk/entities/webpage.py +180 -0
  57. praetorian_cli-2.2.15/praetorian_cli/sdk/keychain.py +189 -0
  58. praetorian_cli-2.2.15/praetorian_cli/sdk/mcp_server.py +235 -0
  59. praetorian_cli-2.2.15/praetorian_cli/sdk/model/__init__.py +0 -0
  60. praetorian_cli-2.2.15/praetorian_cli/sdk/model/aegis.py +156 -0
  61. praetorian_cli-2.2.15/praetorian_cli/sdk/model/globals.py +118 -0
  62. praetorian_cli-2.2.15/praetorian_cli/sdk/model/query.py +234 -0
  63. praetorian_cli-2.2.15/praetorian_cli/sdk/model/utils.py +31 -0
  64. praetorian_cli-2.2.15/praetorian_cli/sdk/test/__init__.py +0 -0
  65. praetorian_cli-2.2.15/praetorian_cli/sdk/test/pytest.ini +6 -0
  66. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_account.py +24 -0
  67. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_agent.py +27 -0
  68. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_asset.py +117 -0
  69. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_attribute.py +34 -0
  70. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_capabilities.py +15 -0
  71. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_configuration.py +51 -0
  72. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_conversation.py +195 -0
  73. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_definition.py +31 -0
  74. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_extend.py +45 -0
  75. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_file.py +73 -0
  76. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_job.py +50 -0
  77. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_key.py +45 -0
  78. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_mcp.py +28 -0
  79. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_preseed.py +31 -0
  80. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_risk.py +80 -0
  81. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_search.py +51 -0
  82. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_seed.py +40 -0
  83. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_setting.py +38 -0
  84. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_webhook.py +56 -0
  85. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_webpage.py +46 -0
  86. praetorian_cli-2.2.15/praetorian_cli/sdk/test/test_z_cli.py +409 -0
  87. praetorian_cli-2.2.15/praetorian_cli/sdk/test/ui_mocks.py +133 -0
  88. praetorian_cli-2.2.15/praetorian_cli/sdk/test/utils.py +92 -0
  89. praetorian_cli-2.2.15/praetorian_cli/ui/__init__.py +3 -0
  90. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/__init__.py +5 -0
  91. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/__init__.py +2 -0
  92. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/help.py +81 -0
  93. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/info.py +136 -0
  94. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/job.py +381 -0
  95. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/list.py +14 -0
  96. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/set.py +33 -0
  97. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/commands/ssh.py +87 -0
  98. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/constants.py +20 -0
  99. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/menu.py +398 -0
  100. praetorian_cli-2.2.15/praetorian_cli/ui/aegis/utils.py +163 -0
  101. praetorian_cli-2.2.15/praetorian_cli/ui/conversation/__init__.py +3 -0
  102. praetorian_cli-2.2.15/praetorian_cli/ui/conversation/textual_chat.py +622 -0
  103. praetorian_cli-2.2.15/praetorian_cli.egg-info/PKG-INFO +211 -0
  104. praetorian_cli-2.2.15/praetorian_cli.egg-info/SOURCES.txt +109 -0
  105. praetorian_cli-2.2.15/praetorian_cli.egg-info/dependency_links.txt +1 -0
  106. praetorian_cli-2.2.15/praetorian_cli.egg-info/entry_points.txt +2 -0
  107. praetorian_cli-2.2.15/praetorian_cli.egg-info/requires.txt +9 -0
  108. praetorian_cli-2.2.15/praetorian_cli.egg-info/top_level.txt +1 -0
  109. praetorian_cli-2.2.15/pyproject.toml +6 -0
  110. praetorian_cli-2.2.15/setup.cfg +39 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Praetorian
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ include praetorian_cli/sdk/test/pytest.ini
@@ -0,0 +1,211 @@
1
+ Metadata-Version: 2.4
2
+ Name: praetorian-cli
3
+ Version: 2.2.15
4
+ Summary: For interacting with the Chariot API
5
+ Home-page: https://github.com/praetorian-inc/praetorian-cli
6
+ Author: Praetorian
7
+ Author-email: support@praetorian.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: click>=8.1.7
15
+ Requires-Dist: boto3>=1.34.0
16
+ Requires-Dist: requests>=2.31.0
17
+ Requires-Dist: pytest>=8.0.2
18
+ Requires-Dist: mcp>=1.12.2
19
+ Requires-Dist: anyio>=3.0.0
20
+ Requires-Dist: textual>=0.47.0
21
+ Requires-Dist: rich>=13.0.0
22
+ Requires-Dist: prompt_toolkit>=3.0.0
23
+ Dynamic: license-file
24
+
25
+ # Praetorian CLI and SDK
26
+
27
+ [![Python Version](https://img.shields.io/badge/Python-v3.9+-blue)](https://www.python.org/)
28
+ [![pip Version](https://img.shields.io/badge/pip-v23.0+-blue)](https://pypi.org/project/praetorian-cli/)
29
+ [![License](https://img.shields.io/badge/License-MIT-007EC6.svg)](LICENSE)
30
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20covenant-2.1-007EC6.svg)](CODE_OF_CONDUCT.md)
31
+ [![Open Source Libraries](https://img.shields.io/badge/Open--source-%F0%9F%92%9A-28a745)](https://opensource.org/)
32
+ [![Contributions Welcome](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg?style=flat)](https://github.com/praetorian-inc/chariot-ui/issues)
33
+
34
+ :link: [Chariot Platform](https://chariot.praetorian.com)
35
+ :book: [Documentation](https://docs.praetorian.com)
36
+ :bookmark: [PyPI](https://pypi.org/project/praetorian-cli/)
37
+
38
+ # Table of Contents
39
+
40
+ - [Description](#description)
41
+ - [Getting started](#getting-started)
42
+ - [Prerequisites](#prerequisites)
43
+ - [Installation](#installation)
44
+ - [Signing up](#signing-up-and-configuration)
45
+ - [Using the CLI](#using-the-cli)
46
+ - [Using scripts](#using-scripts)
47
+ - [Developers](#developers)
48
+ - [Contributing](#contributing)
49
+ - [Support](#support)
50
+ - [License](#license)
51
+
52
+ # Description
53
+
54
+ Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
55
+ access to [Chariot](https://www.praetorian.com/proactive-cybersecurity-technology/), our
56
+ offensive security platform.
57
+ <br> The SDK exposes the full set of APIs that the Chariot UI uses.
58
+ <br> The CLI is a fully-featured companion to the Chariot UI.
59
+
60
+ # Getting Started
61
+
62
+ ## Prerequisites
63
+
64
+ - Python v3.9 or above
65
+ - pip v23.0 or above
66
+
67
+ ## Installation
68
+
69
+ Install the Python package using this command:
70
+
71
+ ```zsh
72
+ pip install praetorian-cli
73
+ ```
74
+
75
+ ## Signing up
76
+
77
+ Register for an account for [Chariot](http://chariot.praetorian.com) using the instructions
78
+ in [our documentation](https://docs.praetorian.com/hc/en-us/articles/38048335323547-Account-Creation-and-Attack-Surface-Setup).
79
+
80
+ ## Authentication
81
+
82
+ Once you can properly access Chariot through the UI. You can obtain API credentials through the UI under
83
+ 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 Chariot.
85
+
86
+ **Note**: SSO Organizations should provision access through API Keys as well.
87
+
88
+ ### Using API Keys
89
+
90
+ This is the authentication method for CLI. You can authenticate using either a keychain file or environment variables.
91
+
92
+ #### Using the keychain file
93
+
94
+ This method stores your API key in a keychain file.
95
+
96
+ 1. Run `praetorian configure` and follow the prompts to set up authentication.
97
+ Use the default values for `profile name`, `URL of backend API`, and `client ID`.
98
+ 2. It creates `~/.praetorian/keychain.ini`, which should read like this:
99
+
100
+ ```
101
+ [United States]
102
+ name = chariot
103
+ client_id = 795dnnr45so7m17cppta0b295o
104
+ api = https://d0qcl2e18h.execute-api.us-east-2.amazonaws.com/chariot
105
+ api_key_id = your-api-key-id-here
106
+ api_key_secret = your-api-key-here
107
+ ```
108
+
109
+ #### Using environment variables
110
+
111
+ This method uses in-memory environment variables to pass your API key to
112
+ the CLI. There is no need for a keychain file on disk. This enables you to choose
113
+ a credential storage method suitable for your use cases. To use this method, set the
114
+ following environment variable:
115
+
116
+ ```zsh
117
+ export PRAETORIAN_CLI_API_KEY_ID=your-api-key-id-here
118
+ export PRAETORIAN_CLI_API_KEY_SECRET=your-api-key-here
119
+ ```
120
+
121
+ For more advanced configuration options or managing access in SSO organizations see
122
+ [the documentation on configuration](https://github.com/praetorian-inc/praetorian-cli/blob/main/docs/configure.md).
123
+
124
+ # Using the CLI
125
+
126
+ The CLI is a command and option utility for accessing the full suite of Chariot's API. You can see the documentation for commands
127
+ using the `help` option:
128
+
129
+ ```zsh
130
+ praetorian chariot --help
131
+ ```
132
+
133
+ As an example, run the following command to retrieve the list of all assets in your account:
134
+
135
+ ```zsh
136
+ praetorian --account chariot+example@praetorian.com chariot list assets
137
+ ```
138
+
139
+ You can obtain the `account` argument by viewing the email of the first user on the Users page in your Chariot account, as shown below:
140
+
141
+ <img width="482" alt="image" src="https://github.com/user-attachments/assets/7c1024c9-7b74-46b1-87c5-af44671b1ec8" />
142
+
143
+ To get detailed information about a specific asset, run:
144
+
145
+ ```zsh
146
+ praetorian --account chariot+example@praetorian.com chariot get asset <ASSET_KEY>
147
+ ```
148
+
149
+ # Developers
150
+
151
+ Both CLI and SDK is open-source in this repository. The SDK is installed along with the `praetorian-cli`
152
+ package. You can extend Chariot by creating scripts using the SDK.
153
+
154
+ ## SDK
155
+
156
+ Integrate the SDK into your own Python application with the following steps:
157
+
158
+ 1. Include the dependency ``praetorian-cli`` in your project.
159
+ 2. Import the Chariot class ``from praetorian_cli.sdk.chariot import Chariot``.
160
+ 3. Import the Keychain class ``from praetorian_cli.sdk.keychain import Keychain``.
161
+ 4. Call any function of the Chariot class, which expose the full backend API. See example below:
162
+
163
+ ```python
164
+ from praetorian_cli.sdk.chariot import Chariot
165
+ from praetorian_cli.sdk.keychain import Keychain
166
+
167
+ chariot = Chariot(Keychain(account='chariot+example@praetorian.com'))
168
+ chariot.add('asset', dict(name='example.com', dns='example.com'))
169
+ ```
170
+
171
+ The best place to explore the SDK is the code of the CLI, especially
172
+ [the handlers of the CLI](https://github.com/praetorian-inc/praetorian-cli/tree/main/praetorian_cli/handlers)
173
+
174
+ You can inspect the handler code to see how each CLI command is implemented with the SDK.
175
+
176
+ ## Developing external scripts
177
+
178
+ The CLI has a scripting engine that allow external scripts to be executed within the CLI's framework, taking
179
+ advantage of the SDK, `click`, and authentication.
180
+
181
+ To add those external scripts to the CLI, set the `PRAETORIAN_SCRIPTS_PATH`
182
+ environment to point to directories where you store additional extension scripts.
183
+
184
+ Those external scripts are available under the `script` commands. To see a list of them:
185
+
186
+ ```zsh
187
+ praetorian --account chariot+example@praetorian.com chariot script --help
188
+ ```
189
+
190
+ For developing scripts, you can refer to
191
+ this [readme file](https://github.com/praetorian-inc/praetorian-cli/blob/main/docs/script-development.md).
192
+
193
+
194
+ ## Contributing
195
+
196
+ We welcome contributions from the community, from scripts, to the core CLI and SDK. To contribute, fork this
197
+ repository and following the
198
+ [GitHub instructions](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)
199
+ to create pull requests.
200
+
201
+ By contributing, you agree to our [Code of Conduct](CODE_OF_CONDUCT.md).
202
+
203
+ ## Support
204
+
205
+ If you have any questions or need support, please open an issue
206
+ [here](https://github.com/praetorian-inc/chariot-ui/issues) or reach out via
207
+ [support@praetorian.com](mailto:support@praetorian.com).
208
+
209
+ ## License
210
+
211
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,187 @@
1
+ # Praetorian CLI and SDK
2
+
3
+ [![Python Version](https://img.shields.io/badge/Python-v3.9+-blue)](https://www.python.org/)
4
+ [![pip Version](https://img.shields.io/badge/pip-v23.0+-blue)](https://pypi.org/project/praetorian-cli/)
5
+ [![License](https://img.shields.io/badge/License-MIT-007EC6.svg)](LICENSE)
6
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20covenant-2.1-007EC6.svg)](CODE_OF_CONDUCT.md)
7
+ [![Open Source Libraries](https://img.shields.io/badge/Open--source-%F0%9F%92%9A-28a745)](https://opensource.org/)
8
+ [![Contributions Welcome](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg?style=flat)](https://github.com/praetorian-inc/chariot-ui/issues)
9
+
10
+ :link: [Chariot Platform](https://chariot.praetorian.com)
11
+ :book: [Documentation](https://docs.praetorian.com)
12
+ :bookmark: [PyPI](https://pypi.org/project/praetorian-cli/)
13
+
14
+ # Table of Contents
15
+
16
+ - [Description](#description)
17
+ - [Getting started](#getting-started)
18
+ - [Prerequisites](#prerequisites)
19
+ - [Installation](#installation)
20
+ - [Signing up](#signing-up-and-configuration)
21
+ - [Using the CLI](#using-the-cli)
22
+ - [Using scripts](#using-scripts)
23
+ - [Developers](#developers)
24
+ - [Contributing](#contributing)
25
+ - [Support](#support)
26
+ - [License](#license)
27
+
28
+ # Description
29
+
30
+ Praetorian CLI and SDK are open-source tools for interacting with our products and services. Currently, they support
31
+ access to [Chariot](https://www.praetorian.com/proactive-cybersecurity-technology/), our
32
+ offensive security platform.
33
+ <br> The SDK exposes the full set of APIs that the Chariot UI uses.
34
+ <br> The CLI is a fully-featured companion to the Chariot UI.
35
+
36
+ # Getting Started
37
+
38
+ ## Prerequisites
39
+
40
+ - Python v3.9 or above
41
+ - pip v23.0 or above
42
+
43
+ ## Installation
44
+
45
+ Install the Python package using this command:
46
+
47
+ ```zsh
48
+ pip install praetorian-cli
49
+ ```
50
+
51
+ ## Signing up
52
+
53
+ Register for an account for [Chariot](http://chariot.praetorian.com) using the instructions
54
+ in [our documentation](https://docs.praetorian.com/hc/en-us/articles/38048335323547-Account-Creation-and-Attack-Surface-Setup).
55
+
56
+ ## Authentication
57
+
58
+ Once you can properly access Chariot through the UI. You can obtain API credentials through the UI under
59
+ 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 Chariot.
61
+
62
+ **Note**: SSO Organizations should provision access through API Keys as well.
63
+
64
+ ### Using API Keys
65
+
66
+ This is the authentication method for CLI. You can authenticate using either a keychain file or environment variables.
67
+
68
+ #### Using the keychain file
69
+
70
+ This method stores your API key in a keychain file.
71
+
72
+ 1. Run `praetorian configure` and follow the prompts to set up authentication.
73
+ Use the default values for `profile name`, `URL of backend API`, and `client ID`.
74
+ 2. It creates `~/.praetorian/keychain.ini`, which should read like this:
75
+
76
+ ```
77
+ [United States]
78
+ name = chariot
79
+ client_id = 795dnnr45so7m17cppta0b295o
80
+ api = https://d0qcl2e18h.execute-api.us-east-2.amazonaws.com/chariot
81
+ api_key_id = your-api-key-id-here
82
+ api_key_secret = your-api-key-here
83
+ ```
84
+
85
+ #### Using environment variables
86
+
87
+ This method uses in-memory environment variables to pass your API key to
88
+ the CLI. There is no need for a keychain file on disk. This enables you to choose
89
+ a credential storage method suitable for your use cases. To use this method, set the
90
+ following environment variable:
91
+
92
+ ```zsh
93
+ export PRAETORIAN_CLI_API_KEY_ID=your-api-key-id-here
94
+ export PRAETORIAN_CLI_API_KEY_SECRET=your-api-key-here
95
+ ```
96
+
97
+ For more advanced configuration options or managing access in SSO organizations see
98
+ [the documentation on configuration](https://github.com/praetorian-inc/praetorian-cli/blob/main/docs/configure.md).
99
+
100
+ # Using the CLI
101
+
102
+ The CLI is a command and option utility for accessing the full suite of Chariot's API. You can see the documentation for commands
103
+ using the `help` option:
104
+
105
+ ```zsh
106
+ praetorian chariot --help
107
+ ```
108
+
109
+ As an example, run the following command to retrieve the list of all assets in your account:
110
+
111
+ ```zsh
112
+ praetorian --account chariot+example@praetorian.com chariot list assets
113
+ ```
114
+
115
+ You can obtain the `account` argument by viewing the email of the first user on the Users page in your Chariot account, as shown below:
116
+
117
+ <img width="482" alt="image" src="https://github.com/user-attachments/assets/7c1024c9-7b74-46b1-87c5-af44671b1ec8" />
118
+
119
+ To get detailed information about a specific asset, run:
120
+
121
+ ```zsh
122
+ praetorian --account chariot+example@praetorian.com chariot get asset <ASSET_KEY>
123
+ ```
124
+
125
+ # Developers
126
+
127
+ Both CLI and SDK is open-source in this repository. The SDK is installed along with the `praetorian-cli`
128
+ package. You can extend Chariot by creating scripts using the SDK.
129
+
130
+ ## SDK
131
+
132
+ Integrate the SDK into your own Python application with the following steps:
133
+
134
+ 1. Include the dependency ``praetorian-cli`` in your project.
135
+ 2. Import the Chariot class ``from praetorian_cli.sdk.chariot import Chariot``.
136
+ 3. Import the Keychain class ``from praetorian_cli.sdk.keychain import Keychain``.
137
+ 4. Call any function of the Chariot class, which expose the full backend API. See example below:
138
+
139
+ ```python
140
+ from praetorian_cli.sdk.chariot import Chariot
141
+ from praetorian_cli.sdk.keychain import Keychain
142
+
143
+ chariot = Chariot(Keychain(account='chariot+example@praetorian.com'))
144
+ chariot.add('asset', dict(name='example.com', dns='example.com'))
145
+ ```
146
+
147
+ The best place to explore the SDK is the code of the CLI, especially
148
+ [the handlers of the CLI](https://github.com/praetorian-inc/praetorian-cli/tree/main/praetorian_cli/handlers)
149
+
150
+ You can inspect the handler code to see how each CLI command is implemented with the SDK.
151
+
152
+ ## Developing external scripts
153
+
154
+ The CLI has a scripting engine that allow external scripts to be executed within the CLI's framework, taking
155
+ advantage of the SDK, `click`, and authentication.
156
+
157
+ To add those external scripts to the CLI, set the `PRAETORIAN_SCRIPTS_PATH`
158
+ environment to point to directories where you store additional extension scripts.
159
+
160
+ Those external scripts are available under the `script` commands. To see a list of them:
161
+
162
+ ```zsh
163
+ praetorian --account chariot+example@praetorian.com chariot script --help
164
+ ```
165
+
166
+ For developing scripts, you can refer to
167
+ this [readme file](https://github.com/praetorian-inc/praetorian-cli/blob/main/docs/script-development.md).
168
+
169
+
170
+ ## Contributing
171
+
172
+ We welcome contributions from the community, from scripts, to the core CLI and SDK. To contribute, fork this
173
+ repository and following the
174
+ [GitHub instructions](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)
175
+ to create pull requests.
176
+
177
+ By contributing, you agree to our [Code of Conduct](CODE_OF_CONDUCT.md).
178
+
179
+ ## Support
180
+
181
+ If you have any questions or need support, please open an issue
182
+ [here](https://github.com/praetorian-inc/chariot-ui/issues) or reach out via
183
+ [support@praetorian.com](mailto:support@praetorian.com).
184
+
185
+ ## License
186
+
187
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
File without changes