praetorian-cli 2.2.0__tar.gz → 2.2.1__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.0/praetorian_cli.egg-info → praetorian_cli-2.2.1}/PKG-INFO +1 -1
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/agent.py +8 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/test.py +1 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/chariot.py +22 -1
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/assets.py +6 -3
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_asset.py +12 -14
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_z_cli.py +1 -1
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1/praetorian_cli.egg-info}/PKG-INFO +1 -1
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/setup.cfg +1 -1
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/LICENSE +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/MANIFEST.in +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/README.md +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/add.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/chariot.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/cli_decorators.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/configure.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/delete.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/enrich.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/get.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/imports.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/link.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/list.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/script.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/search.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/unlink.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/update.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/handlers/utils.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/main.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/scripts/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/scripts/commands/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/scripts/commands/nmap-example.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/scripts/utils.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/accounts.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/agents.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/attributes.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/capabilities.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/configurations.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/credentials.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/definitions.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/files.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/integrations.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/jobs.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/keys.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/preseeds.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/risks.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/search.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/seeds.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/settings.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/statistics.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/entities/webhook.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/keychain.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/mcp_server.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/model/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/model/globals.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/model/query.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/model/utils.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/__init__.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/pytest.ini +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_account.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_agent.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_attribute.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_capabilities.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_configuration.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_definition.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_extend.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_file.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_job.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_key.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_mcp.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_preseed.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_risk.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_search.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_seed.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_setting.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/test_webhook.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli/sdk/test/utils.py +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli.egg-info/SOURCES.txt +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli.egg-info/dependency_links.txt +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli.egg-info/entry_points.txt +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli.egg-info/requires.txt +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/praetorian_cli.egg-info/top_level.txt +0 -0
- {praetorian_cli-2.2.0 → praetorian_cli-2.2.1}/pyproject.toml +0 -0
|
@@ -43,6 +43,14 @@ def start(sdk, allowed):
|
|
|
43
43
|
- praetorian chariot agent mcp start
|
|
44
44
|
- praetorian chariot agent mcp start -a search_by_term -a risk_add
|
|
45
45
|
- praetorian chariot agent mcp start -a search_* -a risk_add
|
|
46
|
+
|
|
47
|
+
\b
|
|
48
|
+
Claude code configuration/usage:
|
|
49
|
+
- claude mcp add chariot -- praetorian chariot agent mcp start # read-only
|
|
50
|
+
- claude mcp add chariot -- praetorian chariot agent mcp start -a search_by_query -a risk_add -a asset_add # select write tools
|
|
51
|
+
- claude "show me my chariot assets from the example.com domain"
|
|
52
|
+
- claude "show me my chariot assets with port 22 open"
|
|
53
|
+
- claude "run a portscan on every discovered ip for example.com"
|
|
46
54
|
"""
|
|
47
55
|
if len(allowed) == 0:
|
|
48
56
|
allowed = None
|
|
@@ -15,6 +15,7 @@ from praetorian_cli.handlers.cli_decorators import cli_handler
|
|
|
15
15
|
def test(chariot, key, suite):
|
|
16
16
|
""" Run integration test suite """
|
|
17
17
|
os.environ['CHARIOT_TEST_PROFILE'] = chariot.keychain.profile
|
|
18
|
+
os.environ['CHARIOT_PROXY'] = chariot.proxy
|
|
18
19
|
command = [test_module.__path__[0]]
|
|
19
20
|
if key:
|
|
20
21
|
command.extend(['-k', key])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import json, requests
|
|
1
|
+
import json, requests, os
|
|
2
2
|
|
|
3
3
|
from praetorian_cli.sdk.entities.accounts import Accounts
|
|
4
4
|
from praetorian_cli.sdk.entities.agents import Agents
|
|
@@ -49,6 +49,9 @@ class Chariot:
|
|
|
49
49
|
self.credentials = Credentials(self)
|
|
50
50
|
self.proxy = proxy
|
|
51
51
|
|
|
52
|
+
if self.proxy == '' and os.environ.get('CHARIOT_PROXY'):
|
|
53
|
+
self.proxy = os.environ.get('CHARIOT_PROXY')
|
|
54
|
+
|
|
52
55
|
if self.proxy:
|
|
53
56
|
import urllib3
|
|
54
57
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
@@ -62,9 +65,27 @@ class Chariot:
|
|
|
62
65
|
if self.proxy:
|
|
63
66
|
kwargs['proxies'] = {'http': self.proxy, 'https': self.proxy}
|
|
64
67
|
kwargs['verify'] = False
|
|
68
|
+
|
|
69
|
+
self._add_beta_filter(method, kwargs)
|
|
65
70
|
|
|
66
71
|
return requests.request(method, url, headers=self.keychain.headers(), **kwargs)
|
|
67
72
|
|
|
73
|
+
def _add_beta_filter(self, method: str, kwargs: dict):
|
|
74
|
+
if method == 'GET' or method == 'DELETE':
|
|
75
|
+
self._add_beta_url_param(kwargs)
|
|
76
|
+
else:
|
|
77
|
+
self._add_beta_json_param(kwargs)
|
|
78
|
+
|
|
79
|
+
def _add_beta_url_param(self, kwargs: dict):
|
|
80
|
+
if 'params' in kwargs:
|
|
81
|
+
kwargs['params']['beta'] = 'true'
|
|
82
|
+
else:
|
|
83
|
+
kwargs['params'] = {'beta': 'true'}
|
|
84
|
+
|
|
85
|
+
def _add_beta_json_param(self, kwargs: dict):
|
|
86
|
+
if 'json' in kwargs:
|
|
87
|
+
kwargs['json']['beta'] = True
|
|
88
|
+
|
|
68
89
|
def my(self, params: dict, pages=1) -> dict:
|
|
69
90
|
final_resp = dict()
|
|
70
91
|
|
|
@@ -26,7 +26,7 @@ class Assets:
|
|
|
26
26
|
:return: The asset that was added
|
|
27
27
|
:rtype: dict
|
|
28
28
|
"""
|
|
29
|
-
return self.api.upsert('asset', dict(group=group, identifier=identifier, status=status,
|
|
29
|
+
return self.api.upsert('asset', dict(group=group, identifier=identifier, status=status, attackSurface=[surface], type=type))[0]
|
|
30
30
|
|
|
31
31
|
def get(self, key, details=False):
|
|
32
32
|
"""
|
|
@@ -57,10 +57,13 @@ class Assets:
|
|
|
57
57
|
:return: None
|
|
58
58
|
:rtype: None
|
|
59
59
|
"""
|
|
60
|
+
params = dict(key=key)
|
|
60
61
|
if status:
|
|
61
|
-
|
|
62
|
+
params = params | dict(status=status)
|
|
62
63
|
if surface:
|
|
63
|
-
|
|
64
|
+
params = params | dict(attackSurface=[surface])
|
|
65
|
+
|
|
66
|
+
return self.api.upsert('asset', params)
|
|
64
67
|
|
|
65
68
|
def delete(self, key):
|
|
66
69
|
"""
|
|
@@ -14,8 +14,8 @@ class TestAsset:
|
|
|
14
14
|
def test_add_asset(self):
|
|
15
15
|
asset = self.sdk.assets.add(self.asset_dns, self.asset_name, status=Asset.ACTIVE.value, surface='test-surface')
|
|
16
16
|
assert asset['key'] == self.asset_key
|
|
17
|
-
assert len(asset['
|
|
18
|
-
assert
|
|
17
|
+
assert len(asset['attackSurface']) == 1
|
|
18
|
+
assert 'test-surface' in asset['attackSurface']
|
|
19
19
|
assert asset['status'] == Asset.ACTIVE.value
|
|
20
20
|
|
|
21
21
|
def test_get_asset(self):
|
|
@@ -30,11 +30,10 @@ class TestAsset:
|
|
|
30
30
|
assert any([a['group'] == self.asset_dns for a in results])
|
|
31
31
|
|
|
32
32
|
def test_update_asset(self):
|
|
33
|
-
self.sdk.assets.update(self.asset_key, status=Asset.FROZEN.value)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
assert any([a['name'] == 'surface' and a['value'] == 'abc' for a in attributes])
|
|
33
|
+
self.sdk.assets.update(self.asset_key, status=Asset.FROZEN.value, surface='abc')
|
|
34
|
+
asset = self.get_asset()
|
|
35
|
+
assert asset['status'] == Asset.FROZEN.value
|
|
36
|
+
assert 'abc' in asset['attackSurface']
|
|
38
37
|
|
|
39
38
|
def test_delete_asset(self):
|
|
40
39
|
self.sdk.assets.delete(self.asset_key)
|
|
@@ -45,8 +44,8 @@ class TestAsset:
|
|
|
45
44
|
def test_add_ad_domain(self):
|
|
46
45
|
asset = self.sdk.assets.add(self.ad_domain_name, self.ad_domain_name, status=Asset.ACTIVE.value, surface='test-surface', type=Kind.ADDOMAIN.value)
|
|
47
46
|
assert asset['key'] == self.ad_domain_key
|
|
48
|
-
assert len(asset['
|
|
49
|
-
assert
|
|
47
|
+
assert len(asset['attackSurface']) == 1
|
|
48
|
+
assert 'test-surface' in asset['attackSurface']
|
|
50
49
|
assert asset['status'] == Asset.ACTIVE.value
|
|
51
50
|
|
|
52
51
|
def test_get_ad_domain(self):
|
|
@@ -61,11 +60,10 @@ class TestAsset:
|
|
|
61
60
|
assert any([a['group'] == self.ad_domain_name for a in results])
|
|
62
61
|
|
|
63
62
|
def test_update_ad_domain(self):
|
|
64
|
-
self.sdk.assets.update(self.ad_domain_key, status=Asset.FROZEN.value)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
assert any([a['name'] == 'surface' and a['value'] == 'abc' for a in attributes])
|
|
63
|
+
self.sdk.assets.update(self.ad_domain_key, status=Asset.FROZEN.value, surface='abc')
|
|
64
|
+
ad_domain = self.get_ad_domain()
|
|
65
|
+
assert ad_domain['status'] == Asset.FROZEN.value
|
|
66
|
+
assert 'abc' in ad_domain['attackSurface']
|
|
69
67
|
|
|
70
68
|
def test_delete_ad_domain(self):
|
|
71
69
|
self.sdk.assets.delete(self.ad_domain_key)
|
|
@@ -33,7 +33,7 @@ class TestZCli:
|
|
|
33
33
|
|
|
34
34
|
self.verify(f'update asset -s F "{o.asset_key}" -f internal')
|
|
35
35
|
self.verify(f'get asset "{o.asset_key}" -d', [o.asset_key,
|
|
36
|
-
f'"status": "{Asset.FROZEN.value}"',
|
|
36
|
+
f'"status": "{Asset.FROZEN.value}"', '"internal"'])
|
|
37
37
|
|
|
38
38
|
self.verify(f'delete asset "{o.asset_key}"')
|
|
39
39
|
self.verify(f'get asset "{o.asset_key}"', [o.asset_key, f'"status": "{Asset.DELETED.value}"'])
|
|
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.0 → praetorian_cli-2.2.1}/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
|
|
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
|
|
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
|