Created
January 1, 2017 21:10
-
-
Save entelechyIT/445084925637ea288c221f2d3fa64c58 to your computer and use it in GitHub Desktop.
Looping through the CCI List XML with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Note the snippet is the second part of the script which | |
## demonstrates extracting information from DISA NIST XML files | |
## Download and unzip the latest control list | |
## from: http://iase.disa.mil/stigs/cci/Pages/index.aspx | |
$CCIControlFile = '~\Documents\U_CCI_List.xml' | |
## This is the NIST Revision we are wanting to reference: | |
$CCIFilter = 'NIST SP 800-53 Revision 4' | |
## loop through the Stig Collection updating the Control information | |
## pulled from the U_CCI_List.xml | |
foreach($StigObj in $StigCollection){ | |
foreach($CciItem in $CCIX.cci_list.cci_items.cci_item){ | |
if($CciItem.Id -EQ $StigObj.ControlIdentifier){ | |
## filter the control version by the title | |
if($CciItem.references.reference.title -EQ $CCIFilter){ | |
$StigObj.Control = $CciItem.references.reference.index | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment