pkeech/stig_parser

New fields added to STIGs

Closed this issue · 2 comments

As of OCT 2020 there have been some new fields, as well as multiple of the same elements.

Based on DISA-STIG SQL SERVER 2016 V2R1, the xccdf.xml file has multiple elements which resulted in an error when running the stig-parser. I had to remove all but one from the XML file so the parser could be successful.

This was the error:
Traceback (most recent call last): File "stig.py", line 12, in <module> json_results = convert_xccdf(raw_file) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/stig_parser/__init__.py", line 19, in convert_xccdf raw_version = content_dict['Benchmark']['plain-text']['#text'] TypeError: list indices must be integers or slices, not str

File snippet:
<plain-text id="release-info">Release: 1 Benchmark Date: 23 Oct 2020</plain-text><plain-text id="generator">3.1.1.36225</plain-text><plain-text id="conventionsVersion">1.10.0</plain-text>

Also, there seems to be a new 'Legacy' field if in case the DoD decides to switch up the item numbering. Total PITA if you ask me.

Just FYI. Thanks for putting this together!

+1 Just found this project and tested with the ASD STIG, U_ASD_STIG_V5R1_Manual-xccdf.xml, same issue

Cheers for pointing this out!

I will review the changes and make the necessary updates.