txt2stix 1.0.7__py3-none-any.whl → 1.0.8__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.
txt2stix/attack_flow.py CHANGED
@@ -147,7 +147,7 @@ def get_techniques_from_extracted_objects(objects: dict, tactics: dict):
147
147
  return techniques
148
148
 
149
149
 
150
- def create_navigator_layer(report, summary, flow: AttackFlowList, techniques):
150
+ def create_navigator_layer(report, summary, flow: AttackFlowList, techniques, tactics):
151
151
  domains = {}
152
152
  comments = {item.attack_technique_id: item.description for item in flow.items}
153
153
  for technique in techniques.values():
@@ -170,7 +170,11 @@ def create_navigator_layer(report, summary, flow: AttackFlowList, techniques):
170
170
  for domain, domain_techniques in domains.items():
171
171
  retval.append(
172
172
  {
173
- "version": "4.5",
173
+ "versions": {
174
+ "layer": "4.5",
175
+ "attack": tactics[domain]['version'],
176
+ "navigator": "5.1.0"
177
+ },
174
178
  "name": report.name,
175
179
  "domain": domain,
176
180
  "description": summary,
@@ -220,6 +224,6 @@ def extract_attack_flow_and_navigator(
220
224
 
221
225
  if ai_create_attack_navigator_layer:
222
226
  navigator = create_navigator_layer(
223
- bundler.report, bundler.summary, flow, techniques
227
+ bundler.report, bundler.summary, flow, techniques, tactics
224
228
  )
225
229
  return flow, navigator
txt2stix/retriever.py CHANGED
@@ -28,8 +28,9 @@ class STIXObjectRetriever:
28
28
 
29
29
  def get_attack_tactics(self, matrix):
30
30
  endpoint = urljoin(self.api_root, f"v1/attack-{matrix}/objects/?attack_type=Tactic")
31
+ version_url = urljoin(self.api_root, f'v1/attack-{matrix}/versions/installed/')
31
32
  tactics = self._retrieve_objects(endpoint)
32
- retval = {}
33
+ retval = dict(version=self.session.get(version_url).json()['latest'])
33
34
  for tac in tactics:
34
35
  retval[tac['x_mitre_shortname']] = tac
35
36
  retval[tac['external_references'][0]['external_id']] = tac
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2stix
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: txt2stix is a Python script that is designed to identify and extract IoCs and TTPs from text files, identify the relationships between them, convert them to STIX 2.1 objects, and output as a STIX 2.1 bundle.
5
5
  Project-URL: Homepage, https://github.com/muchdogesec/txt2stix
6
6
  Project-URL: Issues, https://github.com/muchdogesec/txt2stix/issues
@@ -1,12 +1,12 @@
1
1
  txt2stix/__init__.py,sha256=Sm_VT913IFuAZ6dJEdVz3baPwC5VYtHySVfBAOUG92w,803
2
- txt2stix/attack_flow.py,sha256=WnhihbY_ltWOXrmzigTHIwj1pzSIQqKpu2sPe2M465k,8489
2
+ txt2stix/attack_flow.py,sha256=cAcoqzRzzUYhSFiq_7MyKFcCllG1zqrd2RZKTY1fKp8,8657
3
3
  txt2stix/bundler.py,sha256=kqUNW9_jktuMyWSkoAa-ydZY-L5gzSSkthb7OdhUiKo,16854
4
4
  txt2stix/common.py,sha256=ISnGNKqJPE1EcfhL-x_4G18mcwt1urmorkW-ru9kV-0,585
5
5
  txt2stix/credential_checker.py,sha256=eWDP-jY3-jm8zI0JMoUcyoQZ_JqPNfCIr_HAO8nVYz0,3044
6
6
  txt2stix/extractions.py,sha256=_tlsqYHhfAoV-PJzxRHysrX47uxCsMlSg7PQWxww1u0,2171
7
7
  txt2stix/indicator.py,sha256=c6S0xx0K8JM-PT_Qd1PlN_ZlDXdnEwiRS8529iUp3yg,30774
8
8
  txt2stix/lookups.py,sha256=h42YVtYUkWZm6ZPv2h5hHDHDzDs3yBqrT_T7pj2MDZI,2301
9
- txt2stix/retriever.py,sha256=JHR_bzj442-BZSc1FAE7zMisP-n--Ax54P_JclIVTsQ,5583
9
+ txt2stix/retriever.py,sha256=biRSRwYsZoSvR758y4OFONjfrEMcxgj1PLHFLFydoSU,5729
10
10
  txt2stix/stix.py,sha256=9nXD9a2dCY4uaatl-mlIA1k3srwQBhGW-tUSho3iYe0,30
11
11
  txt2stix/txt2stix.py,sha256=b16h8BCSerZrq7PWjXkUZB4WXkDCUDMru1LDJeIXCHo,18587
12
12
  txt2stix/utils.py,sha256=n6mh4t9ZRJ7iT4Jvp9ai_dfCXjgXNcRtF_zXO7nkpnk,3304
@@ -113,8 +113,8 @@ txt2stix/includes/lookups/threat_actor.txt,sha256=QfDO9maQuqKBgW_Sdd7VGv1SHZ9Ra-
113
113
  txt2stix/includes/lookups/tld.txt,sha256=-MEgJea2NMG_KDsnc4BVvI8eRk5Dm93L-t8SGYx5wMo,8598
114
114
  txt2stix/includes/lookups/tool.txt,sha256=HGKG6JpUE26w6ezzSxOjBkp15UpSaB7N-mZ_NU_3G7A,6
115
115
  txt2stix/includes/tests/test_cases.yaml,sha256=QD1FdIunpPkOpsn6wJRqs2vil_hv8OSVaqUp4a96aZg,22247
116
- txt2stix-1.0.7.dist-info/METADATA,sha256=pddAmuB6pv_PjY8CAf2fgiyXKQZH1jn738gYXrN_HwA,15482
117
- txt2stix-1.0.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
118
- txt2stix-1.0.7.dist-info/entry_points.txt,sha256=x6QPtt65hWeomw4IpJ_wQUesBl1M4WOLODbhOKyWMFg,55
119
- txt2stix-1.0.7.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
120
- txt2stix-1.0.7.dist-info/RECORD,,
116
+ txt2stix-1.0.8.dist-info/METADATA,sha256=B_51zBTBxDdFq2slSLmZgBMI5HHZHZluENUonSb9h4g,15482
117
+ txt2stix-1.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
118
+ txt2stix-1.0.8.dist-info/entry_points.txt,sha256=x6QPtt65hWeomw4IpJ_wQUesBl1M4WOLODbhOKyWMFg,55
119
+ txt2stix-1.0.8.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
120
+ txt2stix-1.0.8.dist-info/RECORD,,