mitre-attack / attack-website

MITRE ATT&CK Website
https://attack.mitre.org
Apache License 2.0
483 stars 144 forks source link

IndexError: list index out of range while running update-attack.py #363

Open Yash66666 opened 2 years ago

Yash66666 commented 2 years ago

While using workbench to integrate with attack website as per the guide, the following occurs while running update-attack.py

clean : ---------------------------------------- 0.00s
matrices : ---------------------------------------- 7.74s
tactics : ---------------------------------------- 0.13s
techniques : ---------------------------------------- Running...Traceback (most recent call last): File "update-attack.py", line 154, in ptr['run_module']() File "/home/yash/Downloads/attack-website-master/modules/techniques/init.py", line 37, in run_module return (techniques.generate_techniques(), techniques_config.module_name) File "/home/yash/Downloads/attack-website-master/modules/techniques/techniques.py", line 53, in generate_techniques check_if_generated = generate_domain_markdown(domain['name'], techniques_no_sub, tactics, side_nav_data, notes, deprecated) File "/home/yash/Downloads/attack-website-master/modules/techniques/techniques.py", line 95, in generate_domain_markdown generate_technique_md(technique, domain, side_nav_data, tactics[domain], notes) File "/home/yash/Downloads/attack-website-master/modules/techniques/techniques.py", line 123, in generate_technique_md technique_dict = generate_data_for_md(technique_dict, technique, tactic_list) File "/home/yash/Downloads/attack-website-master/modules/techniques/techniques.py", line 239, in generate_data_for_md tactic = [x for x in tactic_list if x['x_mitre_shortname'] == elem['phase_name']][0] IndexError: list index out of range

Yash66666 commented 2 years ago

Background: I used the predefined collection index and imported only the enterprise collection stix bundle while keeping everything the default.

Yash66666 commented 2 years ago

Also, while importing the collection from the official ATT&CK repository on the frontend workbench, there was an object which could not be imported. Could this be a reason why the issue is occuring?

Yash66666 commented 2 years ago

There is a strange issue, it all seems to work fine for some versions. But for those versions when I edit something on the workbench and then try update-attack.py, it stops working

Yash66666 commented 2 years ago

For instance, It was working for the version 8 of enterprise matrix. But when I just tried to change the description of the enterprise matrix from the frontend and then tried to execute the update-attack.py, it shows the same error again.

IanDavila commented 2 years ago

Hi @Yash66666, thanks for opening this issue. The error looks related to the tactic of a technique. Did you modify a technique or was it only changing the description of the enterprise matrix?

Yash66666 commented 2 years ago

Hi, It was just the description of the matrix. Also I was wondering is there a way to add or modify the assets in the ICS Matrix (this is related to workbench I think). The current assets are HMI, control server, etc. And finally wanted to ask about the ICS website to be integrated with the main Mitre website.

IanDavila commented 2 years ago

We are currently working on adding ICS to the website (See issue #272). We encountered errors on some ICS techniques similar to what you originally provided. If you are trying to integrate ICS technique to the website then it's likely to be that. We are working on making those fixing on the ICS STIX bundle itself. The target to add ICS to the website is during the next ATT&CK content release in April.

Regarding Also I was wondering is there a way to add or modify the assets in the ICS Matrix: Would appreciate if you could open an issue on https://github.com/center-for-threat-informed-defense/attack-workbench-frontend for the team to look into it

Yash66666 commented 2 years ago

Sure thing, Thank you so much!