attack-detections-collector
attack-detections-collector copied to clipboard
list index out of range in 'load_detections'
Error example
>python adc.py -t T1133 -o results.html
Traceback (most recent call last):
File "adc.py", line 279, in <module>
args.detections, navigator_template="attack-navigator-template.json"
File "adc.py", line 112, in __init__
self.load_detections()
File "adc.py", line 128, in load_detections
uri_path = f"{subdir}{str(path).split(subdir)[1]}"
IndexError: list index out of range
Potential fix to load_detections() function?
Change
uri_path = f"{subdir}{str(path).split(subdir)[1]}"
self.detections.append((uri_path, yaml.safe_load(f)))
to
if len(str(path).split(subdir))>1:
uri_path = f"{subdir}{str(path).split(subdir)[1]}"
self.detections.append((uri_path, yaml.safe_load(f)))