pyoaev 1.18.20__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 (77) hide show
  1. pyoaev-1.18.20/LICENSE +201 -0
  2. pyoaev-1.18.20/PKG-INFO +134 -0
  3. pyoaev-1.18.20/README.md +83 -0
  4. pyoaev-1.18.20/docs/conf.py +65 -0
  5. pyoaev-1.18.20/pyoaev/__init__.py +26 -0
  6. pyoaev-1.18.20/pyoaev/_version.py +6 -0
  7. pyoaev-1.18.20/pyoaev/apis/__init__.py +20 -0
  8. pyoaev-1.18.20/pyoaev/apis/attack_pattern.py +28 -0
  9. pyoaev-1.18.20/pyoaev/apis/collector.py +29 -0
  10. pyoaev-1.18.20/pyoaev/apis/cve.py +18 -0
  11. pyoaev-1.18.20/pyoaev/apis/document.py +29 -0
  12. pyoaev-1.18.20/pyoaev/apis/endpoint.py +38 -0
  13. pyoaev-1.18.20/pyoaev/apis/inject.py +29 -0
  14. pyoaev-1.18.20/pyoaev/apis/inject_expectation/__init__.py +1 -0
  15. pyoaev-1.18.20/pyoaev/apis/inject_expectation/inject_expectation.py +118 -0
  16. pyoaev-1.18.20/pyoaev/apis/inject_expectation/model/__init__.py +7 -0
  17. pyoaev-1.18.20/pyoaev/apis/inject_expectation/model/expectation.py +173 -0
  18. pyoaev-1.18.20/pyoaev/apis/inject_expectation_trace.py +36 -0
  19. pyoaev-1.18.20/pyoaev/apis/injector.py +26 -0
  20. pyoaev-1.18.20/pyoaev/apis/injector_contract.py +56 -0
  21. pyoaev-1.18.20/pyoaev/apis/inputs/__init__.py +0 -0
  22. pyoaev-1.18.20/pyoaev/apis/inputs/search.py +72 -0
  23. pyoaev-1.18.20/pyoaev/apis/kill_chain_phase.py +22 -0
  24. pyoaev-1.18.20/pyoaev/apis/me.py +17 -0
  25. pyoaev-1.18.20/pyoaev/apis/organization.py +11 -0
  26. pyoaev-1.18.20/pyoaev/apis/payload.py +27 -0
  27. pyoaev-1.18.20/pyoaev/apis/security_platform.py +33 -0
  28. pyoaev-1.18.20/pyoaev/apis/tag.py +19 -0
  29. pyoaev-1.18.20/pyoaev/apis/team.py +25 -0
  30. pyoaev-1.18.20/pyoaev/apis/user.py +31 -0
  31. pyoaev-1.18.20/pyoaev/backends/__init__.py +14 -0
  32. pyoaev-1.18.20/pyoaev/backends/backend.py +136 -0
  33. pyoaev-1.18.20/pyoaev/backends/protocol.py +32 -0
  34. pyoaev-1.18.20/pyoaev/base.py +320 -0
  35. pyoaev-1.18.20/pyoaev/client.py +596 -0
  36. pyoaev-1.18.20/pyoaev/configuration/__init__.py +3 -0
  37. pyoaev-1.18.20/pyoaev/configuration/configuration.py +188 -0
  38. pyoaev-1.18.20/pyoaev/configuration/sources.py +44 -0
  39. pyoaev-1.18.20/pyoaev/contracts/__init__.py +5 -0
  40. pyoaev-1.18.20/pyoaev/contracts/contract_builder.py +44 -0
  41. pyoaev-1.18.20/pyoaev/contracts/contract_config.py +292 -0
  42. pyoaev-1.18.20/pyoaev/contracts/contract_utils.py +22 -0
  43. pyoaev-1.18.20/pyoaev/contracts/variable_helper.py +124 -0
  44. pyoaev-1.18.20/pyoaev/daemons/__init__.py +4 -0
  45. pyoaev-1.18.20/pyoaev/daemons/base_daemon.py +131 -0
  46. pyoaev-1.18.20/pyoaev/daemons/collector_daemon.py +91 -0
  47. pyoaev-1.18.20/pyoaev/exceptions.py +219 -0
  48. pyoaev-1.18.20/pyoaev/helpers.py +451 -0
  49. pyoaev-1.18.20/pyoaev/mixins.py +242 -0
  50. pyoaev-1.18.20/pyoaev/signatures/__init__.py +0 -0
  51. pyoaev-1.18.20/pyoaev/signatures/signature_match.py +12 -0
  52. pyoaev-1.18.20/pyoaev/signatures/signature_type.py +51 -0
  53. pyoaev-1.18.20/pyoaev/signatures/types.py +17 -0
  54. pyoaev-1.18.20/pyoaev/utils.py +211 -0
  55. pyoaev-1.18.20/pyoaev.egg-info/PKG-INFO +134 -0
  56. pyoaev-1.18.20/pyoaev.egg-info/SOURCES.txt +75 -0
  57. pyoaev-1.18.20/pyoaev.egg-info/dependency_links.txt +1 -0
  58. pyoaev-1.18.20/pyoaev.egg-info/requires.txt +34 -0
  59. pyoaev-1.18.20/pyoaev.egg-info/top_level.txt +6 -0
  60. pyoaev-1.18.20/pyproject.toml +96 -0
  61. pyoaev-1.18.20/scripts/release.py +127 -0
  62. pyoaev-1.18.20/setup.cfg +4 -0
  63. pyoaev-1.18.20/test/__init__.py +0 -0
  64. pyoaev-1.18.20/test/apis/__init__.py +0 -0
  65. pyoaev-1.18.20/test/apis/expectation/__init__.py +0 -0
  66. pyoaev-1.18.20/test/apis/expectation/test_expectation.py +338 -0
  67. pyoaev-1.18.20/test/apis/injector_contract/__init__.py +0 -0
  68. pyoaev-1.18.20/test/apis/injector_contract/test_injector_contract.py +58 -0
  69. pyoaev-1.18.20/test/configuration/__init__.py +0 -0
  70. pyoaev-1.18.20/test/configuration/test_configuration.py +257 -0
  71. pyoaev-1.18.20/test/configuration/test_sources.py +69 -0
  72. pyoaev-1.18.20/test/daemons/__init__.py +0 -0
  73. pyoaev-1.18.20/test/daemons/test_base_daemon.py +109 -0
  74. pyoaev-1.18.20/test/daemons/test_collector_daemon.py +39 -0
  75. pyoaev-1.18.20/test/signatures/__init__.py +0 -0
  76. pyoaev-1.18.20/test/signatures/test_signature_match.py +25 -0
  77. pyoaev-1.18.20/test/signatures/test_signature_type.py +57 -0
pyoaev-1.18.20/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyoaev
3
+ Version: 1.18.20
4
+ Summary: Python API client for OpenAEV.
5
+ Author-email: Filigran <contact@filigran.io>
6
+ Maintainer-email: Filigran <contact@filigran.io>
7
+ License: Apache-2.0
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: Information Technology
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Natural Language :: French
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Security
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: datefinder<0.8,>=0.7.3
23
+ Requires-Dist: pika<1.4.0,>=1.3.0
24
+ Requires-Dist: python-magic<0.5,>=0.4.27; sys_platform == "linux" or sys_platform == "darwin"
25
+ Requires-Dist: python-magic-bin<0.5,>=0.4.14; sys_platform == "win32"
26
+ Requires-Dist: python_json_logger<3.4.0,>=3.3.0
27
+ Requires-Dist: PyYAML<6.1,>=6.0
28
+ Requires-Dist: pydantic<2.12.0,>=2.11.3
29
+ Requires-Dist: requests<2.33.0,>=2.32.3
30
+ Requires-Dist: setuptools<80.10.0,>=80.9.0
31
+ Requires-Dist: cachetools<5.6.0,>=5.5.0
32
+ Requires-Dist: prometheus-client<0.23.0,>=0.22.1
33
+ Requires-Dist: opentelemetry-api<1.36.0,>=1.35.0
34
+ Requires-Dist: opentelemetry-sdk<1.36.0,>=1.35.0
35
+ Requires-Dist: requests-toolbelt<1.1.0,>=1.0.0
36
+ Requires-Dist: dataclasses-json<0.7.0,>=0.6.4
37
+ Requires-Dist: thefuzz<0.23,>=0.22
38
+ Provides-Extra: dev
39
+ Requires-Dist: black<25.2.0,>=25.1.0; extra == "dev"
40
+ Requires-Dist: build<1.3.0,>=1.2.1; extra == "dev"
41
+ Requires-Dist: isort<6.1.0,>=6.0.0; extra == "dev"
42
+ Requires-Dist: types-pytz<2025.3.0.0,>=2025.2.0.20250326; extra == "dev"
43
+ Requires-Dist: pre-commit<4.3.0,>=4.2.0; extra == "dev"
44
+ Requires-Dist: types-python-dateutil<2.10.0,>=2.9.0; extra == "dev"
45
+ Requires-Dist: wheel<0.46.0,>=0.45.1; extra == "dev"
46
+ Provides-Extra: doc
47
+ Requires-Dist: autoapi<2.1.0,>=2.0.1; extra == "doc"
48
+ Requires-Dist: sphinx-autodoc-typehints<3.3.0,>=3.2.0; extra == "doc"
49
+ Requires-Dist: sphinx-rtd-theme<3.1.0,>=3.0.2; extra == "doc"
50
+ Dynamic: license-file
51
+
52
+ # OpenAEV client for Python
53
+
54
+ [![Website](https://img.shields.io/badge/website-openaev.io-blue.svg)](https://openaev.io)
55
+ [![CircleCI](https://circleci.com/gh/OpenAEV-Platform/client-python.svg?style=shield)](https://circleci.com/gh/OpenAEV-Platform/client-python/tree/main)
56
+ [![readthedocs](https://readthedocs.org/projects/openaev-client-for-python/badge/?style=flat)](https://openaev-client-for-python.readthedocs.io/en/latest/)
57
+ [![GitHub release](https://img.shields.io/github/release/OpenAEV-Platform/client-python.svg)](https://github.com/OpenAEV-Platform/client-python/releases/latest)
58
+ [![Number of PyPI downloads](https://img.shields.io/pypi/dm/pyoaev.svg)](https://pypi.python.org/pypi/pyoaev/)
59
+ [![Slack Status](https://img.shields.io/badge/slack-3K%2B%20members-4A154B)](https://community.filigran.io)
60
+
61
+ The official OpenAEV Python client helps developers to use the OpenAEV API by providing easy to use methods and utils.
62
+ This client is also used by some OpenAEV components.
63
+
64
+ ## Install
65
+
66
+ To install the latest Python client library, please use `pip`:
67
+
68
+ ```bash
69
+ $ pip3 install pyoaev
70
+ ```
71
+
72
+ ## Local development
73
+
74
+ ```bash
75
+ # Fork the current repository, then clone your fork
76
+ $ git clone https://github.com/YOUR-USERNAME/client-python
77
+ $ cd client-python
78
+ $ git remote add upstream https://github.com/OpenAEV-Platform/client-python.git
79
+ # Create a branch for your feature/fix
80
+ $ git checkout -b [branch-name]
81
+ # Create a virtualenv
82
+ $ python3 -m venv .venv
83
+ $ source .venv/bin/activate
84
+ # Install the client-python and dependencies for the development and the documentation
85
+ $ python3 -m pip install -e .[dev,doc]
86
+ # Set up the git hook scripts
87
+ $ pre-commit install
88
+ # Create your feature/fix
89
+ # Create tests for your changes
90
+ $ python -m unittest
91
+ # Push you feature/fix on Github
92
+ $ git add [file(s)]
93
+ $ git commit -m "[descriptive message]"
94
+ $ git push origin [branch-name]
95
+ # Open a pull request
96
+ ```
97
+
98
+ ### Install the package locally
99
+
100
+ ```bash
101
+ $ pip install -e .
102
+ ```
103
+
104
+ ## Documentation
105
+
106
+ ### Client usage
107
+
108
+ To learn about how to use the OpenAEV Python client and read some examples and cases, refer to [the client documentation](https://openaev-client-for-python.readthedocs.io/en/latest/client_usage/getting_started.html).
109
+
110
+ ### API reference
111
+
112
+ To learn about the methods available for executing queries and retrieving their answers, refer to [the client API Reference](https://openaev-client-for-python.readthedocs.io/en/latest/pyoaev/pyoaev.html).
113
+
114
+ ## Tests
115
+
116
+ The standard `unittest` library is used for running the tests.
117
+
118
+ ```bash
119
+ $ python -m unittest
120
+ ```
121
+
122
+ ## Code Coverage
123
+
124
+ To run the tests and generate a code coverage report:
125
+
126
+ ```bash
127
+ pytest --cov=. tests/
128
+ ```
129
+
130
+ ## About
131
+
132
+ OpenAEV is a product designed and developed by the company [Filigran](https://filigran.io).
133
+
134
+ <a href="https://filigran.io" alt="Filigran"><img src="https://github.com/OpenAEV-Platform/openaev/raw/master/.github/img/logo_filigran.png" width="300" /></a>
@@ -0,0 +1,83 @@
1
+ # OpenAEV client for Python
2
+
3
+ [![Website](https://img.shields.io/badge/website-openaev.io-blue.svg)](https://openaev.io)
4
+ [![CircleCI](https://circleci.com/gh/OpenAEV-Platform/client-python.svg?style=shield)](https://circleci.com/gh/OpenAEV-Platform/client-python/tree/main)
5
+ [![readthedocs](https://readthedocs.org/projects/openaev-client-for-python/badge/?style=flat)](https://openaev-client-for-python.readthedocs.io/en/latest/)
6
+ [![GitHub release](https://img.shields.io/github/release/OpenAEV-Platform/client-python.svg)](https://github.com/OpenAEV-Platform/client-python/releases/latest)
7
+ [![Number of PyPI downloads](https://img.shields.io/pypi/dm/pyoaev.svg)](https://pypi.python.org/pypi/pyoaev/)
8
+ [![Slack Status](https://img.shields.io/badge/slack-3K%2B%20members-4A154B)](https://community.filigran.io)
9
+
10
+ The official OpenAEV Python client helps developers to use the OpenAEV API by providing easy to use methods and utils.
11
+ This client is also used by some OpenAEV components.
12
+
13
+ ## Install
14
+
15
+ To install the latest Python client library, please use `pip`:
16
+
17
+ ```bash
18
+ $ pip3 install pyoaev
19
+ ```
20
+
21
+ ## Local development
22
+
23
+ ```bash
24
+ # Fork the current repository, then clone your fork
25
+ $ git clone https://github.com/YOUR-USERNAME/client-python
26
+ $ cd client-python
27
+ $ git remote add upstream https://github.com/OpenAEV-Platform/client-python.git
28
+ # Create a branch for your feature/fix
29
+ $ git checkout -b [branch-name]
30
+ # Create a virtualenv
31
+ $ python3 -m venv .venv
32
+ $ source .venv/bin/activate
33
+ # Install the client-python and dependencies for the development and the documentation
34
+ $ python3 -m pip install -e .[dev,doc]
35
+ # Set up the git hook scripts
36
+ $ pre-commit install
37
+ # Create your feature/fix
38
+ # Create tests for your changes
39
+ $ python -m unittest
40
+ # Push you feature/fix on Github
41
+ $ git add [file(s)]
42
+ $ git commit -m "[descriptive message]"
43
+ $ git push origin [branch-name]
44
+ # Open a pull request
45
+ ```
46
+
47
+ ### Install the package locally
48
+
49
+ ```bash
50
+ $ pip install -e .
51
+ ```
52
+
53
+ ## Documentation
54
+
55
+ ### Client usage
56
+
57
+ To learn about how to use the OpenAEV Python client and read some examples and cases, refer to [the client documentation](https://openaev-client-for-python.readthedocs.io/en/latest/client_usage/getting_started.html).
58
+
59
+ ### API reference
60
+
61
+ To learn about the methods available for executing queries and retrieving their answers, refer to [the client API Reference](https://openaev-client-for-python.readthedocs.io/en/latest/pyoaev/pyoaev.html).
62
+
63
+ ## Tests
64
+
65
+ The standard `unittest` library is used for running the tests.
66
+
67
+ ```bash
68
+ $ python -m unittest
69
+ ```
70
+
71
+ ## Code Coverage
72
+
73
+ To run the tests and generate a code coverage report:
74
+
75
+ ```bash
76
+ pytest --cov=. tests/
77
+ ```
78
+
79
+ ## About
80
+
81
+ OpenAEV is a product designed and developed by the company [Filigran](https://filigran.io).
82
+
83
+ <a href="https://filigran.io" alt="Filigran"><img src="https://github.com/OpenAEV-Platform/openaev/raw/master/.github/img/logo_filigran.png" width="300" /></a>
@@ -0,0 +1,65 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # This file only contains a selection of the most common options. For a full
4
+ # list see the documentation:
5
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
+
7
+ # -- Path setup --------------------------------------------------------------
8
+
9
+ # If extensions (or modules to document with autodoc) are in another directory,
10
+ # add these directories to sys.path here. If the directory is relative to the
11
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
12
+ #
13
+ import os
14
+ import sys
15
+
16
+ sys.path.insert(0, os.path.abspath(".."))
17
+
18
+
19
+ # -- Project information -----------------------------------------------------
20
+
21
+ project = "OpenAEV client for Python"
22
+ copyright = "2024, Filigran"
23
+ author = "OpenAEV Project"
24
+
25
+ # The full version, including alpha/beta/rc tags
26
+ release = "1.10.1"
27
+
28
+ master_doc = "index"
29
+
30
+ autoapi_modules = {"pyoaev": {"prune": True}}
31
+
32
+ pygments_style = "sphinx"
33
+
34
+ # -- General configuration ---------------------------------------------------
35
+
36
+ # Add any Sphinx extension module names here, as strings. They can be
37
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38
+ # ones.
39
+ extensions = [
40
+ "sphinx.ext.autodoc",
41
+ "sphinx.ext.inheritance_diagram",
42
+ "autoapi.sphinx",
43
+ "sphinx_autodoc_typehints",
44
+ ]
45
+
46
+ # Add any paths that contain templates here, relative to this directory.
47
+ templates_path = ["_templates"]
48
+
49
+ # List of patterns, relative to source directory, that match files and
50
+ # directories to ignore when looking for source files.
51
+ # This pattern also affects html_static_path and html_extra_path.
52
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
53
+
54
+
55
+ # -- Options for HTML output -------------------------------------------------
56
+
57
+ # The theme to use for HTML and HTML Help pages. See the documentation for
58
+ # a list of builtin themes.
59
+ #
60
+ html_theme = "sphinx_rtd_theme"
61
+
62
+ # Add any paths that contain custom static files (such as style sheets) here,
63
+ # relative to this directory. They are copied after the builtin static files,
64
+ # so a file named "default.css" will overwrite the builtin "default.css".
65
+ html_static_path = ["_static"]
@@ -0,0 +1,26 @@
1
+ # -*- coding: utf-8 -*-
2
+ __version__ = "1.18.20"
3
+
4
+ from pyoaev._version import ( # noqa: F401
5
+ __author__,
6
+ __copyright__,
7
+ __email__,
8
+ __license__,
9
+ __title__,
10
+ )
11
+ from pyoaev.client import OpenAEV # noqa: F401
12
+ from pyoaev.configuration import * # noqa: F401,F403,F405
13
+ from pyoaev.contracts import * # noqa: F401,F403,F405
14
+ from pyoaev.exceptions import * # noqa: F401,F403,F405
15
+ from pyoaev.signatures import * # noqa: F401,F403,F405
16
+
17
+ __all__ = [
18
+ "__author__",
19
+ "__copyright__",
20
+ "__email__",
21
+ "__license__",
22
+ "__title__",
23
+ "__version__",
24
+ "OpenAEV",
25
+ ]
26
+ __all__.extend(exceptions.__all__) # noqa: F405
@@ -0,0 +1,6 @@
1
+ __author__ = "Filigran team"
2
+ __copyright__ = "Copyright 2025 Filigran"
3
+ __email__ = "contact@filigran.io"
4
+ __license__ = "Apache 2.0"
5
+ __title__ = "python-openaev"
6
+ __version__ = "1.18.20"
@@ -0,0 +1,20 @@
1
+ from .attack_pattern import * # noqa: F401,F403
2
+ from .collector import * # noqa: F401,F403
3
+ from .cve import * # noqa: F401,F403
4
+ from .document import * # noqa: F401,F403
5
+ from .endpoint import * # noqa: F401,F403
6
+ from .inject import * # noqa: F401,F403
7
+ from .inject_expectation import * # noqa: F401,F403
8
+ from .inject_expectation_trace import * # noqa: F401,F403
9
+ from .injector import * # noqa: F401,F403
10
+ from .injector_contract import * # noqa: F401,F403
11
+ from .kill_chain_phase import * # noqa: F401,F403
12
+ from .me import * # noqa: F401,F403
13
+ from .organization import * # noqa: F401,F403
14
+ from .payload import * # noqa: F401,F403
15
+ from .security_platform import * # noqa: F401,F403
16
+ from .tag import * # noqa: F401,F403
17
+ from .team import * # noqa: F401,F403
18
+ from .user import * # noqa: F401,F403
19
+
20
+ __all__ = [name for name in dir() if not name.startswith("_")]
@@ -0,0 +1,28 @@
1
+ from typing import Any, Dict, List
2
+
3
+ from pyoaev import exceptions as exc
4
+ from pyoaev.base import RESTManager, RESTObject
5
+
6
+
7
+ class AttackPattern(RESTObject):
8
+ _id_attr = "attack_pattern_id"
9
+
10
+
11
+ class AttackPatternManager(RESTManager):
12
+ _path = "/attack_patterns"
13
+ _obj_cls = AttackPattern
14
+
15
+ @exc.on_http_error(exc.OpenAEVUpdateError)
16
+ def upsert(
17
+ self,
18
+ attack_patterns: List[Dict[str, Any]],
19
+ ignore_dependencies: bool = False,
20
+ **kwargs: Any,
21
+ ) -> Dict[str, Any]:
22
+ data = {
23
+ "attack_patterns": attack_patterns,
24
+ "ignore_dependencies": ignore_dependencies,
25
+ }
26
+ path = f"{self.path}/upsert"
27
+ result = self.openaev.http_post(path, post_data=data, **kwargs)
28
+ return result
@@ -0,0 +1,29 @@
1
+ from typing import Any, Dict
2
+
3
+ from pyoaev import exceptions as exc
4
+ from pyoaev.base import RESTManager, RESTObject
5
+ from pyoaev.mixins import CreateMixin, GetMixin, ListMixin, UpdateMixin
6
+ from pyoaev.utils import RequiredOptional
7
+
8
+
9
+ class Collector(RESTObject):
10
+ pass
11
+
12
+
13
+ class CollectorManager(GetMixin, ListMixin, CreateMixin, UpdateMixin, RESTManager):
14
+ _path = "/collectors"
15
+ _obj_cls = Collector
16
+ _create_attrs = RequiredOptional(
17
+ required=(
18
+ "collector_id",
19
+ "collector_name",
20
+ "collector_type",
21
+ "collector_period",
22
+ )
23
+ )
24
+
25
+ @exc.on_http_error(exc.OpenAEVUpdateError)
26
+ def get(self, collector_id: str, **kwargs: Any) -> Dict[str, Any]:
27
+ path = f"{self.path}/" + collector_id
28
+ result = self.openaev.http_get(path, **kwargs)
29
+ return result
@@ -0,0 +1,18 @@
1
+ from typing import Any, Dict
2
+
3
+ from pyoaev import exceptions as exc
4
+ from pyoaev.base import RESTManager, RESTObject
5
+
6
+
7
+ class Cve(RESTObject):
8
+ _id_attr = "cve_id"
9
+
10
+
11
+ class CveManager(RESTManager):
12
+ _path = "/cves"
13
+
14
+ @exc.on_http_error(exc.OpenAEVUpdateError)
15
+ def upsert(self, data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]:
16
+ path = f"{self.path}/bulk"
17
+ result = self.openaev.http_post(path, post_data=data, **kwargs)
18
+ return result
@@ -0,0 +1,29 @@
1
+ from typing import Any, Dict
2
+
3
+ from pyoaev import exceptions as exc
4
+ from pyoaev.base import RESTManager, RESTObject
5
+
6
+
7
+ class Document(RESTObject):
8
+ _id_attr = "document_id"
9
+
10
+
11
+ class DocumentManager(RESTManager):
12
+ _path = "/documents"
13
+ _obj_cls = Document
14
+
15
+ @exc.on_http_error(exc.OpenAEVUpdateError)
16
+ def download(self, document_id: str, **kwargs: Any) -> Dict[str, Any]:
17
+ path = f"{self.path}/" + document_id + "/file"
18
+ result = self.openaev.http_get(path, **kwargs)
19
+ return result
20
+
21
+ @exc.on_http_error(exc.OpenAEVUpdateError)
22
+ def upsert(
23
+ self, document: Dict[str, Any], file: tuple, **kwargs: Any
24
+ ) -> Dict[str, Any]:
25
+ path = f"{self.path}/upsert"
26
+ result = self.openaev.http_post(
27
+ path, post_data=document, files={"file": file}, **kwargs
28
+ )
29
+ return result