pyattackforge 0.1.0__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
- pyattackforge/__init__.py +0 -0
- pyattackforge/client.py +924 -340
- pyattackforge/prev_client.py +384 -0
- pyattackforge-0.1.3.dist-info/METADATA +281 -0
- pyattackforge-0.1.3.dist-info/RECORD +8 -0
- {pyattackforge-0.1.0.dist-info → pyattackforge-0.1.3.dist-info}/WHEEL +0 -0
- {pyattackforge-0.1.0.dist-info → pyattackforge-0.1.3.dist-info}/licenses/LICENSE +661 -661
- {pyattackforge-0.1.0.dist-info → pyattackforge-0.1.3.dist-info}/top_level.txt +0 -0
- pyattackforge-0.1.0.dist-info/METADATA +0 -120
- pyattackforge-0.1.0.dist-info/RECORD +0 -7
|
File without changes
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: pyattackforge
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Python wrapper for the AttackForge API
|
|
5
|
-
Home-page: https://github.com/Tantalum-Labs/PyAttackForge
|
|
6
|
-
Author: Shane S
|
|
7
|
-
License: AGPL-3.0
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
-
Requires-Python: >=3.7
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: requests>=2.20.0
|
|
18
|
-
Dynamic: author
|
|
19
|
-
Dynamic: classifier
|
|
20
|
-
Dynamic: description
|
|
21
|
-
Dynamic: description-content-type
|
|
22
|
-
Dynamic: home-page
|
|
23
|
-
Dynamic: license
|
|
24
|
-
Dynamic: license-file
|
|
25
|
-
Dynamic: requires-dist
|
|
26
|
-
Dynamic: requires-python
|
|
27
|
-
Dynamic: summary
|
|
28
|
-
|
|
29
|
-
# PyAttackForge
|
|
30
|
-
|
|
31
|
-
A lightweight Python library for interacting with the AttackForge API.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Features
|
|
36
|
-
|
|
37
|
-
- Create and fetch projects
|
|
38
|
-
- Manage assets
|
|
39
|
-
- Submit vulnerabilities
|
|
40
|
-
- Dry-run mode for testing
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Install
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
mkdir PyAttackForgeEnv
|
|
48
|
-
cd PyAttackForgeEnv
|
|
49
|
-
virtualenv venv
|
|
50
|
-
source ./venv/bin/activate
|
|
51
|
-
pip install git+https://github.com/Tantalum-Labs/PyAttackForge.git
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Use
|
|
55
|
-
|
|
56
|
-
```python
|
|
57
|
-
from pyattackforge import PyAttackForgeClient
|
|
58
|
-
|
|
59
|
-
# Initialize client - Note: Make sure to set your AttackForge URL and API Key
|
|
60
|
-
client = PyAttackForgeClient(api_key="your-api-key", base_url="https://demo.attackforge.com", dry_run=False)
|
|
61
|
-
|
|
62
|
-
# Create a project
|
|
63
|
-
project = client.create_project("My Project", scope=["Asset1", "Asset2"])
|
|
64
|
-
|
|
65
|
-
## Create a vulnerability with auto-created assets
|
|
66
|
-
client.create_vulnerability(
|
|
67
|
-
vulnerability_data={
|
|
68
|
-
"projectId": "abc123",
|
|
69
|
-
"title": "Open SSH Port",
|
|
70
|
-
"affected_assets": [{"assetName": "ssh-prod-1"}],
|
|
71
|
-
"priority": "High",
|
|
72
|
-
"likelihood_of_exploitation": 10,
|
|
73
|
-
},
|
|
74
|
-
auto_create_assets=True,
|
|
75
|
-
default_asset_type="Cloud",
|
|
76
|
-
default_asset_library_ids=["your-lib-id"]
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## API Reference
|
|
84
|
-
|
|
85
|
-
### `PyAttackForgeClient`
|
|
86
|
-
|
|
87
|
-
- `__init__(api_key: str, base_url: str = ..., dry_run: bool = False)`
|
|
88
|
-
- `get_assets() -> dict`
|
|
89
|
-
- `get_asset_by_name(name: str) -> dict or None`
|
|
90
|
-
- `create_asset(asset_data: dict) -> dict`
|
|
91
|
-
- `get_project_by_name(name: str) -> dict or None`
|
|
92
|
-
- `get_project_scope(project_id: str) -> set`
|
|
93
|
-
- `update_project_scope(project_id: str, new_assets: list) -> dict`
|
|
94
|
-
- `create_project(name: str, **kwargs) -> dict`
|
|
95
|
-
- `update_project(project_id: str, update_fields: dict) -> dict`
|
|
96
|
-
- `create_vulnerability(vulnerability_data: dict, auto_create_assets: bool = False, ...) -> dict`
|
|
97
|
-
|
|
98
|
-
See the source code for full details and docstrings.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Contributing
|
|
103
|
-
|
|
104
|
-
Contributions are welcome! Please open issues or submit pull requests via GitHub.
|
|
105
|
-
|
|
106
|
-
- Ensure code is PEP8-compliant and includes docstrings and type hints.
|
|
107
|
-
- Add or update tests for new features or bugfixes.
|
|
108
|
-
- Do **not** commit API keys or other secrets.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Security
|
|
113
|
-
|
|
114
|
-
**Never commit your API keys or other sensitive information to version control.**
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## License
|
|
119
|
-
|
|
120
|
-
This project is licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](https://www.gnu.org/licenses/agpl-3.0.html).
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pyattackforge/__init__.py,sha256=xZxubdjv_Fc1bRqfVRMR4j9SCTLXg9TfckWn9CQHH_E,839
|
|
2
|
-
pyattackforge/client.py,sha256=wYyWCscQGYlysBgvxhnQlZnEdhTT8555RmSJ8FH9lrw,12784
|
|
3
|
-
pyattackforge-0.1.0.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
|
|
4
|
-
pyattackforge-0.1.0.dist-info/METADATA,sha256=Xm1YpRAVkEKp5KeQqS2JM5zvfrCYEX90qmfNI9B6FtA,3311
|
|
5
|
-
pyattackforge-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
pyattackforge-0.1.0.dist-info/top_level.txt,sha256=1rDeMkWvFWuX3MS8V65no7KuybYyvtfIgbYSt5m_uPU,14
|
|
7
|
-
pyattackforge-0.1.0.dist-info/RECORD,,
|