grolston / PowerStig

A module for parsing DISA XCCDF.XML Files for Windows Compliance with PowerShell DSC
9 stars 2 forks source link

Modularize-Reg-Checks #3

Closed clcaldwell closed 6 years ago

clcaldwell commented 6 years ago

Modularized / created functions for all of the Registry checks.

Added logic to ensure you don't write blank data into the required fields in the DSC File.

Added -DisplayRules param to show which rules were sucessfully parsed and which were not.

Deleted 'New-DSCPolicyConfig' - you weren't actually using it, but it was causing you to output blank entries into the DSC file.

Made a bunch of syntax changes - like explicitly breaking inside (most) switches to avoid weird branch logic.

clcaldwell commented 6 years ago

Nice to meet you, George! I thought it was a brilliant idea to try and convert those terrible xccdf's into DSC. There is still a bunch of work to do on this though, hope you don't mind me making changes to 'PowerStig'. -Coby

grolston commented 6 years ago

I appreciate the work. I am not sure if you figured out one of the issues the module has is parsing some of the multiple line rules (if I am getting the term right). Basically the XCCDF file will have state that in order to meet requirement the following will be found....and then list in one rule multiple registry findings. I will see if I can find that here tomorrow and point out the logic. Basically we would run another foreach or create a function to test the xml element if it contains multiple registry values.

clcaldwell commented 6 years ago

I haven't seen any checks that check for multiple values, yet.