zarqa 0.1.0b0__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 (115) hide show
  1. zarqa-0.1.0b0/LICENSE +202 -0
  2. zarqa-0.1.0b0/NOTICE +17 -0
  3. zarqa-0.1.0b0/PKG-INFO +164 -0
  4. zarqa-0.1.0b0/README.md +105 -0
  5. zarqa-0.1.0b0/pyproject.toml +72 -0
  6. zarqa-0.1.0b0/setup.cfg +4 -0
  7. zarqa-0.1.0b0/tests/test_brand.py +117 -0
  8. zarqa-0.1.0b0/tests/test_bridges.py +289 -0
  9. zarqa-0.1.0b0/tests/test_cli.py +52 -0
  10. zarqa-0.1.0b0/tests/test_config.py +66 -0
  11. zarqa-0.1.0b0/tests/test_connectors.py +296 -0
  12. zarqa-0.1.0b0/tests/test_db.py +130 -0
  13. zarqa-0.1.0b0/tests/test_demo_reports.py +59 -0
  14. zarqa-0.1.0b0/tests/test_enrich_relevance.py +200 -0
  15. zarqa-0.1.0b0/tests/test_gemini.py +100 -0
  16. zarqa-0.1.0b0/tests/test_icons.py +30 -0
  17. zarqa-0.1.0b0/tests/test_intel.py +402 -0
  18. zarqa-0.1.0b0/tests/test_investigate.py +195 -0
  19. zarqa-0.1.0b0/tests/test_jobs.py +42 -0
  20. zarqa-0.1.0b0/tests/test_oauth.py +112 -0
  21. zarqa-0.1.0b0/tests/test_providers.py +149 -0
  22. zarqa-0.1.0b0/tests/test_providers_ollama.py +57 -0
  23. zarqa-0.1.0b0/tests/test_share.py +172 -0
  24. zarqa-0.1.0b0/tests/test_tasks.py +19 -0
  25. zarqa-0.1.0b0/tests/test_version.py +25 -0
  26. zarqa-0.1.0b0/tests/test_web.py +96 -0
  27. zarqa-0.1.0b0/zarqa/__init__.py +3 -0
  28. zarqa-0.1.0b0/zarqa/__main__.py +3 -0
  29. zarqa-0.1.0b0/zarqa/access.py +137 -0
  30. zarqa-0.1.0b0/zarqa/auth.py +438 -0
  31. zarqa-0.1.0b0/zarqa/brand/__init__.py +1 -0
  32. zarqa-0.1.0b0/zarqa/brand/permute.py +130 -0
  33. zarqa-0.1.0b0/zarqa/brand/watch.py +320 -0
  34. zarqa-0.1.0b0/zarqa/bridges/__init__.py +17 -0
  35. zarqa-0.1.0b0/zarqa/bridges/common.py +148 -0
  36. zarqa-0.1.0b0/zarqa/bridges/openapi.py +169 -0
  37. zarqa-0.1.0b0/zarqa/bridges/server.py +109 -0
  38. zarqa-0.1.0b0/zarqa/bridges/taxii.py +185 -0
  39. zarqa-0.1.0b0/zarqa/bridges/web.py +109 -0
  40. zarqa-0.1.0b0/zarqa/cli.py +524 -0
  41. zarqa-0.1.0b0/zarqa/collect/__init__.py +1 -0
  42. zarqa-0.1.0b0/zarqa/collect/collector.py +326 -0
  43. zarqa-0.1.0b0/zarqa/collect/fetch.py +187 -0
  44. zarqa-0.1.0b0/zarqa/collect/stix_in.py +125 -0
  45. zarqa-0.1.0b0/zarqa/config.example.yaml +227 -0
  46. zarqa-0.1.0b0/zarqa/config.py +341 -0
  47. zarqa-0.1.0b0/zarqa/connectors/__init__.py +6 -0
  48. zarqa-0.1.0b0/zarqa/connectors/audit.py +131 -0
  49. zarqa-0.1.0b0/zarqa/connectors/client.py +294 -0
  50. zarqa-0.1.0b0/zarqa/connectors/hub.py +293 -0
  51. zarqa-0.1.0b0/zarqa/connectors/oauth.py +237 -0
  52. zarqa-0.1.0b0/zarqa/connectors/policy.py +115 -0
  53. zarqa-0.1.0b0/zarqa/connectors/ratelimit.py +26 -0
  54. zarqa-0.1.0b0/zarqa/connectors/spec.py +184 -0
  55. zarqa-0.1.0b0/zarqa/connectors/untrusted.py +29 -0
  56. zarqa-0.1.0b0/zarqa/db.py +341 -0
  57. zarqa-0.1.0b0/zarqa/decode.py +150 -0
  58. zarqa-0.1.0b0/zarqa/demo/__init__.py +1 -0
  59. zarqa-0.1.0b0/zarqa/demo/data.py +47 -0
  60. zarqa-0.1.0b0/zarqa/demo/setup.py +70 -0
  61. zarqa-0.1.0b0/zarqa/doctor.py +127 -0
  62. zarqa-0.1.0b0/zarqa/intel/attack.py +111 -0
  63. zarqa-0.1.0b0/zarqa/intel/attack_data.json +1 -0
  64. zarqa-0.1.0b0/zarqa/intel/enrich.py +256 -0
  65. zarqa-0.1.0b0/zarqa/intel/extract.py +230 -0
  66. zarqa-0.1.0b0/zarqa/intel/injection.py +111 -0
  67. zarqa-0.1.0b0/zarqa/intel/model_extract.py +227 -0
  68. zarqa-0.1.0b0/zarqa/intel/pipeline.py +134 -0
  69. zarqa-0.1.0b0/zarqa/intel/relevance.py +175 -0
  70. zarqa-0.1.0b0/zarqa/intel/service.py +83 -0
  71. zarqa-0.1.0b0/zarqa/intel/store.py +441 -0
  72. zarqa-0.1.0b0/zarqa/investigate/__init__.py +1 -0
  73. zarqa-0.1.0b0/zarqa/investigate/engine.py +237 -0
  74. zarqa-0.1.0b0/zarqa/investigate/service.py +31 -0
  75. zarqa-0.1.0b0/zarqa/investigate/store.py +92 -0
  76. zarqa-0.1.0b0/zarqa/investigate/tools.py +120 -0
  77. zarqa-0.1.0b0/zarqa/jobs.py +358 -0
  78. zarqa-0.1.0b0/zarqa/jsonparse.py +75 -0
  79. zarqa-0.1.0b0/zarqa/llm.py +28 -0
  80. zarqa-0.1.0b0/zarqa/mcp_server.py +104 -0
  81. zarqa-0.1.0b0/zarqa/paths.py +26 -0
  82. zarqa-0.1.0b0/zarqa/privacy.py +210 -0
  83. zarqa-0.1.0b0/zarqa/providers/__init__.py +193 -0
  84. zarqa-0.1.0b0/zarqa/providers/anthropic.py +65 -0
  85. zarqa-0.1.0b0/zarqa/providers/base.py +141 -0
  86. zarqa-0.1.0b0/zarqa/providers/cli.py +86 -0
  87. zarqa-0.1.0b0/zarqa/providers/demo.py +101 -0
  88. zarqa-0.1.0b0/zarqa/providers/gemini.py +230 -0
  89. zarqa-0.1.0b0/zarqa/providers/ollama.py +78 -0
  90. zarqa-0.1.0b0/zarqa/providers/openai_compat.py +87 -0
  91. zarqa-0.1.0b0/zarqa/reporting.py +162 -0
  92. zarqa-0.1.0b0/zarqa/scheduler.py +60 -0
  93. zarqa-0.1.0b0/zarqa/server.py +81 -0
  94. zarqa-0.1.0b0/zarqa/share/__init__.py +1 -0
  95. zarqa-0.1.0b0/zarqa/share/misp.py +63 -0
  96. zarqa-0.1.0b0/zarqa/share/push.py +74 -0
  97. zarqa-0.1.0b0/zarqa/share/stix_out.py +187 -0
  98. zarqa-0.1.0b0/zarqa/share/taxii_server.py +115 -0
  99. zarqa-0.1.0b0/zarqa/static/app.css +67 -0
  100. zarqa-0.1.0b0/zarqa/static/app.js +447 -0
  101. zarqa-0.1.0b0/zarqa/static/img/logo.svg +16 -0
  102. zarqa-0.1.0b0/zarqa/static/mdi/LICENSE +20 -0
  103. zarqa-0.1.0b0/zarqa/static/mdi/README.md +5 -0
  104. zarqa-0.1.0b0/zarqa/static/mdi/css/icons.css +71 -0
  105. zarqa-0.1.0b0/zarqa/static/mdi/fonts/icons.woff2 +0 -0
  106. zarqa-0.1.0b0/zarqa/tasks.py +70 -0
  107. zarqa-0.1.0b0/zarqa/templates/index.html +31 -0
  108. zarqa-0.1.0b0/zarqa/templates/login.html +19 -0
  109. zarqa-0.1.0b0/zarqa/web.py +495 -0
  110. zarqa-0.1.0b0/zarqa.egg-info/PKG-INFO +164 -0
  111. zarqa-0.1.0b0/zarqa.egg-info/SOURCES.txt +113 -0
  112. zarqa-0.1.0b0/zarqa.egg-info/dependency_links.txt +1 -0
  113. zarqa-0.1.0b0/zarqa.egg-info/entry_points.txt +2 -0
  114. zarqa-0.1.0b0/zarqa.egg-info/requires.txt +40 -0
  115. zarqa-0.1.0b0/zarqa.egg-info/top_level.txt +1 -0
zarqa-0.1.0b0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
zarqa-0.1.0b0/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ Zarqa
2
+ Copyright 2026 ares-369
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Zarqa collects public information from the internet and reads from the intel
11
+ sources you connect to it. Use it only with sources and data you are authorized
12
+ to access, and follow each source's terms of use. It is provided "AS IS", without
13
+ warranty of any kind (sections 7 and 8 of the License). Its read-only defaults,
14
+ tool allow/deny lists and audit log are safety aids, not a guarantee.
15
+
16
+ Bundled third-party assets:
17
+ * Material Design Icons webfont (zarqa/static/mdi) - see its LICENSE file.
zarqa-0.1.0b0/PKG-INFO ADDED
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.4
2
+ Name: zarqa
3
+ Version: 0.1.0b0
4
+ Summary: Open-source, AI-powered threat intelligence tool (beta)
5
+ Author: ares-369
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/ares-369/zarqa
8
+ Project-URL: Repository, https://github.com/ares-369/zarqa
9
+ Project-URL: Documentation, https://github.com/ares-369/zarqa/tree/main/docs
10
+ Project-URL: Issues, https://github.com/ares-369/zarqa/issues
11
+ Project-URL: Changelog, https://github.com/ares-369/zarqa/blob/main/CHANGELOG.md
12
+ Keywords: security,threat-intelligence,cti,osint,stix,mcp,llm
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Security
19
+ Classifier: Environment :: Console
20
+ Classifier: Environment :: Web Environment
21
+ Classifier: Intended Audience :: Information Technology
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ License-File: NOTICE
27
+ Requires-Dist: flask>=3.0
28
+ Requires-Dist: waitress>=3.0
29
+ Requires-Dist: requests>=2.31
30
+ Requires-Dist: PyYAML>=6.0
31
+ Requires-Dist: python-dotenv>=1.0
32
+ Provides-Extra: anthropic
33
+ Requires-Dist: anthropic>=0.40; extra == "anthropic"
34
+ Provides-Extra: gemini
35
+ Requires-Dist: google-genai>=0.3; extra == "gemini"
36
+ Provides-Extra: openai
37
+ Requires-Dist: openai>=1.40; extra == "openai"
38
+ Provides-Extra: oidc
39
+ Requires-Dist: authlib>=1.3; extra == "oidc"
40
+ Provides-Extra: pdf
41
+ Requires-Dist: pypdf>=4; extra == "pdf"
42
+ Provides-Extra: dns
43
+ Requires-Dist: dnspython>=2.4; extra == "dns"
44
+ Provides-Extra: postgres
45
+ Requires-Dist: psycopg[binary]>=3.1; extra == "postgres"
46
+ Requires-Dist: psycopg-pool>=3.2; extra == "postgres"
47
+ Provides-Extra: all
48
+ Requires-Dist: anthropic>=0.40; extra == "all"
49
+ Requires-Dist: google-genai>=0.3; extra == "all"
50
+ Requires-Dist: openai>=1.40; extra == "all"
51
+ Requires-Dist: authlib>=1.3; extra == "all"
52
+ Requires-Dist: pypdf>=4; extra == "all"
53
+ Requires-Dist: dnspython>=2.4; extra == "all"
54
+ Provides-Extra: dev
55
+ Requires-Dist: pytest>=8; extra == "dev"
56
+ Requires-Dist: ruff>=0.6; extra == "dev"
57
+ Requires-Dist: pypdf>=4; extra == "dev"
58
+ Dynamic: license-file
59
+
60
+ <p align="center"><img src="docs/img/logo.svg" width="120" alt="Zarqa logo"></p>
61
+
62
+ # Zarqa
63
+
64
+ [![CI](https://github.com/ares-369/zarqa/actions/workflows/ci.yml/badge.svg)](https://github.com/ares-369/zarqa/actions/workflows/ci.yml)
65
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
66
+ [![Python 3.10–3.12](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)](pyproject.toml)
67
+ [![PyPI](https://img.shields.io/pypi/v/zarqa.svg)](https://pypi.org/project/zarqa/)
68
+ [![Release](https://img.shields.io/github/v/release/ares-369/zarqa?include_prereleases&sort=semver)](https://github.com/ares-369/zarqa/releases)
69
+
70
+ **An open-source, AI-powered threat intelligence tool.** Zarqa collects intel from the internet and
71
+ from the threat intel platforms you already use, turns it into structured, sourced intel, ranks it by
72
+ how much it matters to your organization, and answers questions about it with cited evidence.
73
+
74
+ It is not a replacement for anything. It works next to your existing platforms, reads from them, and
75
+ can send what it finds back to them in standard formats.
76
+
77
+ Named after Zarqa al-Yamama, who in Arabian legend could see an army coming days before it arrived.
78
+
79
+ > **Beta, solo-maintained.** Collection, extraction, enrichment, relevance ranking,
80
+ > investigations, brand watch, sharing, reports and the connector layer work and are tested. First
81
+ > benchmark: [benchmarks](docs/benchmarks.md) (without a model it is precise but misses most names and
82
+ > techniques; a small local model adds little). See the
83
+ > [roadmap](docs/roadmap.md).
84
+
85
+ ## What works today
86
+
87
+ - **Collect from the internet and from other platforms.** RSS/Atom feeds (with the full article), pages,
88
+ PDFs, indicator lists (text, CSV, JSON, STIX), and pulls from other intel platforms through MCP
89
+ connectors or the built-in STIX/TAXII 2.1 and REST bridges. On a schedule, or by hand.
90
+ ([collection](docs/collection.md))
91
+ - **Turn text into structured intel you can check.** Indicators (defanged or not), CVEs, ATT&CK techniques,
92
+ threat actors, malware, tools, campaigns and targets, and the relations between them. Each one links to
93
+ the sentence it came from and says how it was found. ([extraction](docs/extraction.md))
94
+ - **Models are checked, not trusted.** The extractor model must quote the document for every item; items
95
+ whose quote is not in the text are dropped, and a model can label indicators but never add one. Rules
96
+ and ATT&CK names work with no model at all.
97
+ - **Aliases resolved.** "Fancy Bear", "Sednit" and "Forest Blizzard" are one actor (APT28), from MITRE
98
+ ATT&CK data shipped with Zarqa.
99
+ - **Ranked for you.** Describe your organization and your intelligence requirements; every report gets a
100
+ 0-100 score with the reasons (your products named, your sector targeted, known-exploited CVEs, a
101
+ requirement answered). ([relevance](docs/relevance.md))
102
+ - **Ask, and get a cited answer.** "What do we know about this IP?" The analyst model searches the store and
103
+ your connectors; every finding cites its evidence, unsupported claims are set aside, and "not enough data"
104
+ is an allowed answer. ([investigations](docs/investigations.md))
105
+ - **Brand watch.** Lookalikes of your domains, resolved and checked: how new they are, whether the page uses
106
+ your name or asks for a password, or is parked. Scored and tracked with a status. ([brand](docs/brand.md))
107
+ - **Enrichment on request.** Connectors declare their lookups; built-in EPSS and RDAP are opt-in and never
108
+ sent your own or internal values. ([enrichment](docs/enrichment.md))
109
+ - **Shares in standard formats.** STIX 2.1 and MISP-format exports, a read-only TAXII 2.1 server, pushes to
110
+ other platforms that a person starts, and an MCP server so other agents can ask Zarqa.
111
+ ([sharing](docs/sharing.md))
112
+ - **A brief.** What came in over a day or a week, most relevant first, with new names, indicators,
113
+ known-exploited CVEs, lookalikes and investigations; Markdown or HTML. `zarqa brief`.
114
+ - **Connectors, read-only by default.** Writes to another platform go only through a sharing connector
115
+ with the exact tool allowed, never from a model, always audited. ([connectors](docs/connectors.md))
116
+ - **Any model.** Local models through Ollama, or cloud providers, per role. Prompts to cloud models are
117
+ masked (emails, private IPs, user names and your own terms).
118
+
119
+ ## Screenshots
120
+
121
+ From the offline demo (fictional data).
122
+
123
+ | A report: what was found, with the sentence each came from | An investigation: every finding cites its evidence |
124
+ |---|---|
125
+ | ![document](docs/screenshots/document.png) | ![investigation](docs/screenshots/investigation.png) |
126
+ | **An actor: where it was seen, relations, what ATT&CK knows** | **Brand watch: lookalikes scored and tracked** |
127
+ | ![entity](docs/screenshots/entity.png) | ![brand](docs/screenshots/brand.png) |
128
+
129
+ ## Planned
130
+
131
+ A benchmark with a stronger model; registrant comparison in the brand watch; separate worker processes.
132
+
133
+ ## Try it
134
+
135
+ Offline, with fictional sample data and no model: `zarqa demo --run`, then
136
+ `ZARQA_HOME=~/.zarqa-demo zarqa serve` ([demo](docs/demo.md)). Or `docker compose --profile demo up demo`.
137
+
138
+ ```bash
139
+ pipx install zarqa # or: pip install zarqa (extras: zarqa[all])
140
+ zarqa init # config.yaml, .env (mode 600) and data/ in the home folder
141
+ zarqa doctor # checks the setup and says what to fix
142
+ zarqa serve # http://127.0.0.1:8621
143
+
144
+ zarqa add --url https://... # a report, extracted straight away
145
+ zarqa sources pull # pull every source in config.yaml now
146
+ zarqa lookup 203.0.113.66 # everything known about a value, with the sentences
147
+ zarqa ask "What do we know about 203.0.113.66?"
148
+ ```
149
+
150
+ Docker: `docker compose up -d` (non-root, read-only container, loopback port).
151
+
152
+ ## Configuration
153
+
154
+ `config.example.yaml` documents every setting. Secrets go in `.env` only. Login modes: none
155
+ (loopback only), basic, local, OIDC and reverse-proxy headers, with viewer, operator and admin roles.
156
+ The server refuses to listen on a network address without a login.
157
+
158
+ ## Project
159
+
160
+ - Licence: Apache-2.0. No paid edition.
161
+ - [SECURITY.md](SECURITY.md) for reporting vulnerabilities.
162
+ - [CONTRIBUTING.md](CONTRIBUTING.md) for running the tests.
163
+ - [docs/project-standard.md](docs/project-standard.md): the rules this project shares with its sibling
164
+ projects.
@@ -0,0 +1,105 @@
1
+ <p align="center"><img src="docs/img/logo.svg" width="120" alt="Zarqa logo"></p>
2
+
3
+ # Zarqa
4
+
5
+ [![CI](https://github.com/ares-369/zarqa/actions/workflows/ci.yml/badge.svg)](https://github.com/ares-369/zarqa/actions/workflows/ci.yml)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
7
+ [![Python 3.10–3.12](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)](pyproject.toml)
8
+ [![PyPI](https://img.shields.io/pypi/v/zarqa.svg)](https://pypi.org/project/zarqa/)
9
+ [![Release](https://img.shields.io/github/v/release/ares-369/zarqa?include_prereleases&sort=semver)](https://github.com/ares-369/zarqa/releases)
10
+
11
+ **An open-source, AI-powered threat intelligence tool.** Zarqa collects intel from the internet and
12
+ from the threat intel platforms you already use, turns it into structured, sourced intel, ranks it by
13
+ how much it matters to your organization, and answers questions about it with cited evidence.
14
+
15
+ It is not a replacement for anything. It works next to your existing platforms, reads from them, and
16
+ can send what it finds back to them in standard formats.
17
+
18
+ Named after Zarqa al-Yamama, who in Arabian legend could see an army coming days before it arrived.
19
+
20
+ > **Beta, solo-maintained.** Collection, extraction, enrichment, relevance ranking,
21
+ > investigations, brand watch, sharing, reports and the connector layer work and are tested. First
22
+ > benchmark: [benchmarks](docs/benchmarks.md) (without a model it is precise but misses most names and
23
+ > techniques; a small local model adds little). See the
24
+ > [roadmap](docs/roadmap.md).
25
+
26
+ ## What works today
27
+
28
+ - **Collect from the internet and from other platforms.** RSS/Atom feeds (with the full article), pages,
29
+ PDFs, indicator lists (text, CSV, JSON, STIX), and pulls from other intel platforms through MCP
30
+ connectors or the built-in STIX/TAXII 2.1 and REST bridges. On a schedule, or by hand.
31
+ ([collection](docs/collection.md))
32
+ - **Turn text into structured intel you can check.** Indicators (defanged or not), CVEs, ATT&CK techniques,
33
+ threat actors, malware, tools, campaigns and targets, and the relations between them. Each one links to
34
+ the sentence it came from and says how it was found. ([extraction](docs/extraction.md))
35
+ - **Models are checked, not trusted.** The extractor model must quote the document for every item; items
36
+ whose quote is not in the text are dropped, and a model can label indicators but never add one. Rules
37
+ and ATT&CK names work with no model at all.
38
+ - **Aliases resolved.** "Fancy Bear", "Sednit" and "Forest Blizzard" are one actor (APT28), from MITRE
39
+ ATT&CK data shipped with Zarqa.
40
+ - **Ranked for you.** Describe your organization and your intelligence requirements; every report gets a
41
+ 0-100 score with the reasons (your products named, your sector targeted, known-exploited CVEs, a
42
+ requirement answered). ([relevance](docs/relevance.md))
43
+ - **Ask, and get a cited answer.** "What do we know about this IP?" The analyst model searches the store and
44
+ your connectors; every finding cites its evidence, unsupported claims are set aside, and "not enough data"
45
+ is an allowed answer. ([investigations](docs/investigations.md))
46
+ - **Brand watch.** Lookalikes of your domains, resolved and checked: how new they are, whether the page uses
47
+ your name or asks for a password, or is parked. Scored and tracked with a status. ([brand](docs/brand.md))
48
+ - **Enrichment on request.** Connectors declare their lookups; built-in EPSS and RDAP are opt-in and never
49
+ sent your own or internal values. ([enrichment](docs/enrichment.md))
50
+ - **Shares in standard formats.** STIX 2.1 and MISP-format exports, a read-only TAXII 2.1 server, pushes to
51
+ other platforms that a person starts, and an MCP server so other agents can ask Zarqa.
52
+ ([sharing](docs/sharing.md))
53
+ - **A brief.** What came in over a day or a week, most relevant first, with new names, indicators,
54
+ known-exploited CVEs, lookalikes and investigations; Markdown or HTML. `zarqa brief`.
55
+ - **Connectors, read-only by default.** Writes to another platform go only through a sharing connector
56
+ with the exact tool allowed, never from a model, always audited. ([connectors](docs/connectors.md))
57
+ - **Any model.** Local models through Ollama, or cloud providers, per role. Prompts to cloud models are
58
+ masked (emails, private IPs, user names and your own terms).
59
+
60
+ ## Screenshots
61
+
62
+ From the offline demo (fictional data).
63
+
64
+ | A report: what was found, with the sentence each came from | An investigation: every finding cites its evidence |
65
+ |---|---|
66
+ | ![document](docs/screenshots/document.png) | ![investigation](docs/screenshots/investigation.png) |
67
+ | **An actor: where it was seen, relations, what ATT&CK knows** | **Brand watch: lookalikes scored and tracked** |
68
+ | ![entity](docs/screenshots/entity.png) | ![brand](docs/screenshots/brand.png) |
69
+
70
+ ## Planned
71
+
72
+ A benchmark with a stronger model; registrant comparison in the brand watch; separate worker processes.
73
+
74
+ ## Try it
75
+
76
+ Offline, with fictional sample data and no model: `zarqa demo --run`, then
77
+ `ZARQA_HOME=~/.zarqa-demo zarqa serve` ([demo](docs/demo.md)). Or `docker compose --profile demo up demo`.
78
+
79
+ ```bash
80
+ pipx install zarqa # or: pip install zarqa (extras: zarqa[all])
81
+ zarqa init # config.yaml, .env (mode 600) and data/ in the home folder
82
+ zarqa doctor # checks the setup and says what to fix
83
+ zarqa serve # http://127.0.0.1:8621
84
+
85
+ zarqa add --url https://... # a report, extracted straight away
86
+ zarqa sources pull # pull every source in config.yaml now
87
+ zarqa lookup 203.0.113.66 # everything known about a value, with the sentences
88
+ zarqa ask "What do we know about 203.0.113.66?"
89
+ ```
90
+
91
+ Docker: `docker compose up -d` (non-root, read-only container, loopback port).
92
+
93
+ ## Configuration
94
+
95
+ `config.example.yaml` documents every setting. Secrets go in `.env` only. Login modes: none
96
+ (loopback only), basic, local, OIDC and reverse-proxy headers, with viewer, operator and admin roles.
97
+ The server refuses to listen on a network address without a login.
98
+
99
+ ## Project
100
+
101
+ - Licence: Apache-2.0. No paid edition.
102
+ - [SECURITY.md](SECURITY.md) for reporting vulnerabilities.
103
+ - [CONTRIBUTING.md](CONTRIBUTING.md) for running the tests.
104
+ - [docs/project-standard.md](docs/project-standard.md): the rules this project shares with its sibling
105
+ projects.
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "zarqa"
7
+ version = "0.1.0b0"
8
+ description = "Open-source, AI-powered threat intelligence tool (beta)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE", "NOTICE"]
13
+ authors = [{ name = "ares-369" }]
14
+ keywords = ["security", "threat-intelligence", "cti", "osint", "stix", "mcp", "llm"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Security",
22
+ "Environment :: Console",
23
+ "Environment :: Web Environment",
24
+ "Intended Audience :: Information Technology",
25
+ "Operating System :: OS Independent",
26
+ ]
27
+ dependencies = [
28
+ "flask>=3.0",
29
+ "waitress>=3.0",
30
+ "requests>=2.31",
31
+ "PyYAML>=6.0",
32
+ "python-dotenv>=1.0",
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/ares-369/zarqa"
37
+ Repository = "https://github.com/ares-369/zarqa"
38
+ Documentation = "https://github.com/ares-369/zarqa/tree/main/docs"
39
+ Issues = "https://github.com/ares-369/zarqa/issues"
40
+ Changelog = "https://github.com/ares-369/zarqa/blob/main/CHANGELOG.md"
41
+
42
+ [project.optional-dependencies]
43
+ anthropic = ["anthropic>=0.40"]
44
+ gemini = ["google-genai>=0.3"]
45
+ openai = ["openai>=1.40"]
46
+ oidc = ["authlib>=1.3"]
47
+ pdf = ["pypdf>=4"]
48
+ dns = ["dnspython>=2.4"]
49
+ postgres = ["psycopg[binary]>=3.1", "psycopg-pool>=3.2"]
50
+ all = ["anthropic>=0.40", "google-genai>=0.3", "openai>=1.40", "authlib>=1.3", "pypdf>=4", "dnspython>=2.4"]
51
+ dev = ["pytest>=8", "ruff>=0.6", "pypdf>=4"]
52
+
53
+ [project.scripts]
54
+ zarqa = "zarqa.cli:cli_main"
55
+
56
+ [tool.setuptools.packages.find]
57
+ include = ["zarqa*"]
58
+
59
+ [tool.setuptools.package-data]
60
+ zarqa = ["templates/*.html", "static/**/*", "config.example.yaml", "intel/*.json"]
61
+
62
+ [tool.pytest.ini_options]
63
+ testpaths = ["tests"]
64
+ pythonpath = ["."]
65
+
66
+ [tool.ruff]
67
+ target-version = "py310"
68
+ line-length = 120
69
+
70
+ [tool.ruff.lint]
71
+ select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
72
+ ignore = ["E501", "SIM105", "SIM108", "RUF012"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+