Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 615ce60

Browse files
author
clittle
committed
Updated code to remove link to
1 parent 0e0b0cb commit 615ce60

3 files changed

Lines changed: 8 additions & 22 deletions

File tree

layers/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ out_layer6.to_file("C:\demo_layer6.json") # Save combined co
133133
## to_excel.py
134134
to_excel.py provides the ToExcel class, which is a way to export an existing layer file as an Excel
135135
spreadsheet. The ToExcel class has an optional parameter for the initialization function, that
136-
tells the exporter what data source to use when building the output matrix. Valid options include using live data from cti-taxii.mitre.org, using data from the Mitre cti repository, or using a local collection.
136+
tells the exporter what data source to use when building the output matrix. Valid options include using live data from cti-taxii.mitre.org or using a local collection.
137137

138138
##### ToExcel()
139139
```python
140140
x = ToExcel(domain='enterprise', source='taxii', local=None)
141141
```
142142
The ToExcel constructor takes domain, server, and local arguments during instantiation. The domain can
143-
be either `enterprise` or `mobile`, and can be pulled directly from a layer file as `layer.domain`. The source argument tells the matrix generation tool which data source to use when building the matrix. `taxii` indicates that the tool should utilize the `cti-taxii` server when building the matrix, while the `repo` and `local` options indicate that it should use the repository and a local collection respectively. The local argument is only required if the source is set to `local`, in which case it should be a path to a local stix collection.
143+
be either `enterprise` or `mobile`, and can be pulled directly from a layer file as `layer.domain`. The source argument tells the matrix generation tool which data source to use when building the matrix. `taxii` indicates that the tool should utilize the `cti-taxii` server when building the matrix, while the `local` option indicates that it should use a local collection respectively. The local argument is only required if the source is set to `local`, in which case it should be a path to a local stix collection.
144144

145145
##### .to_file() Method
146146
```python
@@ -159,10 +159,7 @@ lay.from_file("path/to/layer/file.json")
159159
# Using taxii server for template
160160
t = ToExcel(domain=lay.layer.domain, source='taxii')
161161
t.to_xlsx(layer=lay, filepath="demo.xlsx")
162-
# Using repo data for template
163-
t2 = ToExcel(domain='enterprise', source='repo')
164-
t.to_xlsx(layer=lay, filepath="demo2.xlsx")
165162
#Using local stix data for template
166-
t3 = ToExcel(domain='mobile', source='local', local='path/to/local/stix')
167-
t3.to_xlsx(layer=lay, filepath="demo3.xlsx")
163+
t2 = ToExcel(domain='mobile', source='local', local='path/to/local/stix')
164+
t2.to_xlsx(layer=lay, filepath="demo2.xlsx")
168165
```

layers/exporters/matrix_gen.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ def __init__(self, source='taxii', local=None):
8484
"""
8585
Initialization - Creates a matrix generator object
8686
87-
:param server: Bool for whether or not to read from the cti-taxii server (server currently has no
88-
subtechniques)
87+
:param server: Source to utilize (taxii or local)
8988
:param local: string path to local cache of stix data
9089
"""
9190
self.convert_data = {}
92-
if source.lower() not in ['taxii', 'local', 'repo']:
93-
print('[MatrixGen] - Unable to generate matrix, source {} is not one of "taxii", "local", '
94-
'or "repo"'.format(source))
91+
if source.lower() not in ['taxii', 'local']:
92+
print('[MatrixGen] - Unable to generate matrix, source {} is not one of "taxii" or "local"'.format(source))
9593
raise BadSource
9694

9795
if source.lower() == 'taxii':
@@ -112,15 +110,6 @@ def __init__(self, source='taxii', local=None):
112110
else:
113111
print('[MatrixGen] - "local" source specified, but path to local source not provided')
114112
raise BadSource
115-
else:
116-
self.collections = dict()
117-
stix_e = requests.get("https://raw.githubusercontent.com/mitre/cti/subtechniques/enterprise-attack"
118-
"/enterprise-attack.json", verify=True).json()
119-
stix_m = requests.get("https://raw.githubusercontent.com/mitre/cti/subtechniques/mobile-attack/mobile"
120-
"-attack.json", verify=True).json()
121-
self.collections['enterprise'] = MemoryStore(stix_data=stix_e["objects"])
122-
self.collections['mobile'] = MemoryStore(stix_data=stix_m["objects"])
123-
124113
self.matrix = {}
125114
self._build_matrix()
126115

layers/exporters/to_excel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, domain='enterprise', source='taxii', local=None):
1919
"""
2020
Sets up exporting system, builds underlying matrix
2121
22-
:param source: Source to generate the matrix from, one of (taxii, repo, or local)
22+
:param source: Source to generate the matrix from, one of (taxii or local)
2323
:param local: Optional path to local stix data, required in source is local
2424
2525
"""

0 commit comments

Comments
 (0)