Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.7.0 PR to Dev for Release #806

Merged
merged 12 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## [Unreleased]

## [4.7.0] - 2020-12-17

* Update PowerSTIG to successfully parse/apply Microsoft Windows 2012 and 2012 R2 DC STIG - Ver 3, Rel 1: [#784](https://github.com/microsoft/PowerStig/issues/784)
* Update PowerSTIG to successfully parse/apply Microsoft Windows 2012 and 2012 R2 MS STIG - Ver 3, Rel 1: [#785](https://github.com/microsoft/PowerStig/issues/785)
* Update PowerSTIG to successfully parse/apply Microsoft Windows 10 STIG - Ver 2, Rel 1: [#783](https://github.com/microsoft/PowerStig/issues/783)
* Update PowerSTIG to successfully parse/apply Microsoft Windows Defender Antivirus STIG - Ver 2, Rel 1: [#786](https://github.com/microsoft/PowerStig/issues/786)
* Update PowerSTIG to successfully parse/apply Microsoft Windows Server 2016 STIG - Ver 2, Rel 1: [#782](https://github.com/microsoft/PowerStig/issues/782)
* Update PowerSTIG to successfully parse/apply Microsoft Windows Server 2019 STIG - Ver 2, Rel 1 [#787](https://github.com/microsoft/PowerStig/issues/787)
* Update PowerSTIG to successfully parse/apply Google Chrome V2R1: [#709](https://github.com/microsoft/PowerStig/issues/709)
* Update PowerSTIG to include LegacyId to assist in determining Legacy Vuln Ids with the new DISA standard: [#788](https://github.com/microsoft/PowerStig/issues/788)
* Update PowerSTIG to include LegacyId query via Get-StigRule function: [#800](https://github.com/microsoft/PowerStig/issues/800)
* Fixed: Update PowerSTIG to fix LegacyId logic: [#791](https://github.com/microsoft/PowerStig/issues/791)
* Fixed: Update PowerSTIG to correctly parse Windows Server 2019 DC - LDAP SecurityOptionRule: [#804](https://github.com/microsoft/PowerStig/issues/804)

## [4.6.0] - 2020-12-01

* Provide Method to install DoD Root Certs for Server OS and Client OS: [#755](https://github.com/microsoft/PowerStig/issues/755)
Expand Down
52 changes: 27 additions & 25 deletions FILEHASH.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PowerSTIG File Hashes : Module Version 4.6.0
# PowerSTIG File Hashes : Module Version 4.7.0

Hashes for **PowerSTIG** files are listed in the following table:

Expand All @@ -14,22 +14,24 @@ Hashes for **PowerSTIG** files are listed in the following table:
| FireFox-All-4.28.xml | E84C9DB143EDA81131510607F0F667200BEF0950FF8E1FC4683C121489A8FCF5 | 38487 |
| FireFox-All-4.29.org.default.xml | 9CA1F7AE74DDEB299A9B09F4259F1B12E2FD1BADED9CFBB89585D1428CF8C32F | 306 |
| FireFox-All-4.29.xml | 83D5D4F59C81316455AAA18FFE207768E13C78CEBE91DD7C633E38E675C8B878 | 48344 |
| Google-Chrome-2.1.org.default.xml | 6B0CD862F76C16A40C3CB20EADFBC6A9D789211B707CEA8AE8F5513ED5318AF7 | 1143 |
| Google-Chrome-2.1.xml | 0CCC64397468814DFDFE1B9BC93D2521979F1959FEF9621C4C240D88ED967A86 | 96838 |
| IISServer-10.0-1.2.org.default.xml | CCE53579894CC3DCE929CB2782DC077B9BEF54D3DFDFAD0208DDD8092D2DAA86 | 440 |
| IISServer-10.0-1.2.xml | A4A5751B19B5BF1658B91D0BBA8DF405E35C9A28E84E6BE67CAD300C2AC9D131 | 131096 |
| IISServer-10.0-2.1.org.default.xml | D0460DE57ADDF6FACCE9288CAF5B059D8D9F223276985F2AC53E0DC894E225AA | 440 |
| IISServer-10.0-2.1.xml | A77E882910DD67C0892E46F908ADB24A616F8BC2C54DC53217713CCEACA00EDB | 131197 |
| IISServer-10.0-2.1.xml | 44293CF4680B55AB2FC81113DDE3892F686C2E1E7B0C4666361516BB878CF870 | 133456 |
| IISServer-8.5-1.11.org.default.xml | D2B45974062E5C376E5088B318EC6E858954BCE33CCCCB60390824C058DC3D3D | 439 |
| IISServer-8.5-1.11.xml | 75B8A98823AC044D0BD68A66E6263D6FF7529DD54565660E0DA41DCC854587F1 | 132327 |
| IISServer-8.5-2.1.org.default.xml | 74430102C9E2D3140C8FEC42EF426F214D191A387E9E2FF8235648D9455530A8 | 440 |
| IISServer-8.5-2.1.xml | 62A6BE8FB6E3A7B3B87092ECD670205AFDC3E5BE6F6423A001EF7D2311081252 | 130798 |
| IISServer-8.5-2.1.xml | 3FB79D7B3FDF5333524255F9E04559F33019031BB229EF116DD75A4331053DF0 | 132962 |
| IISSite-10.0-1.2.org.default.xml | 881F5FACEC050D06B4FA949C641B930A38E54EFB831DA57C12D047F1C891C4BD | 1309 |
| IISSite-10.0-1.2.xml | 82D1D28315F2930CA49BFA486E9F996EDEE2396D694CD01D4EB0D88DEDD463EC | 115767 |
| IISSite-10.0-2.1.org.default.xml | 37D96FAD978E78F5E28FEDE958D033DF820464632C14699BE4BD349C11A6C601 | 1309 |
| IISSite-10.0-2.1.xml | 48F01BD2F5A8AA6B8C5F15CA901A37561FF4E94B42973B09C60F222186B4EDE4 | 115864 |
| IISSite-10.0-2.1.xml | 43BBB8FFBFB08953639599362BA3D6663D1337C891E05A3E8516FB27D5EDA23F | 117801 |
| IISSite-8.5-1.11.org.default.xml | 1A76F1D9232E65679703886888A243072E84A65F6CF4EFE67D61E577EDA6644B | 1383 |
| IISSite-8.5-1.11.xml | A951C0E93FDD1EE15AD95B92928C4FCD10373CCEBD9AF1DC71179066EC1EA42B | 125081 |
| IISSite-8.5-2.1.org.default.xml | B0BA05F7D3FD430927B8924334F90851630DB326463635EAA1E08EB6B212362A | 1403 |
| IISSite-8.5-2.1.xml | 1DE2B403183B12E66AAA0581CAA19B545EC2745120258E955DF82BC267715959 | 125274 |
| IISSite-8.5-2.1.xml | CAF8FE884C15BFE5F42CF624558925B97CF03C49FF61E4FA4842EA469484B58B | 127267 |
| InternetExplorer-11-1.18.org.default.xml | 1095CEEAD18CBBAD9068326B97D520F7F76F1F71331618F17B2138DC8FE55ED4 | 306 |
| InternetExplorer-11-1.18.xml | 7AB1611E525B8D257E722BE7175898F76EAC1C3AFD592C15738AC7EB365139D4 | 332058 |
| InternetExplorer-11-1.19.org.default.xml | 586CE903A5C77913C78DAB9129560E118D56C6F4AB3C7B0AEA2BC38F25EE54DB | 306 |
Expand All @@ -47,15 +49,15 @@ Hashes for **PowerSTIG** files are listed in the following table:
| Office-Outlook2016-1.2.org.default.xml | B3587A82F4CC9A347B4D491AA1E84036EA1C410E24CB1B28DFF41846B58594F3 | 305 |
| Office-Outlook2016-1.2.xml | 5AFB894BFCFB367FB643DE6ACAE8C513584EC2812DA54ECCBAFF9C551D465DF9 | 138739 |
| Office-Outlook2016-2.1.org.default.xml | 90B8C7718C06C930178B621218A629B44A4F18885F0B5816E06AC76E8A1DA329 | 305 |
| Office-Outlook2016-2.1.xml | 465AE0839E3CEDCDF99014949913F28C8516F23DB2A00D010B85BDBFA718A0E5 | 139334 |
| Office-Outlook2016-2.1.xml | 32E12517ECB326AE1B049D9A268DA9A45D4E1141DC8C33CF5B97553F96C6172C | 141421 |
| Office-PowerPoint2013-1.6.org.default.xml | 737AEDF59D64684358B3E58ED4D0C42E5FD99AA4495489B8E625B79CE838E663 | 305 |
| Office-PowerPoint2013-1.6.xml | 563E20C0149E0CB20880EB777439A7B67C4FE1BBF4347EA7677048E6DD2D2EAA | 94142 |
| Office-PowerPoint2016-1.1.org.default.xml | 3FEE8C811ED3DB6986E24ABF9BBA833975A908C82EFAECC2E91755E10D02C30C | 431 |
| Office-PowerPoint2016-1.1.xml | 8F17DC18B9997782E98DACA5044ACB1E63B178A80240AE130D0AC7F64B703531 | 91626 |
| Office-System2013-1.9.org.default.xml | 45055F756C705090A9F8D6470EF55C2FC8838EA00B2103E372E22B948A06DF63 | 869 |
| Office-System2013-1.9.xml | 346A48CA6FD98889F0E60928AA0E87E138CF4E8A45E1BDB82BB04005428638C5 | 122545 |
| Office-System2013-2.1.org.default.xml | 96C2EFAF8780965F18914EB31F6C869AF63ADDB780CB3EA537626BA7DA2B7358 | 873 |
| Office-System2013-2.1.xml | AEE84228BF4E1F341BEF640202AD4BA134526D67AEA6FF4F96F9AD3391784783 | 115297 |
| Office-System2013-2.1.xml | 40657EF393151DFE4D8FD1B5ABD4C5E87DD4AFD3A7F0B230DD22502F0B9DBF4C | 117184 |
| Office-System2016-1.1.org.default.xml | 1BC04F0B3B55ED751A1451845E35821A7A8DE2A9592ED63D70AD422E5B3BB1C4 | 305 |
| Office-System2016-1.1.xml | 6ABE255AD940C70AA20E72B50FCE9E78BA3C3291C085EFF26581059445904229 | 63544 |
| Office-Visio2013-1.4.org.default.xml | DEB619FD6632472F27796C703DB93523035A5BCD84A2FE878DABBCFC968FFFD9 | 305 |
Expand All @@ -77,48 +79,48 @@ Hashes for **PowerSTIG** files are listed in the following table:
| SqlServer-2016-Instance-1.10.org.default.xml | B3F8FCFB9E003FBADBD9A2FE64F807DD54FF660ABFAE8E80DF229339F69138DD | 306 |
| SqlServer-2016-Instance-1.10.xml | 474084FF0E2742078124A15651C46D24F51CB7ED7FEE1CEDC3081811C3FAB8F2 | 467648 |
| SqlServer-2016-Instance-2.1.org.default.xml | 90B8C7718C06C930178B621218A629B44A4F18885F0B5816E06AC76E8A1DA329 | 305 |
| SqlServer-2016-Instance-2.1.xml | 5A3768B0814749B9FB476AE9ED38AF1B8D10613F40D1E928C99A8B262A86D39F | 461823 |
| SqlServer-2016-Instance-2.1.xml | 4EEA00BFC5072FB2969EAB567DD6B8602841AE00E7A059A99F63698CCB50A3E6 | 466722 |
| vSphere-6.5-1.3.org.default.xml | C990416E2E49502DADF351E07E50F01FDE10BDDADD940316F943BC31CA043BFA | 791 |
| vSphere-6.5-1.3.xml | 1DE6CB25FD5ACD705F0F7ED1AB8F062F75B00B85FFD6DD5688D81C51858043A2 | 168420 |
| Vsphere-6.5-1.4.org.default.xml | 0094C819CBDE50985DC324280712622E3ECAA46E45AFFFEAFB6C91A139B72627 | 791 |
| Vsphere-6.5-1.4.xml | D78A4D1192D4D0836A6A3FC945F06D4DF3F9EB36F35141A4BED8DC401AEB71DE | 143136 |
| WindowsClient-10-1.21.org.default.xml | 1356B94B5A6F5A37F07C70EABF0D2977241D99EA5C8F278D51ACDD607F85E870 | 4803 |
| WindowsClient-10-1.21.xml | 6D832C0B109A16E08B44BE0F04567085E09B902F86AEE69F581F1FD7CA174517 | 797580 |
| WindowsClient-10-1.23.org.default.xml | 560C71F2C07DB76CB9B824D50FEFA2D50F59AF4379BD2EB13C75D091EAAF6382 | 4828 |
| WindowsClient-10-1.23.xml | 0C3EEA49B0A81C6A6DDD4CAC6273BDB539EDCC2F087DD5D4D71FA881C7836828 | 706835 |
| WindowsDefender-All-1.7.org.default.xml | C6D7C72A7EC7681FADC9F9CEACE9D7A7BF3391E26DE0E0F202C7C53EA2CD1C8C | 1170 |
| WindowsDefender-All-1.7.xml | 9657199FA1B037CA49D274BE3B0960F6EF1590178991C9A4B346B5BC9E6BB945 | 95148 |
| WindowsClient-10-2.1.org.default.xml | 00E4C5DD37FA4AAA5C050F1FB2D04662541DF389040F2861EAA011E603256A74 | 4660 |
| WindowsClient-10-2.1.xml | 6A2663CE9691A3F8812964008A0980647991611D0D568F64496F616A3E0122AC | 718398 |
| WindowsDefender-All-1.8.org.default.xml | C9609DE449345A4BE63AACBEF2EE44689852811ED2D4845F426945C5ADE25897 | 1071 |
| WindowsDefender-All-1.8.xml | F54DDC75434BF5CA58A57F2FC648A04F90FB7C0A6BC4C10B3BC00DFCF6BB71A5 | 94765 |
| WindowsDefender-All-2.1.org.default.xml | 1B0F2EE7D068944E2B55187D9A45DC792CD38559DF888AFC8C6FF10B3A756770 | 1088 |
| WindowsDefender-All-2.1.xml | 4A6538A6AD9E0ADF16D6A907DF0A12EAE44952BDCF383455C52A7E850FD8C45F | 96806 |
| WindowsDnsServer-2012R2-1.15.org.default.xml | B96A080974E42D51381B47C63FEB29F5DF91EDED3A44617945AC78A1D39E89D1 | 449 |
| WindowsDnsServer-2012R2-1.15.xml | F5881AF1DF6BD623F6C115DC059C8EEBA4F5175A0986F21322A268E8825D63FF | 268780 |
| WindowsDnsServer-2012R2-2.1.org.default.xml | 693C53E7B2DCB367DA8119934BBC66C2FD78BFC764F4FC2A514FC00CB1C450F9 | 449 |
| WindowsDnsServer-2012R2-2.1.xml | EB837A7E949C301736283A940DF55EA54CBFCB3B92FBFFD3C6D0E331E68CAD8D | 244143 |
| WindowsDnsServer-2012R2-2.1.xml | D5C639D871A9875C6AD4FFD0B5EF9C822FE9568827605E0C4D15AC185FD879F9 | 247159 |
| WindowsFirewall-All-1.6.org.default.xml | 129A5B9F20B27E36FED4C1AC470B7B7419B563A6B2733B7FC3112CAF682ABB77 | 966 |
| WindowsFirewall-All-1.6.xml | 42FA28D3C4BA6387D3EA4F5DCB72F133F814D3A9854555498E22DDFD188194B7 | 65518 |
| WindowsFirewall-All-1.7.org.default.xml | 64E9FFA9B456C36DD36B5824BF641E473931B5C350F473DDFFDF31B1B64DD016 | 966 |
| WindowsFirewall-All-1.7.xml | BBB13C6D675EB591D972EF8AD9B46472CFE80FCAD76E9D453586E6BE430F01B6 | 65518 |
| WindowsServer-2012R2-DC-2.19.org.default.xml | 119AA2E10130E0518F700ABB3623A24E08459D677298BCB54F86A29347D67307 | 5457 |
| WindowsServer-2012R2-DC-2.19.xml | B545AD63C8EAACCEA6169B71A083736656C1C816A7C10548460558FDC670338F | 771790 |
| WindowsServer-2012R2-DC-2.21.org.default.xml | 283BBECBB51464093C4DAB666C7CEB3B6F42D7AF6F15D4067951D904287ECC9B | 5457 |
| WindowsServer-2012R2-DC-2.21.xml | 137671F0A048D2A2A20C85B9D24E48A96E04DD6A3525858DC89B679492041535 | 774698 |
| WindowsServer-2012R2-MS-2.17.org.default.xml | 399C869FC12FD21214F427A41BC8F2FE0C5D815EA2A6DC387339F8DA003D889F | 4913 |
| WindowsServer-2012R2-MS-2.17.xml | 737CB71B2FD7A6839CB7B02C714F982ADCB7797AE7F7536A4FD05259F04CEDB8 | 665509 |
| WindowsServer-2012R2-DC-3.1.org.default.xml | 1E6C3050BFC42B2F61D829F9C1EE40DCAA7335B9EE5AEF185CB69C4EE2765633 | 5596 |
| WindowsServer-2012R2-DC-3.1.xml | F5927DDA5E7A284615388CF7CD2F351DE46FB1A87F1421DBC2A7147D42BE38CD | 784187 |
| WindowsServer-2012R2-MS-2.19.org.default.xml | AB13E75014B54356651DF9A790155B4BDE4D5A189EAF2BA5665635C667A27155 | 4913 |
| WindowsServer-2012R2-MS-2.19.xml | 047B0425AB155611E371FE37E059C7F44B6842736CDD1372ECD34BF04EAB408A | 668684 |
| WindowsServer-2016-DC-1.10.org.default.xml | 928F37C54F333ABBB403DDBA264BF1D7F3E69462B326797E10AC400C520F49D7 | 4598 |
| WindowsServer-2016-DC-1.10.xml | BA20DE96E4900D06A16811D3A1EE3BBB63300780983F6E6D767402176EEFFC8A | 547947 |
| WindowsServer-2012R2-MS-3.1.org.default.xml | D84032D248CC5D70C2D1CF24B86AAE02D73330FA1EC4E69249FC2C4A523883AD | 5026 |
| WindowsServer-2012R2-MS-3.1.xml | 86248DA9F80EDB67126F579E30EFFAC71B7EC9E6632CF5DEB4CBEC87B956FE97 | 678771 |
| WindowsServer-2016-DC-1.12.org.default.xml | 7E29598C831A28FE0A94E566B448CF10D7A75AE82C7AFD7F5281067C777601BD | 4598 |
| WindowsServer-2016-DC-1.12.xml | 6FA88C2321461D8455BC28A2B977DFC1D2EDA8D1F585EB8B4F0DD60D1E1DD8DE | 550978 |
| WindowsServer-2016-MS-1.10.org.default.xml | 0D4C4F9983F354B4186A83C1E64CB722FB855E211ECF5E329755FE74404259FA | 4714 |
| WindowsServer-2016-MS-1.10.xml | 4F5BE41F030E299CF379041CE181FE0BFBBD7A3E76E2405829983EB1949784EA | 470570 |
| WindowsServer-2016-DC-2.1.org.default.xml | B80069F4AEB52DB4CA7934E617A699A8F8D343E7EAC7DE1FF088CAAC6AF20602 | 4671 |
| WindowsServer-2016-DC-2.1.xml | E6A62B787CFD6DB3A8AE3AAC17C08F856DB8B11F424DA1B81290B16607645DCC | 561489 |
| WindowsServer-2016-MS-1.12.org.default.xml | 6167494CE31CF938EBBB91FDEA24ABC05D11FA13294EFD1DEF36DB6ACF12EF5D | 4714 |
| WindowsServer-2016-MS-1.12.xml | 6A06D0C7B734A504F90F3FF7B33A44EEEFAA47C982FC891B46B6FD57171CEC65 | 473633 |
| WindowsServer-2019-DC-1.3.org.default.xml | FEF197F027ADB13849604CFE145A9541663E947F91B262EC234CA97E7015BD93 | 4842 |
| WindowsServer-2019-DC-1.3.xml | FBB47CA9382084CB7A58AF85BE881B645D875552C413166C911CAB8287995E79 | 832961 |
| WindowsServer-2016-MS-2.1.org.default.xml | 183037554B06AD1FE437CA4569657759DAE1DC08FA46D886CC9310072952DD05 | 4783 |
| WindowsServer-2016-MS-2.1.xml | 491E715367722D255D8F3DD3FFFA78F01514539B5FB236A8212A70139A924D65 | 483071 |
| WindowsServer-2019-DC-1.5.org.default.xml | 4C557728FC6957E8366F3FA61F9AF9B93097D17F768FA34D82EAE39472553DE0 | 4842 |
| WindowsServer-2019-DC-1.5.xml | 304B5E1F9AA02630E2FAAA260A89690B4C507428F787E32C5F5B9424A9F22343 | 835931 |
| WindowsServer-2019-MS-1.3.org.default.xml | 95D1EF80EC3533EF1B32BFF282042F73410627045049CA03C1E7537BC50181DF | 4780 |
| WindowsServer-2019-MS-1.3.xml | 48F4E1F528FD80C64DFBD820ECD3F345CA7D25107324AFA8E52CA4F267A2ADE3 | 755318 |
| WindowsServer-2019-DC-2.1.org.default.xml | 16E9FD633C5E0609DC83C6D3DF153E488647690323FFA6061342BD07156EA433 | 4770 |
| WindowsServer-2019-DC-2.1.xml | 3B7A17903DF6F0ECAB63D1A79FDD4B85A5D40DC459EED72300520963F2E6CEB3 | 852593 |
| WindowsServer-2019-MS-1.5.org.default.xml | C66E670220BE21B939CE7323C3E2F65281C0A1627229EF1B03F196D62AB16054 | 4780 |
| WindowsServer-2019-MS-1.5.xml | 9031353E5A070FAD5CF136AB366924D5C0DAF16077D4882E10CE3496E5DDA788 | 758317 |
| WindowsServer-2019-MS-2.1.org.default.xml | FA3161D5757A0851C663F2F04596D9964D5BE756113F0691C608497D02C09914 | 4702 |
| WindowsServer-2019-MS-2.1.xml | 490BEC047CE034AF0FFAAE81BBA643F15B8683FB5A9CE41C16921D682F35A16F | 773974 |
57 changes: 57 additions & 0 deletions Tests/Integration/DSCResources/Chrome.config.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
configuration Chrome_config
{
param
(
[Parameter()]
[AllowNull()]
[string]
$TechnologyVersion,

[Parameter()]
[AllowNull()]
[string]
$TechnologyRole,

[Parameter(Mandatory = $true)]
[version]
$StigVersion,

[Parameter()]
[string[]]
$SkipRule,

[Parameter()]
[string[]]
$SkipRuleType,

[Parameter()]
[string[]]
$SkipRuleSeverity,

[Parameter()]
[hashtable]
$Exception,

[Parameter()]
[object]
$OrgSettings,

[Parameter()]
[string[]]
$ResourceParameters
)

Import-DscResource -ModuleName PowerStig

Node localhost
{
$psboundParams = $PSBoundParameters
$psboundParams.Remove('TechnologyRole')
$psboundParams.Remove('ConfigurationData')
$psboundParams.Remove('TechnologyVersion')

$resourceParamString = New-ResourceParameterString -ResourceParameters $ResourceParameters -PSBoundParams $psboundParams
$resourceScriptBlockString = New-ResourceString -ResourceParameterString $resourceParamString -ResourceName Chrome
& ([scriptblock]::Create($resourceScriptBlockString))
}
}
47 changes: 47 additions & 0 deletions Tests/Integration/DSCResources/Chrome.integration.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using module .\helper.psm1

$script:DSCCompositeResourceName = ($MyInvocation.MyCommand.Name -split '\.')[0]
. $PSScriptRoot\.tests.header.ps1

$configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:DSCCompositeResourceName).config.ps1"
. $configFile

$script:DSCCompositeResourceNameUpdate = "Google-{0}" -f ($MyInvocation.MyCommand.Name -split '\.')[0]
$stigList = Get-StigVersionTable -CompositeResourceName $script:DSCCompositeResourceNameUpdate
$resourceInformation = $global:getDscResource | Where-Object -FilterScript {$PSItem.Name -eq $script:DSCCompositeResourceName}
$resourceParameters = $resourceInformation.Properties.Name

foreach ($stig in $stigList)
{
$orgSettingsPath = $stig.Path.Replace('.xml', '.org.default.xml')
$blankSkipRuleId = Get-BlankOrgSettingRuleId -OrgSettingPath $orgSettingsPath
$powerstigXml = [xml](Get-Content -Path $stig.Path) |
Remove-DscResourceEqualsNone | Remove-SkipRuleBlankOrgSetting -OrgSettingPath $orgSettingsPath

$skipRule = Get-Random -InputObject $powerstigXml.RegistryRule.Rule.id
$skipRuleType = $null
$expectedSkipRuleTypeCount = 0 + $blankSkipRuleId.Count

$skipRuleMultiple = Get-Random -InputObject $powerstigXml.RegistryRule.Rule.id -Count 2
$skipRuleTypeMultiple = $null
$expectedSkipRuleTypeMultipleCount = 0 + $blankSkipRuleId.Count

$singleSkipRuleSeverity = 'CAT_I'
$multipleSkipRuleSeverity = 'CAT_I', 'CAT_II'
$expectedSingleSkipRuleSeverity = Get-CategoryRule -PowerStigXml $powerstigXml -RuleCategory $singleSkipRuleSeverity
$expectedSingleSkipRuleSeverityCount = ($expectedSingleSkipRuleSeverity | Measure-Object).Count + $blankSkipRuleId.Count
$expectedMultipleSkipRuleSeverity = Get-CategoryRule -PowerStigXml $powerstigXml -RuleCategory $multipleSkipRuleSeverity
$expectedMultipleSkipRuleSeverityCount = ($expectedMultipleSkipRuleSeverity | Measure-Object).Count + $blankSkipRuleId.Count

$getRandomExceptionRuleParams = @{
RuleType = 'RegistryRule'
PowerStigXml = $powerstigXml
ParameterValue = 1234567
}
$exception = Get-RandomExceptionRule @getRandomExceptionRuleParams -Count 1
$exceptionMultiple = Get-RandomExceptionRule @getRandomExceptionRuleParams -Count 2
$backCompatException = Get-RandomExceptionRule @getRandomExceptionRuleParams -Count 1 -BackwardCompatibility
$backCompatExceptionMultiple = Get-RandomExceptionRule @getRandomExceptionRuleParams -Count 2 -BackwardCompatibility

. "$PSScriptRoot\Common.integration.ps1"
}
3 changes: 3 additions & 0 deletions Tests/Unit/Module/Rule.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ try
It 'Should return the rule Id' {
$stig.id | Should Be 'V-1000'
}
It 'Should return the legacy Id' {
$stig.legacyid | Should Be 'V-1111'
}
It 'Should return the Severity' {
$stig.severity | Should Be 'medium'
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Module/STIG.PowerStigXml.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Describe 'Compare-PowerStigXml' {

Describe 'Get-BaseRulePropertyName' {

It 'Should return 11 base rule types' {
It 'Should return 12 base rule types' {
$baseRulePropertyName = Get-BaseRulePropertyName
$baseRulePropertyName.Count | Should -Be 11
$baseRulePropertyName.Count | Should -Be 12
}
}

Expand Down
Loading