You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: layers/README.md
+33-15Lines changed: 33 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,12 @@ This folder contains modules and scripts for working with ATT&CK Navigator layer
21
21
#### Exporter Scripts
22
22
| script | description |
23
23
|:-------|:------------|
24
-
|[matrix_gen](exporters/matrix_gen.py)| Provides a means by which to generate a matrix from raw data, either cached or from the ATT&CK TAXII server. |
25
-
|[excel_templates](exporters/excel_templates.py)| Provides a means by which to convert a matrix into a base excel template. |
26
24
|[to_excel](exporters/to_excel.py)| Provides a means by which to export an ATT&CK Layer to an excel file. A further breakdown can be found in the corresponding section below. |
25
+
##### Utility Modules
26
+
| script | description |
27
+
|:-------|:------------|
28
+
|[excel_templates](exporters/excel_templates.py)| Provides a means by which to convert a matrix into a base excel template. |
29
+
|[matrix_gen](exporters/matrix_gen.py)| Provides a means by which to generate a matrix from raw data, either cached or from the ATT&CK TAXII server. |
27
30
28
31
## Layer
29
32
The Layer class provides format validation and read/write capabilities to aid in working with ATT&CK Navigator Layers in python. It is the primary interface through which other Layer-related classes defined in the core module should be used. The Layer class API and a usage example are below.
@@ -128,35 +131,50 @@ out_layer6.to_file("C:\demo_layer6.json") # Save combined co
128
131
```
129
132
130
133
## to_excel.py
131
-
to_excel.py provides the ToExcel class, which is a way to export an existing layer file as an Excel spreadsheet. The ToExcel class has an optional parameter for the export function, `to_file()`, that tells the exporter to build the output matrix based on live data from cti-taxii.mitre.org. Otherwise, it will use the cached subtechniques data. If matrix template lacks elements included in a layer's technique listing, those elements will not be visible in the output file.
134
+
to_excel.py provides the ToExcel class, which is a way to export an existing layer file as an Excel
135
+
spreadsheet. The ToExcel class has an optional parameter for the initialization function, that
136
+
tells the exporter to build the output matrix based on live data from cti-taxii.mitre.org. It
137
+
can also use cached subtechniques data. If neither of these is used, it will default to pulling from the
138
+
ATT&CK cti repo. If matrix template lacks elements included in a layer's technique listing, those
139
+
elements will not be visible in the output file.
132
140
133
141
##### ToExcel()
134
142
```python
135
-
x = ToExcel(layer=None)
143
+
x = ToExcel(domain='enterprise', server=False, local=None)
136
144
```
137
-
The ToExcel constructor takes an options layer argument during instantiation. If no layer is loaded at this time, it must be loaded later before exporting `x.layer = Layer()`.
145
+
The ToExcel constructor takes domain, server, and local arguments during instantiation. The domain can
146
+
be either 'enterprise' or 'mobile', and can be pulled from a layer file as `layer.domain`. The server
147
+
argument tells the matrix generation tool to use the `cti-taxii` server when building the matrix. The
148
+
local argument tells the matrix generation tool the path to a local stix repository to use when
149
+
constructing the matrix.
138
150
139
151
##### .to_file() Method
140
152
```python
141
-
x.to_file(filepath="layer.xlsx", fresh=False)
153
+
x.to_xlsx(layer=layer, filepath="layer.xlsx")
142
154
```
143
-
The to_file method exports the layer file loaded in the ToExcel class (`x`), as an excel file to the
144
-
filepath specified. The fresh parameter is an optional parameter that bases the export on a matrix built
145
-
from the live data on the taxii server (`True`), or based on cached data (`False`).
146
-
155
+
The to_xlsx method exports the layer file referenced as `layer`, as an excel file to the
0 commit comments