From 339c7476840d1310dc5163d4e4e307e0bf2a4460 Mon Sep 17 00:00:00 2001 From: Emily Rodriguez Date: Tue, 21 Mar 2023 07:25:51 -0500 Subject: [PATCH 1/2] update control numbers Signed-off-by: Emily Rodriguez --- controls/SV-205624.rb | 139 ++++++++++++++++++++++ controls/SV-205625.rb | 61 ++++++++++ controls/SV-205626.rb | 61 ++++++++++ controls/SV-205627.rb | 61 ++++++++++ controls/SV-205628.rb | 70 +++++++++++ controls/SV-205629.rb | 58 ++++++++++ controls/SV-205630.rb | 53 +++++++++ controls/SV-205631.rb | 55 +++++++++ controls/SV-205632.rb | 40 +++++++ controls/SV-205633.rb | 44 +++++++ controls/SV-205634.rb | 59 ++++++++++ controls/SV-205635.rb | 59 ++++++++++ controls/SV-205636.rb | 44 +++++++ controls/SV-205637.rb | 41 +++++++ controls/SV-205638.rb | 46 ++++++++ controls/SV-205639.rb | 44 +++++++ controls/SV-205640.rb | 69 +++++++++++ controls/SV-205641.rb | 69 +++++++++++ controls/SV-205642.rb | 69 +++++++++++ controls/SV-205643.rb | 79 +++++++++++++ controls/SV-205644.rb | 43 +++++++ controls/SV-205645.rb | 43 +++++++ controls/SV-205646.rb | 48 ++++++++ controls/SV-205647.rb | 37 ++++++ controls/SV-205648.rb | 118 +++++++++++++++++++ controls/SV-205649.rb | 116 +++++++++++++++++++ controls/SV-205650.rb | 108 +++++++++++++++++ controls/SV-205651.rb | 36 ++++++ controls/SV-205652.rb | 33 ++++++ controls/SV-205653.rb | 31 +++++ controls/SV-205654.rb | 31 +++++ controls/SV-205655.rb | 31 +++++ controls/SV-205656.rb | 29 +++++ controls/SV-205657.rb | 60 ++++++++++ controls/SV-205658.rb | 70 +++++++++++ controls/SV-205659.rb | 29 +++++ controls/SV-205660.rb | 29 +++++ controls/SV-205661.rb | 28 +++++ controls/SV-205662.rb | 30 +++++ controls/SV-205663.rb | 56 +++++++++ controls/SV-205664.rb | 51 ++++++++ controls/SV-205665.rb | 79 +++++++++++++ controls/SV-205666.rb | 70 +++++++++++ controls/SV-205667.rb | 76 ++++++++++++ controls/SV-205668.rb | 74 ++++++++++++ controls/SV-205669.rb | 68 +++++++++++ controls/SV-205670.rb | 75 ++++++++++++ controls/SV-205671.rb | 88 ++++++++++++++ controls/SV-205672.rb | 139 ++++++++++++++++++++++ controls/SV-205673.rb | 112 ++++++++++++++++++ controls/SV-205674.rb | 106 +++++++++++++++++ controls/SV-205675.rb | 113 ++++++++++++++++++ controls/SV-205676.rb | 63 ++++++++++ controls/SV-205677.rb | 26 +++++ controls/SV-205678.rb | 34 ++++++ controls/SV-205679.rb | 34 ++++++ controls/SV-205680.rb | 34 ++++++ controls/SV-205681.rb | 34 ++++++ controls/SV-205682.rb | 49 ++++++++ controls/SV-205683.rb | 48 ++++++++ controls/SV-205684.rb | 48 ++++++++ controls/SV-205685.rb | 33 ++++++ controls/SV-205686.rb | 31 +++++ controls/SV-205687.rb | 33 ++++++ controls/SV-205688.rb | 33 ++++++ controls/SV-205689.rb | 33 ++++++ controls/SV-205690.rb | 31 +++++ controls/SV-205691.rb | 33 ++++++ controls/SV-205692.rb | 41 +++++++ controls/SV-205693.rb | 41 +++++++ controls/SV-205694.rb | 31 +++++ controls/SV-205695.rb | 56 +++++++++ controls/SV-205696.rb | 42 +++++++ controls/SV-205697.rb | 46 ++++++++ controls/SV-205698.rb | 34 ++++++ controls/SV-205699.rb | 28 +++++ controls/SV-205700.rb | 50 ++++++++ controls/SV-205701.rb | 55 +++++++++ controls/SV-205702.rb | 41 +++++++ controls/SV-205703.rb | 40 +++++++ controls/SV-205704.rb | 40 +++++++ controls/SV-205705.rb | 41 +++++++ controls/SV-205706.rb | 41 +++++++ controls/SV-205707.rb | 103 +++++++++++++++++ controls/SV-205708.rb | 38 ++++++ controls/SV-205709.rb | 30 +++++ controls/SV-205710.rb | 85 ++++++++++++++ controls/SV-205711.rb | 31 +++++ controls/SV-205712.rb | 31 +++++ controls/SV-205713.rb | 31 +++++ controls/SV-205714.rb | 30 +++++ controls/SV-205715.rb | 45 ++++++++ controls/SV-205716.rb | 41 +++++++ controls/SV-205717.rb | 45 ++++++++ controls/SV-205718.rb | 41 +++++++ controls/SV-205719.rb | 41 +++++++ controls/SV-205720.rb | 41 +++++++ controls/SV-205721.rb | 54 +++++++++ controls/SV-205722.rb | 31 +++++ controls/SV-205723.rb | 69 +++++++++++ controls/SV-205724.rb | 31 +++++ controls/SV-205725.rb | 31 +++++ controls/SV-205726.rb | 67 +++++++++++ controls/SV-205727.rb | 29 +++++ controls/SV-205728.rb | 24 ++++ controls/SV-205729.rb | 57 +++++++++ controls/SV-205730.rb | 72 ++++++++++++ controls/SV-205731.rb | 68 +++++++++++ controls/SV-205732.rb | 69 +++++++++++ controls/SV-205733.rb | 132 +++++++++++++++++++++ controls/SV-205734.rb | 104 +++++++++++++++++ controls/SV-205735.rb | 125 ++++++++++++++++++++ controls/SV-205736.rb | 116 +++++++++++++++++++ controls/SV-205737.rb | 139 ++++++++++++++++++++++ controls/SV-205738.rb | 68 +++++++++++ controls/SV-205739.rb | 90 +++++++++++++++ controls/SV-205740.rb | 115 ++++++++++++++++++ controls/SV-205741.rb | 117 +++++++++++++++++++ controls/SV-205742.rb | 188 ++++++++++++++++++++++++++++++ controls/SV-205743.rb | 262 ++++++++++++++++++++++++++++++++++++++++++ controls/SV-205744.rb | 71 ++++++++++++ controls/SV-205745.rb | 75 ++++++++++++ controls/SV-205746.rb | 84 ++++++++++++++ controls/SV-205747.rb | 64 +++++++++++ controls/SV-205748.rb | 68 +++++++++++ controls/SV-205749.rb | 58 ++++++++++ controls/SV-205750.rb | 72 ++++++++++++ controls/SV-205751.rb | 72 ++++++++++++ controls/SV-205752.rb | 61 ++++++++++ controls/SV-205753.rb | 70 +++++++++++ controls/SV-205754.rb | 72 ++++++++++++ controls/SV-205755.rb | 56 +++++++++ controls/SV-205756.rb | 69 +++++++++++ controls/SV-205757.rb | 76 ++++++++++++ controls/SV-205758.rb | 62 ++++++++++ controls/SV-205759.rb | 66 +++++++++++ controls/SV-205760.rb | 91 +++++++++++++++ controls/SV-205761.rb | 47 ++++++++ controls/SV-205762.rb | 62 ++++++++++ controls/SV-205763.rb | 67 +++++++++++ controls/SV-205764.rb | 62 ++++++++++ controls/SV-205765.rb | 62 ++++++++++ controls/SV-205766.rb | 62 ++++++++++ controls/SV-205767.rb | 72 ++++++++++++ controls/SV-205768.rb | 72 ++++++++++++ controls/SV-205769.rb | 58 ++++++++++ controls/SV-205770.rb | 57 +++++++++ controls/SV-205771.rb | 57 +++++++++ controls/SV-205772.rb | 57 +++++++++ controls/SV-205773.rb | 58 ++++++++++ controls/SV-205774.rb | 58 ++++++++++ controls/SV-205775.rb | 59 ++++++++++ controls/SV-205776.rb | 60 ++++++++++ controls/SV-205777.rb | 58 ++++++++++ controls/SV-205778.rb | 58 ++++++++++ controls/SV-205779.rb | 58 ++++++++++ controls/SV-205780.rb | 58 ++++++++++ controls/SV-205781.rb | 58 ++++++++++ controls/SV-205782.rb | 58 ++++++++++ controls/SV-205783.rb | 58 ++++++++++ controls/SV-205784.rb | 59 ++++++++++ controls/SV-205785.rb | 183 +++++++++++++++++++++++++++++ controls/SV-205786.rb | 223 +++++++++++++++++++++++++++++++++++ controls/SV-205787.rb | 166 ++++++++++++++++++++++++++ controls/SV-205788.rb | 198 +++++++++++++++++++++++++++++++ controls/SV-205789.rb | 171 +++++++++++++++++++++++++++ controls/SV-205790.rb | 167 +++++++++++++++++++++++++++ controls/SV-205791.rb | 68 +++++++++++ controls/SV-205792.rb | 68 +++++++++++ controls/SV-205793.rb | 68 +++++++++++ controls/SV-205794.rb | 68 +++++++++++ controls/SV-205795.rb | 64 +++++++++++ controls/SV-205796.rb | 42 +++++++ controls/SV-205797.rb | 43 +++++++ controls/SV-205798.rb | 42 +++++++ controls/SV-205799.rb | 30 +++++ controls/SV-205800.rb | 97 ++++++++++++++++ controls/SV-205801.rb | 38 ++++++ controls/SV-205802.rb | 38 ++++++ controls/SV-205803.rb | 36 ++++++ controls/SV-205804.rb | 31 +++++ controls/SV-205805.rb | 31 +++++ controls/SV-205806.rb | 31 +++++ controls/SV-205807.rb | 45 ++++++++ controls/SV-205808.rb | 32 ++++++ controls/SV-205809.rb | 32 ++++++ controls/SV-205810.rb | 32 ++++++ controls/SV-205811.rb | 43 +++++++ controls/SV-205812.rb | 43 +++++++ controls/SV-205813.rb | 43 +++++++ controls/SV-205814.rb | 33 ++++++ controls/SV-205815.rb | 31 +++++ controls/SV-205816.rb | 32 ++++++ controls/SV-205817.rb | 32 ++++++ controls/SV-205818.rb | 44 +++++++ controls/SV-205819.rb | 32 ++++++ controls/SV-205820.rb | 42 +++++++ controls/SV-205821.rb | 31 +++++ controls/SV-205822.rb | 31 +++++ controls/SV-205823.rb | 31 +++++ controls/SV-205824.rb | 33 ++++++ controls/SV-205825.rb | 31 +++++ controls/SV-205826.rb | 31 +++++ controls/SV-205827.rb | 31 +++++ controls/SV-205828.rb | 31 +++++ controls/SV-205829.rb | 31 +++++ controls/SV-205830.rb | 39 +++++++ controls/SV-205832.rb | 56 +++++++++ controls/SV-205833.rb | 57 +++++++++ controls/SV-205834.rb | 56 +++++++++ controls/SV-205835.rb | 58 ++++++++++ controls/SV-205836.rb | 56 +++++++++ controls/SV-205837.rb | 56 +++++++++ controls/SV-205838.rb | 57 +++++++++ controls/SV-205839.rb | 62 ++++++++++ controls/SV-205840.rb | 61 ++++++++++ controls/SV-205841.rb | 61 ++++++++++ controls/SV-205842.rb | 33 ++++++ controls/SV-205843.rb | 30 +++++ controls/SV-205844.rb | 33 ++++++ controls/SV-205845.rb | 54 +++++++++ controls/SV-205846.rb | 46 ++++++++ controls/SV-205847.rb | 76 ++++++++++++ controls/SV-205848.rb | 72 ++++++++++++ controls/SV-205849.rb | 42 +++++++ controls/SV-205850.rb | 40 +++++++ controls/SV-205851.rb | 38 ++++++ controls/SV-205852.rb | 38 ++++++ controls/SV-205853.rb | 56 +++++++++ controls/SV-205854.rb | 49 ++++++++ controls/SV-205855.rb | 68 +++++++++++ controls/SV-205856.rb | 43 +++++++ controls/SV-205857.rb | 42 +++++++ controls/SV-205858.rb | 44 +++++++ controls/SV-205859.rb | 43 +++++++ controls/SV-205860.rb | 44 +++++++ controls/SV-205861.rb | 37 ++++++ controls/SV-205862.rb | 69 +++++++++++ controls/SV-205863.rb | 42 +++++++ controls/SV-205864.rb | 114 ++++++++++++++++++ controls/SV-205865.rb | 63 ++++++++++ controls/SV-205866.rb | 43 +++++++ controls/SV-205867.rb | 47 ++++++++ controls/SV-205868.rb | 47 ++++++++ controls/SV-205869.rb | 49 ++++++++ controls/SV-205870.rb | 72 ++++++++++++ controls/SV-205871.rb | 56 +++++++++ controls/SV-205872.rb | 57 +++++++++ controls/SV-205873.rb | 37 ++++++ controls/SV-205874.rb | 56 +++++++++ controls/SV-205875.rb | 52 +++++++++ controls/SV-205876.rb | 42 +++++++ controls/SV-205877.rb | 73 ++++++++++++ controls/SV-205906.rb | 42 +++++++ controls/SV-205907.rb | 66 +++++++++++ controls/SV-205908.rb | 31 +++++ controls/SV-205909.rb | 34 ++++++ controls/SV-205910.rb | 29 +++++ controls/SV-205911.rb | 34 ++++++ controls/SV-205912.rb | 33 ++++++ controls/SV-205913.rb | 28 +++++ controls/SV-205914.rb | 31 +++++ controls/SV-205915.rb | 31 +++++ controls/SV-205916.rb | 31 +++++ controls/SV-205917.rb | 31 +++++ controls/SV-205918.rb | 31 +++++ controls/SV-205919.rb | 31 +++++ controls/SV-205920.rb | 31 +++++ controls/SV-205921.rb | 31 +++++ controls/SV-205922.rb | 31 +++++ controls/SV-205923.rb | 31 +++++ controls/SV-205924.rb | 42 +++++++ controls/SV-205925.rb | 31 +++++ controls/SV-214936.rb | 46 ++++++++ 274 files changed, 15707 insertions(+) create mode 100644 controls/SV-205624.rb create mode 100644 controls/SV-205625.rb create mode 100644 controls/SV-205626.rb create mode 100644 controls/SV-205627.rb create mode 100644 controls/SV-205628.rb create mode 100644 controls/SV-205629.rb create mode 100644 controls/SV-205630.rb create mode 100644 controls/SV-205631.rb create mode 100644 controls/SV-205632.rb create mode 100644 controls/SV-205633.rb create mode 100644 controls/SV-205634.rb create mode 100644 controls/SV-205635.rb create mode 100644 controls/SV-205636.rb create mode 100644 controls/SV-205637.rb create mode 100644 controls/SV-205638.rb create mode 100644 controls/SV-205639.rb create mode 100644 controls/SV-205640.rb create mode 100644 controls/SV-205641.rb create mode 100644 controls/SV-205642.rb create mode 100644 controls/SV-205643.rb create mode 100644 controls/SV-205644.rb create mode 100644 controls/SV-205645.rb create mode 100644 controls/SV-205646.rb create mode 100644 controls/SV-205647.rb create mode 100644 controls/SV-205648.rb create mode 100644 controls/SV-205649.rb create mode 100644 controls/SV-205650.rb create mode 100644 controls/SV-205651.rb create mode 100644 controls/SV-205652.rb create mode 100644 controls/SV-205653.rb create mode 100644 controls/SV-205654.rb create mode 100644 controls/SV-205655.rb create mode 100644 controls/SV-205656.rb create mode 100644 controls/SV-205657.rb create mode 100644 controls/SV-205658.rb create mode 100644 controls/SV-205659.rb create mode 100644 controls/SV-205660.rb create mode 100644 controls/SV-205661.rb create mode 100644 controls/SV-205662.rb create mode 100644 controls/SV-205663.rb create mode 100644 controls/SV-205664.rb create mode 100644 controls/SV-205665.rb create mode 100644 controls/SV-205666.rb create mode 100644 controls/SV-205667.rb create mode 100644 controls/SV-205668.rb create mode 100644 controls/SV-205669.rb create mode 100644 controls/SV-205670.rb create mode 100644 controls/SV-205671.rb create mode 100644 controls/SV-205672.rb create mode 100644 controls/SV-205673.rb create mode 100644 controls/SV-205674.rb create mode 100644 controls/SV-205675.rb create mode 100644 controls/SV-205676.rb create mode 100644 controls/SV-205677.rb create mode 100644 controls/SV-205678.rb create mode 100644 controls/SV-205679.rb create mode 100644 controls/SV-205680.rb create mode 100644 controls/SV-205681.rb create mode 100644 controls/SV-205682.rb create mode 100644 controls/SV-205683.rb create mode 100644 controls/SV-205684.rb create mode 100644 controls/SV-205685.rb create mode 100644 controls/SV-205686.rb create mode 100644 controls/SV-205687.rb create mode 100644 controls/SV-205688.rb create mode 100644 controls/SV-205689.rb create mode 100644 controls/SV-205690.rb create mode 100644 controls/SV-205691.rb create mode 100644 controls/SV-205692.rb create mode 100644 controls/SV-205693.rb create mode 100644 controls/SV-205694.rb create mode 100644 controls/SV-205695.rb create mode 100644 controls/SV-205696.rb create mode 100644 controls/SV-205697.rb create mode 100644 controls/SV-205698.rb create mode 100644 controls/SV-205699.rb create mode 100644 controls/SV-205700.rb create mode 100644 controls/SV-205701.rb create mode 100644 controls/SV-205702.rb create mode 100644 controls/SV-205703.rb create mode 100644 controls/SV-205704.rb create mode 100644 controls/SV-205705.rb create mode 100644 controls/SV-205706.rb create mode 100644 controls/SV-205707.rb create mode 100644 controls/SV-205708.rb create mode 100644 controls/SV-205709.rb create mode 100644 controls/SV-205710.rb create mode 100644 controls/SV-205711.rb create mode 100644 controls/SV-205712.rb create mode 100644 controls/SV-205713.rb create mode 100644 controls/SV-205714.rb create mode 100644 controls/SV-205715.rb create mode 100644 controls/SV-205716.rb create mode 100644 controls/SV-205717.rb create mode 100644 controls/SV-205718.rb create mode 100644 controls/SV-205719.rb create mode 100644 controls/SV-205720.rb create mode 100644 controls/SV-205721.rb create mode 100644 controls/SV-205722.rb create mode 100644 controls/SV-205723.rb create mode 100644 controls/SV-205724.rb create mode 100644 controls/SV-205725.rb create mode 100644 controls/SV-205726.rb create mode 100644 controls/SV-205727.rb create mode 100644 controls/SV-205728.rb create mode 100644 controls/SV-205729.rb create mode 100644 controls/SV-205730.rb create mode 100644 controls/SV-205731.rb create mode 100644 controls/SV-205732.rb create mode 100644 controls/SV-205733.rb create mode 100644 controls/SV-205734.rb create mode 100644 controls/SV-205735.rb create mode 100644 controls/SV-205736.rb create mode 100644 controls/SV-205737.rb create mode 100644 controls/SV-205738.rb create mode 100644 controls/SV-205739.rb create mode 100644 controls/SV-205740.rb create mode 100644 controls/SV-205741.rb create mode 100644 controls/SV-205742.rb create mode 100644 controls/SV-205743.rb create mode 100644 controls/SV-205744.rb create mode 100644 controls/SV-205745.rb create mode 100644 controls/SV-205746.rb create mode 100644 controls/SV-205747.rb create mode 100644 controls/SV-205748.rb create mode 100644 controls/SV-205749.rb create mode 100644 controls/SV-205750.rb create mode 100644 controls/SV-205751.rb create mode 100644 controls/SV-205752.rb create mode 100644 controls/SV-205753.rb create mode 100644 controls/SV-205754.rb create mode 100644 controls/SV-205755.rb create mode 100644 controls/SV-205756.rb create mode 100644 controls/SV-205757.rb create mode 100644 controls/SV-205758.rb create mode 100644 controls/SV-205759.rb create mode 100644 controls/SV-205760.rb create mode 100644 controls/SV-205761.rb create mode 100644 controls/SV-205762.rb create mode 100644 controls/SV-205763.rb create mode 100644 controls/SV-205764.rb create mode 100644 controls/SV-205765.rb create mode 100644 controls/SV-205766.rb create mode 100644 controls/SV-205767.rb create mode 100644 controls/SV-205768.rb create mode 100644 controls/SV-205769.rb create mode 100644 controls/SV-205770.rb create mode 100644 controls/SV-205771.rb create mode 100644 controls/SV-205772.rb create mode 100644 controls/SV-205773.rb create mode 100644 controls/SV-205774.rb create mode 100644 controls/SV-205775.rb create mode 100644 controls/SV-205776.rb create mode 100644 controls/SV-205777.rb create mode 100644 controls/SV-205778.rb create mode 100644 controls/SV-205779.rb create mode 100644 controls/SV-205780.rb create mode 100644 controls/SV-205781.rb create mode 100644 controls/SV-205782.rb create mode 100644 controls/SV-205783.rb create mode 100644 controls/SV-205784.rb create mode 100644 controls/SV-205785.rb create mode 100644 controls/SV-205786.rb create mode 100644 controls/SV-205787.rb create mode 100644 controls/SV-205788.rb create mode 100644 controls/SV-205789.rb create mode 100644 controls/SV-205790.rb create mode 100644 controls/SV-205791.rb create mode 100644 controls/SV-205792.rb create mode 100644 controls/SV-205793.rb create mode 100644 controls/SV-205794.rb create mode 100644 controls/SV-205795.rb create mode 100644 controls/SV-205796.rb create mode 100644 controls/SV-205797.rb create mode 100644 controls/SV-205798.rb create mode 100644 controls/SV-205799.rb create mode 100644 controls/SV-205800.rb create mode 100644 controls/SV-205801.rb create mode 100644 controls/SV-205802.rb create mode 100644 controls/SV-205803.rb create mode 100644 controls/SV-205804.rb create mode 100644 controls/SV-205805.rb create mode 100644 controls/SV-205806.rb create mode 100644 controls/SV-205807.rb create mode 100644 controls/SV-205808.rb create mode 100644 controls/SV-205809.rb create mode 100644 controls/SV-205810.rb create mode 100644 controls/SV-205811.rb create mode 100644 controls/SV-205812.rb create mode 100644 controls/SV-205813.rb create mode 100644 controls/SV-205814.rb create mode 100644 controls/SV-205815.rb create mode 100644 controls/SV-205816.rb create mode 100644 controls/SV-205817.rb create mode 100644 controls/SV-205818.rb create mode 100644 controls/SV-205819.rb create mode 100644 controls/SV-205820.rb create mode 100644 controls/SV-205821.rb create mode 100644 controls/SV-205822.rb create mode 100644 controls/SV-205823.rb create mode 100644 controls/SV-205824.rb create mode 100644 controls/SV-205825.rb create mode 100644 controls/SV-205826.rb create mode 100644 controls/SV-205827.rb create mode 100644 controls/SV-205828.rb create mode 100644 controls/SV-205829.rb create mode 100644 controls/SV-205830.rb create mode 100644 controls/SV-205832.rb create mode 100644 controls/SV-205833.rb create mode 100644 controls/SV-205834.rb create mode 100644 controls/SV-205835.rb create mode 100644 controls/SV-205836.rb create mode 100644 controls/SV-205837.rb create mode 100644 controls/SV-205838.rb create mode 100644 controls/SV-205839.rb create mode 100644 controls/SV-205840.rb create mode 100644 controls/SV-205841.rb create mode 100644 controls/SV-205842.rb create mode 100644 controls/SV-205843.rb create mode 100644 controls/SV-205844.rb create mode 100644 controls/SV-205845.rb create mode 100644 controls/SV-205846.rb create mode 100644 controls/SV-205847.rb create mode 100644 controls/SV-205848.rb create mode 100644 controls/SV-205849.rb create mode 100644 controls/SV-205850.rb create mode 100644 controls/SV-205851.rb create mode 100644 controls/SV-205852.rb create mode 100644 controls/SV-205853.rb create mode 100644 controls/SV-205854.rb create mode 100644 controls/SV-205855.rb create mode 100644 controls/SV-205856.rb create mode 100644 controls/SV-205857.rb create mode 100644 controls/SV-205858.rb create mode 100644 controls/SV-205859.rb create mode 100644 controls/SV-205860.rb create mode 100644 controls/SV-205861.rb create mode 100644 controls/SV-205862.rb create mode 100644 controls/SV-205863.rb create mode 100644 controls/SV-205864.rb create mode 100644 controls/SV-205865.rb create mode 100644 controls/SV-205866.rb create mode 100644 controls/SV-205867.rb create mode 100644 controls/SV-205868.rb create mode 100644 controls/SV-205869.rb create mode 100644 controls/SV-205870.rb create mode 100644 controls/SV-205871.rb create mode 100644 controls/SV-205872.rb create mode 100644 controls/SV-205873.rb create mode 100644 controls/SV-205874.rb create mode 100644 controls/SV-205875.rb create mode 100644 controls/SV-205876.rb create mode 100644 controls/SV-205877.rb create mode 100644 controls/SV-205906.rb create mode 100644 controls/SV-205907.rb create mode 100644 controls/SV-205908.rb create mode 100644 controls/SV-205909.rb create mode 100644 controls/SV-205910.rb create mode 100644 controls/SV-205911.rb create mode 100644 controls/SV-205912.rb create mode 100644 controls/SV-205913.rb create mode 100644 controls/SV-205914.rb create mode 100644 controls/SV-205915.rb create mode 100644 controls/SV-205916.rb create mode 100644 controls/SV-205917.rb create mode 100644 controls/SV-205918.rb create mode 100644 controls/SV-205919.rb create mode 100644 controls/SV-205920.rb create mode 100644 controls/SV-205921.rb create mode 100644 controls/SV-205922.rb create mode 100644 controls/SV-205923.rb create mode 100644 controls/SV-205924.rb create mode 100644 controls/SV-205925.rb create mode 100644 controls/SV-214936.rb diff --git a/controls/SV-205624.rb b/controls/SV-205624.rb new file mode 100644 index 0000000..d3b08ed --- /dev/null +++ b/controls/SV-205624.rb @@ -0,0 +1,139 @@ +# encoding: UTF-8 + + control 'SV-205624' do + title "Windows Server 2019 must automatically remove or disable temporary user accounts after #{input('temporary_account_period_phrase')}." + desc "If temporary user accounts remain active when no longer needed or for an excessive period, these accounts may be used to gain unauthorized access. To mitigate this risk, automated termination of all temporary accounts must be set upon account creation. + + Temporary accounts are established as part of normal account activation procedures when there is a need for short-term accounts without the demand for immediacy in account activation. + If temporary accounts are used, the operating system must be configured to automatically terminate these types of accounts after a #{input('org_name')[:acronym]}-defined time period of #{input('temporary_account_period_phrase')}. + To address access requirements, many operating systems may be integrated with enterprise-level authentication/access mechanisms that meet or exceed access control policy requirements." + desc 'rationale', '' + desc 'check', "Review temporary user accounts for expiration dates. + Determine if temporary user accounts are used and identify any that exist. If none exist, this is NA. + + Domain Controllers: + Open \"PowerShell\". + Enter \"Search-ADAccount -AccountExpiring | FT Name, AccountExpirationDate\". + If \"AccountExpirationDate\" has not been defined within #{input('temporary_account_period_phrase')} for any temporary user account, this is a finding. + + Member servers and standalone systems: + Open \"Command Prompt\". + Run \"Net user [username]\", where [username] is the name of the temporary user account. + If \"Account expires\" has not been defined within #{input('temporary_account_period_phrase')} for any temporary user account, this is a finding." + desc 'fix', "Configure temporary user accounts to automatically expire within #{input('temporary_account_period_phrase')}. + Domain accounts can be configured with an account expiration date, under \"Account\" properties. + Local accounts can be configured to expire with the command \"Net user [username] /expires:[mm/dd/yyyy]\", where username is the name of the temporary user account. + Delete any temporary user accounts that are no longer necessary." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000002-GPOS-00002' + tag 'gid': 'V-92975' + tag 'rid': 'SV-103063r1_rule' + tag 'stig_id': 'WN19-00-000300' + tag 'fix_id': 'F-99221r1_fix' + tag 'cci': ['CCI-000016'] + tag 'nist': ['AC-2 (2)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + expiring_accounts = [] + temporary_accounts = input('temp_accounts_domain') + unless temporary_accounts == [nil] + temporary_accounts.each do |temporary_account| + expiring_accounts << json({ command: "Get-ADUser -Identity #{temporary_account} -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json" }).params + end + end + ad_accounts = json({ command: "Get-ADUser -Filter 'Enabled -eq $true' -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json" }).params + if ad_accounts.empty? + impact 0.0 + describe 'This control is not applicable as no user accounts were found' do + skip 'This control is not applicable as no user accounts were found' + end + else + case ad_accounts + when Hash # One user account + if ad_accounts.fetch('AccountExpirationDate').nil? + impact 0.0 + describe 'This control is not applicable as no expiring user accounts were found' do + skip 'This control is not applicable as no expiring user accounts were found' + end + else + expiring_accounts << ad_accounts unless expiring_accounts.any? { |h| h['SamAccountName'] == ad_accounts.fetch('SamAccountName') } + end + when Array # Multiple user accounts + ad_accounts.each do |ad_account| + next if ad_account.fetch('AccountExpirationDate').nil? + expiring_accounts << ad_account unless expiring_accounts.any? { |h| h['SamAccountName'] == ad_account.fetch('SamAccountName') } + end + end + end + if expiring_accounts.empty? + impact 0.0 + describe 'This control is not applicable as no expiring user accounts were found' do + skip 'This control is not applicable as no expiring user accounts were found' + end + else + expiring_accounts.each do |expiring_account| + account_name = expiring_account.fetch('SamAccountName') + creation_date = Date.parse(expiring_account.fetch('WhenCreated')) + expiration_date = Date.parse(expiring_account.fetch('AccountExpirationDate')) + date_difference = expiration_date.mjd - creation_date.mjd + describe "Account expiration set for #{account_name}" do + subject { date_difference } + it { should cmp <= input('temporary_account_period') } + end + end + end + + else + expiring_users = [] + temporary_accounts = input('temp_accounts_local') + unless temporary_accounts == [nil] + temporary_accounts.each do |temporary_account| + expiring_users << json({ command: "Get-LocalUser -Name #{temporary_account} | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json" }).params + end + end + local_users = json({ command: "Get-LocalUser * | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json" }).params + if local_users.empty? + impact 0.0 + describe 'This control is not applicable as no user accounts were found' do + skip 'This control is not applicable as no user accounts were found' + end + else + case local_users + when Hash # One user account + if local_users.fetch('AccountExpires').nil? || local_user.fetch('PasswordLastSet').nil? + impact 0.0 + describe 'This control is not applicable as no expiring user accounts with password last set date were found' do + skip 'This control is not applicable as no expiring user accounts password last set date were found' + end + else + expiring_users << local_users unless expiring_users.any? { |h| h['Name'] == local_users.fetch('Name') } + end + when Array # Multiple user accounts + local_users.each do |local_user| + next if local_user.fetch('AccountExpires').nil? || local_user.fetch('PasswordLastSet').nil? + expiring_users << local_user unless expiring_users.any? { |h| h['Name'] == local_user.fetch('Name') } + end + end + end + if expiring_users.empty? + impact 0.0 + describe 'This control is not applicable as no expiring user accounts with password last set date were found' do + skip 'This control is not applicable as no expiring user accounts with password last set date were found' + end + else + expiring_users.each do |expiring_account| + user_name = expiring_account.fetch('Name') + password_date = Date.parse(expiring_account.fetch('PasswordLastSet')) + expiration_date = Date.parse(expiring_account.fetch('AccountExpires')) + date_difference = expiration_date.mjd - password_date.mjd + describe "Account expiration set for #{user_name}" do + subject { date_difference } + it { should cmp <= input('temporary_account_period') } + end + end + end + end + end \ No newline at end of file diff --git a/controls/SV-205625.rb b/controls/SV-205625.rb new file mode 100644 index 0000000..d12a4b5 --- /dev/null +++ b/controls/SV-205625.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205625" do + title "Windows Server 2019 must be configured to audit Account Management - +Security Group Management successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Security Group Management records events such as creating, deleting, or +changing security groups, including changes in group members." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Management >> Security Group Management - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit Security Group +Management\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000004-GPOS-00004' + tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", +"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", +"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] + tag 'gid': 'V-92979' + tag 'rid': 'SV-103067r1_rule' + tag 'stig_id': 'WN19-AU-000100' + tag 'fix_id': 'F-99225r1_fix' + tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", +"CCI-001405", "CCI-002130"] + tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 +(4)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Security Group Management') { should eq 'Success' } + end + describe audit_policy do + its('Security Group Management') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205626.rb b/controls/SV-205626.rb new file mode 100644 index 0000000..1d2150a --- /dev/null +++ b/controls/SV-205626.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205626" do + title "Windows Server 2019 must be configured to audit Account Management - +User Account Management successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + User Account Management records events such as creating, changing, +deleting, renaming, disabling, or enabling user accounts." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Management >> User Account Management - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit User Account +Management\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000004-GPOS-00004' + tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", +"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", +"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] + tag 'gid': 'V-92981' + tag 'rid': 'SV-103069r1_rule' + tag 'stig_id': 'WN19-AU-000110' + tag 'fix_id': 'F-99227r1_fix' + tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", +"CCI-001405", "CCI-002130"] + tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 +(4)", "Rev_4"] + + describe.one do + describe audit_policy do + its('User Account Management') { should eq 'Success' } + end + describe audit_policy do + its('User Account Management') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205627.rb b/controls/SV-205627.rb new file mode 100644 index 0000000..e905c55 --- /dev/null +++ b/controls/SV-205627.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205627" do + title "Windows Server 2019 must be configured to audit Account Management - +User Account Management failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + User Account Management records events such as creating, changing, +deleting, renaming, disabling, or enabling user accounts." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Management >> User Account Management - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit User Account +Management\" with \"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000004-GPOS-00004' + tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", +"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", +"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] + tag 'gid': 'V-92983' + tag 'rid': 'SV-103071r1_rule' + tag 'stig_id': 'WN19-AU-000120' + tag 'fix_id': 'F-99229r1_fix' + tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", +"CCI-001405", "CCI-002130"] + tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 +(4)", "Rev_4"] + + describe.one do + describe audit_policy do + its('User Account Management') { should eq 'Failure' } + end + describe audit_policy do + its('User Account Management') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205628.rb b/controls/SV-205628.rb new file mode 100644 index 0000000..c4cd2f3 --- /dev/null +++ b/controls/SV-205628.rb @@ -0,0 +1,70 @@ +# encoding: UTF-8 + +control 'SV-205628' do + title "Windows Server 2019 must be configured to audit Account Management - +Computer Account Management successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Computer Account Management records events such as creating, changing, +deleting, renaming, disabling, or enabling computer accounts." + desc 'rationale', '' + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Management >> Computer Account Management - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit Computer Account +Management\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000004-GPOS-00004' + tag 'satisfies': %w(SRG-OS-000004-GPOS-00004 SRG-OS-000239-GPOS-00089 +SRG-OS-000240-GPOS-00090 SRG-OS-000241-GPOS-00091 +SRG-OS-000303-GPOS-00120 SRG-OS-000476-GPOS-00221) + tag 'gid': 'V-92985' + tag 'rid': 'SV-103073r1_rule' + tag 'stig_id': 'WN19-DC-000230' + tag 'fix_id': 'F-99231r1_fix' + tag 'cci': %w(CCI-000018 CCI-000172 CCI-001403 CCI-001404 +CCI-001405 CCI-002130) + tag 'nist': ['AC-2 (4)', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', "AC-2 +(4)", 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + describe.one do + describe audit_policy do + its('Computer Account Management') { should eq 'Success' } + end + describe audit_policy do + its('Computer Account Management') { should eq 'Success and Failure' } + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable' do + skip 'This system is not a domain controller, therefore this control is not applicable' + end + end +end diff --git a/controls/SV-205629.rb b/controls/SV-205629.rb new file mode 100644 index 0000000..3cb6611 --- /dev/null +++ b/controls/SV-205629.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205629" do + title "Windows Server 2019 must have the number of allowed bad logon attempts +configured to #{input('max_pass_lockout')} or less." + desc "The account lockout feature, when enabled, prevents brute-force +password attacks on the system. The higher this value is, the less effective +the account lockout feature will be in protecting the local system. The number +of bad logon attempts must be reasonably small to minimize the possibility of a +successful password attack while allowing for honest errors made during normal +user logon." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Account Policies >> Account Lockout Policy. + + If the \"Account lockout threshold\" is \"0\" or more than \"#{input('max_pass_lockout')}\" attempts, +this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + + If \"LockoutBadCount\" equals \"0\" or is greater than \"#{input('max_pass_lockout')}\" in the file, +this is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Account Policies >> Account Lockout +Policy >> \"Account lockout threshold\" to \"#{input('max_pass_lockout')}\" or fewer invalid logon +attempts (excluding \"0\", which is unacceptable)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000021-GPOS-00005' + tag 'gid': 'V-93141' + tag 'rid': 'SV-103229r1_rule' + tag 'stig_id': 'WN19-AC-000020' + tag 'fix_id': 'F-99387r1_fix' + tag 'cci': ["CCI-000044"] + tag 'nist': ["AC-7 a", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('LockoutBadCount') { should be <= input('max_pass_lockout') } + end + describe security_policy do + its('LockoutBadCount') { should be > 0 } + end + end +end + diff --git a/controls/SV-205630.rb b/controls/SV-205630.rb new file mode 100644 index 0000000..13f7fae --- /dev/null +++ b/controls/SV-205630.rb @@ -0,0 +1,53 @@ +# encoding: UTF-8 + +control "SV-205630" do + title "Windows Server 2019 must have the period of time before the bad logon +counter is reset configured to #{input('pass_lock_time')} minutes or greater." + desc "The account lockout feature, when enabled, prevents brute-force +password attacks on the system. This parameter specifies the period of time +that must pass after failed logon attempts before the counter is reset to +\"0\". The smaller this value is, the less effective the account lockout +feature will be in protecting the local system." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Account Policies >> Account Lockout Policy. + + If the \"Reset account lockout counter after\" value is less than \"#{input('pass_lock_time')}\" +minutes, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + + If \"ResetLockoutCount\" is less than \"#{input('pass_lock_time')}\" in the file, this is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Account Policies >> Account Lockout +Policy >> \"Reset account lockout counter after\" to at least \"#{input('pass_lock_time')}\" minutes." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000021-GPOS-00005' + tag 'satisfies': ["SRG-OS-000021-GPOS-00005", "SRG-OS-000329-GPOS-00128"] + tag 'gid': 'V-93143' + tag 'rid': 'SV-103231r1_rule' + tag 'stig_id': 'WN19-AC-000030' + tag 'fix_id': 'F-99389r1_fix' + tag 'cci': ["CCI-000044", "CCI-002238"] + tag 'nist': ["AC-7 a", "AC-7 b", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('ResetLockoutCount') { should be >= input('pass_lock_time') } + end + end +end + diff --git a/controls/SV-205631.rb b/controls/SV-205631.rb new file mode 100644 index 0000000..4caa5ec --- /dev/null +++ b/controls/SV-205631.rb @@ -0,0 +1,55 @@ +# encoding: UTF-8 + +control "SV-205631" do + title "Windows Server 2019 required legal notice must be configured to +display before console logon." + desc "Failure to display the logon banner prior to a logon attempt will +negate legal proceedings resulting from unauthorized access to system resources." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: LegalNoticeText + + Value Type: REG_SZ + Value: See message text below + + #{input('LegalNoticeText')}" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> Security Options >> \"Interactive +Logon: Message text for users attempting to log on\" to the following: + + #{input('LegalNoticeText')}" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000023-GPOS-00006' + tag 'satisfies': ["SRG-OS-000023-GPOS-00006", "SRG-OS-000024-GPOS-00007", +"SRG-OS-000228-GPOS-00088"] + tag 'gid': 'V-93147' + tag 'rid': 'SV-103235r1_rule' + tag 'stig_id': 'WN19-SO-000130' + tag 'fix_id': 'F-99393r1_fix' + tag 'cci': ["CCI-000048", "CCI-000050", "CCI-001384", "CCI-001385", +"CCI-001386", "CCI-001387", "CCI-001388"] + tag 'nist': ["AC-8 a", "AC-8 b", "AC-8 c 1", "AC-8 c 2", "AC-8 c 2", "AC-8 c +2", "AC-8 c 3", "Rev_4"] + +describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'LegalNoticeText' } + end + + key = registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System').LegalNoticeText.to_s + + k = key.gsub("\u0000", '') + legal_notice_text = input('LegalNoticeText') + + describe 'The required legal notice text' do + subject { k.scan(/[\w().;,!]/).join } + it { should cmp legal_notice_text.scan(/[\w().;,!]/).join } + end +end + diff --git a/controls/SV-205632.rb b/controls/SV-205632.rb new file mode 100644 index 0000000..d45913d --- /dev/null +++ b/controls/SV-205632.rb @@ -0,0 +1,40 @@ +# encoding: UTF-8 + +control "SV-205632" do + title "Windows Server 2019 title for legal banner dialog box must be configured with the appropriate text." + desc "Failure to display the logon banner prior to a logon attempt will negate legal proceedings resulting from unauthorized access to system resources." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: LegalNoticeCaption + + Value Type: REG_SZ + Value: See message title options below + + \"#{input('LegalNoticeCaption').join("\", \"")}\", or an organization-defined equivalent. + + If an organization-defined title is used, it can in no case contravene or modify the language of the banner text required in WN19-SO-000150. + + Automated tools may only search for the titles defined above. If an organization-defined title is used, a manual review will be required." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive Logon: Message title for users attempting to log on\" to \"#{input('LegalNoticeCaption').join("\", \"")}\", or an organization-defined equivalent. + + If an organization-defined title is used, it can in no case contravene or modify the language of the message text required in WN19-SO-000150." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000023-GPOS-00006' + tag 'satisfies': ["SRG-OS-000023-GPOS-00006", "SRG-OS-000228-GPOS-00088"] + tag 'gid': 'V-93149' + tag 'rid': 'SV-103237r1_rule' + tag 'stig_id': 'WN19-SO-000140' + tag 'fix_id': 'F-99395r1_fix' + tag 'cci': ["CCI-000048", "CCI-001384", "CCI-001385", "CCI-001386", "CCI-001387", "CCI-001388"] + tag 'nist': ["AC-8 a", "AC-8 c 1", "AC-8 c 2", "AC-8 c 2", "AC-8 c 2", "AC-8 c 3", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'LegalNoticeCaption' } + its('LegalNoticeCaption') { should be_in input('LegalNoticeCaption') } + end +end \ No newline at end of file diff --git a/controls/SV-205633.rb b/controls/SV-205633.rb new file mode 100644 index 0000000..c3121e1 --- /dev/null +++ b/controls/SV-205633.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205633" do + title "Windows Server 2019 machine inactivity limit must be set to 15 minutes +or less, locking the system with the screen saver." + desc "Unattended systems are susceptible to unauthorized use and should be +locked when unattended. The screen saver should be set at a maximum of 15 +minutes and be password protected. This protects critical and sensitive data +from exposure to unauthorized personnel with physical access to the computer." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: InactivityTimeoutSecs + + Value Type: REG_DWORD + Value: 0x00000384 (900) (or less, excluding \"0\" which is effectively +disabled)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> Security Options >> +\"Interactive logon: Machine inactivity limit\" to \"900\" seconds or less, +excluding \"0\" which is effectively disabled." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000028-GPOS-00009' + tag 'satisfies': ["SRG-OS-000028-GPOS-00009", "SRG-OS-000029-GPOS-00010", +"SRG-OS-000031-GPOS-00012"] + tag 'gid': 'V-92961' + tag 'rid': 'SV-103049r1_rule' + tag 'stig_id': 'WN19-SO-000120' + tag 'fix_id': 'F-99207r1_fix' + tag 'cci': ["CCI-000056", "CCI-000057", "CCI-000060"] + tag 'nist': ["AC-11 b", "AC-11 a", "AC-11 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System') do + its('InactivityTimeoutSecs') { should be <= 900 } + its('InactivityTimeoutSecs') { should_not eq 0 } + end +end + diff --git a/controls/SV-205634.rb b/controls/SV-205634.rb new file mode 100644 index 0000000..507f9aa --- /dev/null +++ b/controls/SV-205634.rb @@ -0,0 +1,59 @@ +# encoding: UTF-8 + +control "SV-205634" do + title "Windows Server 2019 must be configured to audit logon successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Logon records user logons. If this is an interactive logon, it is recorded +on the local system. If it is to a network share, it is recorded on the system +accessed." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Logon - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Logon/Logoff >> \"Audit Logon\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': "SRG-OS-000032-GPOS-00013" + tag 'satisfies': ["SRG-OS-000032-GPOS-00013", "SRG-OS-000470-GPOS-00214", +"SRG-OS-000472-GPOS-00217", "SRG-OS-000473-GPOS-00218", +"SRG-OS-000475-GPOS-00220"] + tag 'gid': 'V-92967' + tag 'rid': 'SV-103055r1_rule' + tag 'stig_id': 'WN19-AU-000190' + tag 'fix_id': 'F-99213r1_fix' + tag 'cci': ["CCI-000067", "CCI-000172"] + tag 'nist': ["AC-17 (1)", "AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Logon') { should eq 'Success' } + end + describe audit_policy do + its('Logon') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205635.rb b/controls/SV-205635.rb new file mode 100644 index 0000000..43ef1ee --- /dev/null +++ b/controls/SV-205635.rb @@ -0,0 +1,59 @@ +# encoding: UTF-8 + +control "SV-205635" do + title "Windows Server 2019 must be configured to audit logon failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Logon records user logons. If this is an interactive logon, it is recorded +on the local system. If it is to a network share, it is recorded on the system +accessed." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Logon - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Logon/Logoff >> \"Audit Logon\" with \"Failure\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000032-GPOS-00013' + tag 'satisfies': ["SRG-OS-000032-GPOS-00013", "SRG-OS-000470-GPOS-00214", +"SRG-OS-000472-GPOS-00217", "SRG-OS-000473-GPOS-00218", +"SRG-OS-000475-GPOS-00220"] + tag 'gid': 'V-92969' + tag 'rid': 'SV-103057r1_rule' + tag 'stig_id': 'WN19-AU-000200' + tag 'fix_id': 'F-99215r1_fix' + tag 'cci': ["CCI-000067", "CCI-000172"] + tag 'nist': ["AC-17 (1)", "AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Logon') { should eq 'Failure' } + end + describe audit_policy do + its('Logon') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205636.rb b/controls/SV-205636.rb new file mode 100644 index 0000000..f1235f5 --- /dev/null +++ b/controls/SV-205636.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205636" do + title "Windows Server 2019 Remote Desktop Services must require secure Remote +Procedure Call (RPC) communications." + desc "Allowing unsecure RPC communication exposes the system to +man-in-the-middle attacks and data disclosure attacks. A man-in-the-middle +attack occurs when an intruder captures packets between a client and server and +modifies them before allowing the packets to be exchanged. Usually the attacker +will modify the information in the packets in an attempt to cause either the +client or server to reveal sensitive information." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal +Services\\ + + Value Name: fEncryptRPCTraffic + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Remote Desktop Services >> +Remote Desktop Session Host >> Security >> \"Require secure RPC communication\" +to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000033-GPOS-00014' + tag 'satisfies': ["SRG-OS-000033-GPOS-00014", "SRG-OS-000250-GPOS-00093"] + tag 'gid': 'V-92971' + tag 'rid': 'SV-103059r1_rule' + tag 'stig_id': 'WN19-CC-000370' + tag 'fix_id': 'F-99217r1_fix' + tag 'cci': ["CCI-000068", "CCI-001453"] + tag 'nist': ["AC-17 (2)", "AC-17 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services') do + it { should have_property "fEncryptRPCTraffic"} + its("fEncryptRPCTraffic") { should cmp 1 } + end +end + diff --git a/controls/SV-205637.rb b/controls/SV-205637.rb new file mode 100644 index 0000000..f4f098e --- /dev/null +++ b/controls/SV-205637.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205637" do + title "Windows Server 2019 Remote Desktop Services must be configured with +the client connection encryption set to High Level." + desc "Remote connections must be encrypted to prevent interception of data +or sensitive information. Selecting \"High Level\" will ensure encryption of +Remote Desktop Services sessions in both directions." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal +Services\\ + + Value Name: MinEncryptionLevel + + Type: REG_DWORD + Value: 0x00000003 (3)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Remote Desktop Services >> +Remote Desktop Session Host >> Security >> \"Set client connection encryption +level\" to \"Enabled\" with \"High Level\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000033-GPOS-00014' + tag 'satisfies': ["SRG-OS-000033-GPOS-00014", "SRG-OS-000250-GPOS-00093"] + tag 'gid': 'V-92973' + tag 'rid': 'SV-103061r1_rule' + tag 'stig_id': 'WN19-CC-000380' + tag 'fix_id': 'F-99219r1_fix' + tag 'cci': ["CCI-000068", "CCI-001453"] + tag 'nist': ["AC-17 (2)", "AC-17 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services') do + it { should have_property "MinEncryptionLevel"} + its("MinEncryptionLevel") { should cmp 3 } + end +end + diff --git a/controls/SV-205638.rb b/controls/SV-205638.rb new file mode 100644 index 0000000..035703e --- /dev/null +++ b/controls/SV-205638.rb @@ -0,0 +1,46 @@ +# encoding: UTF-8 + +control "SV-205638" do + title "Windows Server 2019 command line data must be included in process +creation events." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Enabling \"Include command line data for process creation events\" will +record the command line information with the process creation events in the +log. This can provide additional detail when malware has run on a system." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Audit\\ + + Value Name: ProcessCreationIncludeCmdLine_Enabled + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> System >> Audit Process Creation >> \"Include +command line in process creation events\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000042-GPOS-00020' + tag 'gid': 'V-93173' + tag 'rid': 'SV-103261r1_rule' + tag 'stig_id': 'WN19-CC-000090' + tag 'fix_id': 'F-99419r1_fix' + tag 'cci': ["CCI-000135"] + tag 'nist': ["AU-3 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit') do + it { should have_property 'ProcessCreationIncludeCmdLine_Enabled' } + its('ProcessCreationIncludeCmdLine_Enabled') { should cmp 1 } + end +end + diff --git a/controls/SV-205639.rb b/controls/SV-205639.rb new file mode 100644 index 0000000..bb45ba5 --- /dev/null +++ b/controls/SV-205639.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205639" do + title "Windows Server 2019 PowerShell script block logging must be enabled." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Enabling PowerShell script block logging will record detailed information +from the processing of PowerShell commands and scripts. This can provide +additional detail when malware has run on a system." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ScriptBlockLogging\\ + + Value Name: EnableScriptBlockLogging + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Windows PowerShell >> \"Turn +on PowerShell Script Block Logging\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000042-GPOS-00020' + tag 'gid': 'V-93175' + tag 'rid': 'SV-103263r1_rule' + tag 'stig_id': 'WN19-CC-000460' + tag 'fix_id': 'F-99421r1_fix' + tag 'cci': ["CCI-000135"] + tag 'nist': ["AU-3 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging') do + it { should have_property 'EnableScriptBlockLogging' } + its('EnableScriptBlockLogging') { should cmp 1 } + end +end + diff --git a/controls/SV-205640.rb b/controls/SV-205640.rb new file mode 100644 index 0000000..fd77aa5 --- /dev/null +++ b/controls/SV-205640.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control "SV-205640" do + title "Windows Server 2019 permissions for the Application event log must +prevent access by non-privileged accounts." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. The +Application event log may be susceptible to tampering if proper permissions are +not applied." + desc "rationale", "" + desc 'check', "Navigate to the Application event log file. + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" +folder. However, the logs may have been moved to another folder. + + If the permissions for the \"Application.evtx\" file are not as restrictive +as the default permissions listed below, this is a finding: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control" + desc 'fix', "Configure the permissions on the Application event log file +(Application.evtx) to prevent access by non-privileged accounts. The default +permissions listed below satisfy this requirement: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. + + If the location of the logs has been changed, when adding Eventlog to the +permissions, it must be entered as \"NT Service\\Eventlog\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000057-GPOS-00027' + tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", +"SRG-OS-000059-GPOS-00029"] + tag 'gid': 'V-93189' + tag 'rid': 'SV-103277r1_rule' + tag 'stig_id': 'WN19-AU-000030' + tag 'fix_id': 'F-99435r1_fix' + tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] + tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] + + get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip + system_root = get_system_root[11..get_system_root.length] + + systemroot = system_root.strip + + winevt_logs_application = <<-EOH + $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\Application.evtx).AccessToString + write-output $output + EOH + + # raw powershell output + raw_logs_application = powershell(winevt_logs_application).stdout.strip + + # clean results cleans up the extra line breaks + clean_logs_application = raw_logs_application.lines.collect(&:strip) + + describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\Application.evtx' do + subject { clean_logs_application } + it { should cmp input('winevt_logs_application_perms') } + end +end + diff --git a/controls/SV-205641.rb b/controls/SV-205641.rb new file mode 100644 index 0000000..d97d424 --- /dev/null +++ b/controls/SV-205641.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control "SV-205641" do + title "Windows Server 2019 permissions for the Security event log must +prevent access by non-privileged accounts." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. The +Security event log may disclose sensitive information or be susceptible to +tampering if proper permissions are not applied." + desc "rationale", "" + desc 'check', "Navigate to the Security event log file. + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" +folder. However, the logs may have been moved to another folder. + + If the permissions for the \"Security.evtx\" file are not as restrictive as +the default permissions listed below, this is a finding: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control" + desc 'fix', "Configure the permissions on the Security event log file (Security.evtx) to +prevent access by non-privileged accounts. The default permissions listed below +satisfy this requirement: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. + + If the location of the logs has been changed, when adding Eventlog to the +permissions, it must be entered as \"NT Service\\Eventlog\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000057-GPOS-00027' + tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", +"SRG-OS-000059-GPOS-00029"] + tag 'gid': 'V-93191' + tag 'rid': 'SV-103279r1_rule' + tag 'stig_id': 'WN19-AU-000040' + tag 'fix_id': 'F-99437r1_fix' + tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] + tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] + + get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip + system_root = get_system_root[11..get_system_root.length] + + systemroot = system_root.strip + + winevt_logs_security = <<-EOH + $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\Security.evtx).AccessToString + write-output $output + EOH + + # raw powershell output + raw_logs_security = powershell(winevt_logs_security).stdout.strip + + # clean results cleans up the extra line breaks + clean_logs_security = raw_logs_security.lines.collect(&:strip) + + describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\Security.evtx' do + subject { clean_logs_security } + it { should cmp input('winevt_logs_security_perms') } + end +end + diff --git a/controls/SV-205642.rb b/controls/SV-205642.rb new file mode 100644 index 0000000..d018c65 --- /dev/null +++ b/controls/SV-205642.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control "SV-205642" do + title "Windows Server 2019 permissions for the System event log must prevent +access by non-privileged accounts." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. The +System event log may be susceptible to tampering if proper permissions are not +applied." + desc "rationale", "" + desc 'check', "Navigate to the System event log file. + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" +folder. However, the logs may have been moved to another folder. + + If the permissions for the \"System.evtx\" file are not as restrictive as +the default permissions listed below, this is a finding: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control" + desc 'fix', "Configure the permissions on the System event log file (System.evtx) to +prevent access by non-privileged accounts. The default permissions listed below +satisfy this requirement: + + Eventlog - Full Control + SYSTEM - Full Control + Administrators - Full Control + + The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. + + If the location of the logs has been changed, when adding Eventlog to the +permissions, it must be entered as \"NT Service\\Eventlog\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000057-GPOS-00027' + tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", +"SRG-OS-000059-GPOS-00029"] + tag 'gid': 'V-93193' + tag 'rid': 'SV-103281r1_rule' + tag 'stig_id': 'WN19-AU-000050' + tag 'fix_id': 'F-99439r1_fix' + tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] + tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] + + get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip + system_root = get_system_root[11..get_system_root.length] + + systemroot = system_root.strip + + winevt_logs_system = <<-EOH + $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\System.evtx).AccessToString + write-output $output + EOH + + # raw powershell output + raw_logs_system = powershell(winevt_logs_system).stdout.strip + + # clean results cleans up the extra line breaks + clean_logs_system = raw_logs_system.lines.collect(&:strip) + + describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\System.evtx' do + subject { clean_logs_system } + it { should cmp input('winevt_logs_system_perms') } + end +end + diff --git a/controls/SV-205643.rb b/controls/SV-205643.rb new file mode 100644 index 0000000..06d64aa --- /dev/null +++ b/controls/SV-205643.rb @@ -0,0 +1,79 @@ +# encoding: UTF-8 + +control "SV-205643" do + title "Windows Server 2019 Manage auditing and security log user right must +only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Manage auditing and security log\" user right can +manage the security log and change auditing configurations. This could be used +to clear evidence of tampering." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Manage +auditing and security log\" user right, this is a finding. + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeSecurityPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If the organization has an Auditors group, the assignment of this group to +the user right would not be a finding. + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Manage +auditing and security log\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000057-GPOS-00027' + tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", +"SRG-OS-000059-GPOS-00029", "SRG-OS-000063-GPOS-00032", +"SRG-OS-000337-GPOS-00129"] + tag 'gid': 'V-93197' + tag 'rid': 'SV-103285r1_rule' + tag 'stig_id': 'WN19-UR-000170' + tag 'fix_id': 'F-99443r1_fix' + tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164", "CCI-000171", +"CCI-001914"] + tag 'nist': ["AU-9", "AU-9", "AU-9", "AU-12 b", "AU-12 (3)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeSecurityPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205644.rb b/controls/SV-205644.rb new file mode 100644 index 0000000..623004d --- /dev/null +++ b/controls/SV-205644.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205644" do + title "Windows Server 2019 must force audit policy subcategory settings to +override audit policy category settings." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + This setting allows administrators to enable more precise auditing +capabilities." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: SCENoApplyLegacyAuditPolicy + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> Security Options >> +\"Audit: Force audit policy subcategory settings (Windows Vista or later) to +override audit policy category settings\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000062-GPOS-00031' + tag 'gid': 'V-93151' + tag 'rid': 'SV-103239r1_rule' + tag 'stig_id': 'WN19-SO-000050' + tag 'fix_id': 'F-99397r1_fix' + tag 'cci': ["CCI-000169"] + tag 'nist': ["AU-12 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa') do + it { should have_property 'SCENoApplyLegacyAuditPolicy' } + its('SCENoApplyLegacyAuditPolicy') { should cmp 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205645.rb b/controls/SV-205645.rb new file mode 100644 index 0000000..452403b --- /dev/null +++ b/controls/SV-205645.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205645" do + title "Windows Server 2019 domain controllers must have a PKI server certificate." + desc "Domain controllers are part of the chain of trust for PKI authentications. Without the appropriate certificate, the authenticity of the domain controller cannot be verified. Domain controllers must have a server certificate to establish authenticity as part of PKI authentications in the domain." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + Run \"MMC\". + Select \"Add/Remove Snap-in\" from the \"File\" menu. + Select \"Certificates\" in the left pane and click the \"Add >\" button. + Select \"Computer Account\" and click \"Next\". + Select the appropriate option for \"Select the computer you want this snap-in to manage\" and click \"Finish\". + Click \"OK\". + Select and expand the Certificates (Local Computer) entry in the left pane. + Select and expand the Personal entry in the left pane. + Select the Certificates entry in the left pane. + If no certificate for the domain controller exists in the right pane, this is a finding." + desc "fix", "Obtain a server certificate for the domain controller." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag gid: "V-93481" + tag rid: "SV-103567r1_rule" + tag stig_id: "WN19-DC-000280" + tag fix_id: "F-99725r1_fix" + tag cci: ["CCI-000185"] + tag nist: ["IA-5 (2) (a)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + certs = command("Get-ChildItem -Path Cert:\\LocalMachine\\My | ConvertTo-JSON").stdout + describe 'Verify that the domain controller has a PKI server certificate.' do + subject { certs } + it { should_not be_empty } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205646.rb b/controls/SV-205646.rb new file mode 100644 index 0000000..def16c0 --- /dev/null +++ b/controls/SV-205646.rb @@ -0,0 +1,48 @@ +# encoding: UTF-8 + +control "SV-205646" do + title "Windows Server 2019 domain Controller PKI certificates must be issued by the #{input('org_name')[:acronym]} PKI or an approved External Certificate Authority (ECA)." + desc "A PKI implementation depends on the practices established by the Certificate Authority (CA) to ensure the implementation is secure. Without proper practices, the certificates issued by a CA have limited value in authentication functions. The use of multiple CAs from separate PKI implementations results in interoperability issues. If servers and clients do not have a common set of root CA certificates, they are not able to authenticate each other." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + Run \"MMC\". + Select \"Add/Remove Snap-in\" from the \"File\" menu. + Select \"Certificates\" in the left pane and click the \"Add >\" button. + Select \"Computer Account\" and click \"Next\". + Select the appropriate option for \"Select the computer you want this snap-in to manage\" and click \"Finish\". + Click \"OK\". + Select and expand the Certificates (Local Computer) entry in the left pane. + Select and expand the Personal entry in the left pane. + Select the Certificates entry in the left pane. In the right pane, examine the \"Issued By\" field for the certificate to determine the issuing CA. + If the \"Issued By\" field of the PKI certificate being used by the domain controller does not indicate the issuing CA is part of the #{input('org_name')[:acronym]} PKI or an approved ECA, this is a finding. + If the certificates in use are issued by a CA authorized by the Component's CIO, this is a CAT II finding. + There are multiple sources from which lists of valid #{input('org_name')[:acronym]} CAs and approved ECAs can be obtained: + + The Global Directory Service (GDS) website provides an online source. The address for this site is https://crl.gds.disa.mil. + + #{input('org_name')[:acronym]} Public Key Enablement (PKE) Engineering Support maintains the InstallRoot utility to manage #{input('org_name')[:acronym]} supported root certificates on Windows computers, which includes a list of authorized CAs. The utility package can be downloaded from the PKI and PKE Tools page on IASE: + http://iase.disa.mil/pki-pke/function_pages/tools.html" + desc "fix", "Obtain a server certificate for the domain controller issued by the #{input('org_name')[:acronym]} PKI or an approved ECA." + impact 0.7 + tag 'severity': nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag gid: "V-93483" + tag rid: "SV-103569r1_rule" + tag stig_id: "WN19-DC-000290" + tag fix_id: "F-99727r1_fix" + tag cci: ["CCI-000185"] + tag nist: ["IA-5 (2) (a)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe 'This control needs to be check manually' do + skip 'Control not executed as this test is manual' + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205647.rb b/controls/SV-205647.rb new file mode 100644 index 0000000..9339dd5 --- /dev/null +++ b/controls/SV-205647.rb @@ -0,0 +1,37 @@ +# encoding: UTF-8 + +control "SV-205647" do + title "Windows Server 2019 PKI certificates associated with user accounts must be issued by a DoD PKI or an approved External Certificate Authority (ECA)." + desc "A PKI implementation depends on the practices established by the Certificate Authority (CA) to ensure the implementation is secure. Without proper practices, the certificates issued by a CA have limited value in authentication functions." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + Review user account mappings to PKI certificates. + Open \"Windows PowerShell\". + Enter \"Get-ADUser -Filter * | FT Name, UserPrincipalName, Enabled\". + Exclude disabled accounts (e.g., DefaultAccount, Guest) and the krbtgt account. + If the User Principal Name (UPN) is not in the format of an individual's identifier for the certificate type and for the appropriate domain suffix, this is a finding. + For standard NIPRNet certificates, the individual's identifier is in the format of an Electronic Data Interchange - Personnel Identifier (EDI-PI). + Alt Tokens and other certificates may use a different UPN format than the EDI-PI which vary by organization. Verified these with the organization. + + NIPRNet Example: + + Name - User Principal Name + User1 - 1234567890@mil + + See PKE documentation for other network domain suffixes. + If the mappings are to certificates issued by a CA authorized by the Component's CIO, this is a CAT II finding." + desc "fix", "Map user accounts to PKI certificates using the appropriate User Principal Name (UPN) for the network. See PKE documentation for details." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag gid: "V-93485" + tag rid: "SV-103571r1_rule" + tag stig_id: "WN19-DC-000300" + tag fix_id: "F-99729r1_fix" + tag cci: ["CCI-000185"] + tag nist: ["IA-5 (2) (a)", "Rev_4"] + + describe 'This control needs to be check manually' do + skip 'Control not executed as this test is manual' + end +end \ No newline at end of file diff --git a/controls/SV-205648.rb b/controls/SV-205648.rb new file mode 100644 index 0000000..a2b6796 --- /dev/null +++ b/controls/SV-205648.rb @@ -0,0 +1,118 @@ +# encoding: UTF-8 + +control "SV-205648" do + title "Windows Server 2019 must have the #{input('org_name')[:acronym]} Root Certificate Authority (CA) certificates installed in the Trusted Root Store." + desc "To ensure secure #{input('org_name')[:acronym]} websites and #{input('org_name')[:acronym]}-signed code are properly validated, the system must trust the #{input('org_name')[:acronym]} Root CAs. The #{input('org_name')[:acronym]} root certificates will ensure that the trust chain is established for server certificates issued from the #{input('org_name')[:acronym]} CAs." + desc "rationale", "" + desc "check", "The certificates and thumbprints referenced below apply to unclassified systems; see PKE documentation for other networks. + Open \"Windows PowerShell\" as an administrator. + Execute the following command: + Get-ChildItem -Path Cert:Localmachine\\root | Where Subject -Like \"*DoD*\" | FL Subject, Thumbprint, NotAfter + If the following certificate \"Subject\" and \"Thumbprint\" information is not displayed, this is a finding. + If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. + + Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: 8C941B34EA1EA6ED9AE2BC54CF687252B4C9B561 + NotAfter: 12/5/2029 + + Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: D73CA91102A2204A36459ED32213B467D7CE97FB + NotAfter: 12/30/2029 + + Subject: CN=DoD Root CA 4, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: B8269F25DBD937ECAFD4C35A9838571723F2D026 + NotAfter: 7/25/2032 + + Subject: CN=DoD Root CA 5, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: 4ECB5CC3095670454DA1CBD410FC921F46B8564B + NotAfter: 6/14/2041 + + Alternately, use the Certificates MMC snap-in: + Run \"MMC\". + Select \"File\", \"Add/Remove Snap-in\". + Select \"Certificates\" and click \"Add\". + Select \"Computer account\" and click \"Next\". + Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". + Click \"OK\". + Expand \"Certificates\" and navigate to \"Trusted Root Certification Authorities >> Certificates\". + For each of the DoD Root CA certificates noted below: + Right-click on the certificate and select \"Open\". + Select the \"Details\" Tab. + Scroll to the bottom and select \"Thumbprint\". + If the DoD Root CA certificates below are not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. + If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. + + DoD Root CA 2 + Thumbprint: 8C941B34EA1EA6ED9AE2BC54CF687252B4C9B561 + Valid to: Wednesday, December 5, 2029 + + DoD Root CA 3 + Thumbprint: D73CA91102A2204A36459ED32213B467D7CE97FB + Valid to: Sunday, December 30, 2029 + + DoD Root CA 4 + Thumbprint: B8269F25DBD937ECAFD4C35A9838571723F2D026 + Valid to: Sunday, July 25, 2032 + + DoD Root CA 5 + Thumbprint: 4ECB5CC3095670454DA1CBD410FC921F46B8564B + Valid to: Friday, June 14, 2041" + desc "fix", "Install the DoD Root CA certificates: + + DoD Root CA 2 + DoD Root CA 3 + DoD Root CA 4 + DoD Root CA 5 + + The InstallRoot tool is available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] + tag gid: "V-93487" + tag rid: "SV-103573r1_rule" + tag stig_id: "WN19-PK-000010" + tag fix_id: "F-99731r1_fix" + tag cci: ["CCI-000185", "CCI-002470"] + tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] + + if input('sensitive_system') == true + impact 0.0 + describe 'This Control is Not Applicable to sensitive systems.' do + skip 'This Control is Not Applicable to sensitive systems.' + end + else + dod_interoperability_certificates = JSON.parse(input('dod_interoperability_certificates').to_json) + query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\root | Where Subject -Like "*DoD*" | Select Subject, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }).params + + describe 'Verify DoD Root Certificate Authority (CA) certificates are installed in the Trusted Root Store.' do + subject { query } + it { should be_in dod_interoperability_certificates } + end + + unless query.empty? + case query + when Hash + query.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + when Array + query.each do |certs| + certs.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + end + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205649.rb b/controls/SV-205649.rb new file mode 100644 index 0000000..7751725 --- /dev/null +++ b/controls/SV-205649.rb @@ -0,0 +1,116 @@ +# encoding: UTF-8 + +control "SV-205649" do + title "Windows Server 2019 must have the #{input('org_name')[:acronym]} Interoperability Root Certificate Authority (CA) cross-certificates installed in the Untrusted Certificates Store on unclassified systems." + desc "To ensure users do not experience denial of service when performing certificate-based authentication to #{input('org_name')[:acronym]} websites due to the system chaining to a root other than #{input('org_name')[:acronym]} Root CAs, the #{input('org_name')[:acronym]} Interoperability Root CA cross-certificates must be installed in the Untrusted Certificate Store. This requirement only applies to unclassified systems." + desc "rationale", "" + desc "check", "This is applicable to unclassified systems. It is NA for others. + Open \"PowerShell\" as an administrator. + Execute the following command: + Get-ChildItem -Path Cert:Localmachine\\disallowed | Where {$_.Issuer -Like \"*DoD Interoperability*\" -and $_.Subject -Like \"*DoD*\"} | FL Subject, Issuer, Thumbprint, NotAfter + If the following certificate \"Subject\", \"Issuer\", and \"Thumbprint\" information is not displayed, this is a finding. + If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. + + Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US + Issuer: CN=DoD Interoperability Root CA 1, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: 22BBE981F0694D246CC1472ED2B021DC8540A22F + NotAfter: 9/6/2019 + + Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US + Issuer: CN=DoD Interoperability Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 + NotAfter: 2/17/2019 + + Alternately, use the Certificates MMC snap-in: + Run \"MMC\". + Select \"File\", \"Add/Remove Snap-in\". + Select \"Certificates\" and click \"Add\". + Select \"Computer account\" and click \"Next\". + Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". + Click \"OK\". + Expand \"Certificates\" and navigate to \"Untrusted Certificates >> Certificates\". + For each certificate with \"DoD Root CA...\" under \"Issued To\" and \"DoD Interoperability Root CA...\" under \"Issued By\": + Right-click on the certificate and select \"Open\". + Select the \"Details\" Tab. + Scroll to the bottom and select \"Thumbprint\". + If the certificates below are not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. + If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. + + Issued To: DoD Root CA 2 + Issued By: DoD Interoperability Root CA 1 + Thumbprint: 22BBE981F0694D246CC1472ED2B021DC8540A22F + Valid to: Friday, September 6, 2019 + + Issued To: DoD Root CA 3 + Issued By: DoD Interoperability Root CA 2 + Thumbprint: FFAD03329B9E527A43EEC66A56F9CBB5393E6E13 + Valid to: Sunday, September 23, 2018 + + Issued To: DoD Root CA 3 + Issued By: DoD Interoperability Root CA 2 + Thumbprint: FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 + Valid to: Sunday, February 17, 2019" + desc "fix", "Install the DoD Interoperability Root CA cross-certificates on unclassified systems. + + Issued To - Issued By - Thumbprint + DoD Root CA 2 - DoD Interoperability Root CA 1 - 22BBE981F0694D246CC1472ED2B021DC8540A22F + + DoD Root CA 3 - DoD Interoperability Root CA 2 - FFAD03329B9E527A43EEC66A56F9CBB5393E6E13 + + DoD Root CA 3 - DoD Interoperability Root CA 2 - FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 + + Administrators should run the Federal Bridge Certification Authority (FBCA) Cross-Certificate Removal Tool once as an administrator and once as the current user. + + The FBCA Cross-Certificate Remover Tool and User Guide are available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] + tag gid: "V-93489" + tag rid: "SV-103575r1_rule" + tag stig_id: "WN19-PK-000020" + tag fix_id: "F-99733r1_fix" + tag cci: ["CCI-000185", "CCI-002470"] + tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] + + if input('sensitive_system') == true + impact 0.0 + describe 'This Control is Not Applicable to sensitive systems.' do + skip 'This Control is Not Applicable to sensitive systems.' + end + else + dod_interoperability_certificates = JSON.parse(input('dod_interoperability_certificates').to_json) + query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\\\disallowed | Where {$_.Issuer -Like "*DoD Interoperability*" -and $_.Subject -Like "*DoD*"} | Select Subject, Issuer, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }).params + + describe 'Verify the DoD Interoperability cross-certificates are installed on unclassified systems as Untrusted Certificates.' do + subject { query } + it { should_not be_empty } + it { should be_in dod_interoperability_certificates } + end + + unless query.empty? + case query + when Hash + query.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + when Array + query.each do |certs| + certs.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + end + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205650.rb b/controls/SV-205650.rb new file mode 100644 index 0000000..788367a --- /dev/null +++ b/controls/SV-205650.rb @@ -0,0 +1,108 @@ +# encoding: UTF-8 + +control "SV-205650" do + title "Windows Server 2019 must have the US #{input('org_name')[:acronym]} CCEB Interoperability Root CA cross-certificates in the Untrusted Certificates Store on unclassified systems." + desc "To ensure users do not experience denial of service when performing certificate-based authentication to #{input('org_name')[:acronym]} websites due to the system chaining to a root other than #{input('org_name')[:acronym]} Root CAs, the US #{input('org_name')[:acronym]} CCEB Interoperability Root CA cross-certificates must be installed in the Untrusted Certificate Store. This requirement only applies to unclassified systems." + desc "rationale", "" + desc "check", "This is applicable to unclassified systems. It is NA for others. + Open \"PowerShell\" as an administrator. + Execute the following command: + Get-ChildItem -Path Cert:Localmachine\\disallowed | Where Issuer -Like \"*CCEB Interoperability*\" | FL Subject, Issuer, Thumbprint, NotAfter + If the following certificate \"Subject\", \"Issuer\", and \"Thumbprint\" information is not displayed, this is a finding. + If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. + + Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US + Issuer: CN=US DoD CCEB Interoperability Root CA 1, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 + NotAfter: 3/9/2019 + + Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US + Issuer: CN=US DoD CCEB Interoperability Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US + Thumbprint: 929BF3196896994C0A201DF4A5B71F603FEFBF2E + NotAfter: 9/27/2019 + + Alternately, use the Certificates MMC snap-in: + Run \"MMC\". + Select \"File\", \"Add/Remove Snap-in\". + Select \"Certificates\" and click \"Add\". + Select \"Computer account\" and click \"Next\". + Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". + Click \"OK\". + Expand \"Certificates\" and navigate to \"Untrusted Certificates >> Certificates\". + For each certificate with \"US DoD CCEB Interoperability Root CA ...\" under \"Issued By\": + Right-click on the certificate and select \"Open\". + Select the \"Details\" Tab. + Scroll to the bottom and select \"Thumbprint\". + If the certificate below is not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. + If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. + + Issued To: DoD Root CA 2 + Issued By: US DoD CCEB Interoperability Root CA 1 + Thumbprint: DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 + Valid to: Saturday, March 9, 2019 + + Issued To: DoD Root CA 3 + Issuer by: US DoD CCEB Interoperability Root CA 2 + Thumbprint: 929BF3196896994C0A201DF4A5B71F603FEFBF2E + Valid: Friday, September 27, 2019" + desc "fix", "Install the US DoD CCEB Interoperability Root CA cross-certificate on unclassified systems. + + Issued To - Issued By - Thumbprint + DoD Root CA 2 - US DoD CCEB Interoperability Root CA 1 - DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 + + DoD Root CA 3 - US DoD CCEB Interoperability Root CA 2 - 929BF3196896994C0A201DF4A5B71F603FEFBF2E + + Administrators should run the Federal Bridge Certification Authority (FBCA) Cross-Certificate Removal Tool once as an administrator and once as the current user. + + The FBCA Cross-Certificate Remover Tool and User Guide are available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000066-GPOS-00034" + tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] + tag gid: "V-93491" + tag rid: "SV-103577r1_rule" + tag stig_id: "WN19-PK-000030" + tag fix_id: "F-99735r1_fix" + tag cci: ["CCI-000185", "CCI-002470"] + tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] + + if input('sensitive_system') == 'true' + impact 0.0 + describe 'This Control is Not Applicable to sensitive systems.' do + skip 'This Control is Not Applicable to sensitive systems.' + end + else + dod_cceb_certificates = JSON.parse(input('dod_cceb_certificates').to_json) + query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\\\disallowed | Where {$_.Issuer -Like "*CCEB Interoperability*"} | Select Subject, Issuer, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }) + + describe 'Verify the DoD CCEB CA certificates are installed as Untrusted Certificate.' do + subject { query.params } + it { should be_in dod_cceb_certificates } + end + + unless query.empty? + case query + when Hash + query.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + when Array + query.each do |certs| + certs.each do |key, value| + if key == "NotAfter" + cert_date = Date.parse(value) + describe cert_date do + it { should be >= Date.today } + end + end + end + end + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205651.rb b/controls/SV-205651.rb new file mode 100644 index 0000000..5c66555 --- /dev/null +++ b/controls/SV-205651.rb @@ -0,0 +1,36 @@ +# encoding: UTF-8 + +control "SV-205651" do + title "Windows Server 2019 users must be required to enter a password to access private keys stored on the computer." + desc "If the private key is discovered, an attacker can use the key to authenticate as an authorized user and gain access to the network infrastructure. + The cornerstone of the PKI is the private key used to encrypt or digitally sign information. + + If the private key is stolen, this will lead to the compromise of the authentication and non-repudiation gained through PKI because the attacker can use the private key to digitally sign documents and pretend to be the authorized user. + + Both the holders of a digital certificate and the issuing authority must protect the computers, storage devices, or whatever they use to keep the private keys." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Cryptography\\ + + Value Name: ForceKeyProtection + + Type: REG_DWORD + Value: 0x00000002 (2)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System cryptography: Force strong key protection for user keys stored on the computer\" to \"User must enter a password each time they use a key\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000067-GPOS-00035" + tag gid: "V-93493" + tag rid: "SV-103579r1_rule" + tag stig_id: "WN19-SO-000350" + tag fix_id: "F-99737r1_fix" + tag cci: ["CCI-000186"] + tag nist: ["IA-5 (2) (b)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Cryptography') do + it { should have_property 'ForceKeyProtection' } + its('ForceKeyProtection') { should cmp == 2 } + end +end \ No newline at end of file diff --git a/controls/SV-205652.rb b/controls/SV-205652.rb new file mode 100644 index 0000000..6b4d73f --- /dev/null +++ b/controls/SV-205652.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205652" do + title "Windows Server 2019 must have the built-in Windows password complexity policy enabled." + desc "The use of complex passwords increases their strength against attack. The built-in Windows password complexity policy requires passwords to contain at least three of the four types of characters (numbers, uppercase and lowercase letters, and special characters) and prevents the inclusion of user names or parts of user names." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for \"Password must meet complexity requirements\" is not set to \"Enabled\", this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"PasswordComplexity\" equals \"0\" in the file, this is a finding. + + Note: If an external password filter is in use that enforces all four character types and requires this setting to be set to \"Disabled\", this would not be considered a finding. If this setting does not affect the use of an external password filter, it must be enabled for fallback purposes." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Password must meet complexity requirements\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000069-GPOS-00037" + tag satisfies: ["SRG-OS-000069-GPOS-00037", "SRG-OS-000070-GPOS-00038", "SRG-OS-000071-GPOS-00039", "SRG-OS-000266-GPOS-00101"] + tag gid: "V-93459" + tag rid: "SV-103545r1_rule" + tag stig_id: "WN19-AC-000080" + tag fix_id: "F-99703r1_fix" + tag cci: ["CCI-000192", "CCI-000193", "CCI-000194", "CCI-001619"] + tag nist: ["IA-5 (1) (a)", "IA-5 (1) (a)", "IA-5 (1) (a)", "IA-5 (1) (a)", "Rev_4"] + + describe security_policy do + its('PasswordComplexity') { should eq input('enable_password_complexity') } + end +end \ No newline at end of file diff --git a/controls/SV-205653.rb b/controls/SV-205653.rb new file mode 100644 index 0000000..7e72c5e --- /dev/null +++ b/controls/SV-205653.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205653" do + title "Windows Server 2019 reversible password encryption must be disabled." + desc "Storing passwords using reversible encryption is essentially the same as storing clear-text versions of the passwords, which are easily compromised. For this reason, this policy must never be enabled." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for \"Store passwords using reversible encryption\" is not set to \"Disabled\", this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"ClearTextPassword\" equals \"1\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Store passwords using reversible encryption\" to \"Disabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000073-GPOS-00041" + tag gid: "V-93465" + tag rid: "SV-103551r1_rule" + tag stig_id: "WN19-AC-000090" + tag fix_id: "F-99709r1_fix" + tag cci: ["CCI-000196"] + tag nist: ["IA-5 (1) (c)", "Rev_4"] + + describe security_policy do + its('ClearTextPassword') { should eq 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205654.rb b/controls/SV-205654.rb new file mode 100644 index 0000000..7f58874 --- /dev/null +++ b/controls/SV-205654.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205654" do + title "Windows Server 2019 must be configured to prevent the storage of the LAN Manager hash of passwords." + desc "The LAN Manager hash uses a weak encryption algorithm and there are several tools available that use this hash to retrieve account passwords. This setting controls whether a LAN Manager hash of the password is stored in the SAM the next time the password is changed." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: NoLMHash + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Do not store LAN Manager hash value on next password change\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000073-GPOS-00041" + tag gid: "V-93467" + tag rid: "SV-103553r1_rule" + tag stig_id: "WN19-SO-000300" + tag fix_id: "F-99711r1_fix" + tag cci: ["CCI-000196"] + tag nist: ["IA-5 (1) (c)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'NoLMHash' } + its('NoLMHash') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205655.rb b/controls/SV-205655.rb new file mode 100644 index 0000000..4da8194 --- /dev/null +++ b/controls/SV-205655.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205655" do + title "Windows Server 2019 unencrypted passwords must not be sent to third-party Server Message Block (SMB) servers." + desc "Some non-Microsoft SMB servers only support unencrypted (plain-text) password authentication. Sending plain-text passwords across the network when authenticating to an SMB server reduces the overall security of the environment. Check with the vendor of the SMB server to determine if there is a way to support encrypted password authentication." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ + + Value Name: EnablePlainTextPassword + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft Network Client: Send unencrypted password to third-party SMB servers\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000074-GPOS-00042" + tag gid: "V-93469" + tag rid: "SV-103555r1_rule" + tag stig_id: "WN19-SO-000180" + tag fix_id: "F-99713r1_fix" + tag cci: ["CCI-000197"] + tag nist: ["IA-5 (1) (c)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do + it { should have_property 'EnablePlainTextPassword' } + its('EnablePlainTextPassword') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205656.rb b/controls/SV-205656.rb new file mode 100644 index 0000000..7b98002 --- /dev/null +++ b/controls/SV-205656.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 + +control "SV-205656" do + title "Windows Server 2019 minimum password age must be configured to at least one day." + desc "Permitting passwords to be changed in immediate succession within the same day allows users to cycle passwords through their history database. This enables users to effectively negate the purpose of mandating periodic password changes." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for the \"Minimum password age\" is set to \"0\" days (\"Password can be changed immediately\"), this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"MinimumPasswordAge\" equals \"0\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Minimum password age\" to at least \"1\" day." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000075-GPOS-00043" + tag gid: "V-93471" + tag rid: "SV-103557r1_rule" + tag stig_id: "WN19-AC-000060" + tag fix_id: "F-99715r1_fix" + tag cci: ["CCI-000198"] + tag nist: ["IA-5 (1) (d)", "Rev_4"] + + describe security_policy do + its('MinimumPasswordAge') { should be >= input('minimum_password_age') } + end +end \ No newline at end of file diff --git a/controls/SV-205657.rb b/controls/SV-205657.rb new file mode 100644 index 0000000..cb38c52 --- /dev/null +++ b/controls/SV-205657.rb @@ -0,0 +1,60 @@ +# encoding: UTF-8 + +control "SV-205657" do + title "Windows Server 2019 passwords for the built-in Administrator account must be changed at least every 60 days." + desc "The longer a password is in use, the greater the opportunity for someone to gain unauthorized knowledge of the password. The built-in Administrator account is not generally used and its password not may be changed as frequently as necessary. Changing the password for the built-in Administrator account on a regular basis will limit its exposure. + Organizations that use an automated tool, such Microsoft's Local Administrator Password Solution (LAPS), on domain-joined systems can configure this to occur more frequently. LAPS will change the password every \"30\" days by default." + desc "rationale", "" + desc "check", "Review the password last set date for the built-in Administrator account. + + Domain controllers: + Open \"PowerShell\". + Enter \"Get-ADUser -Filter * -Properties SID, PasswordLastSet | Where SID -Like \"*-500\" | Ft Name, SID, PasswordLastSet\". + If the \"PasswordLastSet\" date is greater than \"60\" days old, this is a finding. + + Member servers and standalone systems: + Open \"Command Prompt\". + Enter 'Net User [account name] | Find /i \"Password Last Set\"', where [account name] is the name of the built-in administrator account. + (The name of the built-in Administrator account must be changed to something other than \"Administrator\" per STIG requirements.) + If the \"PasswordLastSet\" date is greater than \"60\" days old, this is a finding." + desc "fix", "Change the built-in Administrator account password at least every \"60\" days. + Automated tools, such as Microsoft's LAPS, may be used on domain-joined member servers to accomplish this." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000076-GPOS-00044" + tag gid: "V-93473" + tag rid: "SV-103559r1_rule" + tag stig_id: "WN19-00-000020" + tag fix_id: "F-99717r1_fix" + tag cci: ["CCI-000199"] + tag nist: ["IA-5 (1) (d)", "Rev_4"] + + administrator = input('local_administrator') + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + password_set_date = json({ command: "Get-ADUser -Filter * -Properties SID, PasswordLastSet | Where-Object {$_.SID -like '*-500' -and $_.PasswordLastSet -lt ((Get-Date).AddDays(-60))} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }) + date = password_set_date["DateTime"] + describe "Password Last Set Date" do + it "The built-in Administrator account must be changed at least every 60 days." do + expect(date).to be_nil + end + end + else + if administrator == "Administrator" + describe 'The name of the built-in Administrator account:' do + it 'It must be changed to something other than "Administrator" per STIG requirements' do + failure_message = "Change the built-in Administrator account name to something other than: #{administrator}" + expect(administrator).not_to eq("Administrator"), failure_message + end + end + end + local_password_set_date = json({ command: "Get-LocalUser -name #{administrator} | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-60)} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json"}) + local_date = local_password_set_date["DateTime"] + describe "Password Last Set Date" do + it "The built-in Administrator account must be changed at least every 60 days." do + expect(local_date).to be_nil + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205658.rb b/controls/SV-205658.rb new file mode 100644 index 0000000..a5076d6 --- /dev/null +++ b/controls/SV-205658.rb @@ -0,0 +1,70 @@ +# encoding: UTF-8 + +control 'SV-205658' do + title 'Windows Server 2019 passwords must be configured to expire.' + desc 'Passwords that do not expire or are reused increase the exposure of a password with greater probability of being discovered or cracked.' + desc 'rationale', '' + desc 'check', "Review the password never expires status for enabled user accounts. + Open \"PowerShell\". + + Domain Controllers: + Enter \"Search-ADAccount -PasswordNeverExpires -UsersOnly | FT Name, PasswordNeverExpires, Enabled\". + Exclude application accounts, disabled accounts (e.g., DefaultAccount, Guest) and the krbtgt account. + If any enabled user accounts are returned with a \"PasswordNeverExpires\" status of \"True\", this is a finding. + + Member servers and standalone systems: + Enter 'Get-CimInstance -Class Win32_Useraccount -Filter \"PasswordExpires=False and LocalAccount=True\" | FT Name, PasswordExpires, Disabled, LocalAccount'. + Exclude application accounts and disabled accounts (e.g., DefaultAccount, Guest). + If any enabled user accounts are returned with a \"PasswordExpires\" status of \"False\", this is a finding." + desc 'fix', "Configure all enabled user account passwords to expire. + Uncheck \"Password never expires\" for all enabled user accounts in Active Directory Users and Computers for domain accounts and Users in Computer Management for member servers and standalone systems. Document any exceptions with the ISSO." + impact 0.5 + tag severity: nil + tag gtitle: 'SRG-OS-000076-GPOS-00044' + tag gid: 'V-93475' + tag rid: 'SV-103561r1_rule' + tag stig_id: 'WN19-00-000210' + tag fix_id: 'F-99719r1_fix' + tag cci: ['CCI-000199'] + tag nist: ['IA-5 (1) (d)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + untracked_accounts = [] + + if domain_role == '4' || domain_role == '5' + ad_accounts = json({ command: "Search-ADAccount -PasswordNeverExpires -UsersOnly | Where-Object {$_.PasswordNeverExpires -eq 'True' -and $_.Enabled -eq 'True'} | Select -ExpandProperty Name | ConvertTo-Json" }).params + + application_accounts = input('application_accounts_domain') + excluded_accounts = input('excluded_accounts_domain') + + unless ad_accounts.empty? + ad_accounts = [ad_accounts] if ad_accounts.class == String + untracked_accounts = ad_accounts - application_accounts - excluded_accounts + end + + describe 'Untracked Accounts' do + it 'No Enabled Domain Account should be set to have Password Never Expire' do + failure_message = "Users Accounts are set to Password Never Expire: #{untracked_accounts}" + expect(untracked_accounts).to be_empty, failure_message + end + end + else + local_accounts = json({ command: "Get-CimInstance -Class Win32_Useraccount -Filter 'PasswordExpires=False and LocalAccount=True and Disabled=False' | Select -ExpandProperty Name | ConvertTo-Json" }).params + + application_accounts = input('application_accounts_local') + + excluded_accounts = input('excluded_accounts_local') + + unless local_accounts.empty? + local_accounts = [local_accounts] if local_accounts.class == String + untracked_accounts = local_accounts - application_accounts - excluded_accounts + end + + describe 'Account or Accounts exists' do + it 'Server should not have Accounts with Password Never Expire' do + failure_message = "User or Users have Password set to not expire: #{untracked_accounts}" + expect(untracked_accounts).to be_empty, failure_message + end + end + end +end diff --git a/controls/SV-205659.rb b/controls/SV-205659.rb new file mode 100644 index 0000000..d8fac10 --- /dev/null +++ b/controls/SV-205659.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 + +control "SV-205659" do + title "Windows Server 2019 maximum password age must be configured to 60 days or less." + desc "The longer a password is in use, the greater the opportunity for someone to gain unauthorized knowledge of the passwords. Scheduled changing of passwords hinders the ability of unauthorized system users to crack passwords and gain access to a system." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for the \"Maximum password age\" is greater than \"60\" days, this is a finding. + If the value is set to \"0\" (never expires), this is a finding. + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"MaximumPasswordAge\" is greater than \"60\" or equal to \"0\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Maximum password age\" to \"60\" days or less (excluding \"0\", which is unacceptable)." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000076-GPOS-00044" + tag gid: "V-93477" + tag rid: "SV-103563r1_rule" + tag stig_id: "WN19-AC-000050" + tag fix_id: "F-99721r1_fix" + tag cci: ["CCI-000199"] + tag nist: ["IA-5 (1) (d)", "Rev_4"] + + describe security_policy do + its('MaximumPasswordAge') { should be_between(1,input('maximum_password_age')) } + end +end \ No newline at end of file diff --git a/controls/SV-205660.rb b/controls/SV-205660.rb new file mode 100644 index 0000000..db14973 --- /dev/null +++ b/controls/SV-205660.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 + +control "SV-205660" do + title "Windows Server 2019 password history must be configured to #{input('password_history_size')} passwords remembered." + desc "A system is more vulnerable to unauthorized access when system users recycle the same password several times without being required to change to a unique password on a regularly scheduled basis. This enables users to effectively negate the purpose of mandating periodic password changes. The default value is \"#{input('password_history_size')}\" for Windows domain systems. #{input('org_name')[:acronym]} has decided this is the appropriate value for all Windows systems." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for \"Enforce password history\" is less than \"#{input('password_history_size')}\" passwords remembered, this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"PasswordHistorySize\" is less than \"#{input('password_history_size')}\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Enforce password history\" to \"#{input('password_history_size')}\" passwords remembered." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000077-GPOS-00045" + tag gid: "V-93479" + tag rid: "SV-103565r1_rule" + tag stig_id: "WN19-AC-000040" + tag fix_id: "F-99723r1_fix" + tag cci: ["CCI-000200"] + tag nist: ["IA-5 (1) (e)", "Rev_4"] + + describe security_policy do + its('PasswordHistorySize') { should be >= input('password_history_size') } + end +end diff --git a/controls/SV-205661.rb b/controls/SV-205661.rb new file mode 100644 index 0000000..cca1dec --- /dev/null +++ b/controls/SV-205661.rb @@ -0,0 +1,28 @@ +# encoding: UTF-8 + +control "SV-205661" do + title "Windows Server 2019 manually managed application account passwords must be at least #{input('minimum_password_length_manual')} characters in length." + desc "Application/service account passwords must be of sufficient length to prevent being easily cracked. Application/service accounts that are manually managed must have passwords at least #{input('minimum_password_length_manual')} characters in length." + desc "rationale", "" + desc "check", "Determine if manually managed application/service accounts exist. If none exist, this is NA. + + Verify the organization has a policy to ensure passwords for manually managed application/service accounts are at least #{input('minimum_password_length_manual')} characters in length. + + If such a policy does not exist or has not been implemented, this is a finding." + desc "fix", "Establish a policy that requires application/service account passwords that are manually managed to be at least #{input('minimum_password_length_manual')} characters in length. Ensure the policy is enforced." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000078-GPOS-00046" + tag gid: "V-93461" + tag rid: "SV-103547r1_rule" + tag stig_id: "WN19-00-000050" + tag fix_id: "F-99705r1_fix" + tag cci: ["CCI-000205"] + tag nist: ["IA-5 (1) (a)", "Rev_4"] + + mplm = input('minimum_password_length_manual') + + describe 'Please Check all Accounts that are used for Services or Applications to validate they meet the Password Length Policy, Control is a Manual Check' do + skip "Determine if manually managed application/service accounts exist. If none exist, this is NA. Verify the organization has a policy to ensure passwords for manually managed application/service accounts are at least #{mplm} characters in length." + end +end diff --git a/controls/SV-205662.rb b/controls/SV-205662.rb new file mode 100644 index 0000000..9627756 --- /dev/null +++ b/controls/SV-205662.rb @@ -0,0 +1,30 @@ +# encoding: UTF-8 + +control "SV-205662" do + title "Windows Server 2019 minimum password length must be configured to #{input('minimum_password_length')} characters." + desc "Information systems not protected with strong password schemes (including passwords of minimum length) provide the opportunity for anyone to crack the password, thus gaining access to the system and compromising the device, information, or the local network." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. + If the value for the \"Minimum password length,\" is less than \"#{input('minimum_password_length')}\" characters, this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"MinimumPasswordLength\" is less than \"#{input('minimum_password_length')}\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Minimum password length\" to \"#{input('minimum_password_length')}\" characters." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000078-GPOS-00046" + tag gid: "V-93463" + tag rid: "SV-103549r1_rule" + tag stig_id: "WN19-AC-000070" + tag fix_id: "F-99707r1_fix" + tag cci: ["CCI-000205"] + tag nist: ["IA-5 (1) (a)", "Rev_4"] + + describe security_policy do + its('MinimumPasswordLength') { should be >= input('minimum_password_length')} + end +end \ No newline at end of file diff --git a/controls/SV-205663.rb b/controls/SV-205663.rb new file mode 100644 index 0000000..730abb4 --- /dev/null +++ b/controls/SV-205663.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205663" do + title "Windows Server 2019 local volumes must use a format that supports NTFS +attributes." + desc "The ability to set access permissions and auditing is critical to +maintaining the security and proper access controls of a system. To support +this, volumes must be formatted using a file system that supports NTFS +attributes." + desc "rationale", "" + desc 'check', "Open \"Computer Management\". + + Select \"Disk Management\" under \"Storage\". + + For each local volume, if the file system does not indicate \"NTFS\", this +is a finding. + + \"ReFS\" (resilient file system) is also acceptable and would not be a +finding. + + This does not apply to system partitions such the Recovery and EFI System +Partition." + desc 'fix', "Format volumes to use NTFS or ReFS." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-92991' + tag 'rid': 'SV-103079r1_rule' + tag 'stig_id': 'WN19-00-000130' + tag 'fix_id': 'F-99237r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + get_volumes = command("wmic logicaldisk where DriveType=3 get FileSystem | findstr /r /v '^$' |Findstr /v 'FileSystem'").stdout.strip.split("\r\n") + + get_volumes.each do |volume| + volumes = volume.strip + describe.one do + describe 'The format local volumes' do + subject { volumes } + it { should eq 'NTFS' } + end + describe 'The format local volumes' do + subject { volumes } + it { should eq 'ReFS' } + end + end + end + if get_volumes.empty? + impact 0.0 + describe 'There are no local volumes' do + skip 'This control is not applicable' + end + end +end + diff --git a/controls/SV-205664.rb b/controls/SV-205664.rb new file mode 100644 index 0000000..9faa436 --- /dev/null +++ b/controls/SV-205664.rb @@ -0,0 +1,51 @@ +# encoding: UTF-8 + +control "SV-205664" do + title "Windows Server 2019 non-administrative accounts or groups must only +have print permissions on printer shares." + desc "Windows shares are a means by which files, folders, printers, and +other resources can be published for network users to access. Improper +configuration can permit access to devices and data beyond a user's need." + desc "rationale", "" + desc 'check', "Open \"Printers & scanners\" in \"Settings\". + + If there are no printers configured, this is NA. (Exclude Microsoft Print +to PDF and Microsoft XPS Document Writer, which do not support sharing.) + + For each printer: + + Select the printer and \"Manage\". + + Select \"Printer Properties\". + + Select the \"Sharing\" tab. + + If \"Share this printer\" is checked, select the \"Security\" tab. + + If any standard user accounts or groups have permissions other than +\"Print\", this is a finding. + + The default is for the \"Everyone\" group to be given \"Print\" permission. + + \"All APPLICATION PACKAGES\" and \"CREATOR OWNER\" are not standard user +accounts." + desc 'fix', "Configure the permissions on shared printers to restrict +standard users to only have Print permissions." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-92993' + tag 'rid': 'SV-103081r1_rule' + tag 'stig_id': 'WN19-00-000180' + tag 'fix_id': 'F-99239r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + describe "A manual review is required to verify that Non Administrative user accounts or groups only have print + permissions on printer shares" do + skip 'A manual review is required to verify that Non Administrative user accounts or groups only have print + permissions on printer shares' + end + +end + diff --git a/controls/SV-205665.rb b/controls/SV-205665.rb new file mode 100644 index 0000000..96d4751 --- /dev/null +++ b/controls/SV-205665.rb @@ -0,0 +1,79 @@ +# encoding: UTF-8 + +control "SV-205665" do + title "Windows Server 2019 Access this computer from the network user right must only be assigned to the Administrators, Authenticated Users, and Enterprise Domain Controllers groups on domain controllers." + desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. + Accounts with the \"Access this computer from the network\" right may access resources on the system, and this right must be limited to those requiring it." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. + If any accounts or groups other than the following are granted the \"Access this computer from the network\" right, this is a finding. + - Administrators + - Authenticated Users + - Enterprise Domain Controllers + + For server core installations, run the following command: + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + Review the text file. + If any SIDs other than the following are granted the \"SeNetworkLogonRight\" user right, this is a finding. + S-1-5-32-544 (Administrators) + S-1-5-11 (Authenticated Users) + S-1-5-9 (Enterprise Domain Controllers) + + If an application requires this user right, this would not be a finding. + Vendor documentation must support the requirement for having the user right. + The requirement must be documented with the ISSO. + The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Access this computer from the network\" to include only the following accounts or groups: + - Administrators + - Authenticated Users + - Enterprise Domain Controllers" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-92995' + tag 'rid': 'SV-103083r1_rule' + tag 'stig_id': 'WN19-DC-000340' + tag 'fix_id': 'F-99241r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + active_network_access_users = security_policy.SeNetworkLogonRight.entries + allowed_network_access_users = input("allowed_network_access_users") + disallowed_network_access_users = input("disallowed_network_access_users") + unauthorized_users = [] + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + if domain_role == '4' || domain_role == '5' + active_network_access_users.each do |user| + next if allowed_network_access_users.include?(user) + unauthorized_users << user + end + disallowed_network_access_users.each do |user| + unless disallowed_network_access_users == [nil] || unauthorized_users.include?(user) + unauthorized_users << user + end + end + describe "Network Logon Privilege must be limited to" do + it "Authorized SIDs: #{allowed_network_access_users}" do + failure_message = "Unauthorized SIDs: #{unauthorized_users}" + expect(unauthorized_users).to be_empty, failure_message + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205666.rb b/controls/SV-205666.rb new file mode 100644 index 0000000..82ab8df --- /dev/null +++ b/controls/SV-205666.rb @@ -0,0 +1,70 @@ +# encoding: UTF-8 + +control "SV-205666" do + title "Windows Server 2019 Allow log on through Remote Desktop Services user +right must only be assigned to the Administrators group on domain controllers." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Allow log on through Remote Desktop Services\" user +right can access a system through Remote Desktop." + desc "rationale", "" + desc 'check', "This applies to domain controllers, it is NA for other systems. + + Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Allow +log on through Remote Desktop Services\" user right, this is a finding. + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeRemoteInteractiveLogonRight\" user right, this is a finding. + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Allow log +on through Remote Desktop Services\" to include only the following accounts or +groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-92997' + tag 'rid': 'SV-103085r1_rule' + tag 'stig_id': 'WN19-DC-000360' + tag 'fix_id': 'F-99243r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeRemoteInteractiveLogonRight') { should eq ['S-1-5-32-544'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205667.rb b/controls/SV-205667.rb new file mode 100644 index 0000000..69c9c3f --- /dev/null +++ b/controls/SV-205667.rb @@ -0,0 +1,76 @@ +# encoding: UTF-8 + +control "SV-205667" do + title "Windows Server 2019 Deny access to this computer from the network user +right on domain controllers must be configured to prevent unauthenticated +access." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny access to this computer from the network\" user right defines +the accounts that are prevented from logging on from the network. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny access +to this computer from the network\" user right, this is a finding: + + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the \"SeDenyNetworkLogonRight\" +user right, this is a finding. + + S-1-5-32-546 (Guests)" + desc 'fix', " + Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny +access to this computer from the network\" to include the following: + + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-92999' + tag 'rid': 'SV-103087r1_rule' + tag 'stig_id': 'WN19-DC-000370' + tag 'fix_id': 'F-99245r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeDenyNetworkLogonRight') { should eq ['S-1-5-32-546'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205668.rb b/controls/SV-205668.rb new file mode 100644 index 0000000..50f3870 --- /dev/null +++ b/controls/SV-205668.rb @@ -0,0 +1,74 @@ +# encoding: UTF-8 + +control "SV-205668" do + title "Windows Server 2019 Deny log on as a batch job user right on domain +controllers must be configured to prevent unauthenticated access." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on as a batch job\" user right defines accounts that are +prevented from logging on to the system as a batch job, such as Task Scheduler. + + The Guests group must be assigned to prevent unauthenticated access." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +as a batch job\" user right, this is a finding: + + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SID(s) are not defined for the \"SeDenyBatchLogonRight\" +user right, this is a finding: + + S-1-5-32-546 (Guests)" + desc 'fix', " + Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on as a batch job\" to include the following: + + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93001' + tag 'rid': 'SV-103089r1_rule' + tag 'stig_id': 'WN19-DC-000380' + tag 'fix_id': 'F-99247r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeDenyBatchLogonRight') { should eq ['S-1-5-32-546'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205669.rb b/controls/SV-205669.rb new file mode 100644 index 0000000..f8bca6c --- /dev/null +++ b/controls/SV-205669.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205669" do + title "Windows Server 2019 Deny log on as a service user right must be +configured to include no accounts or groups (blank) on domain controllers." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on as a service\" user right defines accounts that are +denied logon as a service. + + Incorrect configurations could prevent services from starting and result in +a denial of service." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are defined for the \"Deny log on as a service\" +user right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeDenyServiceLogonRight\" user right, this is +a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Deny log on as a service\" to include no entries (blank)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93003' + tag 'rid': 'SV-103091r1_rule' + tag 'stig_id': 'WN19-DC-000390' + tag 'fix_id': 'F-99249r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeDenyServiceLogonRight') { should eq [] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205670.rb b/controls/SV-205670.rb new file mode 100644 index 0000000..d1778be --- /dev/null +++ b/controls/SV-205670.rb @@ -0,0 +1,75 @@ +# encoding: UTF-8 + +control "SV-205670" do + title "Windows Server 2019 Deny log on locally user right on domain +controllers must be configured to prevent unauthenticated access." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on locally\" user right defines accounts that are prevented +from logging on interactively. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +locally\" user right, this is a finding: + + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SID(s) are not defined for the +\"SeDenyInteractiveLogonRight\" user right, this is a finding: + + S-1-5-32-546 (Guests)" + desc 'fix', " + Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on locally\" to include the following: + + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93005' + tag 'rid': 'SV-103093r1_rule' + tag 'stig_id': 'WN19-DC-000400' + tag 'fix_id': 'F-99251r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeDenyInteractiveLogonRight') { should eq ['S-1-5-32-546'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205671.rb b/controls/SV-205671.rb new file mode 100644 index 0000000..31984be --- /dev/null +++ b/controls/SV-205671.rb @@ -0,0 +1,88 @@ +# encoding: UTF-8 + +control "SV-205671" do + title "Windows Server 2019 Access this computer from the network user right +must only be assigned to the Administrators and Authenticated Users groups on +domain-joined member servers and standalone systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Access this computer from the network\" user right may +access resources on the system, and this right must be limited to those +requiring it." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Access +this computer from the network\" user right, this is a finding: + + - Administrators + - Authenticated Users + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeNetworkLogonRight\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + S-1-5-11 (Authenticated Users) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', " + Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Access +this computer from the network\" to include only the following accounts or +groups: + + - Administrators + - Authenticated Users" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93007' + tag 'rid': 'SV-103095r1_rule' + tag 'stig_id': 'WN19-MS-000070' + tag 'fix_id': 'F-99253r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + impact 0.0 + describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do + skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' + end + else + describe security_policy do + its('SeNetworkLogonRight') { should eq ['S-1-5-11', 'S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205672.rb b/controls/SV-205672.rb new file mode 100644 index 0000000..e70ca9f --- /dev/null +++ b/controls/SV-205672.rb @@ -0,0 +1,139 @@ +# encoding: UTF-8 + +control "SV-205672" do + title "Windows Server 2019 Deny access to this computer from the network user +right on domain-joined member servers must be configured to prevent access from +highly privileged domain accounts and local accounts and from unauthenticated +access on all systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny access to this computer from the network\" user right defines +the accounts that are prevented from logging on from the network. + + In an Active Directory Domain, denying logons to the Enterprise Admins and +Domain Admins groups on lower-trust systems helps mitigate the risk of +privilege escalation from credential theft attacks, which could lead to the +compromise of an entire domain. + + Local accounts on domain-joined systems must also be assigned this right to +decrease the risk of lateral movement resulting from credential theft attacks. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny access +to this computer from the network\" user right, this is a finding: + + Domain Systems Only: + - Enterprise Admins group + - Domain Admins group + - \"Local account and member of Administrators group\" or \"Local account\" +(see Note below) + + All Systems: + - Guests group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the \"SeDenyNetworkLogonRight\" +user right, this is a finding. + + Domain Systems Only: + S-1-5-root domain-519 (Enterprise Admins) + S-1-5-domain-512 (Domain Admins) + S-1-5-114 (\"Local account and member of Administrators group\") or +S-1-5-113 (\"Local account\") + + All Systems: + S-1-5-32-546 (Guests) + + Note: These are built-in security groups. \"Local account\" is more +restrictive but may cause issues on servers such as systems that provide +failover clustering." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny +access to this computer from the network\" to include the following: + + Domain Systems Only: + - Enterprise Admins group + - Domain Admins group + - \"Local account and member of Administrators group\" or \"Local account\" +(see Note below) + + All Systems: + - Guests group + + Note: These are built-in security groups. \"Local account\" is more +restrictive but may cause issues on servers such as systems that provide +failover clustering." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93009' + tag 'rid': 'SV-103097r1_rule' + tag 'stig_id': 'WN19-MS-000080' + tag 'fix_id': 'F-99255r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.0 + desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do + skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + end + when '3' + domain_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Domain Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + domain_admin_sid = json(command: domain_query).params + enterprise_admin_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + enterprise_admin_sid = json(command: enterprise_admin_query).params + describe security_policy do + its('SeDenyNetworkLogonRight') { should include "#{domain_admin_sid}" } + end + describe security_policy do + its('SeDenyNetworkLogonRight') { should include "#{enterprise_admin_sid}" } + end + describe.one do + describe security_policy do + its('SeDenyNetworkLogonRight') { should include "S-1-5-113" } + end + describe security_policy do + its('SeDenyNetworkLogonRight') { should include "S-1-5-114" } + end + end + describe security_policy do + its('SeDenyNetworkLogonRight') { should include 'S-1-5-32-546' } + end + when '2' + describe security_policy do + its('SeDenyNetworkLogonRight') { should eq ['S-1-5-32-546'] } + end + end +end diff --git a/controls/SV-205673.rb b/controls/SV-205673.rb new file mode 100644 index 0000000..f17faee --- /dev/null +++ b/controls/SV-205673.rb @@ -0,0 +1,112 @@ +# encoding: UTF-8 + +control "SV-205673" do + title "Windows Server 2019 Deny log on as a batch job user right on +domain-joined member servers must be configured to prevent access from highly +privileged domain accounts and from unauthenticated access on all systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on as a batch job\" user right defines accounts that are +prevented from logging on to the system as a batch job, such as Task Scheduler. + + In an Active Directory Domain, denying logons to the Enterprise Admins and +Domain Admins groups on lower-trust systems helps mitigate the risk of +privilege escalation from credential theft attacks, which could lead to the +compromise of an entire domain. + + The Guests group must be assigned to prevent unauthenticated access." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +as a batch job\" user right, this is a finding: + + Domain Systems Only: + - Enterprise Admins Group + - Domain Admins Group + + All Systems: + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the \"SeDenyBatchLogonRight\" +user right, this is a finding. + + Domain Systems Only: + S-1-5-root domain-519 (Enterprise Admins) + S-1-5-domain-512 (Domain Admins) + + All Systems: + S-1-5-32-546 (Guests)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on as a batch job\" to include the following: + + Domain Systems Only: + - Enterprise Admins Group + - Domain Admins Group + + All Systems: + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93011' + tag 'rid': 'SV-103099r1_rule' + tag 'stig_id': 'WN19-MS-000090' + tag 'fix_id': 'F-99257r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.0 + desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do + skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + end + when '2' + describe security_policy do + its('SeDenyBatchLogonRight') { should eq ['S-1-5-32-546'] } + end + when '3' + domain_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Domain Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + domain_admin_sid = json(command: domain_query).params + enterprise_admin_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + enterprise_admin_sid = json(command: enterprise_admin_query).params + describe security_policy do + its('SeDenyBatchLogonRight') { should include "#{domain_admin_sid}" } + end + describe security_policy do + its('SeDenyBatchLogonRight') { should include "#{enterprise_admin_sid}" } + end + describe security_policy do + its('SeDenyBatchLogonRight') { should include 'S-1-5-32-546' } + end + end +end diff --git a/controls/SV-205674.rb b/controls/SV-205674.rb new file mode 100644 index 0000000..8b4e931 --- /dev/null +++ b/controls/SV-205674.rb @@ -0,0 +1,106 @@ +# encoding: UTF-8 + +control "SV-205674" do + title "Windows Server 2019 Deny log on as a service user right on +domain-joined member servers must be configured to prevent access from highly +privileged domain accounts. No other groups or accounts must be assigned this +right." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on as a service\" user right defines accounts that are +denied logon as a service. + + In an Active Directory Domain, denying logons to the Enterprise Admins and +Domain Admins groups on lower-trust systems helps mitigate the risk of +privilege escalation from credential theft attacks, which could lead to the +compromise of an entire domain. + + Incorrect configurations could prevent services from starting and result in +a denial of service." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +as a service\" user right on domain-joined systems, this is a finding: + + - Enterprise Admins Group + - Domain Admins Group + + If any accounts or groups are defined for the \"Deny log on as a service\" +user right on non-domain-joined systems, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the \"SeDenyServiceLogonRight\" +user right on domain-joined systems, this is a finding: + + S-1-5-root domain-519 (Enterprise Admins) + S-1-5-domain-512 (Domain Admins) + + If any SIDs are defined for the user right on non-domain-joined systems, +this is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on as a service\" to include the following: + + Domain systems: + - Enterprise Admins Group + - Domain Admins Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93013' + tag 'rid': 'SV-103101r1_rule' + tag 'stig_id': 'WN19-MS-000100' + tag 'fix_id': 'F-99259r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.0 + desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do + skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + end + when '3' + domain_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Domain Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + domain_admin_sid = json(command: domain_query).params + enterprise_admin_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + enterprise_admin_sid = json(command: enterprise_admin_query).params + describe security_policy do + its('SeDenyServiceLogonRight') { should include "#{domain_admin_sid}" } + end + describe security_policy do + its('SeDenyServiceLogonRight') { should include "#{enterprise_admin_sid}" } + end + when '2' + describe security_policy do + its('SeDenyServiceLogonRight') { should be_empty } + end + end +end diff --git a/controls/SV-205675.rb b/controls/SV-205675.rb new file mode 100644 index 0000000..f408966 --- /dev/null +++ b/controls/SV-205675.rb @@ -0,0 +1,113 @@ +# encoding: UTF-8 + +control "SV-205675" do + title "Windows Server 2019 Deny log on locally user right on domain-joined +member servers must be configured to prevent access from highly privileged +domain accounts and from unauthenticated access on all systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on locally\" user right defines accounts that are prevented +from logging on interactively. + + In an Active Directory Domain, denying logons to the Enterprise Admins and +Domain Admins groups on lower-trust systems helps mitigate the risk of +privilege escalation from credential theft attacks, which could lead to the +compromise of an entire domain. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +locally\" user right, this is a finding: + + Domain Systems Only: + - Enterprise Admins Group + - Domain Admins Group + + All Systems: + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the +\"SeDenyInteractiveLogonRight\" user right, this is a finding: + + Domain Systems Only: + S-1-5-root domain-519 (Enterprise Admins) + S-1-5-domain-512 (Domain Admins) + + All Systems: + S-1-5-32-546 (Guests)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on locally\" to include the following: + + Domain Systems Only: + - Enterprise Admins Group + - Domain Admins Group + + All Systems: + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93015' + tag 'rid': 'SV-103103r1_rule' + tag 'stig_id': 'WN19-MS-000110' + tag 'fix_id': 'F-99261r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.0 + desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do + skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + end + when '2' + describe security_policy do + its('SeDenyInteractiveLogonRight') { should eq ['S-1-5-32-546'] } + end + when '3' + domain_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Domain Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + domain_admin_sid = json(command: domain_query).params + enterprise_admin_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + enterprise_admin_sid = json(command: enterprise_admin_query).params + describe security_policy do + its('SeDenyInteractiveLogonRight') { should include "#{domain_admin_sid}" } + end + describe security_policy do + its('SeDenyInteractiveLogonRight') { should include "#{enterprise_admin_sid}" } + end + describe security_policy do + its('SeDenyInteractiveLogonRight') { should include 'S-1-5-32-546' } + end + end +end diff --git a/controls/SV-205676.rb b/controls/SV-205676.rb new file mode 100644 index 0000000..599bfe3 --- /dev/null +++ b/controls/SV-205676.rb @@ -0,0 +1,63 @@ +# encoding: UTF-8 + +control "SV-205676" do + title "Windows Server 2019 Allow log on locally user right must only be +assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Allow log on locally\" user right can log on +interactively to a system." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Allow +log on locally\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeInteractiveLogonRight\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Allow log +on locally\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000080-GPOS-00048' + tag 'gid': 'V-93017' + tag 'rid': 'SV-103105r1_rule' + tag 'stig_id': 'WN19-UR-000030' + tag 'fix_id': 'F-99263r1_fix' + tag 'cci': ["CCI-000213"] + tag 'nist': ["AC-3", "Rev_4"] + + describe security_policy do + its('SeInteractiveLogonRight') { should eq ['S-1-5-32-544'] } + end +end + diff --git a/controls/SV-205677.rb b/controls/SV-205677.rb new file mode 100644 index 0000000..15fab05 --- /dev/null +++ b/controls/SV-205677.rb @@ -0,0 +1,26 @@ +# encoding: UTF-8 + +control "SV-205677" do + title "Windows Server 2019 must have the roles and features required by the system documented." + desc "Unnecessary roles and features increase the attack surface of a system. Limiting roles and features of a system to only those necessary reduces this potential. The standard installation option (previously called Server Core) further reduces this when selected at installation." + desc "rationale", "" + desc "check", "Required roles and features will vary based on the function of the individual system. + + Roles and features specifically required to be disabled per the STIG are identified in separate requirements. + If the organization has not documented the roles and features required for the system(s), this is a finding. + The PowerShell command \"Get-WindowsFeature\" will list all roles and features with an \"Install State\"." + desc "fix", "Document the roles and features required for the system to operate. Uninstall any that are not required." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93381" + tag rid: "SV-103467r1_rule" + tag stig_id: "WN19-00-000270" + tag fix_id: "F-99625r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe 'A manual review is required to verify that the roles and features required by the system are documented' do + skip 'A manual review is required to verify that the roles and features required by the system are documented' + end +end \ No newline at end of file diff --git a/controls/SV-205678.rb b/controls/SV-205678.rb new file mode 100644 index 0000000..c823d9d --- /dev/null +++ b/controls/SV-205678.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205678" do + title "Windows Server 2019 must not have the Fax Server role installed." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + + Enter \"Get-WindowsFeature | Where Name -eq Fax\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"Fax Server\" role. + + Start \"Server Manager\". + Select the server with the role. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"Fax Server\" on the \"Roles\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93383" + tag rid: "SV-103469r1_rule" + tag stig_id: "WN19-00-000320" + tag fix_id: "F-99627r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe windows_feature('fax') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205679.rb b/controls/SV-205679.rb new file mode 100644 index 0000000..d5e24af --- /dev/null +++ b/controls/SV-205679.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205679" do + title "Windows Server 2019 must not have the Peer Name Resolution Protocol installed." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + + Enter \"Get-WindowsFeature | Where Name -eq PNRP\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"Peer Name Resolution Protocol\" feature. + + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"Peer Name Resolution Protocol\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93385" + tag rid: "SV-103471r1_rule" + tag stig_id: "WN19-00-000340" + tag fix_id: "F-99629r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe windows_feature('PNRP') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205680.rb b/controls/SV-205680.rb new file mode 100644 index 0000000..96e0900 --- /dev/null +++ b/controls/SV-205680.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205680" do + title "Windows Server 2019 must not have Simple TCP/IP Services installed." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + + Enter \"Get-WindowsFeature | Where Name -eq Simple-TCPIP\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"Simple TCP/IP Services\" feature. + + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"Simple TCP/IP Services\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93387" + tag rid: "SV-103473r1_rule" + tag stig_id: "WN19-00-000350" + tag fix_id: "F-99631r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe windows_feature('Simple-TCPIP') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205681.rb b/controls/SV-205681.rb new file mode 100644 index 0000000..bf780e1 --- /dev/null +++ b/controls/SV-205681.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205681" do + title "Windows Server 2019 must not have the TFTP Client installed." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + + Enter \"Get-WindowsFeature | Where Name -eq TFTP-Client\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"TFTP Client\" feature. + + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"TFTP Client\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93389" + tag rid: "SV-103475r1_rule" + tag stig_id: "WN19-00-000370" + tag fix_id: "F-99633r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe windows_feature('TFTP-Client') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205682.rb b/controls/SV-205682.rb new file mode 100644 index 0000000..d72ded9 --- /dev/null +++ b/controls/SV-205682.rb @@ -0,0 +1,49 @@ +# encoding: UTF-8 + +control "SV-205682" do + title "Windows Server 2019 must not the Server Message Block (SMB) v1 protocol installed." + desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks and is not FIPS compliant." + desc "rationale", "" + desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019. This is the preferred method, however if WN19-00-000390 and WN19-00-000400 are configured, this is NA. + + Open \"Windows PowerShell\" with elevated privileges (run as administrator). + Enter \"Get-WindowsFeature -Name FS-SMB1\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the SMBv1 protocol. + + Open \"Windows PowerShell\" with elevated privileges (run as administrator). + Enter \"Uninstall-WindowsFeature -Name FS-SMB1 -Restart\". + (Omit the Restart parameter if an immediate restart of the system cannot be done.) + + Alternately: + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"SMB 1.0/CIFS File Sharing Support\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93391" + tag rid: "SV-103477r1_rule" + tag stig_id: "WN19-00-000380" + tag fix_id: "F-99635r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + if powershell("Get-ItemPropertyValue 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters' -Name SMB1").stdout.strip == "0" && powershell("Get-ItemPropertyValue 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10' -Name Start").stdout.strip == "4" + impact 0.0 + describe 'Controls V-93393 and V-93395 configuration successful' do + skip 'This is NA as the successful configuration of Controls V-93393 (STIG ID# WN19-00-000390) and V-93395 (STIG ID# WN19-00-000400) meets the requirement' + end + else + state = powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip + describe "Server Message Block (SMB) v1 protocol msut not be installed" do + subject { state } + it { should_not eq "Installed" } + end + end +end \ No newline at end of file diff --git a/controls/SV-205683.rb b/controls/SV-205683.rb new file mode 100644 index 0000000..e511a44 --- /dev/null +++ b/controls/SV-205683.rb @@ -0,0 +1,48 @@ +# encoding: UTF-8 + +control "SV-205683" do + title "Windows Server 2019 must have the Server Message Block (SMB) v1 protocol disabled on the SMB server." + desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks as well as not being FIPS compliant." + desc "rationale", "" + desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019, if WN19-00-000380 is configured, this is NA. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\\ + + Value Name: SMB1 + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Configure SMBv1 Server\" to \"Disabled\". + + The system must be restarted for the change to take effect. + + This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \"SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93393" + tag rid: "SV-103479r1_rule" + tag stig_id: "WN19-00-000390" + tag fix_id: "F-99637r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + if powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip == "Installed" + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do + it { should have_property 'SMB1' } + its('SMB1') { should cmp == 0 } + end + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10') do + it { should have_property 'Start' } + its('Start') { should cmp == 4 } + end + else + impact 0.0 + describe 'Control V-93391 configuration successful' do + skip 'This is NA as the successful configuration of Control V-93391 (STIG ID# WN19-00-000380) meets the requirement' + end + end +end \ No newline at end of file diff --git a/controls/SV-205684.rb b/controls/SV-205684.rb new file mode 100644 index 0000000..69eaec7 --- /dev/null +++ b/controls/SV-205684.rb @@ -0,0 +1,48 @@ +# encoding: UTF-8 + +control "SV-205684" do + title "Windows Server 2019 must have the Server Message Block (SMB) v1 protocol disabled on the SMB client." + desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks as well as not being FIPS compliant." + desc "rationale", "" + desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019, if WN19-00-000380 is configured, this is NA. + + If the following registry value is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10\\ + + Value Name: Start + + Type: REG_DWORD + Value: 0x00000004 (4)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Configure SMBv1 client driver\" to \"Enabled\" with \"Disable driver (recommended)\" selected for \"Configure MrxSmb10 driver\". + + The system must be restarted for the changes to take effect. + + This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \"SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93395" + tag rid: "SV-103481r1_rule" + tag stig_id: "WN19-00-000400" + tag fix_id: "F-99639r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + if powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip == "Installed" + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do + it { should have_property 'SMB1' } + its('SMB1') { should cmp == 0 } + end + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10') do + it { should have_property 'Start' } + its('Start') { should cmp == 4 } + end + else + impact 0.0 + describe 'Control V-93391 configuration successful' do + skip 'This is NA as the successful configuration of Control V-93391 (STIG ID# WN19-00-000380) meets the requirement' + end + end +end \ No newline at end of file diff --git a/controls/SV-205685.rb b/controls/SV-205685.rb new file mode 100644 index 0000000..2e74caf --- /dev/null +++ b/controls/SV-205685.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205685" do + title "Windows Server 2019 must not have Windows PowerShell 2.0 installed." + desc "Windows PowerShell 5.x added advanced logging features that can provide additional detail when malware has been run on a system. Disabling the Windows PowerShell 2.0 mitigates against a downgrade attack that evades the Windows PowerShell 5.x script block logging feature." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + Enter \"Get-WindowsFeature | Where Name -eq PowerShell-v2\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"Windows PowerShell 2.0 Engine\". + + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"Windows PowerShell 2.0 Engine\" under \"Windows PowerShell\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93397" + tag rid: "SV-103483r1_rule" + tag stig_id: "WN19-00-000410" + tag fix_id: "F-99641r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe windows_feature('PowerShell-v2') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205686.rb b/controls/SV-205686.rb new file mode 100644 index 0000000..5a811b8 --- /dev/null +++ b/controls/SV-205686.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205686" do + title "Windows Server 2019 must prevent the display of slide shows on the lock screen." + desc "Slide shows that are displayed on the lock screen could display sensitive information to unauthorized personnel. Turning off this feature will limit access to the information to a logged-on user." + desc "rationale", "" + desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\\ + + Value Name: NoLockScreenSlideshow + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Control Panel >> Personalization >> \"Prevent enabling lock screen slide show\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93399" + tag rid: "SV-103485r1_rule" + tag stig_id: "WN19-CC-000010" + tag fix_id: "F-99643r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization') do + it { should have_property 'NoLockScreenSlideshow' } + its('NoLockScreenSlideshow') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205687.rb b/controls/SV-205687.rb new file mode 100644 index 0000000..3dc9bb2 --- /dev/null +++ b/controls/SV-205687.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205687" do + title "Windows Server 2019 must have WDigest Authentication disabled." + desc "When the WDigest Authentication protocol is enabled, plain-text passwords are stored in the Local Security Authority Subsystem Service (LSASS),exposing them to theft. WDigest is disabled by default in Windows Server 2019. This setting ensures this is enforced." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\Wdigest\\ + + Value Name: UseLogonCredential + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"WDigest Authentication (disabling may require KB2871997)\" to \"Disabled\". + + This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \" SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93401" + tag rid: "SV-103487r1_rule" + tag stig_id: "WN19-CC-000020" + tag fix_id: "F-99645r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\Wdigest') do + it { should have_property 'UseLogonCredential' } + its('UseLogonCredential') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205688.rb b/controls/SV-205688.rb new file mode 100644 index 0000000..03305d1 --- /dev/null +++ b/controls/SV-205688.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205688" do + title "Windows Server 2019 downloading print driver packages over HTTP must be turned off." + desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. + + This setting prevents the computer from downloading print driver packages over HTTP." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\\ + + Value Name: DisableWebPnPDownload + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Internet Communication Management >> Internet Communication settings >> \"Turn off downloading of print drivers over HTTP\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93403" + tag rid: "SV-103489r1_rule" + tag stig_id: "WN19-CC-000150" + tag fix_id: "F-99647r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers') do + it { should have_property 'DisableWebPnPDownload' } + its('DisableWebPnPDownload') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205689.rb b/controls/SV-205689.rb new file mode 100644 index 0000000..d3f0631 --- /dev/null +++ b/controls/SV-205689.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205689" do + title "Windows Server 2019 printing over HTTP must be turned off." + desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. + + This setting prevents the client computer from printing over HTTP, which allows the computer to print to printers on the intranet as well as the Internet." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\\ + + Value Name: DisableHTTPPrinting + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Internet Communication Management >> Internet Communication settings >> \"Turn off printing over HTTP\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93405" + tag rid: "SV-103491r1_rule" + tag stig_id: "WN19-CC-000160" + tag fix_id: "F-99649r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers') do + it { should have_property 'DisableHTTPPrinting' } + its('DisableHTTPPrinting') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205690.rb b/controls/SV-205690.rb new file mode 100644 index 0000000..dee97d9 --- /dev/null +++ b/controls/SV-205690.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205690" do + title "Windows Server 2019 network selection user interface (UI) must not be displayed on the logon screen." + desc "Enabling interaction with the network selection UI allows users to change connections to available networks without signing in to Windows." + desc "rationale", "" + desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ + + Value Name: DontDisplayNetworkSelectionUI + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Logon >> \"Do not display network selection UI\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93407" + tag rid: "SV-103493r1_rule" + tag stig_id: "WN19-CC-000170" + tag fix_id: "F-99651r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\System') do + it { should have_property 'DontDisplayNetworkSelectionUI' } + its('DontDisplayNetworkSelectionUI') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205691.rb b/controls/SV-205691.rb new file mode 100644 index 0000000..fd4ef77 --- /dev/null +++ b/controls/SV-205691.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205691" do + title "Windows Server 2019 Application Compatibility Program Inventory must be prevented from collecting data and sending the information to Microsoft." + desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. + + This setting will prevent the Program Inventory from collecting data about a system and sending the information to Microsoft." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat\\ + + Value Name: DisableInventory + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Application Compatibility >> \"Turn off Inventory Collector\" to \"Enabled\"." + impact 0.3 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93409" + tag rid: "SV-103495r1_rule" + tag stig_id: "WN19-CC-000200" + tag fix_id: "F-99653r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\AppCompat') do + it { should have_property 'DisableInventory' } + its('DisableInventory') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205692.rb b/controls/SV-205692.rb new file mode 100644 index 0000000..48d2b2f --- /dev/null +++ b/controls/SV-205692.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205692" do + title "Windows Server 2019 Windows Defender SmartScreen must be enabled." + desc "Windows Defender SmartScreen helps protect systems from programs downloaded from the internet that may be malicious. Enabling SmartScreen can block potentially malicious programs or warn users." + desc "rationale", "" + desc "check", "This is applicable to unclassified systems; for other systems, this is NA. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ + + Value Name: EnableSmartScreen + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> File Explorer >> \"Configure Windows Defender SmartScreen\" to \"Enabled\" with either option \"Warn\" or \"Warn and prevent bypass\" selected. + Windows 2019 includes duplicate policies for this setting. It can also be configured under Computer Configuration >> Administrative Templates >> Windows Components >> Windows Defender SmartScreen >> Explorer." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93411" + tag rid: "SV-103497r2_rule" + tag stig_id: "WN19-CC-000300" + tag fix_id: "F-99655r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + if input('sensitive_system') == true || nil + impact 0.0 + describe 'This Control is Not Applicable to sensitive systems.' do + skip 'This Control is Not Applicable to sensitive systems.' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\System') do + it { should have_property 'EnableSmartScreen' } + its('EnableSmartScreen') { should cmp 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205693.rb b/controls/SV-205693.rb new file mode 100644 index 0000000..8622572 --- /dev/null +++ b/controls/SV-205693.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205693" do + title "Windows Server 2019 must disable Basic authentication for RSS feeds over HTTP." + desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." + desc "rationale", "" + desc "check", "The default behavior is for the Windows RSS platform to not use Basic authentication over HTTP connections. + + If the registry value name below does not exist, this is not a finding. + If it exists and is configured with a value of \"0\", this is not a finding. + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Feeds\\ + + Value Name: AllowBasicAuthInClear + + Value Type: REG_DWORD + Value: 0x00000000 (0) (or if the Value Name does not exist)" + desc "fix", "The default behavior is for the Windows RSS platform to not use Basic authentication over HTTP connections. + If this needs to be corrected, configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> RSS Feeds >> \"Turn on Basic feed authentication over HTTP\" to \"Not Configured\" or \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93413" + tag rid: "SV-103499r1_rule" + tag stig_id: "WN19-CC-000400" + tag fix_id: "F-99657r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + if registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds').has_property?('AllowBasicAuthInClear') + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do + its('AllowBasicAuthInClear') { should cmp 0 } + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do + it { should_not have_property 'AllowBasicAuthInClear' } + end + end +end \ No newline at end of file diff --git a/controls/SV-205694.rb b/controls/SV-205694.rb new file mode 100644 index 0000000..a37d9e5 --- /dev/null +++ b/controls/SV-205694.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205694" do + title "Windows Server 2019 must prevent Indexing of encrypted files." + desc "Indexing of encrypted files may expose sensitive data. This setting prevents encrypted files from being indexed." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\\ + + Value Name: AllowIndexingEncryptedStoresOrItems + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Search >> \"Allow indexing of encrypted files\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93415" + tag rid: "SV-103501r1_rule" + tag stig_id: "WN19-CC-000410" + tag fix_id: "F-99659r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search') do + it { should have_property 'AllowIndexingEncryptedStoresOrItems' } + its('AllowIndexingEncryptedStoresOrItems') { should cmp 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205695.rb b/controls/SV-205695.rb new file mode 100644 index 0000000..274d495 --- /dev/null +++ b/controls/SV-205695.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205695" do + title "Windows Server 2019 domain controllers must run on a machine dedicated to that function." + desc "Executing application servers on the same host machine with a directory server may substantially weaken the security of the directory server. Web or database server applications usually require the addition of many programs and accounts, increasing the attack surface of the computer. + + Some applications require the addition of privileged accounts, providing potential sources of compromise. Some applications (such as Microsoft Exchange) may require the use of network ports or services conflicting with the directory server. In this case, non-standard ports might be selected, and this could interfere with intrusion detection or prevention services." + desc "rationale", "" + desc "check", "This applies to domain controllers, it is NA for other systems. + + Review the installed roles the domain controller is supporting. + Start \"Server Manager\". + Select \"AD DS\" in the left pane and the server name under \"Servers\" to the right. + Select \"Add (or Remove) Roles and Features\" from \"Tasks\" in the \"Roles and Features\" section. (Cancel before any changes are made.) + Determine if any additional server roles are installed. A basic domain controller setup will include the following: + + - Active Directory Domain Services + - DNS Server + - File and Storage Services + + If any roles not requiring installation on a domain controller are installed, this is a finding. + A Domain Name System (DNS) server integrated with the directory server (e.g., AD-integrated DNS) is an acceptable application. However, the DNS server must comply with the DNS STIG security requirements. + Run \"Programs and Features\". + Review installed applications. + If any applications are installed that are not required for the domain controller, this is a finding." + desc "fix", "Remove additional roles or applications such as web, database, and email from the domain controller." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93417" + tag rid: "SV-103503r1_rule" + tag stig_id: "WN19-DC-000130" + tag fix_id: "F-99661r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + role_list = [ + "Active Directory Domain Services", + "DNS Server", + "File and Storage Services" + ] + roles = json(command: "Get-WindowsFeature | Where {($_.installstate -eq 'installed') -and ($_.featuretype -eq 'role')} | foreach { $_.DisplayName } | ConvertTo-JSON").params + describe "The list of roles installed on the server" do + subject { roles } + it { should be_in role_list } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205696.rb b/controls/SV-205696.rb new file mode 100644 index 0000000..3978294 --- /dev/null +++ b/controls/SV-205696.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205696" do + title "Windows Server 2019 local users on domain-joined member servers must not be enumerated." + desc "The username is one part of logon credentials that could be used to gain access to a system. Preventing the enumeration of users limits this information to authorized personnel." + desc "rationale", "" + desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ + + Value Name: EnumerateLocalUsers + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Logon >> \"Enumerate local users on domain-joined computers\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000095-GPOS-00049" + tag gid: "V-93419" + tag rid: "SV-103505r1_rule" + tag stig_id: "WN19-MS-000030" + tag fix_id: "F-99663r1_fix" + tag cci: ["CCI-000381"] + tag nist: ["CM-7 a", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '3' + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\System') do + it { should have_property 'EnumerateLocalUsers' } + its('EnumerateLocalUsers') { should cmp 0 } + end + else + impact 0.0 + describe 'This control is not applicable as it only applies to member servers' do + skip 'This control is not applicable as it only applies to member servers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205697.rb b/controls/SV-205697.rb new file mode 100644 index 0000000..16c2442 --- /dev/null +++ b/controls/SV-205697.rb @@ -0,0 +1,46 @@ +# encoding: UTF-8 + +control "SV-205697" do + title "Windows Server 2019 must not have the Microsoft FTP service installed unless required by the organization." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption." + desc "rationale", "" + desc "check", "If the server has the role of an FTP server, this is NA. + + Open \"PowerShell\". + Enter \"Get-WindowsFeature | Where Name -eq Web-Ftp-Service\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding. + If the system has the role of an FTP server, this must be documented with the ISSO." + desc "fix", "Uninstall the \"FTP Server\" role. + + Start \"Server Manager\". + Select the server with the role. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"FTP Server\" under \"Web Server (IIS)\" on the \"Roles\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000096-GPOS-00050" + tag gid: "V-93421" + tag rid: "SV-103507r1_rule" + tag stig_id: "WN19-00-000330" + tag fix_id: "F-99665r1_fix" + tag cci: ["CCI-000382"] + tag nist: ["CM-7 b", "Rev_4"] + + ftp_server_state = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip + + if input('ftp_server') == false + describe 'Microsoft FTP service must not be installed unless required' do + subject { ftp_server_state } + it { should eq 'False' } + end + else + impact 0.0 + describe 'This server has the role of an FTP server, therefore this control is NA' do + skip 'This server has the role of an FTP server, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205698.rb b/controls/SV-205698.rb new file mode 100644 index 0000000..7e90f3b --- /dev/null +++ b/controls/SV-205698.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205698" do + title "Windows Server 2019 must not have the Telnet Client installed." + desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." + desc "rationale", "" + desc "check", "Open \"PowerShell\". + + Enter \"Get-WindowsFeature | Where Name -eq Telnet-Client\". + If \"Installed State\" is \"Installed\", this is a finding. + An Installed State of \"Available\" or \"Removed\" is not a finding." + desc "fix", "Uninstall the \"Telnet Client\" feature. + + Start \"Server Manager\". + Select the server with the feature. + Scroll down to \"ROLES AND FEATURES\" in the right pane. + Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. + Select the appropriate server on the \"Server Selection\" page and click \"Next\". + Deselect \"Telnet Client\" on the \"Features\" page. + Click \"Next\" and \"Remove\" as prompted." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000096-GPOS-00050" + tag gid: "V-93423" + tag rid: "SV-103509r1_rule" + tag stig_id: "WN19-00-000360" + tag fix_id: "F-99667r1_fix" + tag cci: ["CCI-000382"] + tag nist: ["CM-7 b", "Rev_4"] + + describe windows_feature('Telnet-Client') do + it { should_not be_installed } + end +end \ No newline at end of file diff --git a/controls/SV-205699.rb b/controls/SV-205699.rb new file mode 100644 index 0000000..0dd90db --- /dev/null +++ b/controls/SV-205699.rb @@ -0,0 +1,28 @@ +# encoding: UTF-8 + +control "SV-205699" do + title "Windows Server 2019 shared user accounts must not be permitted." + desc "Shared accounts (accounts where two or more people log on with the same user identification) do not provide adequate identification and authentication. There is no way to provide for nonrepudiation or individual accountability for system access and resource usage." + desc "rationale", "" + desc "check", "Determine whether any shared accounts exist. If no shared accounts exist, this is NA. + + Shared accounts, such as required by an application, may be approved by the organization. This must be documented with the ISSO. Documentation must include the reason for the account, who has access to the account, and how the risk of using the shared account is mitigated to include monitoring account activity. + + If unapproved shared accounts exist, this is a finding." + desc "fix", "Remove unapproved shared accounts from the system. + + Document required shared accounts with the ISSO. Documentation must include the reason for the account, who has access to the account, and how the risk of using the shared account is mitigated to include monitoring account activity." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000104-GPOS-00051" + tag gid: "V-93437" + tag rid: "SV-103523r1_rule" + tag stig_id: "WN19-00-000070" + tag fix_id: "F-99681r1_fix" + tag cci: ["CCI-000764"] + tag nist: ["IA-2", "Rev_4"] + + describe 'This control needs to be check manually' do + skip 'Control not executed as this test is manual' + end +end \ No newline at end of file diff --git a/controls/SV-205700.rb b/controls/SV-205700.rb new file mode 100644 index 0000000..a667ebc --- /dev/null +++ b/controls/SV-205700.rb @@ -0,0 +1,50 @@ +# encoding: UTF-8 + +control "SV-205700" do + title "Windows Server 2019 accounts must require passwords." + desc "The lack of password protection enables anyone to gain access to the information system, which opens a backdoor opportunity for intruders to compromise the system as well as other resources. Accounts on a system must require passwords." + desc "rationale", "" + desc "check", "Review the password required status for enabled user accounts. + Open \"PowerShell\". + + Domain Controllers: + Enter \"Get-Aduser -Filter * -Properties Passwordnotrequired |FT Name, Passwordnotrequired, Enabled\". + Exclude disabled accounts (e.g., DefaultAccount, Guest) and Trusted Domain Objects (TDOs). + If \"Passwordnotrequired\" is \"True\" or blank for any enabled user account, this is a finding. + + Member servers and standalone systems: + Enter 'Get-CimInstance -Class Win32_Useraccount -Filter \"PasswordRequired=False and LocalAccount=True\" | FT Name, PasswordRequired, Disabled, LocalAccount'. + Exclude disabled accounts (e.g., DefaultAccount, Guest). + If any enabled user accounts are returned with a \"PasswordRequired\" status of \"False\", this is a finding." + desc "fix", "Configure all enabled accounts to require passwords. + The password required flag can be set by entering the following on a command line: \"Net user [username] /passwordreq:yes\", substituting [username] with the name of the user account." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000104-GPOS-00051" + tag gid: "V-93439" + tag rid: "SV-103525r2_rule" + tag stig_id: "WN19-00-000200" + tag fix_id: "F-99683r1_fix" + tag cci: ["CCI-000764"] + tag nist: ["IA-2", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + ad_accounts = json({ command: "Get-ADUser -Filter \"(Enabled -eq $true) -And (PasswordNotRequired -eq $true)\" | Select -ExpandProperty Name | ConvertTo-Json" }).params + describe 'AD Accounts' do + it 'AD should not have any Accounts that have Password Not Required' do + failure_message = "Users that have Password Not Required: #{ad_accounts}" + expect(ad_accounts).to be_empty, failure_message + end + end + else + local_accounts = json({ command: "Get-CimInstance -Class Win32_Useraccount -Filter 'PasswordRequired=False and LocalAccount=True and Disabled=False' | Select -ExpandProperty Name | ConvertTo-Json" }).params + describe "Account or Accounts exists" do + it 'Server should not have Accounts with No Password Set' do + failure_message = "User or Users that have no Password Set: #{local_accounts}" + expect(local_accounts).to be_empty, failure_message + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205701.rb b/controls/SV-205701.rb new file mode 100644 index 0000000..7e5abd1 --- /dev/null +++ b/controls/SV-205701.rb @@ -0,0 +1,55 @@ +# encoding: UTF-8 + +control "SV-205701" do + title "Windows Server 2019 Active Directory user accounts, including administrators, must be configured to require the use of a Common Access Card (CAC), Personal Identity Verification (PIV)-compliant hardware token, or Alternate Logon Token (ALT) for user authentication." + desc "Smart cards such as the CAC support a two-factor authentication technique. This provides a higher level of trust in the asserted identity than use of the username and password for authentication." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Open \"PowerShell\". + Enter the following: + \"Get-ADUser -Filter {(Enabled -eq $True) -and (SmartcardLogonRequired -eq $False)} | FT Name\" + (\"DistinguishedName\" may be substituted for \"Name\" for more detailed output.) + If any user accounts, including administrators, are listed, this is a finding. + + Alternately: + To view sample accounts in \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"): + Select the Organizational Unit (OU) where the user accounts are located. (By default, this is the Users node; however, accounts may be under other organization-defined OUs.) + Right-click the sample user account and select \"Properties\". + Select the \"Account\" tab. + If any user accounts, including administrators, do not have \"Smart card is required for interactive logon\" checked in the \"Account Options\" area, this is a finding." + desc "fix", "Configure all user accounts, including administrator accounts, in Active Directory to enable the option \"Smart card is required for interactive logon\". + + Run \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"): + Select the OU where the user accounts are located. (By default this is the Users node; however, accounts may be under other organization-defined OUs.) + Right-click the user account and select \"Properties\". + Select the \"Account\" tab. + Check \"Smart card is required for interactive logon\" in the \"Account Options\" area." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000105-GPOS-00052" + tag satisfies: ["SRG-OS-000105-GPOS-00052", "SRG-OS-000106-GPOS-00053", "SRG-OS-000107-GPOS-00054", "SRG-OS-000108-GPOS-00055", "SRG-OS-000375-GPOS-00160"] + tag gid: "V-93441" + tag rid: "SV-103527r1_rule" + tag stig_id: "WN19-DC-000310" + tag fix_id: "F-99685r1_fix" + tag cci: ["CCI-000765", "CCI-000766", "CCI-000767", "CCI-000768", "CCI-001948"] + tag nist: ["IA-2 (1)", "IA-2 (2)", "IA-2 (3)", "IA-2 (4)", "IA-2 (11)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + accounts = json(command: "Get-ADUser -Filter {(Enabled -eq $True) -and (SmartcardLogonRequired -eq $False)} | Select -ExpandProperty Name | ConvertTo-Json").params + describe 'Accounts without smartcard logon required' do + it 'Accounts must be configured to require the use of a CAC, PIV or ALT' do + failure_message = "#{accounts}" + expect(accounts).to be_empty, failure_message + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205702.rb b/controls/SV-205702.rb new file mode 100644 index 0000000..320f194 --- /dev/null +++ b/controls/SV-205702.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205702" do + title "Windows Server 2019 Kerberos user logon restrictions must be enforced." + desc "This policy setting determines whether the Kerberos Key Distribution Center (KDC) validates every request for a session ticket against the user rights policy of the target computer. The policy is enabled by default, which is the most secure setting for validating that access to target resources is not circumvented." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Verify the following is configured in the Default Domain Policy: + Open \"Group Policy Management\". + Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). + Right-click on the \"Default Domain Policy\". + Select \"Edit\". + Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. + + If the \"Enforce user logon restrictions\" is not set to \"Enabled\", this is a finding." + desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Enforce user logon restrictions\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000112-GPOS-00057" + tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] + tag gid: "V-93443" + tag rid: "SV-103529r1_rule" + tag stig_id: "WN19-DC-000020" + tag fix_id: "F-99687r1_fix" + tag cci: ["CCI-001941", "CCI-001942"] + tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('TicketValidateClient') { should eq 1 } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205703.rb b/controls/SV-205703.rb new file mode 100644 index 0000000..f4df488 --- /dev/null +++ b/controls/SV-205703.rb @@ -0,0 +1,40 @@ +# encoding: UTF-8 + +control "SV-205703" do + title "Windows Server 2019 Kerberos service ticket maximum lifetime must be limited to 600 minutes or less." + desc "This setting determines the maximum amount of time (in minutes) that a granted session ticket can be used to access a particular service. Session tickets are used only to authenticate new connections with servers. Ongoing operations are not interrupted if the session ticket used to authenticate the connection expires during the connection." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Verify the following is configured in the Default Domain Policy: + Open \"Group Policy Management\". + Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). + Right-click on the \"Default Domain Policy\". + Select \"Edit\". + Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. + If the value for \"Maximum lifetime for service ticket\" is \"0\" or greater than \"600\" minutes, this is a finding." + desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for service ticket\" to a maximum of \"600\" minutes, but not \"0\", which equates to \"Ticket doesn't expire\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000112-GPOS-00057" + tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] + tag gid: "V-93445" + tag rid: "SV-103531r1_rule" + tag stig_id: "WN19-DC-000030" + tag fix_id: "F-99689r1_fix" + tag cci: ["CCI-001941", "CCI-001942"] + tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('MaxServiceAge') { should be_between(0,600) } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205704.rb b/controls/SV-205704.rb new file mode 100644 index 0000000..88ce452 --- /dev/null +++ b/controls/SV-205704.rb @@ -0,0 +1,40 @@ +# encoding: UTF-8 + +control "SV-205704" do + title "Windows Server 2019 Kerberos user ticket lifetime must be limited to 10 hours or less." + desc "In Kerberos, there are two types of tickets: Ticket Granting Tickets (TGTs) and Service Tickets. Kerberos tickets have a limited lifetime so the time an attacker has to implement an attack is limited. This policy controls how long TGTs can be renewed. With Kerberos, the user's initial authentication to the domain controller results in a TGT, which is then used to request Service Tickets to resources. Upon startup, each computer gets a TGT before requesting a service ticket to the domain controller and any other computers it needs to access. For services that start up under a specified user account, users must always get a TGT first and then get Service Tickets to all computers and services accessed." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Verify the following is configured in the Default Domain Policy: + Open \"Group Policy Management\". + Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). + Right-click on the \"Default Domain Policy\". + Select \"Edit\". + Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. + If the value for \"Maximum lifetime for user ticket\" is \"0\" or greater than \"10\" hours, this is a finding." + desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for user ticket\" to a maximum of \"10\" hours but not \"0\", which equates to \"Ticket doesn't expire\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000112-GPOS-00057" + tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] + tag gid: "V-93447" + tag rid: "SV-103533r1_rule" + tag stig_id: "WN19-DC-000040" + tag fix_id: "F-99691r1_fix" + tag cci: ["CCI-001941", "CCI-001942"] + tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('MaxTicketAge') { should be_between(1, 10) } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205705.rb b/controls/SV-205705.rb new file mode 100644 index 0000000..88e0f6f --- /dev/null +++ b/controls/SV-205705.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205705" do + title "Windows Server 2019 Kerberos policy user ticket renewal maximum lifetime must be limited to seven days or less." + desc "This setting determines the period of time (in days) during which a user's Ticket Granting Ticket (TGT) may be renewed. This security configuration limits the amount of time an attacker has to crack the TGT and gain access." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Verify the following is configured in the Default Domain Policy: + Open \"Group Policy Management\". + Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). + Right-click on the \"Default Domain Policy\". + Select \"Edit\". + Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. + + If the \"Maximum lifetime for user ticket renewal\" is greater than \"7\" days, this is a finding." + desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for user ticket renewal\" to a maximum of \"7\" days or less." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000112-GPOS-00057" + tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] + tag gid: "V-93449" + tag rid: "SV-103535r1_rule" + tag stig_id: "WN19-DC-000050" + tag fix_id: "F-99693r1_fix" + tag cci: ["CCI-001941", "CCI-001942"] + tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('MaxRenewAge') { should be <= 7 } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205706.rb b/controls/SV-205706.rb new file mode 100644 index 0000000..6fc6fdd --- /dev/null +++ b/controls/SV-205706.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205706" do + title "Windows Server 2019 computer clock synchronization tolerance must be limited to five minutes or less." + desc "This setting determines the maximum time difference (in minutes) that Kerberos will tolerate between the time on a client's clock and the time on a server's clock while still considering the two clocks synchronous. In order to prevent replay attacks, Kerberos uses timestamps as part of its protocol definition. For timestamps to work properly, the clocks of the client and the server need to be in sync as much as possible." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + Verify the following is configured in the Default Domain Policy: + + Open \"Group Policy Management\". + Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). + Right-click on the \"Default Domain Policy\". + Select \"Edit\". + Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. + + If the \"Maximum tolerance for computer clock synchronization\" is greater than \"5\" minutes, this is a finding." + desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum tolerance for computer clock synchronization\" to a maximum of \"5\" minutes or less." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000112-GPOS-00057" + tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] + tag gid: "V-93451" + tag rid: "SV-103537r1_rule" + tag stig_id: "WN19-DC-000060" + tag fix_id: "F-99695r1_fix" + tag cci: ["CCI-001941", "CCI-001942"] + tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('MaxClockSkew') { should be <= 5 } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205707.rb b/controls/SV-205707.rb new file mode 100644 index 0000000..f6b350f --- /dev/null +++ b/controls/SV-205707.rb @@ -0,0 +1,103 @@ +# encoding: UTF-8 + +control 'SV-205707' do + title 'Windows Server 2019 outdated or unused accounts must be removed or disabled.' + desc 'Outdated or unused accounts provide penetration points that may go undetected. Inactive accounts must be deleted if no longer necessary or, if still required, disabled until needed.' + desc 'rationale', '' + desc 'check', "Open \"Windows PowerShell\". + + Domain Controllers: + Enter \"Search-ADAccount -AccountInactive -UsersOnly -TimeSpan #{input('unused_account_age')}.00:00:00\" + This will return accounts that have not been logged on to for #{input('unused_account_age')} days, along with various attributes such as the Enabled status and LastLogonDate. + + Member servers and standalone systems: + Copy or enter the lines below to the PowerShell window and enter. (Entering twice may be required. Do not include the quotes at the beginning and end of the query.) + \"([ADSI]('WinNT://{0}' -f $env:COMPUTERNAME)).Children | Where { $_.SchemaClassName -eq 'user' } | ForEach { + $user = ([ADSI]$_.Path) + $lastLogin = $user.Properties.LastLogin.Value + $enabled = ($user.Properties.UserFlags.Value -band 0x2) -ne 0x2 + if ($lastLogin -eq $null) { + $lastLogin = 'Never' + } + Write-Host $user.Name $lastLogin $enabled + }\" + This will return a list of local accounts with the account name, last logon, and if the account is enabled (True/False). + For example: User1 10/31/2015 5:49:56 AM True + Review the list of accounts returned by the above queries to determine the finding validity for each account reported. + + Exclude the following accounts: + - Built-in administrator account (Renamed, SID ending in 500) + - Built-in guest account (Renamed, Disabled, SID ending in 501) + - Application accounts + + If any enabled accounts have not been logged on to within the past #{input('unused_account_age')} days, this is a finding. + + Inactive accounts that have been reviewed and deemed to be required must be documented with the ISSO." + desc 'fix', "Regularly review accounts to determine if they are still active. Remove or disable accounts that have not been used in the last #{input('unused_account_age')} days." + impact 0.5 + tag severity: nil + tag gtitle: 'SRG-OS-000118-GPOS-00060' + tag gid: 'V-93457' + tag rid: 'SV-103543r1_rule' + tag stig_id: 'WN19-00-000190' + tag fix_id: 'F-99701r1_fix' + tag cci: ['CCI-000795'] + tag nist: ['IA-4 e', 'Rev_4'] + + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + age = input('unused_account_age') + untracked_accounts = [] + + if domain_role == '4' || domain_role == '5' + + excluded_accounts_domain_check = json(command: 'Get-ADUser -Filter * | Where {($_.SID -like "*-500") -or ($_.SID -like "*-501")} | Select Name | ConvertTo-Json').params + excluded_accounts_domain = [] + excluded_accounts_domain_check.each { |account| excluded_accounts_domain << account["Name"] } + + ad_accounts = json({ command: "Search-ADAccount -AccountInactive -UsersOnly -Timespan #{age}.00:00:00 | Where -Property Enabled -eq $True | Select -ExpandProperty Name | ConvertTo-Json" }).params + unless ad_accounts.empty? + case ad_accounts + when String + (ad_account = []) << ad_accounts + untracked_accounts = ad_account - input('application_accounts_domain') - excluded_accounts_domain + when Array + untracked_accounts = ad_accounts - input('application_accounts_domain') - excluded_accounts_domain + end + end + + describe 'AD Accounts' do + it "AD should not have any Accounts that are Inactive over #{age} days" do + failure_message = "User(s) that have not logged into system in #{age} days #{untracked_accounts}" + expect(untracked_accounts).to be_empty, failure_message + end + end + + else + + excluded_accounts_local_check = json(command: 'Get-LocalUser | Where {($_.SID -like "*-500") -or ($_.SID -like "*-501")} | Select Name | ConvertTo-Json').params + excluded_accounts_local = [] + excluded_accounts_local_check.each do |account| + excluded_accounts_local << account["Name"] + end + + local_accounts = json({ command: "Get-LocalUser | Where-Object {$_.Enabled -eq 'True' -and $_.Lastlogon -le (Get-Date).AddDays(-#{age}) } | Select -ExpandProperty Name | ConvertTo-Json" }).params + + unless local_accounts.empty? + case local_accounts + when String + (local_account = []) << local_accounts + untracked_accounts = local_account - input('application_accounts_local') - excluded_accounts_local + when Array + untracked_accounts = local_accounts - input('application_accounts_local') - excluded_accounts_local + end + end + + describe 'Inactive account or accounts exists' do + it 'Server should not have inactive accounts' do + failure_message = "User(s) that have not logged into system in #{age} days: #{local_accounts}" + expect(local_accounts).to be_empty, failure_message + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205708.rb b/controls/SV-205708.rb new file mode 100644 index 0000000..e29d19d --- /dev/null +++ b/controls/SV-205708.rb @@ -0,0 +1,38 @@ +# encoding: UTF-8 + +control "SV-205708" do + title "Windows Server 2019 Kerberos encryption types must be configured to prevent the use of DES and RC4 encryption suites." + desc "Certain encryption types are no longer considered secure. The DES and RC4 encryption suites must not be used for Kerberos encryption. + Note: Organizations with domain controllers running earlier versions of Windows where RC4 encryption is enabled, selecting \"The other domain supports Kerberos AES Encryption\" on domain trusts, may be required to allow client communication across the trust relationship." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Kerberos\\Parameters\\ + + Value Name: SupportedEncryptionTypes + + Value Type: REG_DWORD + Value: 0x7ffffff8 (2147483640)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Configure encryption types allowed for Kerberos\" to \"Enabled\" with only the following selected: + + AES128_HMAC_SHA1 + AES256_HMAC_SHA1 + Future encryption types + + Note: Organizations with domain controllers running earlier versions of Windows where RC4 encryption is enabled, selecting \"The other domain supports Kerberos AES Encryption\" on domain trusts, may be required to allow client communication across the trust relationship." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000120-GPOS-00061" + tag gid: "V-93495" + tag rid: "SV-103581r1_rule" + tag stig_id: "WN19-SO-000290" + tag fix_id: "F-99739r1_fix" + tag cci: ["CCI-000803"] + tag nist: ["IA-7", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Kerberos\\Parameters') do + it { should have_property 'SupportedEncryptionTypes' } + its('SupportedEncryptionTypes') { should cmp 2147483640 } + end +end \ No newline at end of file diff --git a/controls/SV-205709.rb b/controls/SV-205709.rb new file mode 100644 index 0000000..0d9385c --- /dev/null +++ b/controls/SV-205709.rb @@ -0,0 +1,30 @@ +# encoding: UTF-8 + +control "SV-205709" do + title "Windows Server 2019 must have the built-in guest account disabled." + desc "A system faces an increased vulnerability threat if the built-in guest account is not disabled. This is a known account that exists on all Windows systems and cannot be deleted. This account is initialized during the installation of the operating system with no password assigned." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. + If the value for \"Accounts: Guest account status\" is not set to \"Disabled\", this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"EnableGuestAccount\" equals \"1\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Guest account status\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000121-GPOS-00062" + tag gid: "V-93497" + tag rid: "SV-103583r1_rule" + tag stig_id: "WN19-SO-000010" + tag fix_id: "F-99741r1_fix" + tag cci: ["CCI-000804"] + tag nist: ["IA-8", "Rev_4"] + + describe security_policy do + its('EnableGuestAccount') { should cmp 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205710.rb b/controls/SV-205710.rb new file mode 100644 index 0000000..1a68b4e --- /dev/null +++ b/controls/SV-205710.rb @@ -0,0 +1,85 @@ +# encoding: UTF-8 + +control "SV-205710" do + title "Windows Server 2019 must automatically remove or disable emergency accounts after the crisis is resolved or within #{input('emergency_account_period_phrase')}." + desc "Emergency administrator accounts are privileged accounts established in response to crisis situations where the need for rapid account activation is required. Therefore, emergency account activation may bypass normal account authorization processes. If these accounts are automatically disabled, system maintenance during emergencies may not be possible, thus adversely affecting system availability. + Emergency administrator accounts are different from infrequently used accounts (i.e., local logon accounts used by system administrators when network or normal logon/access is not available). Infrequently used accounts are not subject to automatic termination dates. Emergency accounts are accounts created in response to crisis situations, usually for use by maintenance personnel. The automatic expiration or disabling time period may be extended as needed until the crisis is resolved; however, it must not be extended indefinitely. A permanent account should be established for privileged users who need long-term maintenance accounts. + To address access requirements, many operating systems can be integrated with enterprise-level authentication/access mechanisms that meet or exceed access control policy requirements." + desc "rationale", "" + desc 'check', "Determine if emergency administrator accounts are used and identify any that exist. If none exist, this is NA. + If emergency administrator accounts cannot be configured with an expiration date due to an ongoing crisis, the accounts must be disabled or removed when the crisis is resolved. + If emergency administrator accounts have not been configured with an expiration date or have not been disabled or removed following the resolution of a crisis, this is a finding. + + Domain Controllers: + Open \"PowerShell\". + Enter \"Search-ADAccount -AccountExpiring | FT Name, AccountExpirationDate\". + If \"AccountExpirationDate\" has been defined and is not within #{input('emergency_account_period_phrase')} for an emergency administrator account, this is a finding. + + Member servers and standalone systems: + Open \"Command Prompt\". + Run \"Net user [username]\", where [username] is the name of the emergency account. + If \"Account expires\" has been defined and is not within #{input('emergency_account_period_phrase')} for an emergency administrator account, this is a finding." + desc 'fix', "Remove emergency administrator accounts after a crisis has been resolved or configure the accounts to automatically expire within #{input('emergency_account_period_phrase')}. + Domain accounts can be configured with an account expiration date, under \"Account\" properties. + Local accounts can be configured to expire with the command \"Net user [username] /expires:[mm/dd/yyyy]\", where username is the name of the temporary user account." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000123-GPOS-00064' + tag 'gid': 'V-92977' + tag 'rid': 'SV-103065r1_rule' + tag 'stig_id': 'WN19-00-000310' + tag 'fix_id': 'F-99223r1_fix' + tag 'cci': ["CCI-001682"] + tag 'nist': ["AC-2 (2)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + emergency_accounts_list = input('emergency_accounts_domain') + if emergency_accounts_list == [nil] + impact 0.0 + describe 'There are no Emergency Account listed for this Control' do + skip 'This becomes a manual check if the input emergency_accounts_domain is not assigned a value' + end + else + emergency_accounts = [] + emergency_accounts_list.each do |emergency_account| + emergency_accounts << json({ command: "Get-ADUser -Identity #{emergency_account} -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json"}).params + end + emergency_accounts.each do |emergency_account| + account_name = emergency_account.fetch("SamAccountName") + creation_date = Date.parse(emergency_account.fetch("WhenCreated")) + expiration_date = Date.parse(emergency_account.fetch("AccountExpirationDate")) + date_difference = expiration_date.mjd - creation_date.mjd + describe "Account expiration set for #{account_name}" do + subject { date_difference } + it { should cmp <= input('emergency_account_period')} + end + end + end + + else + emergency_accounts_list = input('emergency_accounts_local') + if emergency_accounts_list == [nil] + impact 0.0 + describe 'There are no Emergency Account listed for this Control' do + skip 'This is not applicable as there are no Emergency Account listed for this Control' + end + else + emergency_accounts = [] + emergency_accounts_list.each do |emergency_account| + emergency_accounts << json({ command: "Get-LocalUser -Name #{emergency_account} | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json"}).params + end + emergency_accounts.each do |emergency_account| + user_name = emergency_account.fetch("Name") + password_date = Date.parse(emergency_account.fetch("PasswordLastSet")) + expiration_date = Date.parse(emergency_account.fetch("AccountExpires")) + date_difference = expiration_date.mjd - password_date.mjd + describe "Account expiration set for #{user_name}" do + subject { date_difference } + it { should cmp <= input('emergency_account_period')} + end + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205711.rb b/controls/SV-205711.rb new file mode 100644 index 0000000..dc9018e --- /dev/null +++ b/controls/SV-205711.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205711" do + title "Windows Server 2019 Windows Remote Management (WinRM) client must not use Basic authentication." + desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ + + Value Name: AllowBasic + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Allow Basic authentication\" to \"Disabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000125-GPOS-00065" + tag gid: "V-93503" + tag rid: "SV-103589r1_rule" + tag stig_id: "WN19-CC-000470" + tag fix_id: "F-99747r1_fix" + tag cci: ["CCI-000877"] + tag nist: ["MA-4 c", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do + it { should have_property 'AllowBasic' } + its('AllowBasic') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205712.rb b/controls/SV-205712.rb new file mode 100644 index 0000000..e509a6c --- /dev/null +++ b/controls/SV-205712.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205712" do + title "Windows Server 2019 Windows Remote Management (WinRM) client must not use Digest authentication." + desc "Digest authentication is not as strong as other options and may be subject to man-in-the-middle attacks. Disallowing Digest authentication will reduce this potential." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ + + Value Name: AllowDigest + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Disallow Digest authentication\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000125-GPOS-00065" + tag gid: "V-93505" + tag rid: "SV-103591r1_rule" + tag stig_id: "WN19-CC-000490" + tag fix_id: "F-99749r1_fix" + tag cci: ["CCI-000877"] + tag nist: ["MA-4 c", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do + it { should have_property 'AllowDigest' } + its('AllowDigest') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205713.rb b/controls/SV-205713.rb new file mode 100644 index 0000000..7315daa --- /dev/null +++ b/controls/SV-205713.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205713" do + title "Windows Server 2019 Windows Remote Management (WinRM) service must not use Basic authentication." + desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ + + Value Name: AllowBasic + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Allow Basic authentication\" to \"Disabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000125-GPOS-00065" + tag gid: "V-93507" + tag rid: "SV-103593r1_rule" + tag stig_id: "WN19-CC-000500" + tag fix_id: "F-99751r1_fix" + tag cci: ["CCI-000877"] + tag nist: ["MA-4 c", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Service') do + it { should have_property 'AllowBasic' } + its('AllowBasic') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205714.rb b/controls/SV-205714.rb new file mode 100644 index 0000000..904956e --- /dev/null +++ b/controls/SV-205714.rb @@ -0,0 +1,30 @@ +# encoding: UTF-8 + +control "SV-205714" do + title "Windows Server 2019 administrator accounts must not be enumerated during elevation." + desc "Enumeration of administrator accounts when elevating can provide part of the logon information to an unauthorized user. This setting configures the system to always require users to type in a username and password to elevate a running application." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\CredUI\\ + + Value Name: EnumerateAdministrators + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Credential User Interface >> \"Enumerate administrator accounts on elevation\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93517" + tag rid: "SV-103603r1_rule" + tag stig_id: "WN19-CC-000240" + tag fix_id: "F-99761r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\CredUI') do + it { should have_property 'EnumerateAdministrators' } + its('EnumerateAdministrators') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205715.rb b/controls/SV-205715.rb new file mode 100644 index 0000000..1a8cc18 --- /dev/null +++ b/controls/SV-205715.rb @@ -0,0 +1,45 @@ +# encoding: UTF-8 + +control "SV-205715" do + title "Windows Server 2019 local administrator accounts must have their privileged token filtered to prevent elevated privileges from being used over the network on domain-joined member servers." + desc "A compromised local administrator account can provide means for an attacker to move laterally between domain systems. + With User Account Control enabled, filtering the privileged token for local administrator accounts will prevent the elevated privileges of these accounts from being used over the network." + desc "rationale", "" + desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System + + Value Name: LocalAccountTokenFilterPolicy + + Type: REG_DWORD + Value: 0x00000000 (0) + + This setting may cause issues with some network scanning tools if local administrative accounts are used remotely. Scans should use domain accounts where possible. If a local administrative account must be used, temporarily enabling the privileged token by configuring the registry value to \"1\" may be required." + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Apply UAC restrictions to local accounts on network logons\" to \"Enabled\". + This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \" SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93519" + tag rid: "SV-103605r1_rule" + tag stig_id: "WN19-MS-000020" + tag fix_id: "F-99763r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '3' + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'LocalAccountTokenFilterPolicy' } + its('LocalAccountTokenFilterPolicy') { should cmp == 0 } + end + else + impact 0.0 + describe 'This requirement is only applicable to member servers' do + skip 'This control is NA as the requirement is only applicable to member servers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205716.rb b/controls/SV-205716.rb new file mode 100644 index 0000000..38f4dda --- /dev/null +++ b/controls/SV-205716.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205716" do + title "Windows Server 2019 UIAccess applications must not be allowed to prompt for elevation without using the secure desktop." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting prevents User Interface Accessibility programs from disabling the secure desktop for elevation prompts." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: EnableUIADesktopToggle + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93521" + tag rid: "SV-103607r1_rule" + tag stig_id: "WN19-SO-000390" + tag fix_id: "F-99765r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'EnableUIADesktopToggle' } + its('EnableUIADesktopToggle') { should cmp == 0 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205717.rb b/controls/SV-205717.rb new file mode 100644 index 0000000..a8822a0 --- /dev/null +++ b/controls/SV-205717.rb @@ -0,0 +1,45 @@ +# encoding: UTF-8 + +control "SV-205717" do + title "Windows Server 2019 User Account Control must, at a minimum, prompt administrators for consent on the secure desktop." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures the elevation requirements for logged-on administrators to complete a task that requires raised privileges." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is default installation option for Windows Server 2019 versus Server with Desktop Experience). + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: ConsentPromptBehaviorAdmin + + Value Type: REG_DWORD + Value: 0x00000002 (2) (Prompt for consent on the secure desktop) + 0x00000001 (1) (Prompt for credentials on the secure desktop)" + desc "fix", " + Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode\" to \"Prompt for consent on the secure desktop\". + + The more secure option for this setting, \"Prompt for credentials on the secure desktop\", would also be acceptable." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93523" + tag rid: "SV-103609r1_rule" + tag stig_id: "WN19-SO-000400" + tag fix_id: "F-99767r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'ConsentPromptBehaviorAdmin' } + its('ConsentPromptBehaviorAdmin') { should be_between(1,2) } + end + end +end \ No newline at end of file diff --git a/controls/SV-205718.rb b/controls/SV-205718.rb new file mode 100644 index 0000000..6097f80 --- /dev/null +++ b/controls/SV-205718.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205718" do + title "Windows Server 2019 User Account Control must be configured to detect application installations and prompt for elevation." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting requires Windows to respond to application installation requests by prompting for credentials." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: EnableInstallerDetection + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Detect application installations and prompt for elevation\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93525" + tag rid: "SV-103611r1_rule" + tag stig_id: "WN19-SO-000420" + tag fix_id: "F-99769r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'EnableInstallerDetection' } + its('EnableInstallerDetection') { should cmp == 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205719.rb b/controls/SV-205719.rb new file mode 100644 index 0000000..034716d --- /dev/null +++ b/controls/SV-205719.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205719" do + title "Windows Server 2019 User Account Control (UAC) must only elevate UIAccess applications that are installed in secure locations." + desc "UAC is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures Windows to only allow applications installed in a secure location on the file system, such as the Program Files or the Windows\\System32 folders, to run with elevated privileges." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: EnableSecureUIAPaths + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Only elevate UIAccess applications that are installed in secure locations\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93527" + tag rid: "SV-103613r1_rule" + tag stig_id: "WN19-SO-000430" + tag fix_id: "F-99771r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'EnableSecureUIAPaths' } + its('EnableSecureUIAPaths') { should cmp == 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205720.rb b/controls/SV-205720.rb new file mode 100644 index 0000000..9dfb4b5 --- /dev/null +++ b/controls/SV-205720.rb @@ -0,0 +1,41 @@ +# encoding: UTF-8 + +control "SV-205720" do + title "Windows Server 2019 User Account Control (UAC) must virtualize file and registry write failures to per-user locations." + desc "UAC is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures non-UAC-compliant applications to run in virtualized file and registry entries in per-user locations, allowing them to run." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: EnableVirtualization + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Virtualize file and registry write failures to per-user locations\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000134-GPOS-00068" + tag gid: "V-93529" + tag rid: "SV-103615r1_rule" + tag stig_id: "WN19-SO-000450" + tag fix_id: "F-99773r1_fix" + tag cci: ["CCI-001084"] + tag nist: ["SC-3", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'EnableVirtualization' } + its('EnableVirtualization') { should cmp == 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205721.rb b/controls/SV-205721.rb new file mode 100644 index 0000000..3a7ddf1 --- /dev/null +++ b/controls/SV-205721.rb @@ -0,0 +1,54 @@ +control 'SV-205721' do + title 'Windows Server 2019 non-system-created file shares must limit access to groups that require it.' + desc 'Shares on a system provide network access. To prevent exposing sensitive information, where shares are necessary, permissions must be reconfigured to give the minimum access to accounts that require it.' + desc 'rationale', '' + desc 'check', "If only system-created shares such as \"ADMIN$\", \"C$\", and \"IPC$\" exist on the system, this is NA. (System-created shares will display a message that it has been shared for administrative purposes when \"Properties\" is selected.) + + Run \"Computer Management\". + Navigate to System Tools >> Shared Folders >> Shares. + Right-click any non-system-created shares. + Select \"Properties\". + Select the \"Share Permissions\" tab. + If the file shares have not been configured to restrict permissions to the specific groups or accounts that require access, this is a finding. + Select the \"Security\" tab. + If the permissions have not been configured to restrict permissions to the specific groups or accounts that require access, this is a finding." + desc 'fix', "If a non-system-created share is required on a system, configure the share and NTFS permissions to limit access to the specific groups or accounts that require it. + Remove any unnecessary non-system-created shares." + impact 0.5 + tag severity: nil + tag gtitle: 'SRG-OS-000138-GPOS-00069' + tag gid: 'V-93531' + tag rid: 'SV-103617r1_rule' + tag stig_id: 'WN19-00-000230' + tag fix_id: 'F-99775r1_fix' + tag cci: ['CCI-001090'] + tag nist: %w(SC-4 Rev_4) + + net_shares = json({ command: 'Get-SMBShare -Special $false | Where-Object -Property Name -notin C$,ADMIN$,IPC$,NETLOGON,SYSVOL | Select Name, Path | ConvertTo-Json' }).params + + if net_shares.empty? + impact 0.0 + describe 'No non-default file shares were detected' do + skip 'This control is NA' + end + else + case net_shares + when Hash + net_shares.each do |_key, value| + describe 'Unrestricted file shares' do + subject { command("Get-Acl -Path '#{value}' | ?{$_.AccessToString -match 'Everyone\sAllow'} | %{($_.PSPath -split '::')[1]}") } + its('stdout') { should eq '' } + end + end + when Array + net_shares.each do |paths| + paths.each do |_key, value| + describe 'Unrestricted file shares' do + subject { command("Get-Acl -Path '#{value}' | ?{$_.AccessToString -match 'Everyone\sAllow'} | %{($_.PSPath -split '::')[1]}") } + its('stdout') { should eq '' } + end + end + end + end + end +end diff --git a/controls/SV-205722.rb b/controls/SV-205722.rb new file mode 100644 index 0000000..608b23b --- /dev/null +++ b/controls/SV-205722.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205722" do + title "Windows Server 2019 Remote Desktop Services must prevent drive redirection." + desc "Preventing users from sharing the local drives on their client computers with Remote Session Hosts that they access helps reduce possible exposure of sensitive data." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ + + Value Name: fDisableCdm + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Session Host >> Device and Resource Redirection >> \"Do not allow drive redirection\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000138-GPOS-00069" + tag gid: "V-93533" + tag rid: "SV-103619r1_rule" + tag stig_id: "WN19-CC-000350" + tag fix_id: "F-99777r1_fix" + tag cci: ["CCI-001090"] + tag nist: ["SC-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows NT\\Terminal Services') do + it { should have_property 'fDisableCdm' } + its('fDisableCdm') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205723.rb b/controls/SV-205723.rb new file mode 100644 index 0000000..44fef97 --- /dev/null +++ b/controls/SV-205723.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control "SV-205723" do + title "Windows Server 2019 data files owned by users must be on a different logical partition from the directory server data files." + desc "When directory service data files, especially for directories used for identification, authentication, or authorization, reside on the same logical partition as user-owned files, the directory service data may be more vulnerable to unauthorized access or other availability compromises. Directory service and user-owned data files sharing a partition may be configured with less restrictive permissions in order to allow access to the user data. + + The directory service may be vulnerable to a denial of service attack when user-owned files on a common partition are expanded to an extent preventing the directory service from acquiring more space for directory or audit data." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Run \"Regedit\". + Navigate to \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\". + Note the directory locations in the values for \"DSA Database file\". + + Open \"Command Prompt\". + Enter \"net share\". + Note the logical drive(s) or file system partition for any organization-created data shares. + Ignore system shares (e.g., NETLOGON, SYSVOL, and administrative shares ending in $). User shares that are hidden (ending with $) should not be ignored. + + If user shares are located on the same logical partition as the directory server data files, this is a finding." + desc "fix", "Move shares used to store files owned by users to a different logical partition than the directory server data files." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000138-GPOS-00069" + tag gid: "V-93535" + tag rid: "SV-103621r1_rule" + tag stig_id: "WN19-DC-000120" + tag fix_id: "F-99779r1_fix" + tag cci: ["CCI-001090"] + tag nist: ["SC-4", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + dsa_db_file = command('Get-ItemPropertyValue -Path HKLM:\\System\\CurrentControlSet\\Services\\NTDS\\Parameters -Name "DSA Database file"').stdout.strip + net_shares = json({ command: "Get-SMBShare | Where-Object -Property Name -notin C$,ADMIN$,IPC$,NETLOGON,SYSVOL | Select Path | ConvertTo-Json" }).params + + if net_shares.empty? + impact 0.0 + describe 'No non-default file shares were detected' do + skip 'This control is NA' + end + else + case net_shares + when Hash + net_shares.each do |key, value| + describe "Net Share path: #{value}" do + subject { value } + it { should_not eq dsa_db_file } + end + end + when Array + net_shares.each do |paths| + paths.each do |key, value| + describe "Net Share path: #{value}" do + subject { value } + it { should_not eq dsa_db_file } + end + end + end + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205724.rb b/controls/SV-205724.rb new file mode 100644 index 0000000..6117bae --- /dev/null +++ b/controls/SV-205724.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205724" do + title "Windows Server 2019 must not allow anonymous enumeration of shares." + desc "Allowing anonymous logon users (null session connections) to list all account names and enumerate all shared resources can provide a map of potential points to attack the system." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: RestrictAnonymous + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Do not allow anonymous enumeration of SAM accounts and shares\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000138-GPOS-00069" + tag gid: "V-93537" + tag rid: "SV-103623r1_rule" + tag stig_id: "WN19-SO-000230" + tag fix_id: "F-99781r1_fix" + tag cci: ["CCI-001090"] + tag nist: ["SC-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'RestrictAnonymous' } + its('RestrictAnonymous') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205725.rb b/controls/SV-205725.rb new file mode 100644 index 0000000..afa4a26 --- /dev/null +++ b/controls/SV-205725.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205725" do + title "Windows Server 2019 must restrict anonymous access to Named Pipes and Shares." + desc "Allowing anonymous access to named pipes or shares provides the potential for unauthorized system access. This setting restricts access to those defined in \"Network access: Named Pipes that can be accessed anonymously\" and \"Network access: Shares that can be accessed anonymously\", both of which must be blank under other requirements." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ + + Value Name: RestrictNullSessAccess + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Restrict anonymous access to Named Pipes and Shares\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000138-GPOS-00069" + tag gid: "V-93539" + tag rid: "SV-103625r1_rule" + tag stig_id: "WN19-SO-000250" + tag fix_id: "F-99783r1_fix" + tag cci: ["CCI-001090"] + tag nist: ["SC-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters') do + it { should have_property 'restrictnullsessaccess' } + its('restrictnullsessaccess') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205726.rb b/controls/SV-205726.rb new file mode 100644 index 0000000..f32aa22 --- /dev/null +++ b/controls/SV-205726.rb @@ -0,0 +1,67 @@ +# encoding: UTF-8 + +control 'SV-205726' do + title "Windows Server 2019 directory service must be configured to terminate LDAP-based network connections to the directory server after #{input('maximum_idle_time_phrase')} of inactivity." + desc 'The failure to terminate inactive network connections increases the risk of a successful attack on the directory server. The longer an established session is in progress, the more time an attacker has to hijack the session, implement a means to passively intercept data, or compromise any protections on client access. For example, if an attacker gains control of a client computer, an existing (already authenticated) session with the directory server could allow access to the directory. The lack of confidentiality protection in LDAP-based sessions increases exposure to this vulnerability.' + desc 'rationale', '' + desc 'check', "This applies to domain controllers. It is NA for other systems. + Open an elevated \"Command Prompt\" (run as administrator). + Enter \"ntdsutil\". + At the \"ntdsutil:\" prompt, enter \"LDAP policies\". + At the \"ldap policy:\" prompt, enter \"connections\". + At the \"server connections:\" prompt, enter \"connect to server [host-name]\" + (where [host-name] is the computer name of the domain controller). + At the \"server connections:\" prompt, enter \"q\". + At the \"ldap policy:\" prompt, enter \"show values\". + If the value for MaxConnIdleTime is greater than \"#{input('maximum_idle_time')}\" (#{input('maximum_idle_time_phrase')}) or is not specified, this is a finding. + Enter \"q\" at the \"ldap policy:\" and \"ntdsutil:\" prompts to exit. + + Alternately, Dsquery can be used to display MaxConnIdleTime: + Open \"Command Prompt (Admin)\". + Enter the following command (on a single line). + dsquery * \"cn=Default Query Policy,cn=Query-Policies,cn=Directory Service, cn=Windows NT,cn=Services,cn=Configuration,dc=[forest-name]\" -attr LDAPAdminLimits + + The quotes are required and dc=[forest-name] is the fully qualified LDAP name of the domain being reviewed (e.g., dc=disaost,dc=mil). + If the results do not specify a \"MaxConnIdleTime\" or it has a value greater than \"#{input('maximum_idle_time')}\" (#{input('maximum_idle_time_phrase')}), this is a finding." + desc 'fix', "Configure the directory service to terminate LDAP-based network connections to the directory server after #{input('maximum_idle_time_phrase')} of inactivity. + Open an elevated \"Command prompt\" (run as administrator). + Enter \"ntdsutil\". + At the \"ntdsutil:\" prompt, enter \"LDAP policies\". + At the \"ldap policy:\" prompt, enter \"connections\". + At the \"server connections:\" prompt, enter \"connect to server [host-name]\" (where [host-name] is the computer name of the domain controller). + At the \"server connections:\" prompt, enter \"q\". + At the \"ldap policy:\" prompt, enter \"Set MaxConnIdleTime to #{input('maximum_idle_time')}\". + Enter \"Commit Changes\" to save. + Enter \"Show values\" to verify changes. + Enter \"q\" at the \"ldap policy:\" and \"ntdsutil:\" prompts to exit." + impact 0.3 + tag 'severity': '' + tag 'gtitle': "SRG-OS-000163-GPOS-00072" + tag 'gid': "V-93509" + tag 'rid': "SV-103595r1_rule" + tag 'stig_id': "WN19-DC-000160" + tag 'fix_id': "F-99753r1_fix" + tag 'cci': ["CCI-001133"] + tag 'nist': ["SC-10", "Rev_4"] + + forest_name = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-Json').params + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + query = command("dsquery * 'cn=Default Query Policy,cn=Query-Policies,cn=Directory Service, cn=Windows NT,cn=Services,cn=Configuration,#{forest_name}' -attr LDAPAdminLimits").stdout + ldap_admin_limits = parse_config(query.gsub(/;/, "\n")).params + describe "MaxConnIdleTime is configured" do + subject { ldap_admin_limits } + it { should include 'MaxConnIdleTime' } + end + describe "The MaxConnIdleTime" do + subject { ldap_admin_limits['MaxConnIdleTime'] } + it { should cmp <= input("maximum_idle_time") } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end diff --git a/controls/SV-205727.rb b/controls/SV-205727.rb new file mode 100644 index 0000000..c0d0525 --- /dev/null +++ b/controls/SV-205727.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 + +control "SV-205727" do + title "Windows Server 2019 systems requiring data at rest protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest." + desc "This requirement addresses protection of user-generated data as well as operating system-specific configuration data. Organizations may choose to employ different mechanisms to achieve confidentiality and integrity protections, as appropriate, in accordance with the security category and/or classification of the information. + Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields)." + desc "rationale", "" + desc "check", "Verify systems that require additional protections due to factors such as inadequate physical protection or sensitivity of the data employ encryption to protect the confidentiality and integrity of all information at rest. + If they do not, this is a finding." + desc "fix", "Configure systems that require additional protections due to factors such as inadequate physical protection or sensitivity of the data to employ encryption to protect the confidentiality and integrity of all information at rest." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000185-GPOS-00079" + tag satisfies: ["SRG-OS-000185-GPOS-00079", "SRG-OS-000404-GPOS-00183", "SRG-OS-000405-GPOS-00184"] + tag gid: "V-93515" + tag rid: "SV-103601r1_rule" + tag stig_id: "WN19-00-000250" + tag fix_id: "F-99759r1_fix" + tag cci: ["CCI-001199", "CCI-002475", "CCI-002476"] + tag nist: ["SC-28", "SC-28 (1)", "SC-28 (1)", "Rev_4"] + + describe "A manual review is required to ensure systems requiring data at rest protections must employ cryptographic + mechanisms to prevent unauthorized disclosure and modification of the + information at rest." do + skip 'A manual review is required to ensure systems requiring data at rest protections must employ cryptographic + mechanisms to prevent unauthorized disclosure and modification of the + information at rest.' + end +end \ No newline at end of file diff --git a/controls/SV-205728.rb b/controls/SV-205728.rb new file mode 100644 index 0000000..93c325f --- /dev/null +++ b/controls/SV-205728.rb @@ -0,0 +1,24 @@ +# encoding: UTF-8 + +control "SV-205728" do + title "Windows Server 2019 must employ automated mechanisms to determine the state of system components with regard to flaw remediation using the following frequency: continuously, where Host Based Security System (HBSS) is used; 30 days, for any additional internal network scans not covered by HBSS; and annually, for external scans by Computer Network Defense Service Provider (CNDSP)." + desc "Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. The operating system may have an integrated solution incorporating continuous scanning using HBSS and periodic scanning using other tools." + desc "rationale", "" + desc "check", "Verify #{input('org_name')[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." + desc "fix", "Install a #{input('org_name')[:acronym]} approved HBSS software and ensure it is operating continuously." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000191-GPOS-00080" + tag gid: "V-93567" + tag rid: "SV-103653r1_rule" + tag stig_id: "WN19-00-000290" + tag fix_id: "F-99811r1_fix" + tag cci: ["CCI-001233"] + tag nist: ["SI-2 (2)", "Rev_4"] + + org_name = input('org_name') + + describe "A manual review is required to verify #{org_name[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." do + skip "A manual review is required to verify #{org_name[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." + end +end \ No newline at end of file diff --git a/controls/SV-205729.rb b/controls/SV-205729.rb new file mode 100644 index 0000000..54381b1 --- /dev/null +++ b/controls/SV-205729.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205729" do + title "Windows Server 2019 must be configured to audit Logon/Logoff - Account +Lockout successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Account Lockout events can be used to identify potentially malicious logon +attempts." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Account Lockout - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Logon/Logoff >> \"Audit Account Lockout\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000240-GPOS-00090' + tag 'satisfies': ["SRG-OS-000240-GPOS-00090", "SRG-OS-000470-GPOS-00214"] + tag 'gid': 'V-92987' + tag 'rid': 'SV-103075r1_rule' + tag 'stig_id': 'WN19-AU-000150' + tag 'fix_id': 'F-99233r1_fix' + tag 'cci': ["CCI-000172", "CCI-001404"] + tag 'nist': ["AU-12 c", "AC-2 (4)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Account Lockout') { should eq 'Success' } + end + describe audit_policy do + its('Account Lockout') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205730.rb b/controls/SV-205730.rb new file mode 100644 index 0000000..7334b34 --- /dev/null +++ b/controls/SV-205730.rb @@ -0,0 +1,72 @@ + +control 'V-92985' do + title "Windows Server 2019 must be configured to audit Account Management - +Computer Account Management successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Computer Account Management records events such as creating, changing, +deleting, renaming, disabling, or enabling computer accounts." + desc 'rationale', '' + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Management >> Computer Account Management - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit Computer Account +Management\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000004-GPOS-00004' + tag 'satisfies': %w(SRG-OS-000004-GPOS-00004 SRG-OS-000239-GPOS-00089 +SRG-OS-000240-GPOS-00090 SRG-OS-000241-GPOS-00091 +SRG-OS-000303-GPOS-00120 SRG-OS-000476-GPOS-00221) + tag 'gid': 'V-92985' + tag 'rid': 'SV-103073r1_rule' + tag 'stig_id': 'WN19-DC-000230' + tag 'fix_id': 'F-99231r1_fix' + tag 'cci': %w(CCI-000018 CCI-000172 CCI-001403 CCI-001404 +CCI-001405 CCI-002130) + tag 'nist': ['AC-2 (4)', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', "AC-2 +(4)", 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.5 + describe.one do + describe audit_policy do + its('Computer Account Management') { should eq 'Success' } + end + describe audit_policy do + its('Computer Account Management') { should eq 'Success and Failure' } + end + end + when '2', '3' + impact 0.0 + desc 'This system is exempt from this control' + describe 'This system is exempt from this control' do + skip 'This system is exempt from this control' + end + end +end diff --git a/controls/SV-205731.rb b/controls/SV-205731.rb new file mode 100644 index 0000000..02f1c4d --- /dev/null +++ b/controls/SV-205731.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205731" do + title "Windows Server 2019 Event Viewer must be protected from unauthorized +modification and deletion." + desc "Protecting audit information also includes identifying and protecting +the tools used to view and manipulate log data. Therefore, protecting audit +tools is necessary to prevent unauthorized operation on audit information. + + Operating systems providing tools to interface with audit information will +leverage user permissions and roles identifying the user accessing the tools +and the corresponding rights the user enjoys in order to make access decisions +regarding the modification or deletion of audit tools." + desc "rationale", "" + desc 'check', "Navigate to \"%SystemRoot%\\System32\". + + View the permissions on \"Eventvwr.exe\". + + If any groups or accounts other than TrustedInstaller have \"Full control\" +or \"Modify\" permissions, this is a finding. + + The default permissions below satisfy this requirement: + + TrustedInstaller - Full Control + Administrators, SYSTEM, Users, ALL APPLICATION PACKAGES, ALL RESTRICTED +APPLICATION PACKAGES - Read & Execute" + desc 'fix', "Configure the permissions on the \"Eventvwr.exe\" file to prevent +modification by any groups or accounts other than TrustedInstaller. The default +permissions listed below satisfy this requirement: + + TrustedInstaller - Full Control + Administrators, SYSTEM, Users, ALL APPLICATION PACKAGES, ALL RESTRICTED +APPLICATION PACKAGES - Read & Execute + + The default location is the \"%SystemRoot%\\System32\" folder." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000257-GPOS-00098' + tag 'satisfies': ["SRG-OS-000257-GPOS-00098", "SRG-OS-000258-GPOS-00099"] + tag 'gid': 'V-93195' + tag 'rid': 'SV-103283r1_rule' + tag 'stig_id': 'WN19-AU-000060' + tag 'fix_id': 'F-99441r1_fix' + tag 'cci': ["CCI-001494", "CCI-001495"] + tag 'nist': ["AU-9", "AU-9", "Rev_4"] + + get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip + system_root = get_system_root[11..get_system_root.length] + + systemroot = system_root.strip + + eventvwr = <<-EOH + $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\Eventvwr.exe).AccessToString + write-output $output + EOH + + # raw powershell output + raw_eventvwr = powershell(eventvwr).stdout.strip + + # clean results cleans up the extra line breaks + clean_eventvwr = raw_eventvwr.lines.collect(&:strip) + + describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\Eventvwr.exe' do + subject { clean_eventvwr } + it { should cmp input('eventvwr_perms') } + end +end + diff --git a/controls/SV-205732.rb b/controls/SV-205732.rb new file mode 100644 index 0000000..461b42e --- /dev/null +++ b/controls/SV-205732.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control 'SV-205732' do + title "Windows Server 2019 Deny log on through Remote Desktop Services user +right on domain controllers must be configured to prevent unauthenticated +access." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on through Remote Desktop Services\" user right defines the +accounts that are prevented from logging on using Remote Desktop Services. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc 'rationale', '' + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +through Remote Desktop Services\" user right, this is a finding: + + - Guests Group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SID(s) are not defined for the +\"SeDenyRemoteInteractiveLogonRight\" user right, this is a finding. + + S-1-5-32-546 (Guests)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on through Remote Desktop Services\" to include the following: + + - Guests Group" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000297-GPOS-00115' + tag 'gid': 'V-92963' + tag 'rid': 'SV-103051r1_rule' + tag 'stig_id': 'WN19-DC-000410' + tag 'fix_id': 'F-99209r1_fix' + tag 'cci': ['CCI-002314'] + tag 'nist': ['AC-17 (1)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should eq ['S-1-5-32-546'] } + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end diff --git a/controls/SV-205733.rb b/controls/SV-205733.rb new file mode 100644 index 0000000..ff720bc --- /dev/null +++ b/controls/SV-205733.rb @@ -0,0 +1,132 @@ +# encoding: UTF-8 + +control "SV-205733" do + title "Windows Server 2019 Deny log on through Remote Desktop Services user +right on domain-joined member servers must be configured to prevent access from +highly privileged domain accounts and all local accounts and from +unauthenticated access on all systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Deny log on through Remote Desktop Services\" user right defines the +accounts that are prevented from logging on using Remote Desktop Services. + + In an Active Directory Domain, denying logons to the Enterprise Admins and +Domain Admins groups on lower-trust systems helps mitigate the risk of +privilege escalation from credential theft attacks, which could lead to the +compromise of an entire domain. + + Local accounts on domain-joined systems must also be assigned this right to +decrease the risk of lateral movement resulting from credential theft attacks. + + The Guests group must be assigned this right to prevent unauthenticated +access." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If the following accounts or groups are not defined for the \"Deny log on +through Remote Desktop Services\" user right, this is a finding: + + Domain Systems Only: + - Enterprise Admins group + - Domain Admins group + - Local account (see Note below) + + All Systems: + - Guests group + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If the following SIDs are not defined for the +\"SeDenyRemoteInteractiveLogonRight\" user right, this is a finding. + + Domain Systems Only: + S-1-5-root domain-519 (Enterprise Admins) + S-1-5-domain-512 (Domain Admins) + S-1-5-113 (\"Local account\") + + All Systems: + S-1-5-32-546 (Guests) + + Note: \"Local account\" is referring to the Windows built-in security group." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log +on through Remote Desktop Services\" to include the following: + + Domain Systems Only: + - Enterprise Admins group + - Domain Admins group + - Local account (see Note below) + + All Systems: + - Guests group + + Note: \"Local account\" is referring to the Windows built-in security group." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000297-GPOS-00115' + tag 'gid': 'V-92965' + tag 'rid': 'SV-103053r1_rule' + tag 'stig_id': 'WN19-MS-000120' + tag 'fix_id': 'F-99211r1_fix' + tag 'cci': ["CCI-002314"] + tag 'nist': ["AC-17 (1)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + case domain_role + when '4', '5' + impact 0.0 + desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do + skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' + end + when '3' + domain_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Domain Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + domain_admin_sid = json(command: domain_query).params + enterprise_admin_query = <<-EOH + $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') + $sid = ($group.Translate([security.principal.securityidentifier])).value + $sid | ConvertTo-Json + EOH + + enterprise_admin_sid = json(command: enterprise_admin_query).params + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should include "#{domain_admin_sid}" } + end + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should include "#{enterprise_admin_sid}" } + end + describe.one do + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should include "S-1-5-113" } + end + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should include "S-1-5-114" } + end + end + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should include 'S-1-5-32-546' } + end + when '2' + describe security_policy do + its('SeDenyRemoteInteractiveLogonRight') { should eq ['S-1-5-32-546'] } + end + end +end \ No newline at end of file diff --git a/controls/SV-205734.rb b/controls/SV-205734.rb new file mode 100644 index 0000000..0f75c59 --- /dev/null +++ b/controls/SV-205734.rb @@ -0,0 +1,104 @@ +control 'SV-205734' do + title "Windows Server 2019 permissions for the system drive root directory + (usually C:\\) must conform to minimum requirements." + desc "Changing the system's file and directory permissions allows the + possibility of unauthorized and anonymous modification to the operating system + and installed applications. + + The default permissions are adequate when the Security Option \"Network + access: Let Everyone permissions apply to anonymous users\" is set to + \"Disabled\" (WN19-SO-000240)." + desc 'rationale', '' + desc 'check', "The default permissions are adequate when the Security Option \"Network + access: Let Everyone permissions apply to anonymous users\" is set to + \"Disabled\" (WN19-SO-000240). + + Review the permissions for the system drive's root directory (usually + C:\\). Non-privileged groups such as Users or Authenticated Users must not have + greater than \"Read & execute\" permissions except where noted as defaults. + Individual accounts must not be used to assign permissions. + + If permissions are not as restrictive as the default permissions listed + below, this is a finding. + + Viewing in File Explorer: + + View the Properties of the system drive's root directory. + + Select the \"Security\" tab, and the \"Advanced\" button. + + Default permissions: + C:\\ + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + SYSTEM - Full control - This folder, subfolders, and files + Administrators - Full control - This folder, subfolders, and files + Users - Read & execute - This folder, subfolders, and files + Users - Create folders/append data - This folder and subfolders + Users - Create files/write data - Subfolders only + CREATOR OWNER - Full Control - Subfolders and files only + + Alternately, use icacls: + + Open \"Command Prompt (Admin)\". + + Enter \"icacls\" followed by the directory: + + \"icacls c:\\\" + + The following results should be displayed: + + c:\\ + NT AUTHORITY\\SYSTEM:(OI)(CI)(F) + BUILTIN\\Administrators:(OI)(CI)(F) + BUILTIN\\Users:(OI)(CI)(RX) + BUILTIN\\Users:(CI)(AD) + BUILTIN\\Users:(CI)(IO)(WD) + CREATOR OWNER:(OI)(CI)(IO)(F) + Successfully processed 1 files; Failed processing 0 files" + desc 'fix', " + Maintain the default permissions for the system drive's root directory and + configure the Security Option \"Network access: Let Everyone permissions apply + to anonymous users\" to \"Disabled\" (WN19-SO-000240). + + Default Permissions + C:\\ + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + SYSTEM - Full control - This folder, subfolders, and files + Administrators - Full control - This folder, subfolders, and files + Users - Read & execute - This folder, subfolders, and files + Users - Create folders/append data - This folder and subfolders + Users - Create files/write data - Subfolders only + CREATOR OWNER - Full Control - Subfolders and files only" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000312-GPOS-00122' + tag 'satisfies': %w(SRG-OS-000312-GPOS-00122 SRG-OS-000312-GPOS-00123 +SRG-OS-000312-GPOS-00124) + tag 'gid': 'V-93019' + tag 'rid': 'SV-103107r1_rule' + tag 'stig_id': 'WN19-00-000140' + tag 'fix_id': 'F-99265r1_fix' + tag 'cci': ['CCI-002165'] + tag 'nist': ['AC-3 (4)', 'Rev_4'] + + expected_c_perm = input('c_perm') + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'EveryoneIncludesAnonymous' } + its('EveryoneIncludesAnonymous') { should eq 0 } + end + c_perm = json(command: "icacls 'C:\\' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub('C:\\ ', '') } + describe 'C:\\ permissions are set correctly on folder structure' do + subject { c_perm.eql? expected_c_perm } + it { should eq true } + end + end +end diff --git a/controls/SV-205735.rb b/controls/SV-205735.rb new file mode 100644 index 0000000..b3fa438 --- /dev/null +++ b/controls/SV-205735.rb @@ -0,0 +1,125 @@ +# encoding: UTF-8 + +control "SV-205735" do + title "Windows Server 2019 permissions for program file directories must +conform to minimum requirements." + desc "Changing the system's file and directory permissions allows the +possibility of unauthorized and anonymous modification to the operating system +and installed applications. + + The default permissions are adequate when the Security Option \"Network +access: Let Everyone permissions apply to anonymous users\" is set to +\"Disabled\" (WN19-SO-000240)." + desc "rationale", "" + desc 'check', "The default permissions are adequate when the Security Option \"Network +access: Let Everyone permissions apply to anonymous users\" is set to +\"Disabled\" (WN19-SO-000240). + + Review the permissions for the program file directories (Program Files and +Program Files [x86]). Non-privileged groups such as Users or Authenticated +Users must not have greater than \"Read & execute\" permissions. Individual +accounts must not be used to assign permissions. + + If permissions are not as restrictive as the default permissions listed +below, this is a finding. + + Viewing in File Explorer: + + For each folder, view the Properties. + + Select the \"Security\" tab, and the \"Advanced\" button. + + Default permissions: + \\Program Files and \\Program Files (x86) + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + TrustedInstaller - Full control - This folder and subfolders + SYSTEM - Modify - This folder only + SYSTEM - Full control - Subfolders and files only + Administrators - Modify - This folder only + Administrators - Full control - Subfolders and files only + Users - Read & execute - This folder, subfolders and files + CREATOR OWNER - Full control - Subfolders and files only + ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and +files + ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, +subfolders, and files + + Alternately, use icacls: + + Open a Command prompt (admin). + + Enter \"icacls\" followed by the directory: + + 'icacls \"c:\\program files\"' + 'icacls \"c:\\program files (x86)\"' + + The following results should be displayed for each when entered: + + c:\\program files (c:\\program files (x86)) + NT SERVICE\\TrustedInstaller:(F) + NT SERVICE\\TrustedInstaller:(CI)(IO)(F) + NT AUTHORITY\\SYSTEM:(M) + NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) + BUILTIN\\Administrators:(M) + BUILTIN\\Administrators:(OI)(CI)(IO)(F) + BUILTIN\\Users:(RX) + BUILTIN\\Users:(OI)(CI)(IO)(GR,GE) + CREATOR OWNER:(OI)(CI)(IO)(F) + APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(RX) + APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(GR,GE) + APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION PACKAGES:(RX) + APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION +PACKAGES:(OI)(CI)(IO)(GR,GE) + Successfully processed 1 files; Failed processing 0 files" + desc 'fix', " + Maintain the default permissions for the program file directories and +configure the Security Option \"Network access: Let Everyone permissions apply +to anonymous users\" to \"Disabled\" (WN19-SO-000240). + + Default permissions: + \\Program Files and \\Program Files (x86) + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + TrustedInstaller - Full control - This folder and subfolders + SYSTEM - Modify - This folder only + SYSTEM - Full control - Subfolders and files only + Administrators - Modify - This folder only + Administrators - Full control - Subfolders and files only + Users - Read & execute - This folder, subfolders, and files + CREATOR OWNER - Full control - Subfolders and files only + ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and +files + ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, +subfolders, and files" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000312-GPOS-00122' + tag 'satisfies': ["SRG-OS-000312-GPOS-00122", "SRG-OS-000312-GPOS-00123", +"SRG-OS-000312-GPOS-00124"] + tag 'gid': 'V-93021' + tag 'rid': 'SV-103109r1_rule' + tag 'stig_id': 'WN19-00-000150' + tag 'fix_id': 'F-99267r1_fix' + tag 'cci': ["CCI-002165"] + tag 'nist': ["AC-3 (4)", "Rev_4"] + + c_program_files_perm = json( command: "icacls 'C:\\Program Files' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Program Files ", '') } + describe "c:\\Program Files permissions are set correctly on folder structure" do + subject { c_program_files_perm.eql? input('c_program_files_perm') } + it { should eq true } + end + + c_program_filesx86_perm = json( command: "icacls 'C:\\Program Files (x86)' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Program Files (x86) ", '') } + describe "c:\\Program Files(x86) permissions are set correctly on folder structure" do + subject { c_program_filesx86_perm.eql? input('c_program_files_perm') } + it { should eq true } + end +end + diff --git a/controls/SV-205736.rb b/controls/SV-205736.rb new file mode 100644 index 0000000..e7b7ff5 --- /dev/null +++ b/controls/SV-205736.rb @@ -0,0 +1,116 @@ +# encoding: UTF-8 + +control "SV-205736" do + title "Windows Server 2019 permissions for the Windows installation directory +must conform to minimum requirements." + desc "Changing the system's file and directory permissions allows the +possibility of unauthorized and anonymous modification to the operating system +and installed applications. + + The default permissions are adequate when the Security Option \"Network +access: Let Everyone permissions apply to anonymous users\" is set to +\"Disabled\" (WN19-SO-000240)." + desc "rationale", "" + desc 'check', "The default permissions are adequate when the Security Option \"Network +access: Let Everyone permissions apply to anonymous users\" is set to +\"Disabled\" (WN19-SO-000240). + + Review the permissions for the Windows installation directory (usually +C:\\Windows). Non-privileged groups such as Users or Authenticated Users must +not have greater than \"Read & execute\" permissions. Individual accounts must +not be used to assign permissions. + + If permissions are not as restrictive as the default permissions listed +below, this is a finding: + + Viewing in File Explorer: + + For each folder, view the Properties. + + Select the \"Security\" tab and the \"Advanced\" button. + + Default permissions: + \\Windows + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + TrustedInstaller - Full control - This folder and subfolders + SYSTEM - Modify - This folder only + SYSTEM - Full control - Subfolders and files only + Administrators - Modify - This folder only + Administrators - Full control - Subfolders and files only + Users - Read & execute - This folder, subfolders, and files + CREATOR OWNER - Full control - Subfolders and files only + ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and +files + ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, +subfolders, and files + + Alternately, use icacls: + + Open a Command prompt (admin). + + Enter \"icacls\" followed by the directory: + + \"icacls c:\\windows\" + + The following results should be displayed for each when entered: + + c:\\windows + NT SERVICE\\TrustedInstaller:(F) + NT SERVICE\\TrustedInstaller:(CI)(IO)(F) + NT AUTHORITY\\SYSTEM:(M) + NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) + BUILTIN\\Administrators:(M) + BUILTIN\\Administrators:(OI)(CI)(IO)(F) + BUILTIN\\Users:(RX) + BUILTIN\\Users:(OI)(CI)(IO)(GR,GE) + CREATOR OWNER:(OI)(CI)(IO)(F) + APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(RX) + APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(GR,GE) + APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION PACKAGES:(RX) + APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION +PACKAGES:(OI)(CI)(IO)(GR,GE) + Successfully processed 1 files; Failed processing 0 files" + desc 'fix', "Maintain the default file ACLs and configure the Security Option \"Network +access: Let Everyone permissions apply to anonymous users\" to \"Disabled\" +(WN19-SO-000240). + + Default permissions: + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + TrustedInstaller - Full control - This folder and subfolders + SYSTEM - Modify - This folder only + SYSTEM - Full control - Subfolders and files only + Administrators - Modify - This folder only + Administrators - Full control - Subfolders and files only + Users - Read & execute - This folder, subfolders, and files + CREATOR OWNER - Full control - Subfolders and files only + ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and +files + ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, +subfolders, and files" + impact 0.5 + tag 'severity': nil + tag 'gtitle': "SRG-OS-000312-GPOS-00122" + tag 'satisfies': ["SRG-OS-000312-GPOS-00122", "SRG-OS-000312-GPOS-00123", +"SRG-OS-000312-GPOS-00124"] + tag 'gid': 'V-93023' + tag 'rid': 'SV-103111r1_rule' + tag 'stig_id': 'WN19-00-000160' + tag 'fix_id': 'F-99269r1_fix' + tag 'cci': ["CCI-002165"] + tag 'nist': ["AC-3 (4)", "Rev_4"] + + c_windows_perm = json( command: "icacls 'C:\\Windows' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Windows ", '') } + describe "C:\\Windows permissions are set correctly on folder structure" do + subject { c_windows_perm.eql? input('c_windows_perm') } + it { should eq true } + end +end + diff --git a/controls/SV-205737.rb b/controls/SV-205737.rb new file mode 100644 index 0000000..43b5245 --- /dev/null +++ b/controls/SV-205737.rb @@ -0,0 +1,139 @@ + control 'SV-205737' do + title "Windows Server 2019 default permissions for the HKEY_LOCAL_MACHINE +registry hive must be maintained." + desc "The registry is integral to the function, security, and stability of +the Windows system. Changing the system's registry permissions allows the +possibility of unauthorized and anonymous modification to the operating system." + desc 'rationale', '' + desc 'check', "Review the registry permissions for the keys of the HKEY_LOCAL_MACHINE hive +noted below. + + If any non-privileged groups such as Everyone, Users, or Authenticated +Users have greater than Read permission, this is a finding. + + If permissions are not as restrictive as the default permissions listed +below, this is a finding: + + Run \"Regedit\". + + Right-click on the registry areas noted below. + + Select \"Permissions\" and the \"Advanced\" button. + + HKEY_LOCAL_MACHINE\\SECURITY + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + SYSTEM - Full Control - This key and subkeys + Administrators - Special - This key and subkeys + + HKEY_LOCAL_MACHINE\\SOFTWARE + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + Users - Read - This key and subkeys + Administrators - Full Control - This key and subkeys + SYSTEM - Full Control - This key and subkeys + CREATOR OWNER - Full Control - This key and subkeys + ALL APPLICATION PACKAGES - Read - This key and subkeys + + HKEY_LOCAL_MACHINE\\SYSTEM + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + Users - Read - This key and subkeys + Administrators - Full Control - This key and subkeys + SYSTEM - Full Control - This key and subkeys + CREATOR OWNER - Full Control - Subkeys only + ALL APPLICATION PACKAGES - Read - This key and subkeys + + Other examples under the noted keys may also be sampled. There may be some +instances where non-privileged groups have greater than Read permission. + + Microsoft has given Read permission to the SOFTWARE and SYSTEM registry +keys in Windows Server 2019 to the following SID, this is currently not a +finding. + +S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 + + If the defaults have not been changed, these are not a finding." + desc 'fix', " + Maintain the default permissions for the HKEY_LOCAL_MACHINE registry hive. + + The default permissions of the higher-level keys are noted below. + + HKEY_LOCAL_MACHINE\\SECURITY + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + SYSTEM - Full Control - This key and subkeys + Administrators - Special - This key and subkeys + + HKEY_LOCAL_MACHINE\\SOFTWARE + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + Users - Read - This key and subkeys + Administrators - Full Control - This key and subkeys + SYSTEM - Full Control - This key and subkeys + CREATOR OWNER - Full Control - This key and subkeys + ALL APPLICATION PACKAGES - Read - This key and subkeys + + HKEY_LOCAL_MACHINE\\SYSTEM + + Type - \"Allow\" for all + Inherited from - \"None\" for all + Principal - Access - Applies to + Users - Read - This key and subkeys + Administrators - Full Control - This key and subkeys + SYSTEM - Full Control - This key and subkeys + CREATOR OWNER - Full Control - Subkeys only + ALL APPLICATION PACKAGES - Read - This key and subkeys + + Microsoft has also given Read permission to the SOFTWARE and SYSTEM +registry keys in Windows Server 2019 to the following SID. + +S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93025' + tag 'rid': 'SV-103113r1_rule' + tag 'stig_id': 'WN19-00-000170' + tag 'fix_id': 'F-99271r1_fix' + tag 'cci': ['CCI-002235'] + tag 'nist': ['AC-6 (10)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + hklm_system = powershell('(Get-Acl -Path HKLM:System).AccessToString').stdout.lines.collect(&:strip) + describe 'Registry Key Security are set correctly on folder structure' do + subject { hklm_system.eql? input('reg_system_perms_dc') } + it { should eq true } + end + else + hklm_software = powershell('(Get-Acl -Path HKLM:Software).AccessToString').stdout.lines.collect(&:strip) + describe 'Registry Key Software permissions are set correctly on folder structure' do + subject { hklm_software.eql? input('reg_software_perms') } + it { should eq true } + end + + hklm_security = powershell('(Get-Acl -Path HKLM:Security).AccessToString').stdout.lines.collect(&:strip) + describe 'Registry Key Security are set correctly on folder structure' do + subject { hklm_security.eql? input('reg_security_perms') } + it { should eq true } + end + + hklm_system = powershell('(Get-Acl -Path HKLM:System).AccessToString').stdout.lines.collect(&:strip) + describe 'Registry Key System are set correctly on folder structure' do + subject { hklm_system.eql? input('reg_system_perms') } + it { should eq true } + end + end + end diff --git a/controls/SV-205738.rb b/controls/SV-205738.rb new file mode 100644 index 0000000..4dc6832 --- /dev/null +++ b/controls/SV-205738.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205738" do + title "Windows Server 2019 must only allow administrators responsible for the +domain controller to have Administrator rights on the system." + desc "An account that does not have Administrator duties must not have +Administrator rights. Such rights would allow the account to bypass or modify +required security restrictions on that machine and make it vulnerable to attack. + + System administrators must log on to systems using only accounts with the +minimum level of authority necessary. + + Standard user accounts must not be members of the built-in Administrators +group." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Review the Administrators group. Only the appropriate administrator groups +or accounts responsible for administration of the system may be members of the +group. + + Standard user accounts must not be members of the local administrator group. + + If prohibited accounts are members of the local administrators group, this +is a finding. + + If the built-in Administrator account or other required administrative +accounts are found on the system, this is not a finding." + desc 'fix', " + Configure the Administrators group to include only administrator groups or +accounts that are responsible for the system. + + Remove any standard user accounts." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93027' + tag 'rid': 'SV-103115r1_rule' + tag 'stig_id': 'WN19-DC-000010' + tag 'fix_id': 'F-99273r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + administrators = input('local_administrators_dc') + administrator_group = command("net localgroup Administrators | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") + if administrator_group.empty? + impact 0.0 + describe 'There are no users with administrative privileges' do + skip 'This control is not applicable' + end + else + administrator_group.each do |user| + describe user.to_s do + it { should be_in administrators } + end + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205739.rb b/controls/SV-205739.rb new file mode 100644 index 0000000..423c0c2 --- /dev/null +++ b/controls/SV-205739.rb @@ -0,0 +1,90 @@ +control 'SV-205739' do + title "Windows Server 2019 permissions on the Active Directory data files +must only allow System and Administrators access." + desc "Improper access permissions for directory data-related files could +allow unauthorized users to read, modify, or delete directory data or audit +trails." + desc 'rationale', '' + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Run \"Regedit\". + + Navigate to +\"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\". + + Note the directory locations in the values for: + + Database log files path + DSA Database file + + By default, they will be \\Windows\\NTDS. + + If the locations are different, the following will need to be run for each. + + Open \"Command Prompt (Admin)\". + + Navigate to the NTDS directory (\\Windows\\NTDS by default). + + Run \"icacls *.*\". + + If the permissions on each file are not as restrictive as the following, +this is a finding: + + NT AUTHORITY\\SYSTEM:(I)(F) + BUILTIN\\Administrators:(I)(F) + + (I) - permission inherited from parent container + (F) - full access" + desc 'fix', "Maintain the permissions on NTDS database and log files as follows: + + NT AUTHORITY\\SYSTEM:(I)(F) + BUILTIN\\Administrators:(I)(F) + + (I) - permission inherited from parent container + (F) - full access" + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93029' + tag 'rid': 'SV-103117r1_rule' + tag 'stig_id': 'WN19-DC-000070' + tag 'fix_id': 'F-99275r1_fix' + tag 'cci': ['CCI-002235'] + tag 'nist': ['AC-6 (10)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + # Command Gets the Location of the Property Required + ntds_database_logs_files_path = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "Database log files path" | ConvertTo-Json').params + # Command Gets the Location of the Property Required + ntds_dsa_working_directory = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "DSA Working Directory" | ConvertTo-Json').params + expected_permissions = input('ntds_permissions') + if domain_role == '4' || domain_role == '5' + if ntds_database_logs_files_path == ntds_dsa_working_directory + perms = json(command: "icacls '#{ntds_dsa_working_directory}\\*.*' | convertto-json").params.map(&:strip)[0..-3].map { |e| e.gsub(/^[^\s]*\s/, '') }.reject(&:empty?) + describe "Permissions on each file in #{ntds_dsa_working_directory} is set" do + subject { (perms - expected_permissions).empty? } + it { should eq true } + end + else + # Command Gets Permissions on Folder Path + icacls_permissions_ntds_logs = json(command: "icacls '#{ntds_database_logs_files_path}\\*.*' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub(/^[^\s]*\s/, '') }.reject(&:empty?) + # Command Gets the Location of the Property Required + ntds_dsa_file_path = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "DSA Database file" | ConvertTo-Json').params + # Command Gets Permissions on file ntds.dit + icacls_permissions_ntds_dsa_file = json(command: "icacls '#{ntds_dsa_file_path}' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub("#{ntds_dsa_file_path} ", '') } + describe 'Permissions on NTDS Database Log Files Path is set to' do + subject { (icacls_permissions_ntds_logs - expected_permissions).empty? } + it { should eq true } + end + describe 'Permissions on NTDS Database DSA File is set to' do + subject { (icacls_permissions_ntds_dsa_file - expected_permissions).empty? } + it { should eq true } + end + end + else + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end diff --git a/controls/SV-205740.rb b/controls/SV-205740.rb new file mode 100644 index 0000000..1535547 --- /dev/null +++ b/controls/SV-205740.rb @@ -0,0 +1,115 @@ +# encoding: UTF-8 + +control "SV-205740" do + title "Windows Server 2019 Active Directory SYSVOL directory must have the +proper access control permissions." + desc "Improper access permissions for directory data files could allow +unauthorized users to read, modify, or delete directory data. + + The SYSVOL directory contains public files (to the domain) such as policies +and logon scripts. Data in shared subdirectories are replicated to all domain +controllers in a domain." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Open a command prompt. + + Run \"net share\". + + Make note of the directory location of the SYSVOL share. + + By default, this will be \\Windows\\SYSVOL\\sysvol. For this requirement, +permissions will be verified at the first SYSVOL directory level. + + If any standard user accounts or groups have greater than \"Read & +execute\" permissions, this is a finding. + + The default permissions noted below meet this requirement: + + Open \"Command Prompt\". + + Run \"icacls c:\\Windows\\SYSVOL\". + + The following results should be displayed: + + NT AUTHORITY\\Authenticated Users:(RX) + NT AUTHORITY\\Authenticated Users:(OI)(CI)(IO)(GR,GE) + BUILTIN\\Server Operators:(RX) + BUILTIN\\Server Operators:(OI)(CI)(IO)(GR,GE) + BUILTIN\\Administrators:(M,WDAC,WO) + BUILTIN\\Administrators:(OI)(CI)(IO)(F) + NT AUTHORITY\\SYSTEM:(F) + NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) + CREATOR OWNER:(OI)(CI)(IO)(F) + + (RX) - Read & execute + + Run \"icacls /help\" to view definitions of other permission codes. + + Alternately, open \"File Explorer\". + + Navigate to \\Windows\\SYSVOL (or the directory noted previously if +different). + + Right-click the directory and select properties. + + Select the \"Security\" tab and click \"Advanced\". + + Default permissions: + + C:\\Windows\\SYSVOL + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + Authenticated Users - Read & execute - This folder, subfolder, and files + Server Operators - Read & execute- This folder, subfolder, and files + Administrators - Special - This folder only (Special = Basic Permissions: +all selected except Full control) + CREATOR OWNER - Full control - Subfolders and files only + Administrators - Full control - Subfolders and files only + SYSTEM - Full control - This folder, subfolders, and files" + desc "fix", " + Maintain the permissions on the SYSVOL directory. Do not allow greater than +\"Read & execute\" permissions for standard user accounts or groups. The +defaults below meet this requirement: + + C:\\Windows\\SYSVOL + Type - \"Allow\" for all + Inherited from - \"None\" for all + + Principal - Access - Applies to + + Authenticated Users - Read & execute - This folder, subfolder, and files + Server Operators - Read & execute- This folder, subfolder, and files + Administrators - Special - This folder only (Special = Basic Permissions: +all selected except Full control) + CREATOR OWNER - Full control - Subfolders and files only + Administrators - Full control - Subfolders and files only + SYSTEM - Full control - This folder, subfolders, and files" + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93031' + tag 'rid': 'SV-103119r1_rule' + tag 'stig_id': 'WN19-DC-000080' + tag 'fix_id': 'F-99277r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + sysvol_perm = json( command: "icacls 'c:\\Windows\\SYSVOL' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("c:\\Windows\\SYSVOL ", '') } + + describe "c:\\ permissions are set correctly on folder structure" do + subject { sysvol_perm.eql? input('c_windows_sysvol_perm') } + it { should eq true } + end + else + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205741.rb b/controls/SV-205741.rb new file mode 100644 index 0000000..c17c204 --- /dev/null +++ b/controls/SV-205741.rb @@ -0,0 +1,117 @@ +# encoding: UTF-8 + +control "SV-205741" do + title "Windows Server 2019 Active Directory Group Policy objects must have +proper access control permissions." + desc "When directory service database objects do not have appropriate access +control permissions, it may be possible for malicious users to create, read, +update, or delete the objects and degrade or destroy the integrity of the data. +When the directory service is used for identification, authentication, or +authorization functions, a compromise of the database objects could lead to a +compromise of all systems relying on the directory service. + + For Active Directory (AD), the Group Policy objects require special +attention. In a distributed administration model (i.e., help desk), Group +Policy objects are more likely to have access permissions changed from the +secure defaults. If inappropriate access permissions are defined for Group +Policy objects, this could allow an intruder to change the security policy +applied to all domain client computers (workstations and servers)." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the permissions on Group Policy objects. + + Open \"Group Policy Management\" (available from various menus or run +\"gpmc.msc\"). + + Navigate to \"Group Policy Objects\" in the domain being reviewed (Forest +>> Domains >> Domain). + + For each Group Policy object: + + Select the Group Policy object item in the left pane. + + Select the \"Delegation\" tab in the right pane. + + Select the \"Advanced\" button. + + Select each Group or user name. + + View the permissions. + + If any standard user accounts or groups have \"Allow\" permissions greater +than \"Read\" and \"Apply group policy\", this is a finding. + + Other access permissions that allow the objects to be updated are +considered findings unless specifically documented by the ISSO. + + The default permissions noted below satisfy this requirement. + + The permissions shown are at the summary level. More detailed permissions +can be viewed by selecting the next \"Advanced\" button, the desired Permission +entry, and the \"Edit\" button. + + Authenticated Users - Read, Apply group policy, Special permissions + + The special permissions for Authenticated Users are for Read-type +Properties. If detailed permissions include any Create, Delete, Modify, or +Write Permissions or Properties, this is a finding. + + The special permissions for the following default groups are not the focus +of this requirement and may include a wide range of permissions and properties: + + CREATOR OWNER - Special permissions + SYSTEM - Read, Write, Create all child objects, Delete all child objects, +Special permissions + Domain Admins - Read, Write, Create all child objects, Delete all child +objects, Special permissions + Enterprise Admins - Read, Write, Create all child objects, Delete all child +objects, Special permissions + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions + + The Domain Admins and Enterprise Admins will not have the \"Delete all +child objects\" permission on the two default Group Policy objects: Default +Domain Policy and Default Domain Controllers Policy. They will have this +permission o'n organization created Group Policy objects." + desc 'fix', "Maintain the permissions on Group Policy objects to not allow greater than +\"Read\" and \"Apply group policy\" for standard user accounts or groups. The +default permissions below meet this requirement: + + Authenticated Users - Read, Apply group policy, Special permissions + + The special permissions for Authenticated Users are for Read-type +Properties. + + CREATOR OWNER - Special permissions + SYSTEM - Read, Write, Create all child objects, Delete all child objects, +Special permissions + Domain Admins - Read, Write, Create all child objects, Delete all child +objects, Special permissions + Enterprise Admins - Read, Write, Create all child objects, Delete all child +objects, Special permissions + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions + + Document any other access permissions that allow the objects to be updated +with the ISSO. + + The Domain Admins and Enterprise Admins will not have the \"Delete all +child objects\" permission on the two default Group Policy objects: Default +Domain Policy and Default Domain Controllers Policy. They will have this +permission on created Group Policy objects." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93033' + tag 'rid': 'SV-103121r1_rule' + tag 'stig_id': 'WN19-DC-000090' + tag 'fix_id': 'F-99279r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + #Checked Code in 2016 and it is not a validate way of checking permissions, Until a command is put together that can get all GPO's in a Domain and then check all permissions, this is manually + describe 'A manual review is required to ensure all Group Policies have the correct permisions' do + skip 'A manual review is required to ensure all Group Policies have the correct permisions' + end + +end + diff --git a/controls/SV-205742.rb b/controls/SV-205742.rb new file mode 100644 index 0000000..e9e4d63 --- /dev/null +++ b/controls/SV-205742.rb @@ -0,0 +1,188 @@ +# encoding: UTF-8 + +control "SV-205742" do + title "Windows Server 2019 Active Directory Domain Controllers Organizational Unit (OU) object must have the proper access control permissions." + desc "When Active Directory objects do not have appropriate access control permissions, it may be possible for malicious users to create, read, update, or delete the objects and degrade or destroy the integrity of the data. When the directory service is used for identification, authentication, or authorization functions, a compromise of the database objects could lead to a compromise of all systems that rely on the directory service. + + The Domain Controllers OU object requires special attention as the Domain Controllers are central to the configuration and management of the domain. + Inappropriate access permissions defined for the Domain Controllers OU could allow an intruder or unauthorized personnel to make changes that could lead to the compromise of the domain." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the permissions on the Domain Controllers OU. + Open \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"). + Select \"Advanced Features\" in the \"View\" menu if not previously selected. + Select the \"Domain Controllers\" OU (folder in folder icon). + Right-click and select \"Properties\". + Select the \"Security\" tab. + If the permissions on the Domain Controllers OU do not restrict changes to System, Domain Admins, Enterprise Admins and Administrators, this is a finding. + + The default permissions listed below satisfy this requirement. + Domains supporting Microsoft Exchange will have additional Exchange related permissions on the Domain Controllers OU. These may include some change related permissions and are not a finding. + The permissions shown are at the summary level. More detailed permissions can be viewed by selecting the \"Advanced\" button, the desired Permission entry, and the \"View\" or \"Edit\" button. + Except where noted otherwise, the special permissions may include a wide range of permissions and properties and are acceptable for this requirement. + + CREATOR OWNER - Special permissions + SELF - Special permissions + Authenticated Users - Read, Special permissions + The special permissions for Authenticated Users are Read types. + If detailed permissions include any Create, Delete, Modify, or Write Permissions or Properties, this is a finding. + + SYSTEM - Full Control + Domain Admins - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions + Enterprise Admins - Full Control + Key Admins - Special permissions + Enterprise Key Admins - Special permissions + Administrators - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions + Pre-Windows 2000 Compatible Access - Special permissions + The Special permissions for Pre-Windows 2000 Compatible Access are Read types. + + If detailed permissions include any Create, Delete, Modify, or Write Permissions or Properties, this is a finding. + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" + desc 'fix', "Limit the permissions on the Domain Controllers OU to restrict changes to System, Domain Admins, Enterprise Admins and Administrators. + The default permissions listed below satisfy this requirement. + Domains supporting Microsoft Exchange will have additional Exchange related permissions on the Domain Controllers OU. These may include some change related permissions. + + CREATOR OWNER - Special permissions + SELF - Special permissions + Authenticated Users - Read, Special permissions + The special permissions for Authenticated Users are Read types. + SYSTEM - Full Control + Domain Admins - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions + Enterprise Admins - Full Control + Key Admins - Special permissions + Enterprise Key Admins - Special permissions + Administrators - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions + Pre-Windows 2000 Compatible Access - Special permissions + The special permissions for Pre-Windows 2000 Compatible Access are Read types. + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93035' + tag 'rid': 'SV-103123r1_rule' + tag 'stig_id': 'WN19-DC-000100' + tag 'fix_id': 'F-99281r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + perm_query = <<-EOH + import-module ActiveDirectory + Set-Location ad: + $distinguishedName = (Get-ADDomain).DistinguishedName + $acl_rules = (Get-Acl "OU=Domain Controllers,$distinguishedName").Access + $acl_rules | ConvertTo-Csv | ConvertFrom-Csv | ConvertTo-Json + EOH + + acl_rules = json(command: perm_query).params + netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\ENTERPRISE DOMAIN CONTROLLERS" } + its(['ActiveDirectoryRights']) { should cmp "GenericRead"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\Authenticated Users" } + its(['ActiveDirectoryRights']) { should cmp "GenericRead"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Admins" } + its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, GenericRead, WriteDacl, WriteOwner"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } + its(['ActiveDirectoryRights']) { should cmp "ReadProperty"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty, ExtendedRight"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "#{netbiosname}\\Enterprise Admins" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } + its(['ActiveDirectoryRights']) { should cmp "ListChildren"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } + its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, Delete, GenericRead, WriteDacl, WriteOwner"} + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205743.rb b/controls/SV-205743.rb new file mode 100644 index 0000000..dd66e91 --- /dev/null +++ b/controls/SV-205743.rb @@ -0,0 +1,262 @@ +# encoding: UTF-8 + +control "SV-205743" do + title "Windows Server 2019 organization created Active Directory +Organizational Unit (OU) objects must have proper access control permissions." + desc "When directory service database objects do not have appropriate access +control permissions, it may be possible for malicious users to create, read, +update, or delete the objects and degrade or destroy the integrity of the data. +When the directory service is used for identification, authentication, or +authorization functions, a compromise of the database objects could lead to a +compromise of all systems that rely on the directory service. + + For Active Directory, the OU objects require special attention. In a +distributed administration model (i.e., help desk), OU objects are more likely +to have access permissions changed from the secure defaults. If inappropriate +access permissions are defined for OU objects, it could allow an intruder to +add or delete users in the OU. This could result in unauthorized access to data +or a denial of service (DoS) to authorized users." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the permissions on domain-defined OUs. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + For each OU that is defined (folder in folder icon) excluding the Domain +Controllers OU: + + Right-click the OU and select \"Properties\". + + Select the \"Security\" tab. + + If the Allow type permissions on the OU are not at least as restrictive as +those below, this is a finding. + + The permissions shown are at the summary level. More detailed permissions +can be viewed by selecting the \"Advanced\" button, the desired Permission +entry, and the \"Edit\" or \"View\" button. + + Except where noted otherwise, the special permissions may include a wide +range of permissions and properties and are acceptable for this requirement. + + CREATOR OWNER - Special permissions + + Self - Special permissions + + Authenticated Users - Read, Special permissions + + The Special permissions for Authenticated Users are Read type. If detailed +permissions include any Create, Delete, Modify, or Write Permissions or +Properties, this is a finding. + + SYSTEM - Full Control + + Domain Admins - Full Control + + Enterprise Admins - Full Control + + Key Admins - Special permissions + + Enterprise Key Admins - Special permissions + + Administrators - Read, Write, Create all child objects, Generate resultant +set of policy (logging), Generate resultant set of policy (planning), Special +permissions + + Pre-Windows 2000 Compatible Access - Special permissions + + The Special permissions for Pre-Windows 2000 Compatible Access are for Read +types. If detailed permissions include any Create, Delete, Modify, or Write +Permissions or Properties, this is a finding. + + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions + + If an ISSO-approved distributed administration model (help desk or other +user support staff) is implemented, permissions above Read may be allowed for +groups documented by the ISSO. + + If any OU with improper permissions includes identification or +authentication data (e.g., accounts, passwords, or password hash data) used by +systems to determine access control, the severity is CAT I (e.g., OUs that +include user accounts, including service/application accounts). + + If an OU with improper permissions does not include identification and +authentication data used by systems to determine access control, the severity +is CAT II (e.g., Workstation, Printer OUs)." + desc 'fix', "Maintain the Allow type permissions on domain-defined OUs to be at least as +restrictive as the defaults below. + + Document any additional permissions above Read with the ISSO if an approved +distributed administration model (help desk or other user support staff) is +implemented. + + CREATOR OWNER - Special permissions + + Self - Special permissions + + Authenticated Users - Read, Special permissions + + The special permissions for Authenticated Users are Read type. + + SYSTEM - Full Control + + Domain Admins - Full Control + + Enterprise Admins - Full Control + + Key Admins - Special permissions + + Enterprise Key Admins - Special permissions + + Administrators - Read, Write, Create all child objects, Generate resultant +set of policy (logging), Generate resultant set of policy (planning), Special +permissions + + Pre-Windows 2000 Compatible Access - Special permissions + + The special permissions for Pre-Windows 2000 Compatible Access are for Read +types. + + ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93037' + tag 'rid': 'SV-103125r1_rule' + tag 'stig_id': 'WN19-DC-000110' + tag 'fix_id': 'F-99283r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-Json').params + ou_list = json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params + if ou_list.is_a?(String) + ou_list = [] + ou_list << json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params + end + exclude_dc = json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Where-Object {$_.distinguishedname -like 'OU=Domain Controllers,#{distinguishedName}'} | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params + ou_list.delete(exclude_dc) + netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] + if ou_list.empty? + impact 0.0 + describe 'This control is not applicable as no domain-defined OUs were found (excluding the Domain Controllers OU)' do + skip 'This control is not applicable as no domain-defined OUs were found (excluding the Domain Controllers OU)' + end + else + ou_list.each do |ou| + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'#{ou}').Access | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\ENTERPRISE DOMAIN CONTROLLERS" } + its(['ActiveDirectoryRights']) { should cmp "GenericRead"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\Authenticated Users" } + its(['ActiveDirectoryRights']) { should cmp "GenericRead"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } + its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, Delete, GenericRead, WriteDacl, WriteOwner"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } + its(['ActiveDirectoryRights']) { should cmp "ListChildren"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Admins" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "#{netbiosname}\\Enterprise Admins" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty, ExtendedRight"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + end + end + end + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } + its(['ActiveDirectoryRights']) { should cmp "Self"} + end + end + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205744.rb b/controls/SV-205744.rb new file mode 100644 index 0000000..eac3f44 --- /dev/null +++ b/controls/SV-205744.rb @@ -0,0 +1,71 @@ +# encoding: UTF-8 + +control "SV-205744" do + title "Windows Server 2019 Add workstations to domain user right must only be +assigned to the Administrators group on domain controllers." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Add workstations to domain\" right may add computers to +a domain. This could result in unapproved or incorrectly configured systems +being added to a domain." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Add +workstations to domain\" right, this is a finding. + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeMachineAccountPrivilege\" user right, this is a finding. + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Add +workstations to domain\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93039' + tag 'rid': 'SV-103127r1_rule' + tag 'stig_id': 'WN19-DC-000350' + tag 'fix_id': 'F-99285r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeMachineAccountPrivilege') { should eq ['S-1-5-32-544'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205745.rb b/controls/SV-205745.rb new file mode 100644 index 0000000..e03b886 --- /dev/null +++ b/controls/SV-205745.rb @@ -0,0 +1,75 @@ +# encoding: UTF-8 + +control "SV-205745" do + title "Windows Server 2019 Enable computer and user accounts to be trusted +for delegation user right must only be assigned to the Administrators group on +domain controllers." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Enable computer and user accounts to be trusted for delegation\" user +right allows the \"Trusted for Delegation\" setting to be changed. This could +allow unauthorized users to impersonate other users." + desc "rationale", "" + desc 'check', "This applies to domain controllers. A separate version applies to other +systems. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Enable +computer and user accounts to be trusted for delegation\" user right, this is a +finding. + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeEnableDelegationPrivilege\" user right, this is a finding. + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Enable +computer and user accounts to be trusted for delegation\" to include only the +following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93041' + tag 'rid': 'SV-103129r1_rule' + tag 'stig_id': 'WN19-DC-000420' + tag 'fix_id': 'F-99287r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + describe security_policy do + its('SeEnableDelegationPrivilege') { should eq ['S-1-5-32-544'] } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205746.rb b/controls/SV-205746.rb new file mode 100644 index 0000000..7d9d332 --- /dev/null +++ b/controls/SV-205746.rb @@ -0,0 +1,84 @@ +# encoding: UTF-8 + +control "SV-205746" do + title "Windows Server 2019 must only allow administrators responsible for the +member server or standalone system to have Administrator rights on the system." + desc "An account that does not have Administrator duties must not have +Administrator rights. Such rights would allow the account to bypass or modify +required security restrictions on that machine and make it vulnerable to attack. + + System administrators must log on to systems using only accounts with the +minimum level of authority necessary. + + For domain-joined member servers, the Domain Admins group must be replaced +by a domain member server administrator group (see V-36433 in the Active +Directory Domain STIG). Restricting highly privileged accounts from the local +Administrators group helps mitigate the risk of privilege escalation resulting +from credential theft attacks. + + Standard user accounts must not be members of the built-in Administrators +group." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Open \"Computer Management\". + + Navigate to \"Groups\" under \"Local Users and Groups\". + + Review the local \"Administrators\" group. + + Only administrator groups or accounts responsible for administration of the +system may be members of the group. + + For domain-joined member servers, the Domain Admins group must be replaced +by a domain member server administrator group. + + Standard user accounts must not be members of the local Administrator group. + + If accounts that do not have responsibility for administration of the +system are members of the local Administrators group, this is a finding. + + If the built-in Administrator account or other required administrative +accounts are found on the system, this is not a finding." + desc 'fix', "Configure the local \"Administrators\" group to include only administrator +groups or accounts responsible for administration of the system. + + For domain-joined member servers, replace the Domain Admins group with a +domain member server administrator group. + + Remove any standard user accounts." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93043' + tag 'rid': 'SV-103131r1_rule' + tag 'stig_id': 'WN19-MS-000010' + tag 'fix_id': 'F-99289r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + impact 0.0 + describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do + skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' + end + else + administrators = input('local_administrators_member') + administrator_group = command("Get-LocalGroupMember -Group \"Administrators\" | select -ExpandProperty Name | ForEach-Object {$_ -replace \"$env:COMPUTERNAME\\\\\" -replace \"\"}").stdout.strip.split("\r\n") + if administrator_group.empty? + impact 0.0 + describe 'There are no users with administrative privileges' do + skip 'This control is not applicable' + end + else + administrator_group.each do |user| + describe user.to_s do + it { should be_in administrators } + end + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205747.rb b/controls/SV-205747.rb new file mode 100644 index 0000000..b62b887 --- /dev/null +++ b/controls/SV-205747.rb @@ -0,0 +1,64 @@ +# encoding: UTF-8 + +control "SV-205747" do + title "Windows Server 2019 must restrict remote calls to the Security Account +Manager (SAM) to Administrators on domain-joined member servers and standalone +systems." + desc "The Windows SAM stores users' passwords. Restricting Remote Procedure +Call (RPC) connections to the SAM to Administrators helps protect those +credentials." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems; it is NA for domain +controllers. + + If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: RestrictRemoteSAM + + Value Type: REG_SZ + Value: O:BAG:BAD:(A;;RC;;;BA)" + desc 'fix', "Navigate to the policy Computer Configuration >> Windows Settings >> +Security Settings >> Local Policies >> Security Options >> \"Network access: +Restrict clients allowed to make remote calls to SAM\". + Select \"Edit Security\" to configure the \"Security descriptor:\". + + Add \"Administrators\" in \"Group or user names:\" if it is not already +listed (this is the default). + + Select \"Administrators\" in \"Group or user names:\". + + Select \"Allow\" for \"Remote Access\" in \"Permissions for +\"Administrators\". + + Click \"OK\". + + The \"Security descriptor:\" must be populated with +\"O:BAG:BAD:(A;;RC;;;BA) for the policy to be enforced." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93045' + tag 'rid': 'SV-103133r1_rule' + tag 'stig_id': 'WN19-MS-000060' + tag 'fix_id': 'F-99291r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + impact 0.0 + describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do + skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa') do + it { should have_property "RestrictRemoteSAM"} + its('RestrictRemoteSAM') { should cmp "O:BAG:BAD:(A;;RC;;;BA)" } + end + end +end + diff --git a/controls/SV-205748.rb b/controls/SV-205748.rb new file mode 100644 index 0000000..205f355 --- /dev/null +++ b/controls/SV-205748.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205748" do + title "Windows Server 2019 Enable computer and user accounts to be trusted +for delegation user right must not be assigned to any groups or accounts on +domain-joined member servers and standalone systems." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Enable computer and user accounts to be trusted for delegation\" user +right allows the \"Trusted for Delegation\" setting to be changed. This could +allow unauthorized users to impersonate other users." + desc "rationale", "" + desc 'check', "This applies to member servers and standalone systems. A separate version +applies to domain controllers. + + Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are granted the \"Enable computer and user +accounts to be trusted for delegation\" user right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeEnableDelegationPrivilege\" user right, +this is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Enable computer and user accounts to be trusted for +delegation\" to be defined but containing no entries (blank)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93047' + tag 'rid': 'SV-103135r1_rule' + tag 'stig_id': 'WN19-MS-000130' + tag 'fix_id': 'F-99293r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + end + if domain_role == '4' || domain_role == '5' + impact 0.0 + describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do + skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' + end + else + describe security_policy do + its('SeEnableDelegationPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205749.rb b/controls/SV-205749.rb new file mode 100644 index 0000000..a8eae15 --- /dev/null +++ b/controls/SV-205749.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205749" do + title "Windows Server 2019 Access Credential Manager as a trusted caller user +right must not be assigned to any groups or accounts." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Access Credential Manager as a trusted caller\" user +right may be able to retrieve the credentials of other accounts from Credential +Manager." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are granted the \"Access Credential Manager as a +trusted caller\" user right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeTrustedCredManAccessPrivilege\" user right, +this is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Access Credential Manager as a trusted caller\" to be defined +but containing no entries (blank)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93049' + tag 'rid': 'SV-103137r1_rule' + tag 'stig_id': 'WN19-UR-000010' + tag 'fix_id': 'F-99295r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeTrustedCredManAccessPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205750.rb b/controls/SV-205750.rb new file mode 100644 index 0000000..542d9ee --- /dev/null +++ b/controls/SV-205750.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205750" do + title "Windows Server 2019 Act as part of the operating system user right +must not be assigned to any groups or accounts." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Act as part of the operating system\" user right can +assume the identity of any user and gain access to resources that the user is +authorized to access. Any accounts with this right can take complete control of +a system." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups (to include administrators), are granted the +\"Act as part of the operating system\" user right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeTcbPrivilege\" user right, this is a +finding. + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060). + + Passwords for accounts with this user right must be protected as highly +privileged accounts." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Act as part of the operating system\" to be defined but +containing no entries (blank)." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93051' + tag 'rid': 'SV-103139r1_rule' + tag 'stig_id': 'WN19-UR-000020' + tag 'fix_id': 'F-99297r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeTcbPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205751.rb b/controls/SV-205751.rb new file mode 100644 index 0000000..9d925ee --- /dev/null +++ b/controls/SV-205751.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205751" do + title "Windows Server 2019 Back up files and directories user right must only +be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Back up files and directories\" user right can +circumvent file and directory permissions and could allow access to sensitive +data." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Back +up files and directories\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the \"SeBackupPrivilege\" +user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Back up +files and directories\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93053' + tag 'rid': 'SV-103141r1_rule' + tag 'stig_id': 'WN19-UR-000040' + tag 'fix_id': 'F-99299r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeBackupPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205752.rb b/controls/SV-205752.rb new file mode 100644 index 0000000..79fcbac --- /dev/null +++ b/controls/SV-205752.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205752" do + title "Windows Server 2019 Create a pagefile user right must only be assigned +to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Create a pagefile\" user right can change the size of a +pagefile, which could affect system performance." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Create +a pagefile\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeCreatePagefilePrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Create a +pagefile\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93055' + tag 'rid': 'SV-103143r1_rule' + tag 'stig_id': 'WN19-UR-000050' + tag 'fix_id': 'F-99301r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeCreatePagefilePrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205753.rb b/controls/SV-205753.rb new file mode 100644 index 0000000..06e8c1e --- /dev/null +++ b/controls/SV-205753.rb @@ -0,0 +1,70 @@ +# encoding: UTF-8 + +control "SV-205753" do + title "Windows Server 2019 Create a token object user right must not be +assigned to any groups or accounts." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Create a token object\" user right allows a process to create an +access token. This could be used to provide elevated rights and compromise a +system." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are granted the \"Create a token object\" user +right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeCreateTokenPrivilege\" user right, this is +a finding. + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060). + + Passwords for application accounts with this user right must be protected +as highly privileged accounts." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Create a token object\" to be defined but containing no entries +(blank)." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93057' + tag 'rid': 'SV-103145r1_rule' + tag 'stig_id': 'WN19-UR-000060' + tag 'fix_id': 'F-99303r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeCreateTokenPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205754.rb b/controls/SV-205754.rb new file mode 100644 index 0000000..de0b049 --- /dev/null +++ b/controls/SV-205754.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205754" do + title "Windows Server 2019 Create global objects user right must only be assigned to Administrators, Service, Local Service, and Network Service." + desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. + Accounts with the \"Create global objects\" user right can create objects that are available to all sessions, which could affect processes in otherusers' sessions." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. + If any accounts or groups other than the following are granted the \"Create global objects\" user right, this is a finding: + - Administrators + - Service + - Local Service + - Network Service + + For server core installations, run the following command: + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + Review the text file. + If any SIDs other than the following are granted the \"SeCreateGlobalPrivilege\" user right, this is a finding: + S-1-5-32-544 (Administrators) + S-1-5-6 (Service) + S-1-5-19 (Local Service) + S-1-5-20 (Network Service) + + If an application requires this user right, this would not be a finding. + Vendor documentation must support the requirement for having the user right. + The requirement must be documented with the ISSO. + The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Create global objects\" to include only the following accounts or groups: + - Administrators + - Service + - Local Service + - Network Service" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93059' + tag 'rid': 'SV-103147r1_rule' + tag 'stig_id': 'WN19-UR-000070' + tag 'fix_id': 'F-99305r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + active_global_privilege_users = security_policy.SeCreateGlobalPrivilege.entries + allowed_global_privilege_users = input("allowed_global_privilege_users") + disallowed_global_privilege_users = input("disallowed_global_privilege_users") + unauthorized_users = [] + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + active_global_privilege_users.each do |user| + next if allowed_global_privilege_users.include?(user) + unauthorized_users << user + end + disallowed_global_privilege_users.each do |user| + unless disallowed_global_privilege_users == [nil] || unauthorized_users.include?(user) + unauthorized_users << user + end + end + describe "Global Object Creation Privilege must be limited to" do + it "Authorized SIDs: #{allowed_global_privilege_users}" do + failure_message = "Unauthorized SIDs: #{unauthorized_users}" + expect(unauthorized_users).to be_empty, failure_message + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205755.rb b/controls/SV-205755.rb new file mode 100644 index 0000000..b047030 --- /dev/null +++ b/controls/SV-205755.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205755" do + title "Windows Server 2019 Create permanent shared objects user right must +not be assigned to any groups or accounts." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Create permanent shared objects\" user right could +expose sensitive data by creating shared objects." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are granted the \"Create permanent shared +objects\" user right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeCreatePermanentPrivilege\" user right, this +is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Create permanent shared objects\" to be defined but containing +no entries (blank)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93061' + tag 'rid': 'SV-103149r1_rule' + tag 'stig_id': 'WN19-UR-000080' + tag 'fix_id': 'F-99307r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeCreatePermanentPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205756.rb b/controls/SV-205756.rb new file mode 100644 index 0000000..ee1e8e0 --- /dev/null +++ b/controls/SV-205756.rb @@ -0,0 +1,69 @@ +# encoding: UTF-8 + +control "SV-205756" do + title "Windows Server 2019 Create symbolic links user right must only be +assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Create symbolic links\" user right can create pointers +to other objects, which could expose the system to attack." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Create +symbolic links\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeCreateSymbolicLinkPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + + Systems that have the Hyper-V role will also have \"Virtual Machines\" +given this user right (this may be displayed as \"NT Virtual Machine\\Virtual +Machines\", SID S-1-5-83-0). This is not a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Create +symbolic links\" to include only the following accounts or groups: + + - Administrators + + Systems that have the Hyper-V role will also have \"Virtual Machines\" +given this user right. If this needs to be added manually, enter it as \"NT +Virtual Machine\\Virtual Machines\". " + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93063' + tag 'rid': 'SV-103151r1_rule' + tag 'stig_id': 'WN19-UR-000090' + tag 'fix_id': 'F-99309r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeCreateSymbolicLinkPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205757.rb b/controls/SV-205757.rb new file mode 100644 index 0000000..5beab39 --- /dev/null +++ b/controls/SV-205757.rb @@ -0,0 +1,76 @@ +# encoding: UTF-8 + +control "SV-205757" do + title "Windows Server 2019 Debug programs: user right must only be assigned +to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Debug programs\" user right can attach a debugger to +any process or to the kernel, providing complete access to sensitive and +critical operating system components. This right is given to Administrators in +the default configuration." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Debug +programs\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the \"SeDebugPrivilege\" +user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060). + + Passwords for application accounts with this user right must be protected +as highly privileged accounts." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Debug +programs\" to include only the following accounts or groups: + + - Administrators" + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93065' + tag 'rid': 'SV-103153r1_rule' + tag 'stig_id': 'WN19-UR-000100' + tag 'fix_id': 'F-99311r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeDebugPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205758.rb b/controls/SV-205758.rb new file mode 100644 index 0000000..1865b8f --- /dev/null +++ b/controls/SV-205758.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205758" do + title "Windows Server 2019 Force shutdown from a remote system user right +must only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Force shutdown from a remote system\" user right can +remotely shut down a system, which could result in a denial of service." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Force +shutdown from a remote system\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeRemoteShutdownPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Force +shutdown from a remote system\" to include only the following accounts or +groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93067' + tag 'rid': 'SV-103155r1_rule' + tag 'stig_id': 'WN19-UR-000110' + tag 'fix_id': 'F-99313r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeRemoteShutdownPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205759.rb b/controls/SV-205759.rb new file mode 100644 index 0000000..ec2da93 --- /dev/null +++ b/controls/SV-205759.rb @@ -0,0 +1,66 @@ +# encoding: UTF-8 + +control "SV-205759" do + title "Windows Server 2019 Generate security audits user right must only be assigned to Local Service and Network Service." + desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. + The \"Generate security audits\" user right specifies users and processes that can generate Security Log audit records, which must only be the system service accounts defined." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. + If any accounts or groups other than the following are granted the \"Generate security audits\" user right, this is a finding: + - Local Service + - Network Service + + For server core installations, run the following command: + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + Review the text file. + If any SIDs other than the following are granted the \"SeAuditPrivilege\" user right, this is a finding: + S-1-5-19 (Local Service) + S-1-5-20 (Network Service) + + If an application requires this user right, this would not be a finding. + Vendor documentation must support the requirement for having the user right. + The requirement must be documented with the ISSO. + The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Generate security audits\" to include only the following accounts or groups: + - Local Service + - Network Service" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93069' + tag 'rid': 'SV-103157r1_rule' + tag 'stig_id': 'WN19-UR-000120' + tag 'fix_id': 'F-99315r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + active_audit_privilege_users = security_policy.SeAuditPrivilege.entries + allowed_audit_privilege_users = input("allowed_audit_privilege_users") + disallowed_audit_privilege_users = input("disallowed_audit_privilege_users") + unauthorized_users = [] + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + active_audit_privilege_users.each do |user| + next if allowed_audit_privilege_users.include?(user) + unauthorized_users << user + end + disallowed_audit_privilege_users.each do |user| + unless disallowed_audit_privilege_users == [nil] || unauthorized_users.include?(user) + unauthorized_users << user + end + end + describe "Security Audit Generation Privilege must be limited to" do + it "Authorized SIDs: #{allowed_audit_privilege_users}" do + failure_message = "Unauthorized SIDs: #{unauthorized_users}" + expect(unauthorized_users).to be_empty, failure_message + end + end + end +end \ No newline at end of file diff --git a/controls/SV-205760.rb b/controls/SV-205760.rb new file mode 100644 index 0000000..d51bfc7 --- /dev/null +++ b/controls/SV-205760.rb @@ -0,0 +1,91 @@ +# encoding: UTF-8 + +control "SV-205760" do + title "Windows Server 2019 Impersonate a client after authentication user +right must only be assigned to Administrators, Service, Local Service, and +Network Service." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Impersonate a client after authentication\" user right allows a +program to impersonate another user or account to run on their behalf. An +attacker could use this to elevate privileges." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the +\"Impersonate a client after authentication\" user right, this is a finding: + + - Administrators + - Service + - Local Service + - Network Service + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeImpersonatePrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + S-1-5-6 (Service) + S-1-5-19 (Local Service) + S-1-5-20 (Network Service) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> +\"Impersonate a client after authentication\" to include only the following +accounts or groups: + + - Administrators + - Service + - Local Service + - Network Service" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93071' + tag 'rid': 'SV-103159r1_rule' + tag 'stig_id': 'WN19-UR-000130' + tag 'fix_id': 'F-99317r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeImpersonatePrivilege') { should include "S-1-5-32-544" } + end + describe security_policy do + its('SeImpersonatePrivilege') { should include "S-1-5-6" } + end + describe security_policy do + its('SeImpersonatePrivilege') { should include "S-1-5-19" } + end + describe security_policy do + its('SeImpersonatePrivilege') { should include "S-1-5-20" } + end + end +end diff --git a/controls/SV-205761.rb b/controls/SV-205761.rb new file mode 100644 index 0000000..aa1ca81 --- /dev/null +++ b/controls/SV-205761.rb @@ -0,0 +1,47 @@ +# encoding: UTF-8 + +control "SV-205761" do + title "Windows Server 2019 Increase scheduling priority: user right must only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. + Accounts with the \"Increase scheduling priority\" user right can change a scheduling priority, causing performance issues or a denial of service." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. + If any accounts or groups other than the following are granted the \"Increase scheduling priority\" user right, this is a finding: + - Administrators + + For server core installations, run the following command: + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + Review the text file. + If any SIDs other than the following are granted the \"SeIncreaseBasePriorityPrivilege\" user right, this is a finding: + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + Vendor documentation must support the requirement for having the user right. + The requirement must be documented with the ISSO. + The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Increase scheduling priority\" to include only the following accounts or groups: + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93073' + tag 'rid': 'SV-103161r1_rule' + tag 'stig_id': 'WN19-UR-000140' + tag 'fix_id': 'F-99319r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeIncreaseBasePriorityPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end \ No newline at end of file diff --git a/controls/SV-205762.rb b/controls/SV-205762.rb new file mode 100644 index 0000000..e254acd --- /dev/null +++ b/controls/SV-205762.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205762" do + title "Windows Server 2019 Load and unload device drivers user right must +only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Load and unload device drivers\" user right allows a user to load +device drivers dynamically on a system. This could be used by an attacker to +install malicious code." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Load +and unload device drivers\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeLoadDriverPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Load and +unload device drivers\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93075' + tag 'rid': 'SV-103163r1_rule' + tag 'stig_id': 'WN19-UR-000150' + tag 'fix_id': 'F-99321r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeLoadDriverPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205763.rb b/controls/SV-205763.rb new file mode 100644 index 0000000..2eaa9ad --- /dev/null +++ b/controls/SV-205763.rb @@ -0,0 +1,67 @@ +# encoding: UTF-8 + +control "SV-205763" do + title "Windows Server 2019 Lock pages in memory user right must not be +assigned to any groups or accounts." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + The \"Lock pages in memory\" user right allows physical memory to be +assigned to processes, which could cause performance issues or a denial of +service." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups are granted the \"Lock pages in memory\" user +right, this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs are granted the \"SeLockMemoryPrivilege\" user right, this is a +finding. + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Local Policies >> User Rights +Assignment >> \"Lock pages in memory\" to be defined but containing no entries +(blank)." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93077' + tag 'rid': 'SV-103165r1_rule' + tag 'stig_id': 'WN19-UR-000160' + tag 'fix_id': 'F-99323r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeLockMemoryPrivilege') { should eq [] } + end + end +end + diff --git a/controls/SV-205764.rb b/controls/SV-205764.rb new file mode 100644 index 0000000..760ac15 --- /dev/null +++ b/controls/SV-205764.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205764" do + title "Windows Server 2019 Modify firmware environment values user right must +only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Modify firmware environment values\" user right can +change hardware configuration environment variables. This could result in +hardware failures or a denial of service." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Modify +firmware environment values\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeSystemEnvironmentPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Modify +firmware environment values\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93079' + tag 'rid': 'SV-103167r1_rule' + tag 'stig_id': 'WN19-UR-000180' + tag 'fix_id': 'F-99325r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeSystemEnvironmentPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205765.rb b/controls/SV-205765.rb new file mode 100644 index 0000000..896ac2a --- /dev/null +++ b/controls/SV-205765.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205765" do + title "Windows Server 2019 Perform volume maintenance tasks user right must +only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Perform volume maintenance tasks\" user right can +manage volume and disk configurations. This could be used to delete volumes, +resulting in data loss or a denial of service." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the +\"Perform volume maintenance tasks\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeManageVolumePrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Perform +volume maintenance tasks\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93081' + tag 'rid': 'SV-103169r1_rule' + tag 'stig_id': 'WN19-UR-000190' + tag 'fix_id': 'F-99327r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeManageVolumePrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205766.rb b/controls/SV-205766.rb new file mode 100644 index 0000000..ad53d85 --- /dev/null +++ b/controls/SV-205766.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205766" do + title "Windows Server 2019 Profile single process user right must only be +assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Profile single process\" user right can monitor +non-system processes performance. An attacker could use this to identify +processes to attack." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the +\"Profile single process\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeProfileSingleProcessPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators)" + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Profile +single process\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93083' + tag 'rid': 'SV-103171r1_rule' + tag 'stig_id': 'WN19-UR-000200' + tag 'fix_id': 'F-99329r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeProfileSingleProcessPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205767.rb b/controls/SV-205767.rb new file mode 100644 index 0000000..9c061c0 --- /dev/null +++ b/controls/SV-205767.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205767" do + title "Windows Server 2019 Restore files and directories user right must only +be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Restore files and directories\" user right can +circumvent file and directory permissions and could allow access to sensitive +data. It could also be used to overwrite more current data." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the +\"Restore files and directories\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the \"SeRestorePrivilege\" +user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Restore +files and directories\" to include only the following accounts or groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93085' + tag 'rid': 'SV-103173r1_rule' + tag 'stig_id': 'WN19-UR-000210' + tag 'fix_id': 'F-99331r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeRestorePrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205768.rb b/controls/SV-205768.rb new file mode 100644 index 0000000..3699ae0 --- /dev/null +++ b/controls/SV-205768.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205768" do + title "Windows Server 2019 Take ownership of files or other objects user +right must only be assigned to the Administrators group." + desc "Inappropriate granting of user rights can provide system, +administrative, and other high-level capabilities. + + Accounts with the \"Take ownership of files or other objects\" user right +can take ownership of objects and make changes." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + If any accounts or groups other than the following are granted the \"Take +ownership of files or other objects\" user right, this is a finding: + + - Administrators + + For server core installations, run the following command: + + Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt + + Review the text file. + + If any SIDs other than the following are granted the +\"SeTakeOwnershipPrivilege\" user right, this is a finding: + + S-1-5-32-544 (Administrators) + + If an application requires this user right, this would not be a finding. + + Vendor documentation must support the requirement for having the user right. + + The requirement must be documented with the ISSO. + + The application account must meet requirements for application account +passwords, such as length (WN19-00-000050) and required frequency of changes +(WN19-00-000060)." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Local Policies >> User Rights Assignment >> \"Take +ownership of files or other objects\" to include only the following accounts or +groups: + + - Administrators" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000324-GPOS-00125' + tag 'gid': 'V-93087' + tag 'rid': 'SV-103175r1_rule' + tag 'stig_id': 'WN19-UR-000220' + tag 'fix_id': 'F-99333r1_fix' + tag 'cci': ["CCI-002235"] + tag 'nist': ["AC-6 (10)", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + describe security_policy do + its('SeTakeOwnershipPrivilege') { should eq ['S-1-5-32-544'] } + end + end +end + diff --git a/controls/SV-205769.rb b/controls/SV-205769.rb new file mode 100644 index 0000000..3ebb88d --- /dev/null +++ b/controls/SV-205769.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205769" do + title "Windows Server 2019 must be configured to audit Account Management - +Other Account Management Events successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Other Account Management Events records events such as the access of a +password hash or the Password Policy Checking API being called." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding: + + Account Management >> Other Account Management Events - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Management >> \"Audit Other Account Management +Events\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", +"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] + tag 'gid': 'V-93089' + tag 'rid': 'SV-103177r1_rule' + tag 'stig_id': 'WN19-AU-000090' + tag 'fix_id': 'F-99335r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Other Account Management Events') { should eq 'Success' } + end + describe audit_policy do + its('Other Account Management Events') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205770.rb b/controls/SV-205770.rb new file mode 100644 index 0000000..35726fe --- /dev/null +++ b/controls/SV-205770.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205770" do + title "Windows Server 2019 must be configured to audit Detailed Tracking - +Process Creation successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Process Creation records events related to the creation of a process and +the source." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Detailed Tracking >> Process Creation - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Detailed Tracking >> \"Audit Process Creation\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215"] + tag 'gid': 'V-93091' + tag 'rid': 'SV-103179r1_rule' + tag 'stig_id': 'WN19-AU-000140' + tag 'fix_id': 'F-99337r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Process Creation') { should eq 'Success' } + end + describe audit_policy do + its('Process Creation') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205771.rb b/controls/SV-205771.rb new file mode 100644 index 0000000..74ea2d7 --- /dev/null +++ b/controls/SV-205771.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205771" do + title "Windows Server 2019 must be configured to audit Policy Change - Audit +Policy Change successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Policy Change records events related to changes in audit policy." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Policy Change >> Audit Policy Change - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Policy Change >> \"Audit Audit Policy Change\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93093' + tag 'rid': 'SV-103181r1_rule' + tag 'stig_id': 'WN19-AU-000260' + tag 'fix_id': 'F-99339r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Audit Policy Change') { should eq 'Success' } + end + describe audit_policy do + its('Audit Policy Change') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205772.rb b/controls/SV-205772.rb new file mode 100644 index 0000000..8f10ddc --- /dev/null +++ b/controls/SV-205772.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205772" do + title "Windows Server 2019 must be configured to audit Policy Change - Audit +Policy Change failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Policy Change records events related to changes in audit policy." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Policy Change >> Audit Policy Change - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Policy Change >> \"Audit Audit Policy Change\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93095' + tag 'rid': 'SV-103183r1_rule' + tag 'stig_id': 'WN19-AU-000270' + tag 'fix_id': 'F-99341r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Audit Policy Change') { should eq 'Failure' } + end + describe audit_policy do + its('Audit Policy Change') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205773.rb b/controls/SV-205773.rb new file mode 100644 index 0000000..b03ecaa --- /dev/null +++ b/controls/SV-205773.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205773" do + title "Windows Server 2019 must be configured to audit Policy Change - +Authentication Policy Change successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Authentication Policy Change records events related to changes in +authentication policy, including Kerberos policy and Trust changes." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Policy Change >> Authentication Policy Change - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Policy Change >> \"Audit Authentication Policy +Change\" with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", +"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] + tag 'gid': 'V-93097' + tag 'rid': 'SV-103185r1_rule' + tag 'stig_id': 'WN19-AU-000280' + tag 'fix_id': 'F-99343r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Authentication Policy Change') { should eq 'Success' } + end + describe audit_policy do + its('Authentication Policy Change') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205774.rb b/controls/SV-205774.rb new file mode 100644 index 0000000..b82b201 --- /dev/null +++ b/controls/SV-205774.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205774" do + title "Windows Server 2019 must be configured to audit Policy Change - +Authorization Policy Change successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Authorization Policy Change records events related to changes in user +rights, such as \"Create a token object\"." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Policy Change >> Authorization Policy Change - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Policy Change >> \"Audit Authorization Policy Change\" +with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", +"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] + tag 'gid': 'V-93099' + tag 'rid': 'SV-103187r1_rule' + tag 'stig_id': 'WN19-AU-000290' + tag 'fix_id': 'F-99345r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Authentication Policy Change') { should eq 'Success' } + end + describe audit_policy do + its('Authentication Policy Change') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205775.rb b/controls/SV-205775.rb new file mode 100644 index 0000000..6a87574 --- /dev/null +++ b/controls/SV-205775.rb @@ -0,0 +1,59 @@ +# encoding: UTF-8 + +control "SV-205775" do + title "Windows Server 2019 must be configured to audit Privilege Use - +Sensitive Privilege Use successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Sensitive Privilege Use records events related to use of sensitive +privileges, such as \"Act as part of the operating system\" or \"Debug +programs\"." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Privilege Use >> Sensitive Privilege Use - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Privilege Use >> \"Audit Sensitive Privilege Use\" +with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", +"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] + tag 'gid': 'V-93101' + tag 'rid': 'SV-103189r1_rule' + tag 'stig_id': 'WN19-AU-000300' + tag 'fix_id': 'F-99347r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Sensitive Privilege Use') { should eq 'Success' } + end + describe audit_policy do + its('Sensitive Privilege Use') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205776.rb b/controls/SV-205776.rb new file mode 100644 index 0000000..fb0b199 --- /dev/null +++ b/controls/SV-205776.rb @@ -0,0 +1,60 @@ +# encoding: UTF-8 + +control "SV-205776" do + title "Windows Server 2019 must be configured to audit Privilege Use - +Sensitive Privilege Use failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Sensitive Privilege Use records events related to use of sensitive +privileges, such as \"Act as part of the operating system\" or \"Debug +programs\"." + desc "rationale", "" + desc 'check', " + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Privilege Use >> Sensitive Privilege Use - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Privilege Use >> \"Audit Sensitive Privilege Use\" +with \"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", +"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] + tag 'gid': 'V-93103' + tag 'rid': 'SV-103191r1_rule' + tag 'stig_id': 'WN19-AU-000310' + tag 'fix_id': 'F-99349r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Sensitive Privilege Use') { should eq 'Failure' } + end + describe audit_policy do + its('Sensitive Privilege Use') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205777.rb b/controls/SV-205777.rb new file mode 100644 index 0000000..5a12f55 --- /dev/null +++ b/controls/SV-205777.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205777" do + title "Windows Server 2019 must be configured to audit System - IPsec Driver +successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + IPsec Driver records events related to the IPsec Driver, such as dropped +packets." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> IPsec Driver - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit IPsec Driver\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93105' + tag 'rid': 'SV-103193r1_rule' + tag 'stig_id': 'WN19-AU-000320' + tag 'fix_id': 'F-99351r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('IPsec Driver') { should eq 'Success' } + end + describe audit_policy do + its('IPsec Driver') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205778.rb b/controls/SV-205778.rb new file mode 100644 index 0000000..091ca05 --- /dev/null +++ b/controls/SV-205778.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205778" do + title "Windows Server 2019 must be configured to audit System - IPsec Driver +failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + IPsec Driver records events related to the IPsec Driver, such as dropped +packets." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> IPsec Driver - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit IPsec Driver\" with \"Failure\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93107' + tag 'rid': 'SV-103195r1_rule' + tag 'stig_id': 'WN19-AU-000330' + tag 'fix_id': 'F-99353r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('IPsec Driver') { should eq 'Failure' } + end + describe audit_policy do + its('IPsec Driver') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205779.rb b/controls/SV-205779.rb new file mode 100644 index 0000000..1354e2f --- /dev/null +++ b/controls/SV-205779.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205779" do + title "Windows Server 2019 must be configured to audit System - Other System +Events successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Other System Events records information related to cryptographic key +operations and the Windows Firewall service." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> Other System Events - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit Other System Events\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93109' + tag 'rid': 'SV-103197r1_rule' + tag 'stig_id': 'WN19-AU-000340' + tag 'fix_id': 'F-99355r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Other System Events') { should eq 'Success' } + end + describe audit_policy do + its('Other System Events') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205780.rb b/controls/SV-205780.rb new file mode 100644 index 0000000..a38fa9b --- /dev/null +++ b/controls/SV-205780.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205780" do + title "Windows Server 2019 must be configured to audit System - Other System +Events failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Other System Events records information related to cryptographic key +operations and the Windows Firewall service." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> Other System Events - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit Other System Events\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': "SRG-OS-000327-GPOS-00127" + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': "V-93111" + tag 'rid': "SV-103199r1_rule" + tag 'stig_id': "WN19-AU-000350" + tag 'fix_id': "F-99357r1_fix" + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Other System Events') { should eq 'Failure' } + end + describe audit_policy do + its('Other System Events') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205781.rb b/controls/SV-205781.rb new file mode 100644 index 0000000..7c69bc8 --- /dev/null +++ b/controls/SV-205781.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205781" do + title "Windows Server 2019 must be configured to audit System - Security +State Change successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Security State Change records events related to changes in the security +state, such as startup and shutdown of the system." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> Security State Change - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit Security State Change\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93113' + tag 'rid': 'SV-103201r1_rule' + tag 'stig_id': 'WN19-AU-000360' + tag 'fix_id': 'F-99359r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Security State Change') { should eq 'Success' } + end + describe audit_policy do + its('Security State Change') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205782.rb b/controls/SV-205782.rb new file mode 100644 index 0000000..8a49449 --- /dev/null +++ b/controls/SV-205782.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205782" do + title "Windows Server 2019 must be configured to audit System - Security +System Extension successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Security System Extension records events related to extension code being +loaded by the security subsystem." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> Security System Extension - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit Security System Extension\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93115' + tag 'rid': 'SV-103203r1_rule' + tag 'stig_id': 'WN19-AU-000370' + tag 'fix_id': 'F-99361r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('Security System Extension') { should eq 'Success' } + end + describe audit_policy do + its('Security System Extension') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205783.rb b/controls/SV-205783.rb new file mode 100644 index 0000000..1983a74 --- /dev/null +++ b/controls/SV-205783.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205783" do + title "Windows Server 2019 must be configured to audit System - System +Integrity successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + System Integrity records events related to violations of integrity to the +security subsystem." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> System Integrity - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit System Integrity\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215", +"SRG-OS-000471-GPOS-00216", "SRG-OS-000477-GPOS-00222"] + tag 'gid': 'V-93117' + tag 'rid': 'SV-103205r1_rule' + tag 'stig_id': 'WN19-AU-000380' + tag 'fix_id': 'F-99363r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('System Integrity') { should eq 'Success' } + end + describe audit_policy do + its('System Integrity') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205784.rb b/controls/SV-205784.rb new file mode 100644 index 0000000..39e6d90 --- /dev/null +++ b/controls/SV-205784.rb @@ -0,0 +1,59 @@ +# encoding: UTF-8 + +control "SV-205784" do + title "Windows Server 2019 must be configured to audit System - System +Integrity failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + System Integrity records events related to violations of integrity to the +security subsystem." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + System >> System Integrity - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> System >> \"Audit System Integrity\" with \"Failure\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215", +"SRG-OS-000471-GPOS-00216", "SRG-OS-000477-GPOS-00222"] + tag 'gid': 'V-93119' + tag 'rid': 'SV-103207r1_rule' + tag 'stig_id': 'WN19-AU-000390' + tag 'fix_id': 'F-99365r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + describe.one do + describe audit_policy do + its('System Integrity') { should eq 'Failure' } + end + describe audit_policy do + its('System Integrity') { should eq 'Success and Failure' } + end + end + +end + diff --git a/controls/SV-205785.rb b/controls/SV-205785.rb new file mode 100644 index 0000000..fc1f81b --- /dev/null +++ b/controls/SV-205785.rb @@ -0,0 +1,183 @@ +# encoding: UTF-8 + +control "SV-205785" do + title "Windows Server 2019 Active Directory Group Policy objects must be +configured with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes Group Policy objects. Because changes to these objects can +significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for all Group Policy objects. + + Open \"Group Policy Management\" (available from various menus or run +\"gpmc.msc\"). + + Navigate to \"Group Policy Objects\" in the domain being reviewed (Forest +>> Domains >> Domain). + + For each Group Policy object: + + Select the Group Policy object item in the left pane. + + Select the \"Delegation\" tab in the right pane. + + Select the \"Advanced\" button. + + Select the \"Advanced\" button again and then the \"Auditing\" tab. + + If the audit settings for any Group Policy object are not at least as +inclusive as those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Applies to - This object and all descendant objects or Descendant +groupPolicyContainer objects + + The three Success types listed below are defaults inherited from the Parent +Object. Where Special is listed in the summary screens for Access, detailed +Permissions are provided for reference. + + Type - Success + Principal - Everyone + Access - Special (Permissions: Write all properties, Modify permissions; +Properties: all \"Write\" type selected) + Inherited from - Parent Object + Applies to - Descendant groupPolicyContainer objects + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - blank (Permissions: none selected; Properties: one instance - +Write gPLink, one instance - Write gPOptions) + Inherited from - Parent Object + Applies to - Descendant Organization Unit Objects" + desc 'fix', "Configure the audit settings for Group Policy objects to include the +following: + + This can be done at the Policy level in Active Directory to apply to all +group policies. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Select \"Advanced Features\" from the \"View\" Menu. + + Navigate to [Domain] >> System >> Policies in the left panel. + + Right click \"Policies\", select \"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button. + + Select the \"Auditing\" tab. + + Type - Fail + Principal - Everyone + Access - Full Control + Applies to - This object and all descendant objects or Descendant +groupPolicyContainer objects + + The three Success types listed below are defaults inherited from the Parent +Object. Where Special is listed in the summary screens for Access, detailed +Permissions are provided for reference. + + Type - Success + Principal - Everyone + Access - Special (Permissions: Write all properties, Modify permissions; +Properties: all \"Write\" type selected) + Inherited from - Parent Object + Applies to - Descendant groupPolicyContainer objects + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - blank (Permissions: none selected; Properties: one instance - +Write gPLink, one instance - Write gPOptions) + Inherited from - Parent Object + Applies to - Descendant Organization Unit Objects" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93121' + tag 'rid': 'SV-103209r1_rule' + tag 'stig_id': 'WN19-DC-000170' + tag 'fix_id': 'F-99367r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedNames = json(command: "Get-ADObject -Filter { objectclass -eq 'groupPolicyContainer'} | foreach {$_.DistinguishedName} | ConvertTo-JSON").params + distinguishedNames.each do |distinguishedName| + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + if acl_rules.is_a?(Hash) + acl_rules = [JSON.parse(acl_rules.to_json)] + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll" } + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl" } + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "All" } + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty" } + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "Descendents" } + end + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205786.rb b/controls/SV-205786.rb new file mode 100644 index 0000000..cb6f6ca --- /dev/null +++ b/controls/SV-205786.rb @@ -0,0 +1,223 @@ +# encoding: UTF-8 + +control "SV-205786" do + title "Windows Server 2019 Active Directory Domain object must be configured +with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes the Domain object. Because changes to these objects can +significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for the Domain object. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the domain being reviewed in the left pane. + + Right-click the domain name and select \"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + If the audit settings on the Domain object are not at least as inclusive as +those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + Applies to - This object only + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - None + Applies to - Special + + Type - Success + Principal - Domain Users + Access - All extended rights + Inherited from - None + Applies to - This object only + + Type - Success + Principal - Administrators + Access - All extended rights + Inherited from - None + Applies to - This object only + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Permissions: Write all properties, Modify permissions, +Modify owner)" + desc 'fix', " + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the domain being reviewed in the left pane. + + Right-click the domain name and select \"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + Configure the audit settings for Domain object to include the following: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + Applies to - This object only + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - None + Applies to - Special + + Type - Success + Principal - Domain Users + Access - All extended rights + Inherited from - None + Applies to - This object only + + Type - Success + Principal - Administrators + Access - All extended rights + Inherited from - None + Applies to - This object only + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Permissions: Write all properties, Modify permissions, +Modify owner.)" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93123' + tag 'rid': 'SV-103211r1_rule' + tag 'stig_id': 'WN19-DC-000180' + tag 'fix_id': 'F-99369r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params + distinguishedName = "\'#{distinguishedName}\'" + netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] + acl_rules = json(command: "(Get-ACL -Audit -Path AD:#{distinguishedName}).Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl, WriteOwner"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } + its(['ActiveDirectoryRights']) { should cmp "ExtendedRight"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Users" } + its(['ActiveDirectoryRights']) { should cmp "ExtendedRight"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "All" } + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205787.rb b/controls/SV-205787.rb new file mode 100644 index 0000000..11d30b2 --- /dev/null +++ b/controls/SV-205787.rb @@ -0,0 +1,166 @@ +# encoding: UTF-8 + +control "SV-205787" do + title "Windows Server 2019 Active Directory Infrastructure object must be +configured with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes the Infrastructure object. Because changes to these objects can +significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for Infrastructure object. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the domain being reviewed in the left pane. + + Right-click the \"Infrastructure\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + If the audit settings on the Infrastructure object are not at least as +inclusive as those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + (Access - Special = Permissions: Write all properties, All extended rights, +Change infrastructure master) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain)" + desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the domain being reviewed in the left pane. + + Right-click the \"Infrastructure\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + Configure the audit settings for Infrastructure object to include the +following: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + (Access - Special = Permissions: Write all properties, All extended rights, +Change infrastructure master) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain)" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93125' + tag 'rid': 'SV-103213r1_rule' + tag 'stig_id': 'WN19-DC-000190' + tag 'fix_id': 'F-99371r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=Infrastructure,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty, ExtendedRight"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "Descendents" } + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205788.rb b/controls/SV-205788.rb new file mode 100644 index 0000000..ae4d0cc --- /dev/null +++ b/controls/SV-205788.rb @@ -0,0 +1,198 @@ +# encoding: UTF-8 + +control "SV-205788" do + title "Windows Server 2019 Active Directory Domain Controllers Organizational +Unit (OU) object must be configured with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes the Domain Controller OU object. Because changes to these objects +can significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for the Domain Controller OU object. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the \"Domain Controllers OU\" under the domain being reviewed in the +left pane. + + Right-click the \"Domain Controllers OU\" object and select \"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + If the audit settings on the Domain Controllers OU object are not at least +as inclusive as those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + Applies to - This object and all descendant objects + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Permissions: all create, delete and modify permissions) + + Type - Success + Principal - Everyone + Access - Write all properties + Inherited from - None + Applies to - This object and all descendant objects + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain) + Applies to - Descendant Organizational Unit objects" + desc 'fix', " + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select the \"Domain Controllers OU\" under the domain being reviewed in the +left pane. + + Right-click the \"Domain Controllers OU\" object and select \"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + Configure the audit settings for Domain Controllers OU object to include +the following: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Permissions: all create, delete and modify permissions) + + Type - Success + Principal - Everyone + Access - Write all properties + Inherited from - None + Applies to - This object and all descendant objects + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain) + Applies to - Descendant Organizational Unit objects" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93127' + tag 'rid': 'SV-103215r1_rule' + tag 'stig_id': 'WN19-DC-000200' + tag 'fix_id': 'F-99373r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'OU=Domain Controllers,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "CreateChild, DeleteChild, DeleteTree, Delete, WriteDacl, WriteOwner"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "All" } + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "All" } + end + end + end + + + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205789.rb b/controls/SV-205789.rb new file mode 100644 index 0000000..6556b51 --- /dev/null +++ b/controls/SV-205789.rb @@ -0,0 +1,171 @@ +# encoding: UTF-8 + +control "SV-205789" do + title "Windows Server 2019 Active Directory AdminSDHolder object must be +configured with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes the AdminSDHolder object. Because changes to these objects can +significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for the \"AdminSDHolder\" object. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select \"System\" under the domain being reviewed in the left pane. + + Right-click the \"AdminSDHolder\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + If the audit settings on the \"AdminSDHolder\" object are not at least as +inclusive as those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + Applies to - This object only + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Write all properties, Modify permissions, Modify owner) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain) + Applies to - Descendant Organizational Unit objects" + desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select \"System\" under the domain being reviewed in the left pane. + + Right-click the \"AdminSDHolder\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + Configure the audit settings for AdminSDHolder object to include the +following: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + Applies to - This object only + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + Applies to - This object only + (Access - Special = Write all properties, Modify permissions, Modify owner) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain) + Applies to - Descendant Organizational Unit objects" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93129' + tag 'rid': 'SV-103217r1_rule' + tag 'stig_id': 'WN19-DC-000210' + tag 'fix_id': 'F-99375r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=AdminSDHolder,CN=System,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl, WriteOwner"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "Descendents" } + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205790.rb b/controls/SV-205790.rb new file mode 100644 index 0000000..1f01c0e --- /dev/null +++ b/controls/SV-205790.rb @@ -0,0 +1,167 @@ +# encoding: UTF-8 + +control "SV-205790" do + title "Windows Server 2019 Active Directory RID Manager$ object must be +configured with proper audit settings." + desc "When inappropriate audit settings are configured for directory service +database objects, it may be possible for a user or process to update the data +without generating any tracking data. The impact of missing audit data is +related to the type of object. A failure to capture audit data for objects used +by identification, authentication, or authorization functions could degrade or +eliminate the ability to track changes to access policy for systems or data. + + For Active Directory (AD), there are a number of critical object types in +the domain naming context of the AD database for which auditing is essential. +This includes the RID Manager$ object. Because changes to these objects can +significantly impact access controls or the availability of systems, the +absence of auditing data makes it impossible to identify the source of changes +that impact the confidentiality, integrity, and availability of data and +systems throughout an AD domain. The lack of proper auditing can result in +insufficient forensic evidence needed to investigate an incident and prosecute +the intruder." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Review the auditing configuration for the \"RID Manager$\" object. + + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select \"System\" under the domain being reviewed in the left pane. + + Right-click the \"RID Manager$\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + If the audit settings on the \"RID Manager$\" object are not at least as +inclusive as those below, this is a finding: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + (Access - Special = Write all properties, All extended rights, Change RID +master) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain)" + desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + + Ensure \"Advanced Features\" is selected in the \"View\" menu. + + Select \"System\" under the domain being reviewed in the left pane. + + Right-click the \"RID Manager$\" object in the right pane and select +\"Properties\". + + Select the \"Security\" tab. + + Select the \"Advanced\" button and then the \"Auditing\" tab. + + Configure the audit settings for RID Manager$ object to include the +following: + + Type - Fail + Principal - Everyone + Access - Full Control + Inherited from - None + + The success types listed below are defaults. Where Special is listed in the +summary screens for Access, detailed Permissions are provided for reference. +Various Properties selections may also exist by default. + + Type - Success + Principal - Everyone + Access - Special + Inherited from - None + (Access - Special = Write all properties, All extended rights, Change RID +master) + + Two instances with the following summary information will be listed: + + Type - Success + Principal - Everyone + Access - (blank) + Inherited from - (CN of domain)" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93131' + tag 'rid': 'SV-103219r1_rule' + tag 'stig_id': 'WN19-DC-000220' + tag 'fix_id': 'F-99377r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params + acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=RID Manager$,CN=System,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Failure" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "GenericAll"} + end + end + end + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty, ExtendedRight"} + its(['IsInherited']) { should cmp "False" } + its(['InheritanceType']) { should cmp "None" } + end + end + end + + + describe.one do + acl_rules.each do |acl_rule| + describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do + subject { acl_rule } + its(['AuditFlags']) { should cmp "Success" } + its(['IdentityReference']) { should cmp "Everyone" } + its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} + its(['IsInherited']) { should cmp "True" } + its(['InheritanceType']) { should cmp "Descendents" } + end + end + end + else + impact 0.0 + desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205791.rb b/controls/SV-205791.rb new file mode 100644 index 0000000..af2a084 --- /dev/null +++ b/controls/SV-205791.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205791" do + title "Windows Server 2019 must be configured to audit DS Access - Directory +Service Access successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Directory Service Access records events related to users accessing an +Active Directory object." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + DS Access >> Directory Service Access - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> DS Access >> \"Directory Service Access\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': "SRG-OS-000327-GPOS-00127" + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': "V-93133" + tag 'rid': "SV-103221r1_rule" + tag 'stig_id': "WN19-DC-000240" + tag 'fix_id': "F-99379r1_fix" + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + describe.one do + describe audit_policy do + its('Directory Service Access') { should eq 'Success' } + end + describe audit_policy do + its('Directory Service Access') { should eq 'Success and Failure' } + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205792.rb b/controls/SV-205792.rb new file mode 100644 index 0000000..15bafd6 --- /dev/null +++ b/controls/SV-205792.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205792" do + title "Windows Server 2019 must be configured to audit DS Access - Directory +Service Access failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Directory Service Access records events related to users accessing an +Active Directory object." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + DS Access >> Directory Service Access - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> DS Access >> \"Directory Service Access\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93135' + tag 'rid': 'SV-103223r1_rule' + tag 'stig_id': 'WN19-DC-000250' + tag 'fix_id': 'F-99381r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + describe.one do + describe audit_policy do + its('Directory Service Access') { should eq 'Failure' } + end + describe audit_policy do + its('Directory Service Access') { should eq 'Success and Failure' } + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205793.rb b/controls/SV-205793.rb new file mode 100644 index 0000000..e8f1d5e --- /dev/null +++ b/controls/SV-205793.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205793" do + title "Windows Server 2019 must be configured to audit DS Access - Directory +Service Changes successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Directory Service Changes records events related to changes made to +objects in Active Directory Domain Services." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + DS Access >> Directory Service Changes - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> DS Access >> \"Directory Service Changes\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93137' + tag 'rid': 'SV-103225r1_rule' + tag 'stig_id': 'WN19-DC-000260' + tag 'fix_id': 'F-99383r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + describe.one do + describe audit_policy do + its('Directory Service Changes') { should eq 'Success' } + end + describe audit_policy do + its('Directory Service Changes') { should eq 'Success and Failure' } + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205794.rb b/controls/SV-205794.rb new file mode 100644 index 0000000..3c23881 --- /dev/null +++ b/controls/SV-205794.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205794" do + title "Windows Server 2019 must be configured to audit DS Access - Directory +Service Changes failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Directory Service Changes records events related to changes made to +objects in Active Directory Domain Services." + desc "rationale", "" + desc 'check', "This applies to domain controllers. It is NA for other systems. + + Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + DS Access >> Directory Service Changes - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> DS Access >> \"Directory Service Changes\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000327-GPOS-00127' + tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", +"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] + tag 'gid': 'V-93139' + tag 'rid': 'SV-103227r1_rule' + tag 'stig_id': 'WN19-DC-000270' + tag 'fix_id': 'F-99385r1_fix' + tag 'cci': ["CCI-000172", "CCI-002234"] + tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + if domain_role == '4' || domain_role == '5' + describe.one do + describe audit_policy do + its('Directory Service Changes') { should eq 'Failure' } + end + describe audit_policy do + its('Directory Service Changes') { should eq 'Success and Failure' } + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end + diff --git a/controls/SV-205795.rb b/controls/SV-205795.rb new file mode 100644 index 0000000..49ec5b5 --- /dev/null +++ b/controls/SV-205795.rb @@ -0,0 +1,64 @@ +# encoding: UTF-8 + +control "SV-205795" do + title "Windows Server 2019 account lockout duration must be configured to #{input('pass_lock_duration')} +minutes or greater." + desc "The account lockout feature, when enabled, prevents brute-force +password attacks on the system. This parameter specifies the period of time +that an account will remain locked after the specified number of failed logon +attempts." + desc "rationale", "" + desc 'check', "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Account Policies >> Account Lockout Policy. + + If the \"Account lockout duration\" is less than \"#{input('pass_lock_duration')}\" minutes (excluding +\"0\"), this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + + If \"LockoutDuration\" is less than \"#{input('pass_lock_duration')}\" (excluding \"0\") in the file, +this is a finding. + + Configuring this to \"0\", requiring an administrator to unlock the +account, is more restrictive and is not a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings +>> Security Settings >> Account Policies >> Account Lockout Policy >> \"Account +lockout duration\" to \"#{input('pass_lock_duration')}\" minutes or greater. + + A value of \"0\" is also acceptable, requiring an administrator to unlock +the account." + impact 0.5 + tag severity: nil + tag gtitle: 'SRG-OS-000329-GPOS-00128' + tag gid: 'V-93145' + tag rid: 'SV-103233r1_rule' + tag stig_id: 'WN19-AC-000010' + tag fix_id: 'F-99391r1_fix' + tag cci: ["CCI-002238"] + tag nist: ["AC-7 b", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do + skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' + end + else + pass_lock_duration = input('pass_lock_duration') + describe.one do + describe security_policy do + its('LockoutDuration') { should be >= pass_lock_duration } + end + describe security_policy do + its('LockoutDuration') { should cmp == 0 } + end + end + end +end + diff --git a/controls/SV-205796.rb b/controls/SV-205796.rb new file mode 100644 index 0000000..3a5c26a --- /dev/null +++ b/controls/SV-205796.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205796" do + title "Windows Server 2019 Application event log size must be configured to +32768 KB or greater." + desc "Inadequate log size will cause the log to fill up quickly. This may +prevent audit events from being recorded properly and require frequent +attention by administrative personnel." + desc "rationale", "" + desc 'check', "If the system is configured to write events directly to an audit server, +this is NA. + + If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path:\\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\Application\\ + + Value Name: MaxSize + + Type: REG_DWORD + Value: 0x00008000 (32768) (or greater)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Event Log Service >> +Application >> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a +\"Maximum Log Size (KB)\" of \"32768\" or greater." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000341-GPOS-00132' + tag 'gid': 'V-93177' + tag 'rid': 'SV-103265r1_rule' + tag 'stig_id': 'WN19-CC-000270' + tag 'fix_id': 'F-99423r1_fix' + tag 'cci': ["CCI-001849"] + tag 'nist': ["AU-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application') do + it { should have_property 'MaxSize' } + its('MaxSize') { should cmp >= 32768 } + end +end + diff --git a/controls/SV-205797.rb b/controls/SV-205797.rb new file mode 100644 index 0000000..da3e4b2 --- /dev/null +++ b/controls/SV-205797.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205797" do + title "Windows Server 2019 Security event log size must be configured to +196608 KB or greater." + desc "Inadequate log size will cause the log to fill up quickly. This may +prevent audit events from being recorded properly and require frequent +attention by administrative personnel." + desc "rationale", "" + desc 'check', "If the system is configured to write events directly to an audit server, +this is NA. + + If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\Security\\ + + Value Name: MaxSize + + Type: REG_DWORD + Value: 0x00030000 (196608) (or greater)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Event Log Service >> Security +>> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a \"Maximum +Log Size (KB)\" of \"196608\" or greater." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000341-GPOS-00132' + tag 'gid': 'V-93179' + tag 'rid': 'SV-103267r1_rule' + tag 'stig_id': 'WN19-CC-000280' + tag 'fix_id': 'F-99425r1_fix' + tag 'cci': ["CCI-001849"] + tag 'nist': ["AU-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security') do + it { should have_property 'MaxSize' } + its('MaxSize') { should cmp >= 196608 } + end +end + diff --git a/controls/SV-205798.rb b/controls/SV-205798.rb new file mode 100644 index 0000000..1ced652 --- /dev/null +++ b/controls/SV-205798.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205798" do + title "Windows Server 2019 System event log size must be configured to 32768 +KB or greater." + desc "Inadequate log size will cause the log to fill up quickly. This may +prevent audit events from being recorded properly and require frequent +attention by administrative personnel." + desc "rationale", "" + desc 'check', "If the system is configured to write events directly to an audit server, +this is NA. + + If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\System\\ + + Value Name: MaxSize + + Type: REG_DWORD + Value: 0x00008000 (32768) (or greater)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Event Log Service >> System +>> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a \"Maximum +Log Size (KB)\" of \"32768\" or greater." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000341-GPOS-00132' + tag 'gid': 'V-93181' + tag 'rid': 'SV-103269r1_rule' + tag 'stig_id': 'WN19-CC-000290' + tag 'fix_id': 'F-99427r1_fix' + tag 'cci': ["CCI-001849"] + tag 'nist': ["AU-4", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System') do + it { should have_property 'MaxSize' } + its('MaxSize') { should cmp >= 32768 } + end +end + diff --git a/controls/SV-205799.rb b/controls/SV-205799.rb new file mode 100644 index 0000000..a0bf458 --- /dev/null +++ b/controls/SV-205799.rb @@ -0,0 +1,30 @@ +# encoding: UTF-8 + +control "SV-205799" do + title "Windows Server 2019 audit records must be backed up to a different +system or media than the system being audited." + desc "Protection of log data includes assuring the log data is not +accidentally lost or deleted. Audit information stored in one location is +vulnerable to accidental or incidental deletion or alteration." + desc "rationale", "" + desc 'check', "Determine if a process to back up log data to a different system or media +than the system being audited has been implemented. + + If it has not, this is a finding." + desc 'fix', "Establish and implement a process for backing up log data to +another system or media other than the system being audited." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000342-GPOS-00133' + tag 'gid': 'V-93183' + tag 'rid': 'SV-103271r1_rule' + tag 'stig_id': 'WN19-AU-000010' + tag 'fix_id': 'F-99429r1_fix' + tag 'cci': ["CCI-001851"] + tag 'nist': ["AU-4 (1)", "Rev_4"] + + describe 'A manual review is required to verify audit records are being backed up onto a different system or media than the system being audited' do + skip 'A manual review is required to verify audit records are being backed up onto a different system or media than the system being audited' + end +end + diff --git a/controls/SV-205800.rb b/controls/SV-205800.rb new file mode 100644 index 0000000..254510c --- /dev/null +++ b/controls/SV-205800.rb @@ -0,0 +1,97 @@ +control 'SV-205800' do + title "The Windows Server 2019 time service must synchronize with an + appropriate #{input('org_name')[:acronym]} time source." + desc "The Windows Time Service controls time synchronization settings. Time + synchronization is essential for authentication and auditing purposes. If the + Windows Time Service is used, it must synchronize with a secure, authorized + time source. Domain-joined systems are automatically configured to synchronize + with domain controllers. If an NTP server is configured, it must synchronize + with a secure, authorized time source." + desc 'rationale', '' + desc 'check', "Review the Windows time service configuration. + + Open an elevated \"Command Prompt\" (run as administrator). + + Enter \"W32tm /query /configuration\". + + Domain-joined systems (excluding the domain controller with the PDC + emulator role): + + If the value for \"Type\" under \"NTP Client\" is not \"NT5DS\", this is a + finding. + + Other systems: + + If systems are configured with a \"Type\" of \"NTP\", including standalone + systems and the domain controller with the PDC Emulator role, and do not have a + #{input('org_name')[:acronym]} time server defined for \"NTPServer\", this is a finding. + + To determine the domain controller with the PDC Emulator role: + + Open \"PowerShell\". + + Enter \"Get-ADDomain | FT PDCEmulator\"." + desc 'fix', "Configure the system to synchronize time with an appropriate #{input('org_name')[:acronym]} time + source. + + Domain-joined systems use NT5DS to synchronize time from other systems in + the domain by default. + + If the system needs to be configured to an NTP server, configure the system + to point to an authorized time server by setting the policy value for Computer + Configuration >> Administrative Templates >> System >> Windows Time Service >> + Time Providers >> \"Configure Windows NTP Client\" to \"Enabled\", and + configure the \"NtpServer\" field to point to an appropriate #{input('org_name')[:acronym]} time server. + + The US Naval Observatory operates stratum 1 time servers, identified at + http://tycho.usno.navy.mil/ntp.html. Time synchronization will occur through a + hierarchy of time servers down to the local level. Clients and lower-level + servers will synchronize with an authorized time server in the hierarchy." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000355-GPOS-00143' + tag 'gid': 'V-93187' + tag 'rid': 'SV-103275r1_rule' + tag 'stig_id': 'WN19-00-000440' + tag 'fix_id': 'F-99433r1_fix' + tag 'cci': ['CCI-001891'] + tag 'nist': ['AU-8 (1) (a)', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + forest_pdce = powershell('(Get-ADDomain).PDCEmulator').stdout.strip + if forest_pdce.downcase.include? sys_info.hostname.downcase + # forest pdc emulator should be uniquely configured. + describe w32time_config do + its('type') { should cmp 'NTP' } + its('ntpserver') do + should be_in input('ntp_servers') + end + end + else + # just a normal domain controller + describe w32time_config do + its('type') { should cmp 'NT5DS' } + end + end + elsif domain_role == '3' + # just a memberserver + describe.one do + describe w32time_config do + its('type') { should cmp 'NT5DS' } + end + describe w32time_config do + its('type') { should cmp 'ALLSYNC' } + end + end + else + # just a stand alone system + describe w32time_config do + its('type') { should cmp 'NTP' } + its('ntpserver') do + should be_in input('ntp_servers') + end + end + end +end diff --git a/controls/SV-205801.rb b/controls/SV-205801.rb new file mode 100644 index 0000000..dfe5098 --- /dev/null +++ b/controls/SV-205801.rb @@ -0,0 +1,38 @@ +# encoding: UTF-8 + +control "SV-205801" do + title "Windows Server 2019 must prevent users from changing installation +options." + desc "Installation options for applications are typically controlled by +administrators. This setting prevents users from changing installation options +that may bypass security features." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ + + Value Name: EnableUserControl + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Windows Installer >> \"Allow +user control over installs\" to \"Disabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000362-GPOS-00149' + tag 'gid': 'V-93199' + tag 'rid': 'SV-103287r1_rule' + tag 'stig_id': 'WN19-CC-000420' + tag 'fix_id': 'F-99445r1_fix' + tag 'cci': ["CCI-001812"] + tag 'nist': ["CM-11 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do + it { should have_property 'EnableUserControl' } + its('EnableUserControl') { should cmp 0 } + end +end + diff --git a/controls/SV-205802.rb b/controls/SV-205802.rb new file mode 100644 index 0000000..89457e2 --- /dev/null +++ b/controls/SV-205802.rb @@ -0,0 +1,38 @@ +# encoding: UTF-8 + +control "SV-205802" do + title "Windows Server 2019 must disable the Windows Installer Always install +with elevated privileges option." + desc "Standard user accounts must not be granted elevated privileges. +Enabling Windows Installer to elevate privileges when installing applications +can allow malicious persons and applications to gain full control of a system." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ + + Value Name: AlwaysInstallElevated + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Windows Installer >> \"Always +install with elevated privileges\" to \"Disabled\"." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000362-GPOS-00149' + tag 'gid': 'V-93201' + tag 'rid': 'SV-103289r1_rule' + tag 'stig_id': 'WN19-CC-000430' + tag 'fix_id': 'F-99447r1_fix' + tag 'cci': ["CCI-001812"] + tag 'nist': ["CM-11 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do + it { should have_property 'AlwaysInstallElevated' } + its('AlwaysInstallElevated') { should cmp 0 } + end +end + diff --git a/controls/SV-205803.rb b/controls/SV-205803.rb new file mode 100644 index 0000000..126c05b --- /dev/null +++ b/controls/SV-205803.rb @@ -0,0 +1,36 @@ +# encoding: UTF-8 + +control "SV-205803" do + title "Windows Server 2019 system files must be monitored for unauthorized +changes." + desc "Monitoring system files for changes against a baseline on a regular +basis may help detect the possible introduction of malicious code on a system." + desc "rationale", "" + desc 'check', "Determine whether the system is monitored for unauthorized changes to +system files (e.g., *.exe, *.bat, *.com, *.cmd, and *.dll) against a baseline +on a weekly basis. + + If system files are not monitored for unauthorized changes, this is a +finding. + + A properly configured HBSS Policy Auditor 5.2 or later File Integrity +Monitor (FIM) module will meet the requirement for file integrity checking. The +Asset module within HBSS does not meet this requirement." + desc 'fix', "Monitor the system for unauthorized changes to system files +(e.g., *.exe, *.bat, *.com, *.cmd, and *.dll) against a baseline on a weekly +basis. This can be done with the use of various monitoring tools." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000363-GPOS-00150' + tag 'gid': 'V-93203' + tag 'rid': 'SV-103291r1_rule' + tag 'stig_id': 'WN19-00-000220' + tag 'fix_id': 'F-99449r1_fix' + tag 'cci': ["CCI-001744"] + tag 'nist': ["CM-3 (5)", "Rev_4"] + + describe 'A manual review is required to ensure system files are monitored for unauthorized changes' do + skip 'A manual review is required to ensure system files are monitored for unauthorized changes' + end +end + diff --git a/controls/SV-205804.rb b/controls/SV-205804.rb new file mode 100644 index 0000000..f034b85 --- /dev/null +++ b/controls/SV-205804.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205804" do + title "Windows Server 2019 Autoplay must be turned off for non-volume devices." + desc "Allowing AutoPlay to execute may introduce malicious code to a system. AutoPlay begins reading from a drive as soon as media is inserted into the drive. As a result, the setup file of programs or music on audio media may start. This setting will disable AutoPlay for non-volume devices, such as Media Transfer Protocol (MTP) devices." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ + + Value Name: NoAutoplayfornonVolume + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Disallow Autoplay for non-volume devices\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000368-GPOS-00154" + tag gid: "V-93373" + tag rid: "SV-103459r1_rule" + tag stig_id: "WN19-CC-000210" + tag fix_id: "F-99617r1_fix" + tag cci: ["CCI-001764"] + tag nist: ["CM-7 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\Explorer') do + it { should have_property 'NoAutoplayfornonVolume' } + its('NoAutoplayfornonVolume') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205805.rb b/controls/SV-205805.rb new file mode 100644 index 0000000..7c84348 --- /dev/null +++ b/controls/SV-205805.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205805" do + title "Windows Server 2019 default AutoRun behavior must be configured to prevent AutoRun commands." + desc "Allowing AutoRun commands to execute may introduce malicious code to a system. Configuring this setting prevents AutoRun commands from executing." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ + + Value Name: NoAutorun + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Set the default behavior for AutoRun\" to \"Enabled\" with \"Do not execute any autorun commands\" selected." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000368-GPOS-00154" + tag gid: "V-93375" + tag rid: "SV-103461r1_rule" + tag stig_id: "WN19-CC-000220" + tag fix_id: "F-99619r1_fix" + tag cci: ["CCI-001764"] + tag nist: ["CM-7 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer') do + it { should have_property 'NoAutorun' } + its('NoAutorun') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205806.rb b/controls/SV-205806.rb new file mode 100644 index 0000000..2f672db --- /dev/null +++ b/controls/SV-205806.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205806" do + title "Windows Server 2019 AutoPlay must be disabled for all drives." + desc "Allowing AutoPlay to execute may introduce malicious code to a system. AutoPlay begins reading from a drive as soon media is inserted into the drive. As a result, the setup file of programs or music on audio media may start. By default, AutoPlay is disabled on removable drives, such as the floppy disk drive (but not the CD-ROM drive) and on network drives. Enabling this policy disables AutoPlay on all drives." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\Explorer\\ + + Value Name: NoDriveTypeAutoRun + + Type: REG_DWORD + Value: 0x000000ff (255)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Turn off AutoPlay\" to \"Enabled\" with \"All Drives\" selected." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000368-GPOS-00154" + tag gid: "V-93377" + tag rid: "SV-103463r1_rule" + tag stig_id: "WN19-CC-000230" + tag fix_id: "F-99621r1_fix" + tag cci: ["CCI-001764"] + tag nist: ["CM-7 (2)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer') do + it { should have_property 'NoDriveTypeAutoRun' } + its('NoDriveTypeAutoRun') { should cmp == 255 } + end +end \ No newline at end of file diff --git a/controls/SV-205807.rb b/controls/SV-205807.rb new file mode 100644 index 0000000..c03e2a5 --- /dev/null +++ b/controls/SV-205807.rb @@ -0,0 +1,45 @@ +# encoding: UTF-8 + +control "SV-205807" do + title "Windows Server 2019 must employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs." + desc "Using a whitelist provides a configuration management method to allow the execution of only authorized software. Using only authorized software decreases risk by limiting the number of potential vulnerabilities. + The organization must identify authorized software programs and only permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting." + desc "rationale", "" + desc "check", "This is applicable to unclassified systems. For other systems, this is NA. + + Verify the operating system employs a deny-all, permit-by-exception policy to allow the execution of authorized software programs. + If an application whitelisting program is not in use on the system, this is a finding. + Configuration of whitelisting applications will vary by the program. + AppLocker is a whitelisting application built into Windows Server. A deny-by-default implementation is initiated by enabling any AppLocker rules within a category, only allowing what is specified by defined rules. + If AppLocker is used, perform the following to view the configuration of AppLocker: + + Open \"PowerShell\". + If the AppLocker PowerShell module has not been imported previously, execute the following first: + Import-Module AppLocker + Execute the following command, substituting [c:\\temp\\file.xml] with a location and file name appropriate for the system: + Get-AppLockerPolicy -Effective -XML > c:\\temp\\file.xml + This will produce an xml file with the effective settings that can be viewed in a browser or opened in a program such as Excel for review. + Implementation guidance for AppLocker is available in the NSA paper \"Application Whitelisting using Microsoft AppLocker\" at the following link: + https://www.iad.gov/iad/library/ia-guidance/tech-briefs/application-whitelisting-using-microsoft-applocker.cfm" + desc "fix", "Configure an application whitelisting program to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs. + + Configuration of whitelisting applications will vary by the program. AppLocker is a whitelisting application built into Windows Server. + If AppLocker is used, it is configured through group policy in Computer Configuration >> Windows Settings >> Security Settings >> Application Control Policies >> AppLocker. + Implementation guidance for AppLocker is available in the NSA paper \"Application Whitelisting using Microsoft AppLocker\" at the following link: + https://www.iad.gov/iad/library/ia-guidance/tech-briefs/application-whitelisting-using-microsoft-applocker.cfm" + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000370-GPOS-00155" + tag gid: "V-93379" + tag rid: "SV-103465r1_rule" + tag stig_id: "WN19-00-000080" + tag fix_id: "F-99623r1_fix" + tag cci: ["CCI-001774"] + tag nist: ["CM-7 (5) (b)", "Rev_4"] + + describe "A manual review is required to ensure the operating system employs a deny-all, permit-by-exception + policy to allow the execution of authorized software programs" do + skip 'A manual review is required to ensure the operating system employs a deny-all, permit-by-exception + policy to allow the execution of authorized software programs' + end +end \ No newline at end of file diff --git a/controls/SV-205808.rb b/controls/SV-205808.rb new file mode 100644 index 0000000..42bd23f --- /dev/null +++ b/controls/SV-205808.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205808" do + title "Windows Server 2019 must not save passwords in the Remote Desktop Client." + desc "Saving passwords in the Remote Desktop Client could allow an unauthorized user to establish a remote desktop session to another system. The system must be configured to prevent users from saving passwords in the Remote Desktop Client." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ + + Value Name: DisablePasswordSaving + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Connection Client >> \"Do not allow passwords to be saved\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93425" + tag rid: "SV-103511r1_rule" + tag stig_id: "WN19-CC-000340" + tag fix_id: "F-99669r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services') do + it { should have_property 'DisablePasswordSaving' } + its('DisablePasswordSaving') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205809.rb b/controls/SV-205809.rb new file mode 100644 index 0000000..a8a376c --- /dev/null +++ b/controls/SV-205809.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205809" do + title "Windows Server 2019 Remote Desktop Services must always prompt a client for passwords upon connection." + desc "This setting controls the ability of users to supply passwords automatically as part of their remote desktop connection. Disabling this setting would allow anyone to use the stored credentials in a connection item to connect to the terminal server." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ + + Value Name: fPromptForPassword + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Session Host >> Security >> \"Always prompt for password upon connection\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93427" + tag rid: "SV-103513r1_rule" + tag stig_id: "WN19-CC-000360" + tag fix_id: "F-99671r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows NT\\Terminal Services') do + it { should have_property 'fPromptForPassword' } + its('fPromptForPassword') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205810.rb b/controls/SV-205810.rb new file mode 100644 index 0000000..6d7ac50 --- /dev/null +++ b/controls/SV-205810.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205810" do + title "Windows Server 2019 Windows Remote Management (WinRM) service must not store RunAs credentials." + desc "Storage of administrative credentials could allow unauthorized access. Disallowing the storage of RunAs credentials for Windows Remote Management will prevent them from being used with plug-ins." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ + + Value Name: DisableRunAs + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Disallow WinRM from storing RunAs credentials\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93429" + tag rid: "SV-103515r1_rule" + tag stig_id: "WN19-CC-000520" + tag fix_id: "F-99673r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service') do + it { should have_property 'DisableRunAs' } + its('DisableRunAs') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205811.rb b/controls/SV-205811.rb new file mode 100644 index 0000000..44d5733 --- /dev/null +++ b/controls/SV-205811.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205811" do + title "Windows Server 2019 User Account Control approval mode for the built-in Administrator must be enabled." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures the built-in Administrator account so that it runs in Admin Approval Mode." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: FilterAdministratorToken + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Admin Approval Mode for the Built-in Administrator account\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93431" + tag rid: "SV-103517r1_rule" + tag stig_id: "WN19-SO-000380" + tag fix_id: "F-99675r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'FilterAdministratorToken' } + its('FilterAdministratorToken') { should cmp == 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205812.rb b/controls/SV-205812.rb new file mode 100644 index 0000000..05c1895 --- /dev/null +++ b/controls/SV-205812.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205812" do + title "Windows Server 2019 User Account Control must automatically deny standard user requests for elevation." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting controls the behavior of elevation when requested by a standard user account." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: ConsentPromptBehaviorUser + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Behavior of the elevation prompt for standard users\" to \"Automatically deny elevation requests\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93433" + tag rid: "SV-103519r1_rule" + tag stig_id: "WN19-SO-000410" + tag fix_id: "F-99677r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'ConsentPromptBehaviorUser' } + its('ConsentPromptBehaviorUser') { should cmp == 0 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205813.rb b/controls/SV-205813.rb new file mode 100644 index 0000000..f3adf65 --- /dev/null +++ b/controls/SV-205813.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205813" do + title "Windows Server 2019 User Account Control must run all administrators in Admin Approval Mode, enabling UAC." + desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting enables UAC." + desc "rationale", "" + desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: EnableLUA + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Run all administrators in Admin Approval Mode\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000373-GPOS-00157" + tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] + tag gid: "V-93435" + tag rid: "SV-103521r1_rule" + tag stig_id: "WN19-SO-000440" + tag fix_id: "F-99679r1_fix" + tag cci: ["CCI-002038"] + tag nist: ["IA-11", "Rev_4"] + + os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip + + if os_type == 'False' + impact 0.0 + describe 'This system is a Server Core Installation, control is NA' do + skip 'This system is a Server Core Installation control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do + it { should have_property 'EnableLUA' } + its('EnableLUA') { should cmp == 1 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205814.rb b/controls/SV-205814.rb new file mode 100644 index 0000000..c9435fc --- /dev/null +++ b/controls/SV-205814.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205814" do + title "Windows Server 2019 must restrict unauthenticated Remote Procedure Call (RPC) clients from connecting to the RPC server on domain-joined member servers and standalone systems." + desc "Unauthenticated RPC clients may allow anonymous access to sensitive information. Configuring RPC to restrict unauthenticated RPC clients from connecting to the RPC server will prevent anonymous connections." + desc "rationale", "" + desc "check", "This applies to member servers and standalone systems, it is NA for domain controllers. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Rpc\\ + + Value Name: RestrictRemoteClients + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Remote Procedure Call >> \"Restrict Unauthenticated RPC clients\" to \"Enabled\" with \"Authenticated\" selected." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000379-GPOS-00164" + tag gid: "V-93453" + tag rid: "SV-103539r1_rule" + tag stig_id: "WN19-MS-000040" + tag fix_id: "F-99697r1_fix" + tag cci: ["CCI-001967"] + tag nist: ["IA-3 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Rpc') do + it { should have_property 'RestrictRemoteClients' } + its('RestrictRemoteClients') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205815.rb b/controls/SV-205815.rb new file mode 100644 index 0000000..fc7d59b --- /dev/null +++ b/controls/SV-205815.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205815" do + title "Windows Server 2019 computer account password must not be prevented from being reset." + desc "Computer account passwords are changed automatically on a regular basis. Disabling automatic password changes can make the system more vulnerable to malicious access. Frequent password changes can be a significant safeguard for the system. A new password for the computer account will be generated every 30 days." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: DisablePasswordChange + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Disable machine account password changes\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000379-GPOS-00164" + tag gid: "V-93455" + tag rid: "SV-103541r1_rule" + tag stig_id: "WN19-SO-000090" + tag fix_id: "F-99699r1_fix" + tag cci: ["CCI-001967"] + tag nist: ["IA-3 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'DisablePasswordChange' } + its('DisablePasswordChange') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205816.rb b/controls/SV-205816.rb new file mode 100644 index 0000000..00b1297 --- /dev/null +++ b/controls/SV-205816.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205816" do + title "Windows Server 2019 Windows Remote Management (WinRM) client must not allow unencrypted traffic." + desc "Unencrypted remote access to a system can allow sensitive information to be compromised. Windows remote management connections must be encrypted to prevent this." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ + + Value Name: AllowUnencryptedTraffic + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Allow unencrypted traffic\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000393-GPOS-00173" + tag satisfies: ["SRG-OS-000393-GPOS-00173", "SRG-OS-000394-GPOS-00174"] + tag gid: "V-93499" + tag rid: "SV-103585r1_rule" + tag stig_id: "WN19-CC-000480" + tag fix_id: "F-99743r1_fix" + tag cci: ["CCI-002890", "CCI-003123"] + tag nist: ["MA-4 (6)", "MA-4 (6)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do + it { should have_property 'AllowUnencryptedTraffic' } + its('AllowUnencryptedTraffic') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205817.rb b/controls/SV-205817.rb new file mode 100644 index 0000000..14fc124 --- /dev/null +++ b/controls/SV-205817.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205817" do + title "Windows Server 2019 Windows Remote Management (WinRM) service must not allow unencrypted traffic." + desc "Unencrypted remote access to a system can allow sensitive information to be compromised. Windows remote management connections must be encrypted to prevent this." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ + + Value Name: AllowUnencryptedTraffic + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Allow unencrypted traffic\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000393-GPOS-00173" + tag satisfies: ["SRG-OS-000393-GPOS-00173", "SRG-OS-000394-GPOS-00174"] + tag gid: "V-93501" + tag rid: "SV-103587r1_rule" + tag stig_id: "WN19-CC-000510" + tag fix_id: "F-99745r1_fix" + tag cci: ["CCI-002890", "CCI-003123"] + tag nist: ["MA-4 (6)", "MA-4 (6)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Service') do + it { should have_property 'AllowUnencryptedTraffic' } + its('AllowUnencryptedTraffic') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205818.rb b/controls/SV-205818.rb new file mode 100644 index 0000000..2bd02b0 --- /dev/null +++ b/controls/SV-205818.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205818" do + title "Windows Server 2019 must use separate, NSA-approved (Type 1) cryptography to protect the directory data in transit for directory service implementations at a classified confidentiality level when replication data traverses a network cleared to a lower level than the data." + desc "Directory data that is not appropriately encrypted is subject to compromise. Commercial-grade encryption does not provide adequate protection when the classification level of directory data in transit is higher than the level of the network." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + Review the organization network diagram(s) or documentation to determine the level of classification for the network(s) over which replication data is transmitted. + + Determine the classification level of the Windows domain controller. + + If the classification level of the Windows domain controller is higher than the level of the networks, review the organization network diagram(s) and directory implementation documentation to determine if NSA-approved encryption is used to protect the replication network traffic. + + If the classification level of the Windows domain controller is higher than the level of the network traversed and NSA-approved encryption is not used, this is a finding." + desc "fix", "Configure NSA-approved (Type 1) cryptography to protect the directory data in transit for directory service implementations at a classified confidentiality level that transfer replication data through a network cleared to a lower level than the data." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000396-GPOS-00176" + tag gid: "V-93513" + tag rid: "SV-103599r1_rule" + tag stig_id: "WN19-DC-000140" + tag fix_id: "F-99757r1_fix" + tag cci: ["CCI-002450"] + tag nist: ["SC-13", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe "Separate, NSA-approved (Type 1) cryptography must be used to protect + the directory data in transit for directory service implementations at a + classified confidentiality level when replication data traverses a network + cleared to a lower level than the data." do + skip "Separate, NSA-approved (Type 1) cryptography must be used to protect + the directory data in transit for directory service implementations at a + classified confidentiality level when replication data traverses a network + cleared to a lower level than the data is a manual check" + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end \ No newline at end of file diff --git a/controls/SV-205819.rb b/controls/SV-205819.rb new file mode 100644 index 0000000..6acadf9 --- /dev/null +++ b/controls/SV-205819.rb @@ -0,0 +1,32 @@ +# encoding: UTF-8 + +control "SV-205819" do + title "Windows Server 2019 must be configured to ignore NetBIOS name release requests except from WINS servers." + desc "Configuring the system to ignore name release requests, except from WINS servers, prevents a denial of service (DoS) attack. The DoS consists of sending a NetBIOS name release request to the server for each entry in the server's cache, causing a response delay in the normal operation of the server's WINS resolution capability." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\\ + + Value Name: NoNameReleaseOnDemand + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MSS (Legacy) >> \"MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers\" to \"Enabled\". + This policy setting requires the installation of the MSS-Legacy custom templates included with the STIG package. \"MSS-Legacy.admx\" and \"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.3 + tag severity: nil + tag gtitle: "SRG-OS-000420-GPOS-00186" + tag gid: "V-93541" + tag rid: "SV-103627r1_rule" + tag stig_id: "WN19-CC-000060" + tag fix_id: "F-99785r1_fix" + tag cci: ["CCI-002385"] + tag nist: ["SC-5", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netbt\\Parameters') do + it { should have_property 'NoNameReleaseOnDemand' } + its('NoNameReleaseOnDemand') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205820.rb b/controls/SV-205820.rb new file mode 100644 index 0000000..2abc13c --- /dev/null +++ b/controls/SV-205820.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205820" do + title "Windows Server 2019 domain controllers must require LDAP access signing." + desc "Unsigned network traffic is susceptible to man-in-the-middle attacks, where an intruder captures packets between the server and the client and modifies them before forwarding them to the client. In the case of an LDAP server, this means that an attacker could cause a client to make decisions based on false records from the LDAP directory. The risk of an attacker pulling this off can be decreased by implementing strong physical security measures to protect the network infrastructure. Furthermore, implementing Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for Internet Protocol (IP) traffic, can make all types of man-in-the-middle attacks extremely difficult." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\\ + + Value Name: LDAPServerIntegrity + + Value Type: REG_DWORD + Value: 0x00000002 (2)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain controller: LDAP server signing requirements\" to \"Require signing\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93545" + tag rid: "SV-103631r1_rule" + tag stig_id: "WN19-DC-000320" + tag fix_id: "F-99789r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters') do + it { should have_property 'LDAPServerIntegrity' } + its('LDAPServerIntegrity') { should cmp 2 } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205821.rb b/controls/SV-205821.rb new file mode 100644 index 0000000..5966cd1 --- /dev/null +++ b/controls/SV-205821.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205821" do + title "Windows Server 2019 setting Domain member: Digitally encrypt or sign secure channel data (always) must be configured to Enabled." + desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but not all information is encrypted. If this policy is enabled, outgoing secure channel traffic will be encrypted and signed." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: RequireSignOrSeal + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally encrypt or sign secure channel data (always)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93547" + tag rid: "SV-103633r1_rule" + tag stig_id: "WN19-SO-000060" + tag fix_id: "F-99791r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'RequireSignOrSeal' } + its('RequireSignOrSeal') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205822.rb b/controls/SV-205822.rb new file mode 100644 index 0000000..dcd30a5 --- /dev/null +++ b/controls/SV-205822.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205822" do + title "Windows Server 2019 setting Domain member: Digitally encrypt secure channel data (when possible) must be configured to enabled." + desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but not all information is encrypted. If this policy is enabled, outgoing secure channel traffic will be encrypted." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: SealSecureChannel + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally encrypt secure channel data (when possible)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93549" + tag rid: "SV-103635r1_rule" + tag stig_id: "WN19-SO-000070" + tag fix_id: "F-99793r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'SealSecureChannel' } + its('SealSecureChannel') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205823.rb b/controls/SV-205823.rb new file mode 100644 index 0000000..772adf7 --- /dev/null +++ b/controls/SV-205823.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205823" do + title "Windows Server 2019 setting Domain member: Digitally sign secure channel data (when possible) must be configured to Enabled." + desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but the channel is not integrity checked. If this policy is enabled, outgoing secure channel traffic will be signed." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: SignSecureChannel + + Value Type: REG_DWORD + Value: 0x00000001 (1) " + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally sign secure channel data (when possible)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93551" + tag rid: "SV-103637r1_rule" + tag stig_id: "WN19-SO-000080" + tag fix_id: "F-99795r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'SignSecureChannel' } + its('SignSecureChannel') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205824.rb b/controls/SV-205824.rb new file mode 100644 index 0000000..0a63403 --- /dev/null +++ b/controls/SV-205824.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205824" do + title "Windows Server 2019 must be configured to require a strong session key." + desc "A computer connecting to a domain controller will establish a secure channel. The secure channel connection may be subject to compromise, such as hijacking or eavesdropping, if strong session keys are not used to establish the connection. Requiring strong session keys enforces 128-bit encryption between systems." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: RequireStrongKey + + Value Type: REG_DWORD + Value: 0x00000001 (1) + + This setting may prevent a system from being joined to a domain if not configured consistently between systems." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Require strong (Windows 2000 or Later) session key\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93553" + tag rid: "SV-103639r1_rule" + tag stig_id: "WN19-SO-000110" + tag fix_id: "F-99797r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'RequireStrongKey' } + its('RequireStrongKey') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205825.rb b/controls/SV-205825.rb new file mode 100644 index 0000000..ce7c104 --- /dev/null +++ b/controls/SV-205825.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205825" do + title "Windows Server 2019 setting Microsoft network client: Digitally sign communications (always) must be configured to Enabled." + desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB client will only communicate with an SMB server that performs SMB packet signing." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ + + Value Name: RequireSecuritySignature + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network client: Digitally sign communications (always)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93555" + tag rid: "SV-103641r1_rule" + tag stig_id: "WN19-SO-000160" + tag fix_id: "F-99799r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do + it { should have_property 'RequireSecuritySignature' } + its('RequireSecuritySignature') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205826.rb b/controls/SV-205826.rb new file mode 100644 index 0000000..2cc9ddb --- /dev/null +++ b/controls/SV-205826.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205826" do + title "Windows Server 2019 setting Microsoft network client: Digitally sign communications (if server agrees) must be configured to Enabled." + desc "The server message block (SMB) protocol provides the basis for many network operations. If this policy is enabled, the SMB client will request packet signing when communicating with an SMB server that is enabled or required to perform SMB packet signing." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ + + Value Name: EnableSecuritySignature + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network client: Digitally sign communications (if server agrees)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93557" + tag rid: "SV-103643r1_rule" + tag stig_id: "WN19-SO-000170" + tag fix_id: "F-99801r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do + it { should have_property 'EnableSecuritySignature' } + its('EnableSecuritySignature') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205827.rb b/controls/SV-205827.rb new file mode 100644 index 0000000..3f9de3e --- /dev/null +++ b/controls/SV-205827.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205827" do + title "Windows Server 2019 setting Microsoft network server: Digitally sign communications (always) must be configured to Enabled." + desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB server will only communicate with an SMB client that performs SMB packet signing." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ + + Value Name: RequireSecuritySignature + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network server: Digitally sign communications (always)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93559" + tag rid: "SV-103645r1_rule" + tag stig_id: "WN19-SO-000190" + tag fix_id: "F-99803r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do + it { should have_property 'RequireSecuritySignature' } + its('RequireSecuritySignature') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205828.rb b/controls/SV-205828.rb new file mode 100644 index 0000000..1514063 --- /dev/null +++ b/controls/SV-205828.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205828" do + title "Windows Server 2019 setting Microsoft network server: Digitally sign communications (if client agrees) must be configured to Enabled." + desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB server will negotiate SMB packet signing as requested by the client." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ + + Value Name: EnableSecuritySignature + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network server: Digitally sign communications (if client agrees)\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000423-GPOS-00187" + tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] + tag gid: "V-93561" + tag rid: "SV-103647r1_rule" + tag stig_id: "WN19-SO-000200" + tag fix_id: "F-99805r1_fix" + tag cci: ["CCI-002418", "CCI-002421"] + tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do + it { should have_property 'EnableSecuritySignature' } + its('EnableSecuritySignature') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205829.rb b/controls/SV-205829.rb new file mode 100644 index 0000000..33db469 --- /dev/null +++ b/controls/SV-205829.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205829" do + title "Windows Server 2019 must implement protection methods such as TLS, encrypted VPNs, or IPsec if the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process." + desc "Information can be either unintentionally or maliciously disclosed or modified during preparation for transmission, for example, during aggregation, at protocol transformation points, and during packing/unpacking. These unauthorized disclosures or modifications compromise the confidentiality or integrity of the information. + Ensuring the confidentiality of transmitted information requires the operating system to take measures in preparing information for transmission. + This can be accomplished via access control and encryption. + Use of this requirement will be limited to situations where the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process. When transmitting data, operating systems need to support transmission protection mechanisms such as TLS, encrypted VPNs, or IPsec." + desc "rationale", "" + desc "check", "If the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process, verify protection methods such as TLS, encrypted VPNs, or IPsec have been implemented. + If protection methods have not been implemented, this is a finding." + desc "fix", "Configure protection methods such as TLS, encrypted VPNs, or IPsec when the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000425-GPOS-00189" + tag satisfies: ["SRG-OS-000425-GPOS-00189", "SRG-OS-000426-GPOS-00190"] + tag gid: "V-93543" + tag rid: "SV-103629r1_rule" + tag stig_id: "WN19-00-000260" + tag fix_id: "F-99787r1_fix" + tag cci: ["CCI-002420", "CCI-002422"] + tag nist: ["SC-8 (2)", "SC-8 (2)", "Rev_4"] + + describe "A manual review is required to ensure protection methods such as TLS, encrypted VPNs, or IPSEC are + implemented if the data owner has a strict requirement for ensuring data + integrity and confidentiality is maintained at every step of the data transfer + and handling process." do + skip 'A manual review is required to ensure the operating system employs a deny-all, permit-by-exception + policy to allow the execution of authorized software programs' + end +end \ No newline at end of file diff --git a/controls/SV-205830.rb b/controls/SV-205830.rb new file mode 100644 index 0000000..8ec23b1 --- /dev/null +++ b/controls/SV-205830.rb @@ -0,0 +1,39 @@ +# encoding: UTF-8 + +control "SV-205830" do + title "Windows Server 2019 Explorer Data Execution Prevention must be enabled." + desc "Data Execution Prevention provides additional protection by performing checks on memory to help prevent malicious code from running. This setting will prevent Data Execution Prevention from being turned off for File Explorer." + desc "rationale", "" + desc "check", "The default behavior is for Data Execution Prevention to be turned on for File Explorer. + If the registry value name below does not exist, this is not a finding. + If it exists and is configured with a value of \"0\", this is not a finding. + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ + + Value Name: NoDataExecutionPrevention + + Value Type: REG_DWORD + Value: 0x00000000 (0) (or if the Value Name does not exist)" + desc "fix", "The default behavior is for data execution prevention to be turned on for File Explorer. If this needs to be corrected, configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> File Explorer >> \"Turn off Data Execution Prevention for Explorer\" to \"Not Configured\" or \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000433-GPOS-00192" + tag gid: "V-93563" + tag rid: "SV-103649r1_rule" + tag stig_id: "WN19-CC-000310" + tag fix_id: "F-99807r1_fix" + tag cci: ["CCI-002824"] + tag nist: ["SI-16", "Rev_4"] + + if registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer').has_property?('NoDataExecutionPrevention') + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do + its('NoDataExecutionPrevention') { should cmp 0 } + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do + it { should_not have_property 'NoDataExecutionPrevention' } + end + end +end \ No newline at end of file diff --git a/controls/SV-205832.rb b/controls/SV-205832.rb new file mode 100644 index 0000000..b3b6604 --- /dev/null +++ b/controls/SV-205832.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205832" do + title "Windows Server 2019 must be configured to audit Account Logon - +Credential Validation successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Credential Validation records events related to validation tests on +credentials for a user account logon." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Logon >> Credential Validation - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Logon >> \"Audit Credential Validation\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'gid': 'V-93153' + tag 'rid': 'SV-103241r1_rule' + tag 'stig_id': 'WN19-AU-000070' + tag 'fix_id': 'F-99399r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Credential Validation') { should eq 'Success' } + end + describe audit_policy do + its('Credential Validation') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205833.rb b/controls/SV-205833.rb new file mode 100644 index 0000000..0be8d06 --- /dev/null +++ b/controls/SV-205833.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205833" do + title "Windows Server 2019 must be configured to audit Account Logon - +Credential Validation failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Credential Validation records events related to validation tests on +credentials for a user account logon." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Account Logon >> Credential Validation - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Account Logon >> \"Audit Credential Validation\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'gid': 'V-93155' + tag 'rid': 'SV-103243r1_rule' + tag 'stig_id': 'WN19-AU-000080' + tag 'fix_id': 'F-99401r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Credential Validation') { should eq 'Failure' } + end + describe audit_policy do + its('Credential Validation') { should eq 'Success and Failure' } + end + end + +end + diff --git a/controls/SV-205834.rb b/controls/SV-205834.rb new file mode 100644 index 0000000..d8c50d5 --- /dev/null +++ b/controls/SV-205834.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205834" do + title "Windows Server 2019 must be configured to audit Logon/Logoff - Group +Membership successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Audit Group Membership records information related to the group membership +of a user's logon token." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Group Membership - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Advanced Audit Policy Configuration >> System Audit +Policies >> Logon/Logoff >> \"Audit Group Membership\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'gid': 'V-93159' + tag 'rid': 'SV-103247r1_rule' + tag 'stig_id': 'WN19-AU-000170' + tag 'fix_id': 'F-99405r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Group Membership') { should eq 'Success' } + end + describe audit_policy do + its('Group Membership') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205835.rb b/controls/SV-205835.rb new file mode 100644 index 0000000..ee6cd4f --- /dev/null +++ b/controls/SV-205835.rb @@ -0,0 +1,58 @@ +# encoding: UTF-8 + +control "SV-205835" do + title "Windows Server 2019 must be configured to audit Logon/Logoff - Special +Logon successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Special Logon records special logons that have administrative privileges +and can be used to elevate processes." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Special Logon - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Logon/Logoff >> \"Audit Special Logon\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'satisfies': ["SRG-OS-000470-GPOS-00214", "SRG-OS-000472-GPOS-00217", +"SRG-OS-000473-GPOS-00218", "SRG-OS-000475-GPOS-00220"] + tag 'gid': 'V-93161' + tag 'rid': 'SV-103249r1_rule' + tag 'stig_id': 'WN19-AU-000210' + tag 'fix_id': 'F-99407r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Special Logon') { should eq 'Success' } + end + describe audit_policy do + its('Special Logon') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205836.rb b/controls/SV-205836.rb new file mode 100644 index 0000000..9d43426 --- /dev/null +++ b/controls/SV-205836.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205836" do + title "Windows Server 2019 must be configured to audit Object Access - Other +Object Access Events successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Auditing for other object access records events related to the management +of task scheduler jobs and COM+ objects." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Object Access >> Other Object Access Events - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Object Access >> \"Audit Other Object Access Events\" +with \"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'gid': 'V-93163' + tag 'rid': 'SV-103251r1_rule' + tag 'stig_id': 'WN19-AU-000220' + tag 'fix_id': 'F-99409r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Other Object Access Events') { should eq 'Success' } + end + describe audit_policy do + its('Other Object Access Events') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205837.rb b/controls/SV-205837.rb new file mode 100644 index 0000000..5b40650 --- /dev/null +++ b/controls/SV-205837.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205837" do + title "Windows Server 2019 must be configured to audit Object Access - Other +Object Access Events failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Auditing for other object access records events related to the management +of task scheduler jobs and COM+ objects." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Object Access >> Other Object Access Events - Failure" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Object Access >> \"Audit Other Object Access Events\" +with \"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000470-GPOS-00214' + tag 'gid': 'V-93165' + tag 'rid': 'SV-103253r1_rule' + tag 'stig_id': 'WN19-AU-000230' + tag 'fix_id': 'F-99411r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Other Object Access Events') { should eq 'Failure' } + end + describe audit_policy do + its('Other Object Access Events') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205838.rb b/controls/SV-205838.rb new file mode 100644 index 0000000..e808c82 --- /dev/null +++ b/controls/SV-205838.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205838" do + title "Windows Server 2019 must be configured to audit logoff successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Logoff records user logoffs. If this is an interactive logoff, it is +recorded on the local system. If it is to a network share, it is recorded on +the system accessed." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Logon/Logoff >> Logoff - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Logon/Logoff >> \"Audit Logoff\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000472-GPOS-00217' + tag 'satisfies': ["SRG-OS-000472-GPOS-00217", "SRG-OS-000480-GPOS-00227"] + tag 'gid': 'V-93171' + tag 'rid': 'SV-103259r1_rule' + tag 'stig_id': 'WN19-AU-000180' + tag 'fix_id': 'F-99417r1_fix' + tag 'cci': ["CCI-000172", "CCI-000366"] + tag 'nist': ["AU-12 c", "CM-6 b", "Rev_4"] + + describe.one do + describe audit_policy do + its('Logoff') { should eq 'Success' } + end + describe audit_policy do + its('Logoff') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205839.rb b/controls/SV-205839.rb new file mode 100644 index 0000000..e81d908 --- /dev/null +++ b/controls/SV-205839.rb @@ -0,0 +1,62 @@ +# encoding: UTF-8 + +control "SV-205839" do + title "Windows Server 2019 must be configured to audit Detailed Tracking - +Plug and Play Events successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Plug and Play activity records events related to the successful connection +of external devices." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Detailed Tracking >> Plug and Play Events - Success" + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Advanced Audit Policy Configuration >> System Audit +Policies >> Detailed Tracking >> \"Audit PNP Activity\" with \"Success\" +selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000474-GPOS-00219' + tag 'gid': 'V-93157' + tag 'rid': 'SV-103245r1_rule' + tag 'stig_id': 'WN19-AU-000130' + tag 'fix_id': 'F-99403r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Plug and Play Events') { should eq 'Success' } + end + describe audit_policy do + its('Plug and Play Events') { should eq 'Success and Failure' } + end + describe command("AuditPol /get /category:* | Findstr /c:'Plug and Play Events'") do + its('stdout') { should match /Plug and Play Events Success/ } + end + describe command("AuditPol /get /category:* | Findstr /c:'Plug and Play Events'") do + its('stdout') { should match /Plug and Play Events Success and Failure/ } + end + end +end + diff --git a/controls/SV-205840.rb b/controls/SV-205840.rb new file mode 100644 index 0000000..077063c --- /dev/null +++ b/controls/SV-205840.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205840" do + title "Windows Server 2019 must be configured to audit Object Access - +Removable Storage successes." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Removable Storage auditing under Object Access records events related to +access attempts on file system objects on removable storage devices." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Object Access >> Removable Storage - Success + + Virtual machines or systems that use network attached storage may generate +excessive audit events for secondary virtual drives or the network attached +storage when this setting is enabled. This may be set to Not Configured in such +cases and would not be a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Object Access >> \"Audit Removable Storage\" with +\"Success\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000474-GPOS-00219' + tag 'gid': 'V-93167' + tag 'rid': 'SV-103255r1_rule' + tag 'stig_id': 'WN19-AU-000240' + tag 'fix_id': 'F-99413r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Removable Storage') { should eq 'Success' } + end + describe audit_policy do + its('Removable Storage') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205841.rb b/controls/SV-205841.rb new file mode 100644 index 0000000..d4461a1 --- /dev/null +++ b/controls/SV-205841.rb @@ -0,0 +1,61 @@ +# encoding: UTF-8 + +control "SV-205841" do + title "Windows Server 2019 must be configured to audit Object Access - +Removable Storage failures." + desc "Maintaining an audit trail of system activity logs can help identify +configuration errors, troubleshoot service disruptions, and analyze compromises +that have occurred, as well as detect attacks. Audit logs are necessary to +provide a trail of evidence in case the system or network is compromised. +Collecting this data is essential for analyzing the security of information +assets and detecting signs of suspicious and unexpected behavior. + + Removable Storage auditing under Object Access records events related to +access attempts on file system objects on removable storage devices." + desc "rationale", "" + desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows +Vista or later) to override audit policy category settings\" must be set to +\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be +effective. + + Use the \"AuditPol\" tool to review the current Audit Policy configuration: + + Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run +as administrator\"). + + Enter \"AuditPol /get /category:*\" + + Compare the \"AuditPol\" settings with the following: + + If the system does not audit the following, this is a finding. + + Object Access >> Removable Storage - Failure + + Virtual machines or systems that use network attached storage may generate +excessive audit events for secondary virtual drives or the network attached +storage when this setting is enabled. This may be set to Not Configured in such +cases and would not be a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> +Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> +System Audit Policies >> Object Access >> \"Audit Removable Storage\" with +\"Failure\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000474-GPOS-00219' + tag 'gid': 'V-93169' + tag 'rid': 'SV-103257r1_rule' + tag 'stig_id': 'WN19-AU-000250' + tag 'fix_id': 'F-99415r1_fix' + tag 'cci': ["CCI-000172"] + tag 'nist': ["AU-12 c", "Rev_4"] + + describe.one do + describe audit_policy do + its('Removable Storage') { should eq 'Failure' } + end + describe audit_policy do + its('Removable Storage') { should eq 'Success and Failure' } + end + end +end + diff --git a/controls/SV-205842.rb b/controls/SV-205842.rb new file mode 100644 index 0000000..61acf53 --- /dev/null +++ b/controls/SV-205842.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205842" do + title "Windows Server 2019 must be configured to use FIPS-compliant algorithms for encryption, hashing, and signing." + desc "This setting ensures the system uses algorithms that are FIPS-compliant for encryption, hashing, and signing. FIPS-compliant algorithms meet specific standards established by the U.S. Government and must be the algorithms used for all OS encryption functions." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy\\ + + Value Name: Enabled + + Value Type: REG_DWORD + Value: 0x00000001 (1) + + Clients with this setting enabled will not be able to communicate via digitally encrypted or signed protocols with servers that do not support these algorithms. Both the browser and web server must be configured to use TLS; otherwise. the browser will not be able to connect to a secure site." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000478-GPOS-00223" + tag gid: "V-93511" + tag rid: "SV-103597r1_rule" + tag stig_id: "WN19-SO-000360" + tag fix_id: "F-99755r1_fix" + tag cci: ["CCI-002450"] + tag nist: ["SC-13", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy') do + it { should have_property 'Enabled' } + its('Enabled') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205843.rb b/controls/SV-205843.rb new file mode 100644 index 0000000..8231ad2 --- /dev/null +++ b/controls/SV-205843.rb @@ -0,0 +1,30 @@ +# encoding: UTF-8 + +control "SV-205843" do + title "Windows Server 2019 must, at a minimum, off-load audit records of +interconnected systems in real time and off-load standalone systems weekly." + desc "Protection of log data includes assuring the log data is not +accidentally lost or deleted. Audit information stored in one location is +vulnerable to accidental or incidental deletion or alteration." + desc "rationale", "" + desc 'check', "Verify the audit records, at a minimum, are off-loaded for interconnected +systems in real time and off-loaded for standalone systems weekly. + + If they are not, this is a finding." + desc 'fix', "Configure the system to, at a minimum, off-load audit records +of interconnected systems in real time and off-load standalone systems weekly." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000479-GPOS-00224' + tag 'gid': 'V-93185' + tag 'rid': 'SV-103273r1_rule' + tag 'stig_id': 'WN19-AU-000020' + tag 'fix_id': 'F-99431r1_fix' + tag 'cci': ["CCI-001851"] + tag 'nist': ["AU-4 (1)", "Rev_4"] + + describe "A manual review is required to verify the operating system is, at a minimum, off-loading audit records of interconnected systems in real time and off-loading standalone systems weekly" do + skip "A manual review is required to verify the operating system is, at a minimum, off-loading audit records of interconnected systems in real time and off-loading standalone systems weekly" + end +end + diff --git a/controls/SV-205844.rb b/controls/SV-205844.rb new file mode 100644 index 0000000..d94a58c --- /dev/null +++ b/controls/SV-205844.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205844" do + title "Windows Server 2019 users with Administrative privileges must have separate accounts for administrative duties and normal operational tasks." + desc "Using a privileged account to perform routine functions makes the computer vulnerable to malicious software inadvertently introduced during a session that has been granted full privileges." + desc "rationale", "" + desc "check", "Verify each user with administrative privileges has been assigned a unique administrative account separate from their standard user account. + If users with administrative privileges do not have separate accounts for administrative functions and standard user functions, this is a finding." + desc "fix", "Ensure each user with administrative privileges has a separate account for user duties and one for privileged duties." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93369" + tag rid: "SV-103457r1_rule" + tag stig_id: "WN19-00-000010" + tag fix_id: "F-99615r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + administrators = input('administrators') + administrator_group = command("net localgroup Administrators | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") + administrator_group.each do |user| + describe user.to_s do + it { should be_in administrators } + end + end + if administrator_group.empty? + impact 0.0 + describe 'There are no users with administrative privileges' do + skip 'There are no users with administrative privileges so this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205845.rb b/controls/SV-205845.rb new file mode 100644 index 0000000..fc2c8c3 --- /dev/null +++ b/controls/SV-205845.rb @@ -0,0 +1,54 @@ +# encoding: UTF-8 + +control "SV-205845" do + title "Windows Server 2019 administrative accounts must not be used with +applications that access the Internet, such as web browsers, or with potential +Internet sources, such as email." + desc "Using applications that access the Internet or have potential Internet +sources using administrative privileges exposes a system to compromise. If a +flaw in an application is exploited while running as a privileged user, the +entire system could be compromised. Web browsers and email are common attack +vectors for introducing malicious code and must not be run with an +administrative account. + + Since administrative accounts may generally change or work around technical +restrictions for running a web browser or other applications, it is essential +that policy require administrative accounts to not access the Internet or use +applications such as email. + + The policy should define specific exceptions for local service +administration. These exceptions may include HTTP(S)-based tools that are used +for the administration of the local system, services, or attached devices. + + Whitelisting can be used to enforce the policy to ensure compliance." + desc "rationale", "" + desc 'check', "Determine whether organization policy, at a minimum, prohibits +administrative accounts from using applications that access the Internet, such +as web browsers, or with potential Internet sources, such as email, except as +necessary for local service administration. + + If it does not, this is a finding. + + The organization may use technical means such as whitelisting to prevent +the use of browsers and mail applications to enforce this requirement." + desc 'fix', "Establish a policy, at minimum, to prohibit administrative accounts from +using applications that access the Internet, such as web browsers, or with +potential Internet sources, such as email. Ensure the policy is enforced. + + The organization may use technical means such as whitelisting to prevent +the use of browsers and mail applications to enforce this requirement." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93205' + tag 'rid': 'SV-103293r1_rule' + tag 'stig_id': 'WN19-00-000030' + tag 'fix_id': 'F-99451r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe "A manual review is required to verify that administrative accounts are not being used with applications that access the Internet, such as web browsers, or with potential Internet sources, such as email" do + skip "A manual review is required to verify that administrative accounts are not being used with applications that access the Internet, such as web browsers, or with potential Internet sources, such as email" + end +end + diff --git a/controls/SV-205846.rb b/controls/SV-205846.rb new file mode 100644 index 0000000..f440e11 --- /dev/null +++ b/controls/SV-205846.rb @@ -0,0 +1,46 @@ +# encoding: UTF-8 + +control "SV-205846" do + title "Windows Server 2019 members of the Backup Operators group must have +separate accounts for backup duties and normal operational tasks." + desc "Backup Operators are able to read and write to any file in the system, +regardless of the rights assigned to it. Backup and restore rights permit users +to circumvent the file access restrictions present on NTFS disk drives for +backup and restore purposes. Members of the Backup Operators group must have +separate logon accounts for performing backup duties." + desc "rationale", "" + desc 'check', "If no accounts are members of the Backup Operators group, this is NA. + + Verify users with accounts in the Backup Operators group have a separate +user account for backup functions and for performing normal user tasks. + + If users with accounts in the Backup Operators group do not have separate +accounts for backup functions and standard user functions, this is a finding." + desc 'fix', "Ensure each member of the Backup Operators group has separate +accounts for backup functions and standard user functions." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93207' + tag 'rid': 'SV-103295r1_rule' + tag 'stig_id': 'WN19-00-000040' + tag 'fix_id': 'F-99453r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + backup_operators_group = command("net localgroup 'Backup Operators' | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") + backup_operators = input('backup_operators') + if backup_operators_group.empty? + impact 0.0 + describe 'Backup Operators Group Empty' do + skip 'The control is N/A as there are no users in the Backup Operators group' + end + else + backup_operators_group.each do |user| + describe user do + it { should be_in backup_operators } + end + end + end +end + diff --git a/controls/SV-205847.rb b/controls/SV-205847.rb new file mode 100644 index 0000000..732324b --- /dev/null +++ b/controls/SV-205847.rb @@ -0,0 +1,76 @@ +# encoding: UTF-8 + +control "SV-205847" do + title "Windows Server 2019 manually managed application account passwords must be changed at least every #{input('app_password_age')} days or when a system administrator with knowledge of the password leaves the organization." + desc "Setting application account passwords to expire may cause applications to stop functioning. However, not changing them on a regular basis exposes them to attack. If managed service accounts are used, this alleviates the need to manually change application account passwords." + desc "rationale", "" + desc 'check', "Determine if manually managed application/service accounts exist. If none exist, this is NA. + If passwords for manually managed application/service accounts are not changed at least every #{input('app_password_age')} days or when an administrator with knowledge of the password leaves the organization, this is a finding. + Identify manually managed application/service accounts. + To determine the date a password was last changed: + + Domain controllers: + Open \"PowerShell\". + Enter \"Get-AdUser -Identity [application account name] -Properties PasswordLastSet | FT Name, PasswordLastSet\", where [application account name] is the name of the manually managed application/service account. + If the \"PasswordLastSet\" date is more than #{input('app_password_age')} days old, this is a finding. + + Member servers and standalone systems: + Open \"Command Prompt\". + Enter 'Net User [application account name] | Find /i \"Password Last Set\"', where [application account name] is the name of the manually managed application/service account. + If the \"Password Last Set\" date is more than #{input('app_password_age')} days old, this is a finding." + desc 'fix', "Change passwords for manually managed application/service accounts at least every #{input('app_password_age')} days or when an administrator with knowledge of the password leaves the organization. + It is recommended that system-managed service accounts be used whenever possible." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93209' + tag 'rid': 'SV-103297r1_rule' + tag 'stig_id': 'WN19-00-000060' + tag 'fix_id': 'F-99455r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + application_accounts_domain = input('application_accounts_domain') + application_accounts_local = input('application_accounts_local') + app_password_age = input('app_password_age') + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + if application_accounts_domain.empty? + impact 0.0 + describe 'There are no application accounts are listed for this control' do + skip 'This is not applicable since no application accounts are listed for this control' + end + else + application_accounts_domain.each do |user| + password_set_date = json({ command: "Get-ADUser -Identity #{user} -Properties PasswordLastSet | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-#{app_password_age})} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }).params + date = password_set_date['DateTime'] + describe 'Password Last Set' do + it "Date should not be more that #{app_password_age} days for Application Account: #{user} " do + failure_message = "Password Date is: #{date}" + expect(date).to be_nil, failure_message + end + end + end + end + else + if application_accounts_local.empty? + impact 0.0 + describe 'There are no application accounts are listed for this control' do + skip 'This is not applicable since no application accounts are listed for this control' + end + else + application_accounts_local.each do |user| + local_password_set_date = json({ command: "Get-LocalUser -name #{user} | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-#{app_password_age})} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }).params + date = local_password_set_date['DateTime'] + describe 'Password Last Set' do + it "Date should not be more that #{app_password_age} days for Application Account: #{user} " do + failure_message = "Password Date is: #{date}" + expect(date).to be_nil, failure_message + end + end + end + end + end +end diff --git a/controls/SV-205848.rb b/controls/SV-205848.rb new file mode 100644 index 0000000..5a499b5 --- /dev/null +++ b/controls/SV-205848.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205848" do + title "Windows Server 2019 domain-joined systems must have a Trusted Platform +Module (TPM) enabled and ready for use." + desc "Credential Guard uses virtualization-based security to protect data +that could be used in credential theft attacks if compromised. A number of +system requirements must be met in order for Credential Guard to be configured +and enabled properly. Without a TPM enabled and ready for use, Credential Guard +keys are stored in a less secure method using software." + desc "rationale", "" + desc 'check', "For standalone systems, this is NA. + + Current hardware and virtual environments may not support +virtualization-based security features, including Credential Guard, due to +specific supporting requirements including a TPM, UEFI with Secure Boot, and +the capability to run the Hyper-V feature within a virtual machine. + + Verify the system has a TPM and it is ready for use. + + Run \"tpm.msc\". + + Review the sections in the center pane. + + \"Status\" must indicate it has been configured with a message such as +\"The TPM is ready for use\" or \"The TPM is on and ownership has been taken\". + + TPM Manufacturer Information - Specific Version = 2.0 or 1.2 + + If a TPM is not found or is not ready for use, this is a finding." + desc 'fix', "Ensure domain-joined systems have a TPM that is configured for use. +(Versions 2.0 or 1.2 support Credential Guard.) + + The TPM must be enabled in the firmware. + + Run \"tpm.msc\" for configuration options in Windows." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93213' + tag 'rid': 'SV-103301r1_rule' + tag 'stig_id': 'WN19-00-000090' + tag 'fix_id': 'F-99459r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip + + if sys_info.manufacturer == "VMware, Inc." + impact 0.0 + describe 'This System is NA for Control V-93213, This is a VMware Virtual Machine.' do + skip 'This System is NA for Control V-93213, This is a VMware Virtual Machine.' + end + elsif is_domain == 'WORKGROUP' + impact 0.0 + describe 'This system is not joined to a domain, therefore this control is Not Applicable' do + skip 'This system is not joined to a domain, therefore this control is Not Applicable' + end + else + tpm_ready = command('Get-Tpm | select -expand TpmReady').stdout.strip + tpm_present = command('Get-Tpm | select -expand TpmPresent').stdout.strip + describe 'Trusted Platform Module (TPM) TpmReady' do + subject { tpm_ready } + it { should eq 'True' } + end + describe 'Trusted Platform Module (TPM) TpmPresent' do + subject { tpm_present } + it { should eq 'True' } + end + end +end + diff --git a/controls/SV-205849.rb b/controls/SV-205849.rb new file mode 100644 index 0000000..7d65795 --- /dev/null +++ b/controls/SV-205849.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205849" do + title "Windows Server 2019 must be maintained at a supported servicing level." + desc "Systems at unsupported servicing levels will not receive security +updates for new vulnerabilities, which leave them subject to exploitation. +Systems must be maintained at a servicing level supported by the vendor with +new security updates." + desc "rationale", "" + desc 'check', "Open \"Command Prompt\". + + Enter \"winver.exe\". + + If the \"About Windows\" dialog box does not display \"Microsoft Windows +Server Version 1809 (Build 17763.xxx)\" or greater, this is a finding. + + Preview versions must not be used in a production environment." + desc 'fix', "Update the system to a Version 1809 (Build 17763.xxx) or +greater." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93215' + tag 'rid': 'SV-103303r1_rule' + tag 'stig_id': 'WN19-00-000100' + tag 'fix_id': 'F-99461r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + releaseid = registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId + current_build_number = registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').CurrentBuildNumber + describe 'Microsoft Windows 2019 needs to be higher that release 1809' do + subject { releaseid } + it { should cmp >= 1809} + end + describe 'Microsoft Windows 2019 needs to be higher that build number 17763' do + subject { current_build_number } + it { should cmp >= 17763} + end +end + + diff --git a/controls/SV-205850.rb b/controls/SV-205850.rb new file mode 100644 index 0000000..7dd21ea --- /dev/null +++ b/controls/SV-205850.rb @@ -0,0 +1,40 @@ +# encoding: UTF-8 + +control "SV-205850" do + title "Windows Server 2019 must use an anti-virus program." + desc "Malicious software can establish a base on individual desktops and +servers. Employing an automated mechanism to detect this type of software will +aid in elimination of the software from the operating system." + desc "rationale", "" + desc 'check', "Verify an anti-virus solution is installed on the system. The anti-virus +solution may be bundled with an approved host-based security solution. + + If there is no anti-virus solution installed on the system, this is a +finding." + desc 'fix', "Install an anti-virus solution on the system." + impact 0.7 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93217' + tag 'rid': 'SV-103305r1_rule' + tag 'stig_id': 'WN19-00-000110' + tag 'fix_id': 'F-99463r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe windows_feature('Windows-Defender') do + it { should be_installed } + end + describe registry_key('HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion') do + it { should exist } + end + describe registry_key('HKLM\SOFTWARE\McAfee/DesktopProtection\szProductVer') do + it { should exist } + end + describe registry_key('HKLM\SOFTWARE\McAfee\Endpoint\AV') do + it { should exist } + it { should have_property 'ProductVersion' } + end + end +end diff --git a/controls/SV-205851.rb b/controls/SV-205851.rb new file mode 100644 index 0000000..b39e195 --- /dev/null +++ b/controls/SV-205851.rb @@ -0,0 +1,38 @@ +# encoding: UTF-8 + +control "SV-205851" do + title "Windows Server 2019 must have a host-based intrusion detection or +prevention system." + desc "A properly configured Host-based Intrusion Detection System (HIDS) or +Host-based Intrusion Prevention System (HIPS) provides another level of defense +against unauthorized access to critical servers. With proper configuration and +logging enabled, such a system can stop and/or alert for many attempts to gain +unauthorized access to resources." + desc "rationale", "" + desc 'check', "Determine whether there is a HIDS or HIPS on each server. + + If the HIPS component of HBSS is installed and active on the host and the +alerts of blocked activity are being logged and monitored, this meets the +requirement. + + A HIDS device is not required on a system that has the role as the Network +Intrusion Device (NID). However, this exception needs to be documented with the +ISSO. + + If a HIDS is not installed on the system, this is a finding." + desc 'fix', "Install a HIDS or HIPS on each server." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93219' + tag 'rid': 'SV-103307r1_rule' + tag 'stig_id': 'WN19-00-000120' + tag 'fix_id': 'F-99465r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe 'A manual review is required to determine whether this server has a host-based Intrusion Detection System installed' do + skip 'A manual review is required to determine whether this server has a host-based Intrusion Detection System installed' + end +end + diff --git a/controls/SV-205852.rb b/controls/SV-205852.rb new file mode 100644 index 0000000..1007c55 --- /dev/null +++ b/controls/SV-205852.rb @@ -0,0 +1,38 @@ +# encoding: UTF-8 + +control "SV-205852" do + title "Windows Server 2019 must have software certificate installation files +removed." + desc "Use of software certificates and their accompanying installation files +for end users to access resources is less secure than the use of hardware-based +certificates." + desc "rationale", "" + desc 'check', "Search all drives for *.p12 and *.pfx files. + + If any files with these extensions exist, this is a finding. + + This does not apply to server-based applications that have a requirement +for .p12 certificate files or Adobe PreFlight certificate files. Some +applications create files with extensions of .p12 that are not certificate +installation files. Removal of non-certificate installation files from systems +is not required. These must be documented with the ISSO." + desc 'fix', "Remove any certificate installation files (*.p12 and *.pfx) found on a +system. + + Note: This does not apply to server-based applications that have a +requirement for .p12 certificate files or Adobe PreFlight certificate files." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93221' + tag 'rid': 'SV-103309r2_rule' + tag 'stig_id': 'WN19-00-000240' + tag 'fix_id': 'F-101007r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe command('where /R c: *.p12 *.pfx') do + its('stdout') { should eq '' } + end +end + diff --git a/controls/SV-205853.rb b/controls/SV-205853.rb new file mode 100644 index 0000000..0975e3c --- /dev/null +++ b/controls/SV-205853.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205853" do + title "Windows Server 2019 FTP servers must be configured to prevent +anonymous logons." + desc "The FTP service allows remote users to access shared files and +directories. Allowing anonymous FTP connections makes user auditing difficult. + + Using accounts that have administrator privileges to log on to FTP risks +that the userid and password will be captured on the network and give +administrator access to an unauthorized user." + desc "rationale", "" + desc 'check', "If FTP is not installed on the system, this is NA. + + Open \"Internet Information Services (IIS) Manager\". + + Select the server. + + Double-click \"FTP Authentication\". + + If the \"Anonymous Authentication\" status is \"Enabled\", this is a +finding." + desc 'fix', "Configure the FTP service to prevent anonymous logons. + + Open \"Internet Information Services (IIS) Manager\". + + Select the server. + + Double-click \"FTP Authentication\". + + Select \"Anonymous Authentication\". + + Select \"Disabled\" under \"Actions\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93223' + tag 'rid': 'SV-103311r1_rule' + tag 'stig_id': 'WN19-00-000420' + tag 'fix_id': 'F-99469r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + is_ftp_installed = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip + if is_ftp_installed == 'False' + impact 0.0 + describe 'FTP is not installed' do + skip 'Control not applicable' + end + else + describe 'File Transfer Protocol (FTP) servers must be configured to prevent anonymous logons' do + skip 'is a manual check' + end + end +end + diff --git a/controls/SV-205854.rb b/controls/SV-205854.rb new file mode 100644 index 0000000..eca7ed0 --- /dev/null +++ b/controls/SV-205854.rb @@ -0,0 +1,49 @@ +# encoding: UTF-8 + +control "SV-205854" do + title "Windows Server 2019 FTP servers must be configured to prevent access +to the system drive." + desc "The FTP service allows remote users to access shared files and +directories that could provide access to system resources and compromise the +system, especially if the user can gain access to the root directory of the +boot drive." + desc "rationale", "" + desc 'check', "If FTP is not installed on the system, this is NA. + + Open \"Internet Information Services (IIS) Manager\". + + Select \"Sites\" under the server name. + + For any sites with a Binding that lists FTP, right-click the site and +select \"Explore\". + + If the site is not defined to a specific folder for shared FTP resources, +this is a finding. + + If the site includes any system areas such as root of the drive, Program +Files, or Windows directories, this is a finding." + desc 'fix', "Configure the FTP sites to allow access only to specific FTP +shared resources. Do not allow access to other areas of the system." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93225' + tag 'rid': 'SV-103313r1_rule' + tag 'stig_id': 'WN19-00-000430' + tag 'fix_id': 'F-99471r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + is_ftp_installed = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip + if is_ftp_installed == 'False' + impact 0.0 + describe 'FTP is not installed' do + skip 'Control not applicable' + end + else + describe 'Configure the FTP sites to allow access only to specific FTP shared resources. Do not allow access to other areas of the system.' do + skip 'Configure the FTP sites to allow access only to specific FTP shared resources. Do not allow access to other areas of the system.' + end + end +end + diff --git a/controls/SV-205855.rb b/controls/SV-205855.rb new file mode 100644 index 0000000..4987024 --- /dev/null +++ b/controls/SV-205855.rb @@ -0,0 +1,68 @@ +# encoding: UTF-8 + +control "SV-205855" do + title "Windows Server 2019 must have orphaned security identifiers (SIDs) +removed from user rights." + desc "Accounts or groups given rights on a system may show up as unresolved +SIDs for various reasons including deletion of the accounts or groups. If the +account or group objects are reanimated, there is a potential they may still +have rights no longer intended. Valid domain accounts or groups may also show +up as unresolved SIDs if a connection to the domain cannot be established for +some reason." + desc "rationale", "" + desc 'check', "Review the effective User Rights setting in Local Group Policy Editor. + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows +Settings >> Security Settings >> Local Policies >> User Rights Assignment. + + Review each User Right listed for any unresolved SIDs to determine whether +they are valid, such as due to being temporarily disconnected from the domain. +(Unresolved SIDs have the format that begins with \"*S-1-\".) + + If any unresolved SIDs exist and are not for currently valid accounts or +groups, this is a finding. + + For server core installations, run the following command: + + Secedit /export /areas USER_RIGHTS /cfg c:\\path\\UserRights.txt + + The results in the file identify user right assignments by SID instead of +group name. Review the SIDs for unidentified ones. A list of typical SIDs \\ +Groups is below, search Microsoft for articles on well-known SIDs for others. + + If any unresolved SIDs exist and are not for currently valid accounts or +groups, this is a finding. + + SID - Group + S-1-5-11 - Authenticated Users + S-1-5-113 - Local account + S-1-5-114 - Local account and member of Administrators group + S-1-5-19 - Local Service + S-1-5-20 - Network Service + S-1-5-32-544 - Administrators + S-1-5-32-546 - Guests + S-1-5-6 - Service + S-1-5-9 - Enterprise Domain Controllers + S-1-5-domain-512 - Domain Admins + S-1-5-root domain-519 - Enterprise Admins + S-1-5-80-3139157870-2983391045-3678747466-658725712-1809340420 - NT +Service\\WdiServiceHost" + desc 'fix', "Remove any unresolved SIDs found in User Rights assignments and +determined to not be for currently valid accounts or groups by removing the +accounts or groups from the appropriate group policy." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93227' + tag 'rid': 'SV-103315r1_rule' + tag 'stig_id': 'WN19-00-000450' + tag 'fix_id': 'F-99473r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe "A manual review is required to ensure orphaned security identifiers (SIDs) are removed from user rights on Windows Server 2019" do + skip 'A manual review is required to ensure orphaned security identifiers (SIDs) are removed from user rights on Windows Server 2019' + end + end + diff --git a/controls/SV-205856.rb b/controls/SV-205856.rb new file mode 100644 index 0000000..e67cc41 --- /dev/null +++ b/controls/SV-205856.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205856" do + title "Windows Server 2019 systems must have Unified Extensible Firmware +Interface (UEFI) firmware and be configured to run in UEFI mode, not Legacy +BIOS." + desc "UEFI provides additional security features in comparison to legacy +BIOS firmware, including Secure Boot. UEFI is required to support additional +security features in Windows, including Virtualization Based Security and +Credential Guard. Systems with UEFI that are operating in \"Legacy BIOS\" mode +will not support these security features." + desc "rationale", "" + desc 'check', "Some older systems may not have UEFI firmware. This is currently a CAT III; +it will be raised in severity at a future date when broad support of Windows +hardware and firmware requirements are expected to be met. Devices that have +UEFI firmware must run in \"UEFI\" mode. + + Verify the system firmware is configured to run in \"UEFI\" mode, not +\"Legacy BIOS\". + + Run \"System Information\". + + Under \"System Summary\", if \"BIOS Mode\" does not display \"UEFI\", this +is a finding." + desc 'fix', "Configure UEFI firmware to run in \"UEFI\" mode, not \"Legacy +BIOS\" mode." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93229' + tag 'rid': 'SV-103317r1_rule' + tag 'stig_id': 'WN19-00-000460' + tag 'fix_id': 'F-99475r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + uefi_boot = json( command: 'Confirm-SecureBootUEFI | ConvertTo-Json').params + describe 'Confirm-Secure Boot UEFI is required to be enabled on System' do + subject { uefi_boot } + it { should_not eq 'False' } + end +end + diff --git a/controls/SV-205857.rb b/controls/SV-205857.rb new file mode 100644 index 0000000..fca033a --- /dev/null +++ b/controls/SV-205857.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205857" do + title "Windows Server 2019 must have Secure Boot enabled." + desc "Secure Boot is a standard that ensures systems boot only to a trusted +operating system. Secure Boot is required to support additional security +features in Windows, including Virtualization Based Security and Credential +Guard. If Secure Boot is turned off, these security features will not function." + desc "rationale", "" + desc 'check', "Some older systems may not have UEFI firmware. This is currently a CAT III; +it will be raised in severity at a future date when broad support of Windows +hardware and firmware requirements are expected to be met. Devices that have +UEFI firmware must have Secure Boot enabled. + + Run \"System Information\". + + Under \"System Summary\", if \"Secure Boot State\" does not display \"On\", +this is a finding. + + On server core installations, run the following PowerShell command: + + Confirm-SecureBootUEFI + + If a value of \"True\" is not returned, this is a finding." + desc 'fix', "Enable Secure Boot in the system firmware." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93231' + tag 'rid': 'SV-103319r1_rule' + tag 'stig_id': 'WN19-00-000470' + tag 'fix_id': 'F-99477r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + uefi_boot = json( command: 'Confirm-SecureBootUEFI | ConvertTo-Json').params + describe 'Confirm-Secure Boot UEFI is required to be enabled on System' do + subject { uefi_boot } + it { should_not eq 'False' } + end +end + diff --git a/controls/SV-205858.rb b/controls/SV-205858.rb new file mode 100644 index 0000000..f607345 --- /dev/null +++ b/controls/SV-205858.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205858" do + title "Windows Server 2019 Internet Protocol version 6 (IPv6) source routing +must be configured to the highest protection level to prevent IP source +routing." + desc "Configuring the system to disable IPv6 source routing protects against +spoofing." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters\\ + + Value Name: DisableIPSourceRouting + + Type: REG_DWORD + Value: 0x00000002 (2)" + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative +Templates >> MSS (Legacy) >> \"MSS: (DisableIPSourceRouting IPv6) IP source +routing protection level (protects against packet spoofing)\" to \"Enabled\" +with \"Highest protection, source routing is completely disabled\" selected. + + This policy setting requires the installation of the MSS-Legacy custom +templates included with the STIG package. \"MSS-Legacy.admx\" and +\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and +\\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.3 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93233" + tag rid: "SV-103321r1_rule" + tag stig_id: "WN19-CC-000030" + tag fix_id: "F-99479r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters') do + it { should have_property 'DisableIPSourceRouting' } + its('DisableIPSourceRouting') { should cmp 2} + end +end + diff --git a/controls/SV-205859.rb b/controls/SV-205859.rb new file mode 100644 index 0000000..8223bcd --- /dev/null +++ b/controls/SV-205859.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205859" do + title "Windows Server 2019 source routing must be configured to the highest +protection level to prevent Internet Protocol (IP) source routing." + desc "Configuring the system to disable IP source routing protects against +spoofing." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ + + Value Name: DisableIPSourceRouting + + Value Type: REG_DWORD + Value: 0x00000002 (2)" + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative +Templates >> MSS (Legacy) >> \"MSS: (DisableIPSourceRouting) IP source routing +protection level (protects against packet spoofing)\" to \"Enabled\" with +\"Highest protection, source routing is completely disabled\" selected. + + This policy setting requires the installation of the MSS-Legacy custom +templates included with the STIG package. \"MSS-Legacy.admx\" and +\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and +\\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93235' + tag 'rid': 'SV-103323r1_rule' + tag 'stig_id': 'WN19-CC-000040' + tag 'fix_id': 'F-99481r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do + it { should have_property 'DisableIPSourceRouting' } + its('DisableIPSourceRouting') { should cmp 2} + end +end + diff --git a/controls/SV-205860.rb b/controls/SV-205860.rb new file mode 100644 index 0000000..469a703 --- /dev/null +++ b/controls/SV-205860.rb @@ -0,0 +1,44 @@ +# encoding: UTF-8 + +control "SV-205860" do + title "Windows Server 2019 must be configured to prevent Internet Control +Message Protocol (ICMP) redirects from overriding Open Shortest Path First +(OSPF)-generated routes." + desc "Allowing ICMP redirect of routes can lead to traffic not being routed +properly. When disabled, this forces ICMP to be routed via the shortest path +first." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ + + Value Name: EnableICMPRedirect + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative +Templates >> MSS (Legacy) >> \"MSS: (EnableICMPRedirect) Allow ICMP redirects +to override OSPF generated routes\" to \"Disabled\". + + This policy setting requires the installation of the MSS-Legacy custom +templates included with the STIG package. \"MSS-Legacy.admx\" and +\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and +\\Windows\\PolicyDefinitions\\en-US directories respectively." + impact 0.3 + tag severity: nil + tag gtitle: 'SRG-OS-000480-GPOS-00227' + tag gid: 'V-93237' + tag rid: 'SV-103325r1_rule' + tag stig_id: 'WN19-CC-000050' + tag fix_id: 'F-99483r1_fix' + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do + it { should have_property 'EnableICMPRedirect' } + its('EnableICMPRedirect') { should cmp 0} + end +end + diff --git a/controls/SV-205861.rb b/controls/SV-205861.rb new file mode 100644 index 0000000..f7e30b4 --- /dev/null +++ b/controls/SV-205861.rb @@ -0,0 +1,37 @@ +# encoding: UTF-8 + +control "SV-205861" do + title "Windows Server 2019 insecure logons to an SMB server must be disabled." + desc "Insecure guest logons allow unauthenticated access to shared folders. +Shared resources on a system must require authentication to establish proper +access." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\LanmanWorkstation\\ + + Value Name: AllowInsecureGuestAuth + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Network >> Lanman Workstation >> \"Enable insecure +guest logons\" to \"Disabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93239' + tag 'rid': 'SV-103327r1_rule' + tag 'stig_id': 'WN19-CC-000070' + tag 'fix_id': 'F-99485r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation') do + it { should have_property 'AllowInsecureGuestAuth' } + its('AllowInsecureGuestAuth') { should cmp 0} + end +end + diff --git a/controls/SV-205862.rb b/controls/SV-205862.rb new file mode 100644 index 0000000..c14e581 --- /dev/null +++ b/controls/SV-205862.rb @@ -0,0 +1,69 @@ + + +control 'SV-205862' do + title "Windows Server 2019 hardened Universal Naming Convention (UNC) paths + must be defined to require mutual authentication and integrity for at least the + \\\\*\\SYSVOL and \\\\*\\NETLOGON shares." + desc "Additional security requirements are applied to UNC paths specified in + hardened UNC paths before allowing access to them. This aids in preventing + tampering with or spoofing of connections to these paths." + desc 'rationale', '' + desc 'check', "This requirement is applicable to domain-joined systems. For standalone + systems, this is NA. + + If the following registry values do not exist or are not configured as + specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: + \\SOFTWARE\\Policies\\Microsoft\\Windows\\NetworkProvider\\HardenedPaths\\ + + Value Name: \\\\*\\NETLOGON + Value Type: REG_SZ + Value: RequireMutualAuthentication=1, RequireIntegrity=1 + + Value Name: \\\\*\\SYSVOL + Value Type: REG_SZ + Value: RequireMutualAuthentication=1, RequireIntegrity=1 + + Additional entries would not be a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative + Templates >> Network >> Network Provider >> \"Hardened UNC Paths\" to + \"Enabled\" with at least the following configured in \"Hardened UNC Paths\" + (click the \"Show\" button to display): + + Value Name: \\\\*\\SYSVOL + Value: RequireMutualAuthentication=1, RequireIntegrity=1 + + Value Name: \\\\*\\NETLOGON + Value: RequireMutualAuthentication=1, RequireIntegrity=1" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93241' + tag 'rid': 'SV-103329r1_rule' + tag 'stig_id': 'WN19-CC-000080' + tag 'fix_id': 'F-99487r1_fix' + tag 'cci': ['CCI-000366'] + tag 'nist': ['CM-6 b', 'Rev_4'] + + is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip + keyvalue_netlogon = '\\\\*\\NETLOGON' + keyvalue_sysvol = '\\\\*\\SYSVOL' + + if is_domain == 'WORKGROUP' + impact 0.0 + describe 'The system is not a member of a domain, control is NA' do + skip 'The system is not a member of a domain, control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths') do + it { should have_property keyvalue_sysvol } + its(keyvalue_sysvol) { should cmp 'RequireMutualAuthentication=1, RequireIntegrity=1' } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths') do + it { should have_property keyvalue_netlogon } + its(keyvalue_netlogon) { should cmp 'RequireMutualAuthentication=1, RequireIntegrity=1' } + end + end +end diff --git a/controls/SV-205863.rb b/controls/SV-205863.rb new file mode 100644 index 0000000..814f3cb --- /dev/null +++ b/controls/SV-205863.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205863" do + title "Windows Server 2019 must be configured to enable Remote host allows +delegation of non-exportable credentials." + desc "An exportable version of credentials is provided to remote hosts when +using credential delegation which exposes them to theft on the remote host. +Restricted Admin mode or Remote Credential Guard allow delegation of +non-exportable credentials providing additional protection of the credentials. +Enabling this configures the host to support Restricted Admin mode or Remote +Credential Guard." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Policies\\Microsoft\\Windows\\CredentialsDelegation\\ + + Value Name: AllowProtectedCreds + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> System >> Credentials Delegation >> \"Remote host +allows delegation of non-exportable credentials\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93243' + tag 'rid': 'SV-103331r1_rule' + tag 'stig_id': 'WN19-CC-000100' + tag 'fix_id': 'F-99489r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation') do + it { should have_property 'AllowProtectedCreds' } + its('AllowProtectedCreds') { should cmp 1 } + end +end + diff --git a/controls/SV-205864.rb b/controls/SV-205864.rb new file mode 100644 index 0000000..9bb3681 --- /dev/null +++ b/controls/SV-205864.rb @@ -0,0 +1,114 @@ +# encoding: UTF-8 + +control "SV-205864" do + title "Windows Server 2019 virtualization-based security must be enabled with +the platform security level configured to Secure Boot or Secure Boot with DMA +Protection." + desc "Virtualization Based Security (VBS) provides the platform for the +additional security features Credential Guard and virtualization-based +protection of code integrity. Secure Boot is the minimum security level, with +DMA protection providing additional memory protection. DMA Protection requires +a CPU that supports input/output memory management unit (IOMMU)." + desc "rationale", "" + desc 'check', "For standalone systems, this is NA. + + Current hardware and virtual environments may not support +virtualization-based security features, including Credential Guard, due to +specific supporting requirements, including a TPM, UEFI with Secure Boot, and +the capability to run the Hyper-V feature within a virtual machine. + + Open \"PowerShell\" with elevated privileges (run as administrator). + + Enter the following: + + \"Get-CimInstance -ClassName Win32_DeviceGuard -Namespace +root\\Microsoft\\Windows\\DeviceGuard\" + + If \"RequiredSecurityProperties\" does not include a value of \"2\" +indicating \"Secure Boot\" (e.g., \"{1, 2}\"), this is a finding. + + If \"Secure Boot and DMA Protection\" is configured, \"3\" will also be +displayed in the results (e.g., \"{1, 2, 3}\"). + + If \"VirtualizationBasedSecurityStatus\" is not a value of \"2\" indicating +\"Running\", this is a finding. + + Alternately: + + Run \"System Information\". + + Under \"System Summary\", verify the following: + + If \"Device Guard Virtualization based security\" does not display +\"Running\", this is a finding. + + If \"Device Guard Required Security Properties\" does not display \"Base +Virtualization Support, Secure Boot\", this is a finding. + + If \"Secure Boot and DMA Protection\" is configured, \"DMA Protection\" +will also be displayed (e.g., \"Base Virtualization Support, Secure Boot, DMA +Protection\"). + + The policy settings referenced in the Fix section will configure the +following registry values. However, due to hardware requirements, the registry +values alone do not ensure proper function. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\\ + + Value Name: EnableVirtualizationBasedSecurity + Value Type: REG_DWORD + Value: 0x00000001 (1) + + Value Name: RequirePlatformSecurityFeatures + Value Type: REG_DWORD + Value: 0x00000001 (1) (Secure Boot only) or 0x00000003 (3) (Secure Boot and +DMA Protection) + + A Microsoft TechNet article on Credential Guard, including system +requirement details, can be found at the following link: + + https://technet.microsoft.com/itpro/windows/keep-secure/credential-guard" + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative +Templates >> System >> Device Guard >> \"Turn On Virtualization Based +Security\" to \"Enabled\" with \"Secure Boot\" or \"Secure Boot and DMA +Protection\" selected. + + A Microsoft TechNet article on Credential Guard, including system +requirement details, can be found at the following link: + + https://technet.microsoft.com/itpro/windows/keep-secure/credential-guard" + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93245' + tag 'rid': 'SV-103333r1_rule' + tag 'stig_id': 'WN19-CC-000110' + tag 'fix_id': 'F-99491r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip + if is_domain == 'WORKGROUP' + impact 0.0 + describe 'The system is not a member of a domain, control is NA' do + skip 'The system is not a member of a domain, control is NA' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do + it { should have_property 'EnableVirtualizationBasedSecurity' } + its('EnableVirtualizationBasedSecurity') { should cmp 1 } + end + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do + it { should have_property 'RequirePlatformSecurityFeatures' } + its('RequirePlatformSecurityFeatures') { should cmp 1 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do + it { should have_property 'RequirePlatformSecurityFeatures' } + its('RequirePlatformSecurityFeatures') { should cmp 3 } + end + end + end +end + diff --git a/controls/SV-205865.rb b/controls/SV-205865.rb new file mode 100644 index 0000000..0b95528 --- /dev/null +++ b/controls/SV-205865.rb @@ -0,0 +1,63 @@ +# encoding: UTF-8 + +control "SV-205865" do + title "Windows Server 2019 Early Launch Antimalware, Boot-Start Driver +Initialization Policy must prevent boot drivers identified as bad." + desc "Compromised boot drivers can introduce malware prior to protection +mechanisms that load after initialization. The Early Launch Antimalware driver +can limit allowed drivers based on classifications determined by the malware +protection application. At a minimum, drivers determined to be bad must not be +allowed." + desc "rationale", "" + desc 'check', "The default behavior is for Early Launch Antimalware - Boot-Start Driver +Initialization policy to enforce \"Good, unknown and bad but critical\" +(preventing \"bad\"). + + If the registry value name below does not exist, this is not a finding. + + If it exists and is configured with a value of \"0x00000007 (7)\", this is +a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Policies\\EarlyLaunch\\ + + Value Name: DriverLoadPolicy + + Value Type: REG_DWORD + Value: 0x00000001 (1), 0x00000003 (3), or 0x00000008 (8) (or if the Value +Name does not exist) + + Possible values for this setting are: + 8 - Good only + 1 - Good and unknown + 3 - Good, unknown and bad but critical + 7 - All (which includes \"bad\" and would be a finding)" + desc 'fix', "The default behavior is for Early Launch Antimalware - Boot-Start Driver +Initialization policy to enforce \"Good, unknown and bad but critical\" +(preventing \"bad\"). + + If this needs to be corrected or a more secure setting is desired, +configure the policy value for Computer Configuration >> Administrative +Templates >> System >> Early Launch Antimalware >> \"Boot-Start Driver +Initialization Policy\" to \"Not Configured\" or \"Enabled\" with any option +other than \"All\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93249' + tag 'rid': 'SV-103337r1_rule' + tag 'stig_id': 'WN19-CC-000130' + tag 'fix_id': 'F-99495r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch') do + it { should_not have_property 'DriverLoadPolicy' } + end + describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch') do + its('DriverLoadPolicy') { should_not be 7 } + end + end +end + diff --git a/controls/SV-205866.rb b/controls/SV-205866.rb new file mode 100644 index 0000000..caee4e8 --- /dev/null +++ b/controls/SV-205866.rb @@ -0,0 +1,43 @@ +# encoding: UTF-8 + +control "SV-205866" do + title "Windows Server 2019 group policy objects must be reprocessed even if +they have not changed." + desc "Registry entries for group policy settings can potentially be changed +from the required configuration. This could occur as part of troubleshooting or +by a malicious process on a compromised system. Enabling this setting and then +selecting the \"Process even if the Group Policy objects have not changed\" +option ensures the policies will be reprocessed even if none have been changed. +This way, any unauthorized changes are forced to match the domain-based group +policy settings again." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Group Policy\\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\\ + + Value Name: NoGPOListChanges + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> System >> Group Policy >> \"Configure registry +policy processing\" to \"Enabled\" with the option \"Process even if the Group +Policy objects have not changed\" selected." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93251' + tag 'rid': 'SV-103339r1_rule' + tag 'stig_id': 'WN19-CC-000140' + tag 'fix_id': 'F-99497r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}') do + it { should have_property 'NoGPOListChanges' } + its('NoGPOListChanges') { should cmp 0 } + end +end + diff --git a/controls/SV-205867.rb b/controls/SV-205867.rb new file mode 100644 index 0000000..7786f08 --- /dev/null +++ b/controls/SV-205867.rb @@ -0,0 +1,47 @@ +# encoding: UTF-8 + +control "SV-205867" do + title "Windows Server 2019 users must be prompted to authenticate when the +system wakes from sleep (on battery)." + desc "A system that does not require authentication when resuming from sleep +may provide access to unauthorized users. Authentication must always be +required when accessing a system. This setting ensures users are prompted for a +password when the system wakes from sleep (on battery)." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\\ + + Value Name: DCSettingIndex + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> System >> Power Management >> Sleep Settings >> +\"Require a password when a computer wakes (on battery)\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93253' + tag 'rid': 'SV-103341r1_rule' + tag 'stig_id': 'WN19-CC-000180' + tag 'fix_id': 'F-99499r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + if sys_info.manufacturer == 'VMware, Inc.' + impact 0.0 + describe 'This is a Virtual Machine; This Control is NA.' do + skip 'This is a Virtual Machine; This Control is NA.' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51') do + it { should have_property 'DCSettingIndex' } + its('DCSettingIndex') { should cmp 1 } + end + end +end + diff --git a/controls/SV-205868.rb b/controls/SV-205868.rb new file mode 100644 index 0000000..9b270d7 --- /dev/null +++ b/controls/SV-205868.rb @@ -0,0 +1,47 @@ +# encoding: UTF-8 + +control "SV-205868" do + title "Windows Server 2019 users must be prompted to authenticate when the +system wakes from sleep (plugged in)." + desc "A system that does not require authentication when resuming from sleep +may provide access to unauthorized users. Authentication must always be +required when accessing a system. This setting ensures users are prompted for a +password when the system wakes from sleep (plugged in)." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\\ + + Value Name: ACSettingIndex + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> System >> Power Management >> Sleep Settings >> +\"Require a password when a computer wakes (plugged in)\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93255' + tag 'rid': 'SV-103343r1_rule' + tag 'stig_id': 'WN19-CC-000190' + tag 'fix_id': 'F-99501r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + if sys_info.manufacturer == 'VMware, Inc.' + impact 0.0 + describe 'This is a Virtual Machine; This Control is NA.' do + skip 'This is a Virtual Machine; This Control is NA.' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51') do + it { should have_property 'ACSettingIndex' } + its('ACSettingIndex') { should cmp 1 } + end + end +end + diff --git a/controls/SV-205869.rb b/controls/SV-205869.rb new file mode 100644 index 0000000..3964535 --- /dev/null +++ b/controls/SV-205869.rb @@ -0,0 +1,49 @@ +# encoding: UTF-8 + +control "SV-205869" do + title "Windows Server 2019 Telemetry must be configured to Security or Basic." + desc "Some features may communicate with the vendor, sending system +information or downloading data or components for the feature. Limiting this +capability will prevent potentially sensitive information from being sent +outside the enterprise. The \"Security\" option for Telemetry configures the +lowest amount of data, effectively none outside of the Malicious Software +Removal Tool (MSRT), Defender, and telemetry client settings. \"Basic\" sends +basic diagnostic and usage data and may be required to support some Microsoft +services." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\\ + + Value Name: AllowTelemetry + + Type: REG_DWORD + Value: 0x00000000 (0) (Security), 0x00000001 (1) (Basic)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> Data Collection and Preview +Builds>> \"Allow Telemetry\" to \"Enabled\" with \"0 - Security [Enterprise +Only]\" or \"1 - Basic\" selected in \"Options\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93257' + tag 'rid': 'SV-103345r1_rule' + tag 'stig_id': 'WN19-CC-000250' + tag 'fix_id': 'F-99503r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection') do + it { should have_property 'AllowTelemetry' } + its('AllowTelemetry') { should cmp 0 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection') do + it { should have_property 'AllowTelemetry' } + its('AllowTelemetry') { should cmp 1 } + end + end +end + diff --git a/controls/SV-205870.rb b/controls/SV-205870.rb new file mode 100644 index 0000000..d132780 --- /dev/null +++ b/controls/SV-205870.rb @@ -0,0 +1,72 @@ +# encoding: UTF-8 + +control "SV-205870" do + title "Windows Server 2019 Windows Update must not obtain updates from other +PCs on the Internet." + desc "Windows Update can obtain updates from additional sources instead of +Microsoft. In addition to Microsoft, updates can be obtained from and sent to +PCs on the local network as well as on the Internet. This is part of the +Windows Update trusted process, however to minimize outside exposure, obtaining +updates from or sending to systems on the Internet must be prevented." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeliveryOptimization\\ + + Value Name: DODownloadMode + + Value Type: REG_DWORD + Value: 0x00000000 (0) - No peering (HTTP Only) + 0x00000001 (1) - Peers on same NAT only (LAN) + 0x00000002 (2) - Local Network / Private group peering (Group) + 0x00000063 (99) - Simple download mode, no peering (Simple) + 0x00000064 (100) - Bypass mode, Delivery Optimization not used (Bypass) + + A value of 0x00000003 (3), Internet, is a finding." + desc 'fix', "Configure the policy value for Computer Configuration >> Administrative +Templates >> Windows Components >> Delivery Optimization >> \"Download Mode\" +to \"Enabled\" with any option except \"Internet\" selected. + + Acceptable selections include: + + Bypass (100) + Group (2) + HTTP only (0) + LAN (1) + Simple (99)" + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93259' + tag 'rid': 'SV-103347r1_rule' + tag 'stig_id': 'WN19-CC-000260' + tag 'fix_id': 'F-99505r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do + it { should have_property 'DODownloadMode' } + its('DODownloadMode') { should cmp 0 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do + it { should have_property 'DODownloadMode' } + its('DODownloadMode') { should cmp 1 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do + it { should have_property 'DODownloadMode' } + its('DODownloadMode') { should cmp 2 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do + it { should have_property 'DODownloadMode' } + its('DODownloadMode') { should cmp 99 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do + it { should have_property 'DODownloadMode' } + its('DODownloadMode') { should cmp 100 } + end + end +end diff --git a/controls/SV-205871.rb b/controls/SV-205871.rb new file mode 100644 index 0000000..4219b1a --- /dev/null +++ b/controls/SV-205871.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205871" do + title "Windows Server 2019 Turning off File Explorer heap termination on +corruption must be disabled." + desc "Legacy plug-in applications may continue to function when a File +Explorer session has become corrupt. Disabling this feature will prevent this." + desc "rationale", "" + desc 'check', "The default behavior is for File Explorer heap termination on corruption to +be enabled. + + If the registry Value Name below does not exist, this is not a finding. + + If it exists and is configured with a value of \"0\", this is not a finding. + + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ + + Value Name: NoHeapTerminationOnCorruption + + Value Type: REG_DWORD + Value: 0x00000000 (0) (or if the Value Name does not exist)" + desc 'fix', "The default behavior is for File Explorer heap termination on corruption to +be disabled. + + If this needs to be corrected, configure the policy value for Computer +Configuration >> Administrative Templates >> Windows Components >> File +Explorer >> \"Turn off heap termination on corruption\" to \"Not Configured\" +or \"Disabled\"." + impact 0.3 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93261' + tag 'rid': 'SV-103349r1_rule' + tag 'stig_id': 'WN19-CC-000320' + tag 'fix_id': 'F-99507r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do + it { should_not have_property 'NoHeapTerminationOnCorruption' } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do + it { should have_property 'NoHeapTerminationOnCorruption' } + its('NoHeapTerminationOnCorruption') { should_not be 1 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do + it { should have_property 'NoHeapTerminationOnCorruption' } + its('NoHeapTerminationOnCorruption') { should cmp 0 } + end + end +end + diff --git a/controls/SV-205872.rb b/controls/SV-205872.rb new file mode 100644 index 0000000..1d851f5 --- /dev/null +++ b/controls/SV-205872.rb @@ -0,0 +1,57 @@ +# encoding: UTF-8 + +control "SV-205872" do + title "Windows Server 2019 File Explorer shell protocol must run in protected +mode." + desc "The shell protocol will limit the set of folders that applications can +open when run in protected mode. Restricting files an application can open to a +limited set of folders increases the security of Windows." + desc "rationale", "" + desc 'check', "The default behavior is for shell protected mode to be turned on for File +Explorer. + + If the registry value name below does not exist, this is not a finding. + + If it exists and is configured with a value of \"0\", this is not a finding. + + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: +\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ + + Value Name: PreXPSP2ShellProtocolBehavior + + Value Type: REG_DWORD + Value: 0x00000000 (0) (or if the Value Name does not exist)" + desc 'fix', "The default behavior is for shell protected mode to be turned on for File +Explorer. + + If this needs to be corrected, configure the policy value for Computer +Configuration >> Administrative Templates >> Windows Components >> File +Explorer >> \"Turn off shell protocol protected mode\" to \"Not Configured\" or +\"Disabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93263' + tag 'rid': 'SV-103351r1_rule' + tag 'stig_id': 'WN19-CC-000330' + tag 'fix_id': 'F-99509r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do + it { should_not have_property 'PreXPSP2ShellProtocolBehavior' } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do + it { should have_property 'PreXPSP2ShellProtocolBehavior' } + its('PreXPSP2ShellProtocolBehavior') { should_not be 1 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do + it { should have_property 'PreXPSP2ShellProtocolBehavior' } + its('PreXPSP2ShellProtocolBehavior') { should cmp 0 } + end + end +end \ No newline at end of file diff --git a/controls/SV-205873.rb b/controls/SV-205873.rb new file mode 100644 index 0000000..96698e3 --- /dev/null +++ b/controls/SV-205873.rb @@ -0,0 +1,37 @@ +# encoding: UTF-8 + +control "SV-205873" do + title "Windows Server 2019 must prevent attachments from being downloaded +from RSS feeds." + desc "Attachments from RSS feeds may not be secure. This setting will +prevent attachments from being downloaded from RSS feeds." + desc "rationale", "" + desc 'check', "If the following registry value does not exist or is not configured as +specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Feeds\\ + + Value Name: DisableEnclosureDownload + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc 'fix', "Configure the policy value for Computer Configuration >> +Administrative Templates >> Windows Components >> RSS Feeds >> \"Prevent +downloading of enclosures\" to \"Enabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93265' + tag 'rid': 'SV-103353r1_rule' + tag 'stig_id': 'WN19-CC-000390' + tag 'fix_id': 'F-99511r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do + it { should have_property 'DisableEnclosureDownload' } + its('DisableEnclosureDownload') { should cmp 1 } + end +end + diff --git a/controls/SV-205874.rb b/controls/SV-205874.rb new file mode 100644 index 0000000..cb7d809 --- /dev/null +++ b/controls/SV-205874.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +control "SV-205874" do + title "Windows Server 2019 users must be notified if a web-based program +attempts to install software." + desc "Web-based programs may attempt to install malicious software on a +system. Ensuring users are notified if a web-based program attempts to install +software allows them to refuse the installation." + desc "rationale", "" + desc 'check', "The default behavior is for Internet Explorer to warn users and select +whether to allow or refuse installation when a web-based program attempts to +install software on the system. + + If the registry value name below does not exist, this is not a finding. + + If it exists and is configured with a value of \"0\", this is not a finding. + + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ + + Value Name: SafeForScripting + + Value Type: REG_DWORD + Value: 0x00000000 (0) (or if the Value Name does not exist)" + desc 'fix', "The default behavior is for Internet Explorer to warn users and select +whether to allow or refuse installation when a web-based program attempts to +install software on the system. + + If this needs to be corrected, configure the policy value for Computer +Configuration >> Administrative Templates >> Windows Components >> Windows +Installer >> \"Prevent Internet Explorer security prompt for Windows Installer +scripts\" to \"Not Configured\" or \"Disabled\"." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93267' + tag 'rid': 'SV-103355r1_rule' + tag 'stig_id': 'WN19-CC-000440' + tag 'fix_id': 'F-99513r1_fix' + tag 'cci': ["CCI-000366"] + tag 'nist': ["CM-6 b", "Rev_4"] + + describe.one do + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do + it { should_not have_property 'SafeForScripting' } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do + its('SafeForScripting') { should_not be 1 } + end + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do + its('SafeForScripting') { should cmp 0 } + end + end +end diff --git a/controls/SV-205875.rb b/controls/SV-205875.rb new file mode 100644 index 0000000..8f90b5d --- /dev/null +++ b/controls/SV-205875.rb @@ -0,0 +1,52 @@ +# encoding: UTF-8 + +control "SV-205875" do + title "Windows Server 2019 directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access." + desc "To the extent that anonymous access to directory data (outside the root DSE) is permitted, read access control of the data is effectively disabled. If other means of controlling access (such as network restrictions) are compromised, there may be nothing else to protect the confidentiality of sensitive directory data." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + Open \"Command Prompt\" (not elevated). + Run \"ldp.exe\". + From the \"Connection menu\", select \"Bind\". + Clear the User, Password, and Domain fields. + Select \"Simple bind\" for the Bind type and click \"OK\". + Confirmation of anonymous access will be displayed at the end: + res = ldap_simple_bind_s + Authenticated as: 'NT AUTHORITY\\ANONYMOUS LOGON' + From the \"Browse\" menu, select \"Search\". + In the Search dialog, enter the DN of the domain naming context (generally something like \"dc=disaost,dc=mil\") in the Base DN field. + Clear the Attributes field and select \"Run\". + Error messages should display related to Bind and user not authenticated. + + If attribute data is displayed, anonymous access is enabled to the domain naming context and this is a finding. + The following network controls allow the finding severity to be downgraded to a CAT II since these measures lower the risk associated with anonymous access. + Network hardware ports at the site are subject to 802.1x authentication or MAC address restrictions. + Premise firewall or host restrictions prevent access to ports 389, 636, 3268, and 3269 from client hosts not explicitly identified by domain (.mil) or IP address." + desc "fix", "Configure directory data (outside the root DSE) of a non-public directory to prevent anonymous access. + For AD, there are multiple configuration items that could enable anonymous access. + Changing the access permissions on the domain naming context object (from the secure defaults) could enable anonymous access. If the check procedures indicate this is the cause, the process that was used to change the permissions should be reversed. This could have been through the Windows Support Tools ADSI Edit console (adsiedit.msc). + The dsHeuristics option is used. This is addressed in check V-8555 in the AD Forest STIG." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93271" + tag rid: "SV-103359r1_rule" + tag stig_id: "WN19-DC-000150" + tag fix_id: "F-99517r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe 'Directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access.' do + skip 'Directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access is a manual control' + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205876.rb b/controls/SV-205876.rb new file mode 100644 index 0000000..475e4d0 --- /dev/null +++ b/controls/SV-205876.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205876" do + title "Windows Server 2019 domain controllers must be configured to allow reset of machine account passwords." + desc "Enabling this setting on all domain controllers in a domain prevents domain members from changing their computer account passwords. If these passwords are weak or compromised, the inability to change them may leave these computers vulnerable." + desc "rationale", "" + desc "check", "This applies to domain controllers. It is NA for other systems. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: RefusePasswordChange + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain controller: Refuse machine account password changes\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93273" + tag rid: "SV-103361r1_rule" + tag stig_id: "WN19-DC-000330" + tag fix_id: "F-99519r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'RefusePasswordChange' } + its('RefusePasswordChange') { should cmp 0 } + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is NA' do + skip 'This system is not a domain controller, therefore this control is NA' + end + end +end \ No newline at end of file diff --git a/controls/SV-205877.rb b/controls/SV-205877.rb new file mode 100644 index 0000000..1782f82 --- /dev/null +++ b/controls/SV-205877.rb @@ -0,0 +1,73 @@ +control 'SV-205877' do + title "The password for the krbtgt account on a domain must be reset at least +every 180 days." + desc "The krbtgt account acts as a service account for the Kerberos Key +Distribution Center (KDC) service. The account and password are created when a +domain is created and the password is typically not changed. If the krbtgt +account is compromised, attackers can create valid Kerberos Ticket Granting +Tickets (TGT). + The password must be changed twice to effectively remove the password +history. Changing once, waiting for replication to complete and the amount of +time equal to or greater than the maximum Kerberos ticket lifetime, and +changing again reduces the risk of issues." + desc 'rationale', '' + desc 'check', "This requirement is applicable to domain controllers; it is NA for other +systems. + Open \"Windows PowerShell\". + Enter \"Get-ADUser krbtgt -Property PasswordLastSet\". + If the \"PasswordLastSet\" date is more than 180 days old, this is a +finding." + desc 'fix', "Reset the password for the krbtgt account a least every 180 days. The +password must be changed twice to effectively remove the password history. +Changing once, waiting for replication to complete and changing again reduces +the risk of issues. Changing twice in rapid succession forces clients to +re-authenticate (including application services) but is desired if a compromise +is suspected. + PowerShell scripts are available to accomplish this such as at the +following link: + https://gallery.technet.microsoft.com/Reset-the-krbtgt-account-581a9e51 + Open \"Active Directory Users and Computers\" (available from various menus +or run \"dsa.msc\"). + Select \"Advanced Features\" in the \"View\" menu if not previously +selected. + Select the \"Users\" node. + Right click on the krbtgt account and select \"Reset password\" + Enter a password that meets password complexity requirements. + Clear the \"User must change password at next logon\" check box. + The system will automatically change this to a system-generated complex +password." + impact 0.5 + tag 'severity': nil + tag 'gtitle': 'SRG-OS-000480-GPOS-00227' + tag 'gid': 'V-93211' + tag 'rid': 'SV-103299r3_rule' + tag 'stig_id': 'WN19-DC-000430' + tag 'fix_id': 'F-99457r1_fix' + tag 'cci': ['CCI-000366'] + tag 'nist': ['CM-6 b', 'Rev_4'] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '4' || domain_role == '5' + password_set_date = json(command: 'New-TimeSpan -Start (Get-ADUser krbtgt -Property PasswordLastSet).PAsswordLastSet | where -filter { $_.Days -gt 180 } | ConvertTo-JSON').params + date = password_set_date['Days'] + if date.nil? + describe 'krbtgt Account is within 180 days since password change' do + subject { date } + its(date) { should eq nil } + end + else + describe 'Password Last Set' do + it 'krbtgt Account Password Last Set Date is' do + failure_message = "Password Date should not be more than 180 Days: #{date}" + expect(date).to be_empty, failure_message + end + end + end + else + impact 0.0 + describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do + skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' + end + end +end diff --git a/controls/SV-205906.rb b/controls/SV-205906.rb new file mode 100644 index 0000000..2390206 --- /dev/null +++ b/controls/SV-205906.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205906" do + title "Windows Server 2019 must limit the caching of logon credentials to four or less on domain-joined member servers." + desc "The default Windows configuration caches the last logon credentials for users who log on interactively to a system. This feature is provided for system availability reasons, such as the user's machine being disconnected from the network or domain controllers being unavailable. Even though the credential cache is well protected, if a system is attacked, an unauthorized individual may isolate the password to a domain user account using a password-cracking program and gain access to the domain." + desc "rationale", "" + desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\ + + Value Name: CachedLogonsCount + + Value Type: REG_SZ + Value: 4 (or less)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive Logon: Number of previous logons to cache (in case Domain Controller is not available)\" to \"4\" logons or less." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93275" + tag rid: "SV-103363r1_rule" + tag stig_id: "WN19-MS-000050" + tag fix_id: "F-99521r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + + if domain_role == '3' + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon') do + it { should have_property 'CachedLogonsCount' } + its('CachedLogonsCount') { should cmp <= 4 } + end + else + impact 0.0 + describe 'This requirement is only applicable to member servers' do + skip 'This control is NA as the requirement is only applicable to member servers' + end + end +end diff --git a/controls/SV-205907.rb b/controls/SV-205907.rb new file mode 100644 index 0000000..e5122e5 --- /dev/null +++ b/controls/SV-205907.rb @@ -0,0 +1,66 @@ +# encoding: UTF-8 + +control "SV-205907" do + title "Windows Server 2019 must be running Credential Guard on domain-joined member servers." + desc "Credential Guard uses virtualization-based security to protect data that could be used in credential theft attacks if compromised. This authentication information, which was stored in the Local Security Authority (LSA) in previous versions of Windows, is isolated from the rest of operating system and can only be accessed by privileged system software." + desc "rationale", "" + desc "check", "For domain controllers and standalone systems, this is NA. + + Current hardware and virtual environments may not support virtualization-based security features, including Credential Guard, due to specific supporting requirements, including a TPM, UEFI with Secure Boot, and the capability to run the Hyper-V feature within a virtual machine. + + Open \"PowerShell\" with elevated privileges (run as administrator). + Enter the following: + \"Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\\Microsoft\\Windows\\DeviceGuard\" + If \"SecurityServicesRunning\" does not include a value of \"1\" (e.g., \"{1, 2}\"), this is a finding. + + Alternately: + Run \"System Information\". + Under \"System Summary\", verify the following: + If \"Device Guard Security Services Running\" does not list \"Credential Guard\", this is a finding. + The policy settings referenced in the Fix section will configure the following registry value. However, due to hardware requirements, the registry value alone does not ensure proper function. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\\ + + Value Name: LsaCfgFlags + Value Type: REG_DWORD + Value: 0x00000001 (1) (Enabled with UEFI lock) + + A Microsoft article on Credential Guard system requirement can be found at the following link: + https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-requirements" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Device Guard >> \"Turn On Virtualization Based Security\" to \"Enabled\" with \"Enabled with UEFI lock\" selected for \"Credential Guard Configuration\". + A Microsoft article on Credential Guard system requirement can be found at the following link: https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-requirements" + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93277" + tag rid: "SV-103365r1_rule" + tag stig_id: "WN19-MS-000140" + tag fix_id: "F-99523r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip + security_services = command('Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\\Microsoft\\Windows\\DeviceGuard | Select -ExpandProperty "SecurityServicesRunning"').stdout.strip.split("\r\n") + + if domain_role == '0' || domain_role == '2' + impact 0.0 + describe 'This is NA for standalone systems' do + skip 'This is NA for standalone systems' + end + elsif domain_role == '4' || domain_role == '5' + impact 0.0 + describe 'This is NA for domain controllers' do + skip 'This is NA for domain controllers' + end + else + describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard') do + it { should have_property 'LsaCfgFlags' } + its('LsaCfgFlags') { should cmp 1 } + end + describe "Security Services Running should include 1" do + subject { security_services } + it { should include "1" } + end + end +end \ No newline at end of file diff --git a/controls/SV-205908.rb b/controls/SV-205908.rb new file mode 100644 index 0000000..e3c8b1d --- /dev/null +++ b/controls/SV-205908.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205908" do + title "Windows Server 2019 must prevent local accounts with blank passwords from being used from the network." + desc "An account without a password can allow unauthorized access to a system as only the username would be required. Password policies should prevent accounts with blank passwords from existing on a system. However, if a local account with a blank password does exist, enabling this setting will prevent network access, limiting the account to local console logon only." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: LimitBlankPasswordUse + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Limit local account use of blank passwords to console logon only\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93279" + tag rid: "SV-103367r1_rule" + tag stig_id: "WN19-SO-000020" + tag fix_id: "F-99525r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\Currentcontrolset\\Control\\Lsa') do + it { should have_property 'Limitblankpassworduse' } + its('Limitblankpassworduse') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205909.rb b/controls/SV-205909.rb new file mode 100644 index 0000000..bb5b103 --- /dev/null +++ b/controls/SV-205909.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205909" do + title "Windows Server 2019 built-in administrator account must be renamed." + desc "The built-in administrator account is a well-known account subject to attack. Renaming this account to an unidentified name improves the protection of this account and the system." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. + + If the value for \"Accounts: Rename administrator account\" is not set to a value other than \"Administrator\", this is a finding. + + For server core installations, run the following command: + + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + + If \"NewAdministratorName\" is not something other than \"Administrator\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Rename administrator account\" to a name other than \"Administrator\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93281" + tag rid: "SV-103369r1_rule" + tag stig_id: "WN19-SO-000030" + tag fix_id: "F-99527r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe security_policy do + its('NewAdministratorName') { should_not cmp "Administrator" } + end +end diff --git a/controls/SV-205910.rb b/controls/SV-205910.rb new file mode 100644 index 0000000..475fdf3 --- /dev/null +++ b/controls/SV-205910.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 + +control "SV-205910" do + title "Windows Server 2019 built-in guest account must be renamed." + desc "The built-in guest account is a well-known user account on all Windows systems and, as initially installed, does not require a password. This can allow access to system resources by unauthorized users. Renaming this account to an unidentified name improves the protection of this account and the system." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + Run \"gpedit.msc\". + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. + If the value for \"Accounts: Rename guest account\" is not set to a value other than \"Guest\", this is a finding. + + For server core installations, run the following command: + Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt + If \"NewGuestName\" is not something other than \"Guest\" in the file, this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Rename guest account\" to a name other than \"Guest\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93283" + tag rid: "SV-103371r1_rule" + tag stig_id: "WN19-SO-000040" + tag fix_id: "F-99529r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe security_policy do + its('NewGuestName') { should_not eq "Guest" } + end +end \ No newline at end of file diff --git a/controls/SV-205911.rb b/controls/SV-205911.rb new file mode 100644 index 0000000..df18e85 --- /dev/null +++ b/controls/SV-205911.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 + +control "SV-205911" do + title "Windows Server 2019 maximum age for machine account passwords must be configured to #{input('maximum_password_age_machine')} days or less." + desc "Computer account passwords are changed automatically on a regular basis. This setting controls the maximum password age that a machine account may have. This must be set to no more than #{input('maximum_password_age_machine')} days, ensuring the machine changes its password monthly." + desc "rationale", "" + desc "check", "This is the default configuration for this setting (#{input('maximum_password_age_machine')} days). + + If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ + + Value Name: MaximumPasswordAge + + Value Type: REG_DWORD + Value: 0x000000#{input('maximum_password_age_machine').to_s(16)} (#{input('maximum_password_age_machine')}) (or less, but not 0)" + desc "fix", "This is the default configuration for this setting (#{input('maximum_password_age_machine')} days). + Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Maximum machine account password age\" to \"#{input('maximum_password_age_machine')}\" or less (excluding \"0\", which is unacceptable)." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93285" + tag rid: "SV-103373r1_rule" + tag stig_id: "WN19-SO-000100" + tag fix_id: "F-99531r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do + it { should have_property 'MaximumPasswordAge' } + its('MaximumPasswordAge') { should be_between(1,input('maximum_password_age_machine')) } + end +end diff --git a/controls/SV-205912.rb b/controls/SV-205912.rb new file mode 100644 index 0000000..f3df7b2 --- /dev/null +++ b/controls/SV-205912.rb @@ -0,0 +1,33 @@ +# encoding: UTF-8 + +control "SV-205912" do + title "Windows Server 2019 Smart Card removal option must be configured to Force Logoff or Lock Workstation." + desc "Unattended systems are susceptible to unauthorized use and must be locked. Configuring a system to lock when a smart card is removed will ensure the system is inaccessible when unattended." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\ + + Value Name: scremoveoption + + Value Type: REG_SZ + Value: 1 (Lock Workstation) or 2 (Force Logoff) + + If configuring this on servers causes issues, such as terminating users' remote sessions, and the organization has a policy in place that any other sessions on the servers, such as administrative console logons, are manually locked or logged off when unattended or not in use, this would be acceptable. This must be documented with the ISSO." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive logon: Smart card removal behavior\" to \"Lock Workstation\" or \"Force Logoff\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93287" + tag rid: "SV-103375r1_rule" + tag stig_id: "WN19-SO-000150" + tag fix_id: "F-99533r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon') do + it { should have_property 'scremoveoption' } + its('scremoveoption') { should be_between("1", "2") } + end +end \ No newline at end of file diff --git a/controls/SV-205913.rb b/controls/SV-205913.rb new file mode 100644 index 0000000..d304ecd --- /dev/null +++ b/controls/SV-205913.rb @@ -0,0 +1,28 @@ +# encoding: UTF-8 + +control "SV-205913" do + title "Windows Server 2019 must not allow anonymous SID/Name translation." + desc "Allowing anonymous SID/Name translation can provide sensitive information for accessing a system. Only authorized users must be able to perform such translations." + desc "rationale", "" + desc "check", "Verify the effective setting in Local Group Policy Editor. + + Run \"gpedit.msc\". + + Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. + + If the value for \"Network access: Allow anonymous SID/Name translation\" is not set to \"Disabled\", this is a finding." + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Allow anonymous SID/Name translation\" to \"Disabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93289" + tag rid: "SV-103377r1_rule" + tag stig_id: "WN19-SO-000210" + tag fix_id: "F-99535r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe security_policy do + its('LSAAnonymousNameLookup') { should eq 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205914.rb b/controls/SV-205914.rb new file mode 100644 index 0000000..770fa91 --- /dev/null +++ b/controls/SV-205914.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205914" do + title "Windows Server 2019 must not allow anonymous enumeration of Security Account Manager (SAM) accounts." + desc "Anonymous enumeration of SAM accounts allows anonymous logon users (null session connections) to list all accounts names, thus providing a list of potential points to attack the system." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: RestrictAnonymousSAM + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Do not allow anonymous enumeration of SAM accounts\" to \"Enabled\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93291" + tag rid: "SV-103379r1_rule" + tag stig_id: "WN19-SO-000220" + tag fix_id: "F-99537r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'RestrictAnonymousSAM' } + its('RestrictAnonymousSAM') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205915.rb b/controls/SV-205915.rb new file mode 100644 index 0000000..d00d20a --- /dev/null +++ b/controls/SV-205915.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205915" do + title "Windows Server 2019 must be configured to prevent anonymous users from having the same permissions as the Everyone group." + desc "Access by anonymous users must be restricted. If this setting is enabled, anonymous users have the same rights and permissions as the built-in Everyone group. Anonymous users must not have these permissions or rights." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: EveryoneIncludesAnonymous + + Value Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Let Everyone permissions apply to anonymous users\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93293" + tag rid: "SV-103381r1_rule" + tag stig_id: "WN19-SO-000240" + tag fix_id: "F-99539r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'EveryoneIncludesAnonymous' } + its('EveryoneIncludesAnonymous') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205916.rb b/controls/SV-205916.rb new file mode 100644 index 0000000..8ad986f --- /dev/null +++ b/controls/SV-205916.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205916" do + title "Windows Server 2019 services using Local System that use Negotiate when reverting to NTLM authentication must use the computer identity instead of authenticating anonymously." + desc "Services using Local System that use Negotiate when reverting to NTLM authentication may gain unauthorized access if allowed to authenticate anonymously versus using the computer identity." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\ + + Value Name: UseMachineId + + Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow Local System to use computer identity for NTLM\" to \"Enabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93295" + tag rid: "SV-103383r1_rule" + tag stig_id: "WN19-SO-000260" + tag fix_id: "F-99541r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'UseMachineId' } + its('UseMachineId') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205917.rb b/controls/SV-205917.rb new file mode 100644 index 0000000..4d18519 --- /dev/null +++ b/controls/SV-205917.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205917" do + title "Windows Server 2019 must prevent NTLM from falling back to a Null session." + desc "NTLM sessions that are allowed to fall back to Null (unauthenticated) sessions may gain unauthorized access." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\MSV1_0\\ + + Value Name: allownullsessionfallback + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow LocalSystem NULL session fallback\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93297" + tag rid: "SV-103385r1_rule" + tag stig_id: "WN19-SO-000270" + tag fix_id: "F-99543r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do + it { should have_property 'allownullsessionfallback' } + its('allownullsessionfallback') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205918.rb b/controls/SV-205918.rb new file mode 100644 index 0000000..c794098 --- /dev/null +++ b/controls/SV-205918.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205918" do + title "Windows Server 2019 must prevent PKU2U authentication using online identities." + desc "PKU2U is a peer-to-peer authentication protocol. This setting prevents online identities from authenticating to domain-joined systems. Authentication will be centrally managed with Windows user accounts." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\pku2u\\ + + Value Name: AllowOnlineID + + Type: REG_DWORD + Value: 0x00000000 (0)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow PKU2U authentication requests to this computer to use online identities\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93299" + tag rid: "SV-103387r1_rule" + tag stig_id: "WN19-SO-000280" + tag fix_id: "F-99545r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\pku2u') do + it { should have_property 'AllowOnlineID' } + its('AllowOnlineID') { should cmp == 0 } + end +end \ No newline at end of file diff --git a/controls/SV-205919.rb b/controls/SV-205919.rb new file mode 100644 index 0000000..383a67a --- /dev/null +++ b/controls/SV-205919.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205919" do + title "Windows Server 2019 LAN Manager authentication level must be configured to send NTLMv2 response only and to refuse LM and NTLM." + desc "The Kerberos v5 authentication protocol is the default for authentication of users who are logging on to domain accounts. NTLM, which is less secure, is retained in later Windows versions for compatibility with clients and servers that are running earlier versions of Windows or applications that still use it. It is also used to authenticate logons to standalone computers that are running later versions." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ + + Value Name: LmCompatibilityLevel + + Value Type: REG_DWORD + Value: 0x00000005 (5)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: LAN Manager authentication level\" to \"Send NTLMv2 response only. Refuse LM & NTLM\"." + impact 0.7 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93301" + tag rid: "SV-103389r1_rule" + tag stig_id: "WN19-SO-000310" + tag fix_id: "F-99547r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Lsa') do + it { should have_property 'LmCompatibilityLevel' } + its('LmCompatibilityLevel') { should cmp == 5 } + end +end \ No newline at end of file diff --git a/controls/SV-205920.rb b/controls/SV-205920.rb new file mode 100644 index 0000000..c3b5d96 --- /dev/null +++ b/controls/SV-205920.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205920" do + title "Windows Server 2019 must be configured to at least negotiate signing for LDAP client signing." + desc "This setting controls the signing requirements for LDAP clients. This must be set to \"Negotiate signing\" or \"Require signing\", depending on the environment and type of LDAP server in use." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LDAP\\ + + Value Name: LDAPClientIntegrity + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: LDAP client signing requirements\" to \"Negotiate signing\" at a minimum." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93303" + tag rid: "SV-103391r1_rule" + tag stig_id: "WN19-SO-000320" + tag fix_id: "F-99549r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LDAP') do + it { should have_property 'LDAPClientIntegrity' } + its('LDAPClientIntegrity') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205921.rb b/controls/SV-205921.rb new file mode 100644 index 0000000..96268e3 --- /dev/null +++ b/controls/SV-205921.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205921" do + title "Windows Server 2019 session security for NTLM SSP-based clients must be configured to require NTLMv2 session security and 128-bit encryption." + desc "Microsoft has implemented a variety of security support providers for use with Remote Procedure Call (RPC) sessions. All of the options must be enabled to ensure the maximum security level." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0\\ + + Value Name: NTLMMinClientSec + + Value Type: REG_DWORD + Value: 0x20080000 (537395200)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Minimum session security for NTLM SSP based (including secure RPC) clients\" to \"Require NTLMv2 session security\" and \"Require 128-bit encryption\" (all options selected)." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93305" + tag rid: "SV-103393r1_rule" + tag stig_id: "WN19-SO-000330" + tag fix_id: "F-99551r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do + it { should have_property 'NTLMMinClientSec' } + its('NTLMMinClientSec') { should cmp == 537395200 } + end +end \ No newline at end of file diff --git a/controls/SV-205922.rb b/controls/SV-205922.rb new file mode 100644 index 0000000..bd1e330 --- /dev/null +++ b/controls/SV-205922.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205922" do + title "Windows Server 2019 session security for NTLM SSP-based servers must be configured to require NTLMv2 session security and 128-bit encryption." + desc "Microsoft has implemented a variety of security support providers for use with Remote Procedure Call (RPC) sessions. All of the options must be enabled to ensure the maximum security level." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0\\ + + Value Name: NTLMMinServerSec + + Value Type: REG_DWORD + Value: 0x20080000 (537395200)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Minimum session security for NTLM SSP based (including secure RPC) servers\" to \"Require NTLMv2 session security\" and \"Require 128-bit encryption\" (all options selected)." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93307" + tag rid: "SV-103395r1_rule" + tag stig_id: "WN19-SO-000340" + tag fix_id: "F-99553r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do + it { should have_property 'NTLMMinServerSec' } + its('NTLMMinServerSec') { should cmp == 537395200 } + end +end \ No newline at end of file diff --git a/controls/SV-205923.rb b/controls/SV-205923.rb new file mode 100644 index 0000000..1793992 --- /dev/null +++ b/controls/SV-205923.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205923" do + title "Windows Server 2019 default permissions of global system objects must be strengthened." + desc "Windows systems maintain a global list of shared system resources such as DOS device names, mutexes, and semaphores. Each type of object is created with a default Discretionary Access Control List (DACL) that specifies who can access the objects with what permissions. When this policy is enabled, the default DACL is stronger, allowing non-administrative users to read shared objects but not to modify shared objects they did not create." + desc "rationale", "" + desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\ + + Value Name: ProtectionMode + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System objects: Strengthen default permissions of internal system objects (e.g., Symbolic Links)\" to \"Enabled\"." + impact 0.3 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93309" + tag rid: "SV-103397r1_rule" + tag stig_id: "WN19-SO-000370" + tag fix_id: "F-99555r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager') do + it { should have_property 'ProtectionMode' } + its('ProtectionMode') { should cmp == 1 } + end +end \ No newline at end of file diff --git a/controls/SV-205924.rb b/controls/SV-205924.rb new file mode 100644 index 0000000..1ae81ee --- /dev/null +++ b/controls/SV-205924.rb @@ -0,0 +1,42 @@ +# encoding: UTF-8 + +control "SV-205924" do + title "Windows Server 2019 must preserve zone information when saving attachments." + desc "Attachments from outside sources may contain malicious code. Preserving zone of origin (Internet, intranet, local, restricted) information on file attachments allows Windows to determine risk." + desc "rationale", "" + desc "check", "The default behavior is for Windows to mark file attachments with their zone information. + + If the registry Value Name below does not exist, this is not a finding. + If it exists and is configured with a value of \"2\", this is not a finding. + If it exists and is configured with a value of \"1\", this is a finding. + + Registry Hive: HKEY_CURRENT_USER + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Attachments\\ + + Value Name: SaveZoneInformation + + Value Type: REG_DWORD + Value: 0x00000002 (2) (or if the Value Name does not exist)" + desc "fix", "The default behavior is for Windows to mark file attachments with their zone information. + + If this needs to be corrected, configure the policy value for User Configuration >> Administrative Templates >> Windows Components >> Attachment Manager >> \"Do not preserve zone information in file attachments\" to \"Not Configured\" or \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00227" + tag gid: "V-93311" + tag rid: "SV-103399r1_rule" + tag stig_id: "WN19-UC-000010" + tag fix_id: "F-99557r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + if registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments').has_property?('SaveZoneInformation') + describe registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments') do + its('SaveZoneInformation') { should cmp 2 } + end + else + describe registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments') do + it { should_not have_property 'SaveZoneInformation' } + end + end +end \ No newline at end of file diff --git a/controls/SV-205925.rb b/controls/SV-205925.rb new file mode 100644 index 0000000..fc49ff5 --- /dev/null +++ b/controls/SV-205925.rb @@ -0,0 +1,31 @@ +# encoding: UTF-8 + +control "SV-205925" do + title "Windows Server 2019 must disable automatically signing in the last interactive user after a system-initiated restart." + desc "Windows can be configured to automatically sign the user back in after a Windows Update restart. Some protections are in place to help ensure this is done in a secure fashion; however, disabling this will prevent the caching of credentials for this purpose and also ensure the user is aware of the restart." + desc "rationale", "" + desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. + + Registry Hive: HKEY_LOCAL_MACHINE + Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ + + Value Name: DisableAutomaticRestartSignOn + + Value Type: REG_DWORD + Value: 0x00000001 (1)" + desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Logon Options >> \"Sign-in last interactive user automatically after a system-initiated restart\" to \"Disabled\"." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00229" + tag gid: "V-93269" + tag rid: "SV-103357r1_rule" + tag stig_id: "WN19-CC-000450" + tag fix_id: "F-99515r1_fix" + tag cci: ["CCI-000366"] + tag nist: ["CM-6 b", "Rev_4"] + + describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System') do + it { should have_property 'DisableAutomaticRestartSignOn' } + its('DisableAutomaticRestartSignOn') { should cmp 1 } + end +end \ No newline at end of file diff --git a/controls/SV-214936.rb b/controls/SV-214936.rb new file mode 100644 index 0000000..c706512 --- /dev/null +++ b/controls/SV-214936.rb @@ -0,0 +1,46 @@ +# encoding: UTF-8 + +control "SV-214936" do + title "Windows Server 2019 must have a host-based firewall installed and enabled." + desc "A firewall provides a line of defense against attack, allowing or blocking inbound and outbound connections based on a set of rules." + desc "rationale", "" + desc "check", "Determine if a host-based firewall is installed and enabled on the system. If a host-based firewall is not installed and enabled on the system, this is a finding. The configuration requirements will be determined by the applicable firewall STIG." + desc "fix", "Install and enable a host-based firewall on the system." + impact 0.5 + tag severity: nil + tag gtitle: "SRG-OS-000480-GPOS-00231" + tag gid: "V-93571" + tag rid: "SV-103657r1_rule" + tag stig_id: "WN19-00-000280" + tag fix_id: "F-99815r1_fix" + tag cci: ["CCI-000366", "CCI-002080"] + tag nist: ["CM-6 b", "CA-3 (5)", "Rev_4"] + + query_domain = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Domain' } | Select Enabled | ConvertTo-Json" }).params + query_private = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Private' } | Select Enabled | ConvertTo-Json" }).params + query_public = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Public' } | Select Enabled | ConvertTo-Json" }).params + + describe.one do + describe 'Windows Firewall should be Enabled' do + subject { query_public["Enabled"] } + it 'The Public host-based firewall' do + failure_message = "is not Enabled" + expect(subject).to eql(1), failure_message + end + end + describe 'Windows Firewall should be Enabled' do + subject { query_private["Enabled"] } + it 'The Private host-based firewall' do + failure_message = "is not enabled" + expect(subject).to eql(1), failure_message + end + end + describe 'Windows Firewall should be Enabled' do + subject { query_domain["Enabled"] } + it 'The Domain host-based firewall' do + failure_message = "is not Enabled" + expect(subject).to eql(1), failure_message + end + end + end +end \ No newline at end of file From 65d8f86ca99b161107abb7cd483716a31f1dee42 Mon Sep 17 00:00:00 2001 From: Emily Rodriguez Date: Tue, 21 Mar 2023 08:12:15 -0500 Subject: [PATCH 2/2] delete old names Signed-off-by: Emily Rodriguez --- controls/V-92961.rb | 44 -------- controls/V-92963.rb | 69 ------------ controls/V-92965.rb | 132 ---------------------- controls/V-92967.rb | 59 ---------- controls/V-92969.rb | 59 ---------- controls/V-92971.rb | 44 -------- controls/V-92973.rb | 41 ------- controls/V-92975.rb | 139 ----------------------- controls/V-92977.rb | 85 -------------- controls/V-92979.rb | 61 ----------- controls/V-92981.rb | 61 ----------- controls/V-92983.rb | 61 ----------- controls/V-92985.rb | 70 ------------ controls/V-92987.rb | 57 ---------- controls/V-92989.rb | 72 ------------ controls/V-92991.rb | 56 ---------- controls/V-92993.rb | 51 --------- controls/V-92995.rb | 79 ------------- controls/V-92997.rb | 70 ------------ controls/V-92999.rb | 76 ------------- controls/V-93001.rb | 74 ------------- controls/V-93003.rb | 68 ------------ controls/V-93005.rb | 75 ------------- controls/V-93007.rb | 88 --------------- controls/V-93009.rb | 139 ----------------------- controls/V-93011.rb | 112 ------------------- controls/V-93013.rb | 106 ------------------ controls/V-93015.rb | 113 ------------------- controls/V-93017.rb | 63 ----------- controls/V-93019.rb | 104 ------------------ controls/V-93021.rb | 125 --------------------- controls/V-93023.rb | 116 -------------------- controls/V-93025.rb | 139 ----------------------- controls/V-93027.rb | 68 ------------ controls/V-93029.rb | 90 --------------- controls/V-93031.rb | 115 ------------------- controls/V-93033.rb | 117 -------------------- controls/V-93035.rb | 188 ------------------------------- controls/V-93037.rb | 262 -------------------------------------------- controls/V-93039.rb | 71 ------------ controls/V-93041.rb | 75 ------------- controls/V-93043.rb | 84 -------------- controls/V-93045.rb | 64 ----------- controls/V-93047.rb | 68 ------------ controls/V-93049.rb | 58 ---------- controls/V-93051.rb | 72 ------------ controls/V-93053.rb | 72 ------------ controls/V-93055.rb | 61 ----------- controls/V-93057.rb | 70 ------------ controls/V-93059.rb | 72 ------------ controls/V-93061.rb | 56 ---------- controls/V-93063.rb | 69 ------------ controls/V-93065.rb | 76 ------------- controls/V-93067.rb | 62 ----------- controls/V-93069.rb | 66 ----------- controls/V-93071.rb | 91 --------------- controls/V-93073.rb | 47 -------- controls/V-93075.rb | 62 ----------- controls/V-93077.rb | 67 ----------- controls/V-93079.rb | 62 ----------- controls/V-93081.rb | 62 ----------- controls/V-93083.rb | 62 ----------- controls/V-93085.rb | 72 ------------ controls/V-93087.rb | 72 ------------ controls/V-93089.rb | 58 ---------- controls/V-93091.rb | 57 ---------- controls/V-93093.rb | 57 ---------- controls/V-93095.rb | 57 ---------- controls/V-93097.rb | 58 ---------- controls/V-93099.rb | 58 ---------- controls/V-93101.rb | 59 ---------- controls/V-93103.rb | 60 ---------- controls/V-93105.rb | 58 ---------- controls/V-93107.rb | 58 ---------- controls/V-93109.rb | 58 ---------- controls/V-93111.rb | 58 ---------- controls/V-93113.rb | 58 ---------- controls/V-93115.rb | 58 ---------- controls/V-93117.rb | 58 ---------- controls/V-93119.rb | 59 ---------- controls/V-93121.rb | 183 ------------------------------- controls/V-93123.rb | 223 ------------------------------------- controls/V-93125.rb | 166 ---------------------------- controls/V-93127.rb | 198 --------------------------------- controls/V-93129.rb | 171 ----------------------------- controls/V-93131.rb | 167 ---------------------------- controls/V-93133.rb | 68 ------------ controls/V-93135.rb | 68 ------------ controls/V-93137.rb | 68 ------------ controls/V-93139.rb | 68 ------------ controls/V-93141.rb | 58 ---------- controls/V-93143.rb | 53 --------- controls/V-93145.rb | 64 ----------- controls/V-93147.rb | 55 ---------- controls/V-93149.rb | 40 ------- controls/V-93151.rb | 43 -------- controls/V-93153.rb | 56 ---------- controls/V-93155.rb | 57 ---------- controls/V-93157.rb | 62 ----------- controls/V-93159.rb | 56 ---------- controls/V-93161.rb | 58 ---------- controls/V-93163.rb | 56 ---------- controls/V-93165.rb | 56 ---------- controls/V-93167.rb | 61 ----------- controls/V-93169.rb | 61 ----------- controls/V-93171.rb | 57 ---------- controls/V-93173.rb | 46 -------- controls/V-93175.rb | 44 -------- controls/V-93177.rb | 42 ------- controls/V-93179.rb | 43 -------- controls/V-93181.rb | 42 ------- controls/V-93183.rb | 30 ----- controls/V-93185.rb | 30 ----- controls/V-93187.rb | 97 ---------------- controls/V-93189.rb | 69 ------------ controls/V-93191.rb | 69 ------------ controls/V-93193.rb | 69 ------------ controls/V-93195.rb | 68 ------------ controls/V-93197.rb | 79 ------------- controls/V-93199.rb | 38 ------- controls/V-93201.rb | 38 ------- controls/V-93203.rb | 36 ------ controls/V-93205.rb | 54 --------- controls/V-93207.rb | 46 -------- controls/V-93209.rb | 76 ------------- controls/V-93211.rb | 73 ------------ controls/V-93213.rb | 72 ------------ controls/V-93215.rb | 42 ------- controls/V-93217.rb | 40 ------- controls/V-93219.rb | 38 ------- controls/V-93221.rb | 38 ------- controls/V-93223.rb | 56 ---------- controls/V-93225.rb | 49 --------- controls/V-93227.rb | 68 ------------ controls/V-93229.rb | 43 -------- controls/V-93231.rb | 42 ------- controls/V-93233.rb | 44 -------- controls/V-93235.rb | 43 -------- controls/V-93237.rb | 44 -------- controls/V-93239.rb | 37 ------- controls/V-93241.rb | 69 ------------ controls/V-93243.rb | 42 ------- controls/V-93245.rb | 114 ------------------- controls/V-93249.rb | 63 ----------- controls/V-93251.rb | 43 -------- controls/V-93253.rb | 47 -------- controls/V-93255.rb | 47 -------- controls/V-93257.rb | 49 --------- controls/V-93259.rb | 72 ------------ controls/V-93261.rb | 56 ---------- controls/V-93263.rb | 57 ---------- controls/V-93265.rb | 37 ------- controls/V-93267.rb | 56 ---------- controls/V-93269.rb | 31 ------ controls/V-93271.rb | 52 --------- controls/V-93273.rb | 42 ------- controls/V-93275.rb | 42 ------- controls/V-93277.rb | 66 ----------- controls/V-93279.rb | 31 ------ controls/V-93281.rb | 34 ------ controls/V-93283.rb | 29 ----- controls/V-93285.rb | 34 ------ controls/V-93287.rb | 33 ------ controls/V-93289.rb | 28 ----- controls/V-93291.rb | 31 ------ controls/V-93293.rb | 31 ------ controls/V-93295.rb | 31 ------ controls/V-93297.rb | 31 ------ controls/V-93299.rb | 31 ------ controls/V-93301.rb | 31 ------ controls/V-93303.rb | 31 ------ controls/V-93305.rb | 31 ------ controls/V-93307.rb | 31 ------ controls/V-93309.rb | 31 ------ controls/V-93311.rb | 42 ------- controls/V-93369.rb | 33 ------ controls/V-93373.rb | 31 ------ controls/V-93375.rb | 31 ------ controls/V-93377.rb | 31 ------ controls/V-93379.rb | 45 -------- controls/V-93381.rb | 26 ----- controls/V-93383.rb | 34 ------ controls/V-93385.rb | 34 ------ controls/V-93387.rb | 34 ------ controls/V-93389.rb | 34 ------ controls/V-93391.rb | 49 --------- controls/V-93393.rb | 48 -------- controls/V-93395.rb | 48 -------- controls/V-93397.rb | 33 ------ controls/V-93399.rb | 31 ------ controls/V-93401.rb | 33 ------ controls/V-93403.rb | 33 ------ controls/V-93405.rb | 33 ------ controls/V-93407.rb | 31 ------ controls/V-93409.rb | 33 ------ controls/V-93411.rb | 41 ------- controls/V-93413.rb | 41 ------- controls/V-93415.rb | 31 ------ controls/V-93417.rb | 56 ---------- controls/V-93419.rb | 42 ------- controls/V-93421.rb | 46 -------- controls/V-93423.rb | 34 ------ controls/V-93425.rb | 32 ------ controls/V-93427.rb | 32 ------ controls/V-93429.rb | 32 ------ controls/V-93431.rb | 43 -------- controls/V-93433.rb | 43 -------- controls/V-93435.rb | 43 -------- controls/V-93437.rb | 28 ----- controls/V-93439.rb | 50 --------- controls/V-93441.rb | 55 ---------- controls/V-93443.rb | 41 ------- controls/V-93445.rb | 40 ------- controls/V-93447.rb | 40 ------- controls/V-93449.rb | 41 ------- controls/V-93451.rb | 41 ------- controls/V-93453.rb | 33 ------ controls/V-93455.rb | 31 ------ controls/V-93457.rb | 103 ----------------- controls/V-93459.rb | 33 ------ controls/V-93461.rb | 28 ----- controls/V-93463.rb | 30 ----- controls/V-93465.rb | 31 ------ controls/V-93467.rb | 31 ------ controls/V-93469.rb | 31 ------ controls/V-93471.rb | 29 ----- controls/V-93473.rb | 60 ---------- controls/V-93475.rb | 70 ------------ controls/V-93477.rb | 29 ----- controls/V-93479.rb | 29 ----- controls/V-93481.rb | 43 -------- controls/V-93483.rb | 48 -------- controls/V-93485.rb | 37 ------- controls/V-93487.rb | 118 -------------------- controls/V-93489.rb | 116 -------------------- controls/V-93491.rb | 108 ------------------ controls/V-93493.rb | 36 ------ controls/V-93495.rb | 38 ------- controls/V-93497.rb | 30 ----- controls/V-93499.rb | 32 ------ controls/V-93501.rb | 32 ------ controls/V-93503.rb | 31 ------ controls/V-93505.rb | 31 ------ controls/V-93507.rb | 31 ------ controls/V-93509.rb | 67 ----------- controls/V-93511.rb | 33 ------ controls/V-93513.rb | 44 -------- controls/V-93515.rb | 29 ----- controls/V-93517.rb | 30 ----- controls/V-93519.rb | 45 -------- controls/V-93521.rb | 41 ------- controls/V-93523.rb | 45 -------- controls/V-93525.rb | 41 ------- controls/V-93527.rb | 41 ------- controls/V-93529.rb | 41 ------- controls/V-93531.rb | 54 --------- controls/V-93533.rb | 31 ------ controls/V-93535.rb | 69 ------------ controls/V-93537.rb | 31 ------ controls/V-93539.rb | 31 ------ controls/V-93541.rb | 32 ------ controls/V-93543.rb | 31 ------ controls/V-93545.rb | 42 ------- controls/V-93547.rb | 31 ------ controls/V-93549.rb | 31 ------ controls/V-93551.rb | 31 ------ controls/V-93553.rb | 33 ------ controls/V-93555.rb | 31 ------ controls/V-93557.rb | 31 ------ controls/V-93559.rb | 31 ------ controls/V-93561.rb | 31 ------ controls/V-93563.rb | 39 ------- controls/V-93567.rb | 24 ---- controls/V-93571.rb | 46 -------- 274 files changed, 15707 deletions(-) delete mode 100644 controls/V-92961.rb delete mode 100644 controls/V-92963.rb delete mode 100644 controls/V-92965.rb delete mode 100644 controls/V-92967.rb delete mode 100644 controls/V-92969.rb delete mode 100644 controls/V-92971.rb delete mode 100644 controls/V-92973.rb delete mode 100644 controls/V-92975.rb delete mode 100644 controls/V-92977.rb delete mode 100644 controls/V-92979.rb delete mode 100644 controls/V-92981.rb delete mode 100644 controls/V-92983.rb delete mode 100644 controls/V-92985.rb delete mode 100644 controls/V-92987.rb delete mode 100644 controls/V-92989.rb delete mode 100644 controls/V-92991.rb delete mode 100644 controls/V-92993.rb delete mode 100644 controls/V-92995.rb delete mode 100644 controls/V-92997.rb delete mode 100644 controls/V-92999.rb delete mode 100644 controls/V-93001.rb delete mode 100644 controls/V-93003.rb delete mode 100644 controls/V-93005.rb delete mode 100644 controls/V-93007.rb delete mode 100644 controls/V-93009.rb delete mode 100644 controls/V-93011.rb delete mode 100644 controls/V-93013.rb delete mode 100644 controls/V-93015.rb delete mode 100644 controls/V-93017.rb delete mode 100644 controls/V-93019.rb delete mode 100644 controls/V-93021.rb delete mode 100644 controls/V-93023.rb delete mode 100644 controls/V-93025.rb delete mode 100644 controls/V-93027.rb delete mode 100644 controls/V-93029.rb delete mode 100644 controls/V-93031.rb delete mode 100644 controls/V-93033.rb delete mode 100644 controls/V-93035.rb delete mode 100644 controls/V-93037.rb delete mode 100644 controls/V-93039.rb delete mode 100644 controls/V-93041.rb delete mode 100644 controls/V-93043.rb delete mode 100644 controls/V-93045.rb delete mode 100644 controls/V-93047.rb delete mode 100644 controls/V-93049.rb delete mode 100644 controls/V-93051.rb delete mode 100644 controls/V-93053.rb delete mode 100644 controls/V-93055.rb delete mode 100644 controls/V-93057.rb delete mode 100644 controls/V-93059.rb delete mode 100644 controls/V-93061.rb delete mode 100644 controls/V-93063.rb delete mode 100644 controls/V-93065.rb delete mode 100644 controls/V-93067.rb delete mode 100644 controls/V-93069.rb delete mode 100644 controls/V-93071.rb delete mode 100644 controls/V-93073.rb delete mode 100644 controls/V-93075.rb delete mode 100644 controls/V-93077.rb delete mode 100644 controls/V-93079.rb delete mode 100644 controls/V-93081.rb delete mode 100644 controls/V-93083.rb delete mode 100644 controls/V-93085.rb delete mode 100644 controls/V-93087.rb delete mode 100644 controls/V-93089.rb delete mode 100644 controls/V-93091.rb delete mode 100644 controls/V-93093.rb delete mode 100644 controls/V-93095.rb delete mode 100644 controls/V-93097.rb delete mode 100644 controls/V-93099.rb delete mode 100644 controls/V-93101.rb delete mode 100644 controls/V-93103.rb delete mode 100644 controls/V-93105.rb delete mode 100644 controls/V-93107.rb delete mode 100644 controls/V-93109.rb delete mode 100644 controls/V-93111.rb delete mode 100644 controls/V-93113.rb delete mode 100644 controls/V-93115.rb delete mode 100644 controls/V-93117.rb delete mode 100644 controls/V-93119.rb delete mode 100644 controls/V-93121.rb delete mode 100644 controls/V-93123.rb delete mode 100644 controls/V-93125.rb delete mode 100644 controls/V-93127.rb delete mode 100644 controls/V-93129.rb delete mode 100644 controls/V-93131.rb delete mode 100644 controls/V-93133.rb delete mode 100644 controls/V-93135.rb delete mode 100644 controls/V-93137.rb delete mode 100644 controls/V-93139.rb delete mode 100644 controls/V-93141.rb delete mode 100644 controls/V-93143.rb delete mode 100644 controls/V-93145.rb delete mode 100644 controls/V-93147.rb delete mode 100644 controls/V-93149.rb delete mode 100644 controls/V-93151.rb delete mode 100644 controls/V-93153.rb delete mode 100644 controls/V-93155.rb delete mode 100644 controls/V-93157.rb delete mode 100644 controls/V-93159.rb delete mode 100644 controls/V-93161.rb delete mode 100644 controls/V-93163.rb delete mode 100644 controls/V-93165.rb delete mode 100644 controls/V-93167.rb delete mode 100644 controls/V-93169.rb delete mode 100644 controls/V-93171.rb delete mode 100644 controls/V-93173.rb delete mode 100644 controls/V-93175.rb delete mode 100644 controls/V-93177.rb delete mode 100644 controls/V-93179.rb delete mode 100644 controls/V-93181.rb delete mode 100644 controls/V-93183.rb delete mode 100644 controls/V-93185.rb delete mode 100644 controls/V-93187.rb delete mode 100644 controls/V-93189.rb delete mode 100644 controls/V-93191.rb delete mode 100644 controls/V-93193.rb delete mode 100644 controls/V-93195.rb delete mode 100644 controls/V-93197.rb delete mode 100644 controls/V-93199.rb delete mode 100644 controls/V-93201.rb delete mode 100644 controls/V-93203.rb delete mode 100644 controls/V-93205.rb delete mode 100644 controls/V-93207.rb delete mode 100644 controls/V-93209.rb delete mode 100644 controls/V-93211.rb delete mode 100644 controls/V-93213.rb delete mode 100644 controls/V-93215.rb delete mode 100644 controls/V-93217.rb delete mode 100644 controls/V-93219.rb delete mode 100644 controls/V-93221.rb delete mode 100644 controls/V-93223.rb delete mode 100644 controls/V-93225.rb delete mode 100644 controls/V-93227.rb delete mode 100644 controls/V-93229.rb delete mode 100644 controls/V-93231.rb delete mode 100644 controls/V-93233.rb delete mode 100644 controls/V-93235.rb delete mode 100644 controls/V-93237.rb delete mode 100644 controls/V-93239.rb delete mode 100644 controls/V-93241.rb delete mode 100644 controls/V-93243.rb delete mode 100644 controls/V-93245.rb delete mode 100644 controls/V-93249.rb delete mode 100644 controls/V-93251.rb delete mode 100644 controls/V-93253.rb delete mode 100644 controls/V-93255.rb delete mode 100644 controls/V-93257.rb delete mode 100644 controls/V-93259.rb delete mode 100644 controls/V-93261.rb delete mode 100644 controls/V-93263.rb delete mode 100644 controls/V-93265.rb delete mode 100644 controls/V-93267.rb delete mode 100644 controls/V-93269.rb delete mode 100644 controls/V-93271.rb delete mode 100644 controls/V-93273.rb delete mode 100644 controls/V-93275.rb delete mode 100644 controls/V-93277.rb delete mode 100644 controls/V-93279.rb delete mode 100644 controls/V-93281.rb delete mode 100644 controls/V-93283.rb delete mode 100644 controls/V-93285.rb delete mode 100644 controls/V-93287.rb delete mode 100644 controls/V-93289.rb delete mode 100644 controls/V-93291.rb delete mode 100644 controls/V-93293.rb delete mode 100644 controls/V-93295.rb delete mode 100644 controls/V-93297.rb delete mode 100644 controls/V-93299.rb delete mode 100644 controls/V-93301.rb delete mode 100644 controls/V-93303.rb delete mode 100644 controls/V-93305.rb delete mode 100644 controls/V-93307.rb delete mode 100644 controls/V-93309.rb delete mode 100644 controls/V-93311.rb delete mode 100644 controls/V-93369.rb delete mode 100644 controls/V-93373.rb delete mode 100644 controls/V-93375.rb delete mode 100644 controls/V-93377.rb delete mode 100644 controls/V-93379.rb delete mode 100644 controls/V-93381.rb delete mode 100644 controls/V-93383.rb delete mode 100644 controls/V-93385.rb delete mode 100644 controls/V-93387.rb delete mode 100644 controls/V-93389.rb delete mode 100644 controls/V-93391.rb delete mode 100644 controls/V-93393.rb delete mode 100644 controls/V-93395.rb delete mode 100644 controls/V-93397.rb delete mode 100644 controls/V-93399.rb delete mode 100644 controls/V-93401.rb delete mode 100644 controls/V-93403.rb delete mode 100644 controls/V-93405.rb delete mode 100644 controls/V-93407.rb delete mode 100644 controls/V-93409.rb delete mode 100644 controls/V-93411.rb delete mode 100644 controls/V-93413.rb delete mode 100644 controls/V-93415.rb delete mode 100644 controls/V-93417.rb delete mode 100644 controls/V-93419.rb delete mode 100644 controls/V-93421.rb delete mode 100644 controls/V-93423.rb delete mode 100644 controls/V-93425.rb delete mode 100644 controls/V-93427.rb delete mode 100644 controls/V-93429.rb delete mode 100644 controls/V-93431.rb delete mode 100644 controls/V-93433.rb delete mode 100644 controls/V-93435.rb delete mode 100644 controls/V-93437.rb delete mode 100644 controls/V-93439.rb delete mode 100644 controls/V-93441.rb delete mode 100644 controls/V-93443.rb delete mode 100644 controls/V-93445.rb delete mode 100644 controls/V-93447.rb delete mode 100644 controls/V-93449.rb delete mode 100644 controls/V-93451.rb delete mode 100644 controls/V-93453.rb delete mode 100644 controls/V-93455.rb delete mode 100644 controls/V-93457.rb delete mode 100644 controls/V-93459.rb delete mode 100644 controls/V-93461.rb delete mode 100644 controls/V-93463.rb delete mode 100644 controls/V-93465.rb delete mode 100644 controls/V-93467.rb delete mode 100644 controls/V-93469.rb delete mode 100644 controls/V-93471.rb delete mode 100644 controls/V-93473.rb delete mode 100644 controls/V-93475.rb delete mode 100644 controls/V-93477.rb delete mode 100644 controls/V-93479.rb delete mode 100644 controls/V-93481.rb delete mode 100644 controls/V-93483.rb delete mode 100644 controls/V-93485.rb delete mode 100644 controls/V-93487.rb delete mode 100644 controls/V-93489.rb delete mode 100644 controls/V-93491.rb delete mode 100644 controls/V-93493.rb delete mode 100644 controls/V-93495.rb delete mode 100644 controls/V-93497.rb delete mode 100644 controls/V-93499.rb delete mode 100644 controls/V-93501.rb delete mode 100644 controls/V-93503.rb delete mode 100644 controls/V-93505.rb delete mode 100644 controls/V-93507.rb delete mode 100644 controls/V-93509.rb delete mode 100644 controls/V-93511.rb delete mode 100644 controls/V-93513.rb delete mode 100644 controls/V-93515.rb delete mode 100644 controls/V-93517.rb delete mode 100644 controls/V-93519.rb delete mode 100644 controls/V-93521.rb delete mode 100644 controls/V-93523.rb delete mode 100644 controls/V-93525.rb delete mode 100644 controls/V-93527.rb delete mode 100644 controls/V-93529.rb delete mode 100644 controls/V-93531.rb delete mode 100644 controls/V-93533.rb delete mode 100644 controls/V-93535.rb delete mode 100644 controls/V-93537.rb delete mode 100644 controls/V-93539.rb delete mode 100644 controls/V-93541.rb delete mode 100644 controls/V-93543.rb delete mode 100644 controls/V-93545.rb delete mode 100644 controls/V-93547.rb delete mode 100644 controls/V-93549.rb delete mode 100644 controls/V-93551.rb delete mode 100644 controls/V-93553.rb delete mode 100644 controls/V-93555.rb delete mode 100644 controls/V-93557.rb delete mode 100644 controls/V-93559.rb delete mode 100644 controls/V-93561.rb delete mode 100644 controls/V-93563.rb delete mode 100644 controls/V-93567.rb delete mode 100644 controls/V-93571.rb diff --git a/controls/V-92961.rb b/controls/V-92961.rb deleted file mode 100644 index b775b9e..0000000 --- a/controls/V-92961.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-92961" do - title "Windows Server 2019 machine inactivity limit must be set to 15 minutes -or less, locking the system with the screen saver." - desc "Unattended systems are susceptible to unauthorized use and should be -locked when unattended. The screen saver should be set at a maximum of 15 -minutes and be password protected. This protects critical and sensitive data -from exposure to unauthorized personnel with physical access to the computer." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: InactivityTimeoutSecs - - Value Type: REG_DWORD - Value: 0x00000384 (900) (or less, excluding \"0\" which is effectively -disabled)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> Security Options >> -\"Interactive logon: Machine inactivity limit\" to \"900\" seconds or less, -excluding \"0\" which is effectively disabled." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000028-GPOS-00009' - tag 'satisfies': ["SRG-OS-000028-GPOS-00009", "SRG-OS-000029-GPOS-00010", -"SRG-OS-000031-GPOS-00012"] - tag 'gid': 'V-92961' - tag 'rid': 'SV-103049r1_rule' - tag 'stig_id': 'WN19-SO-000120' - tag 'fix_id': 'F-99207r1_fix' - tag 'cci': ["CCI-000056", "CCI-000057", "CCI-000060"] - tag 'nist': ["AC-11 b", "AC-11 a", "AC-11 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System') do - its('InactivityTimeoutSecs') { should be <= 900 } - its('InactivityTimeoutSecs') { should_not eq 0 } - end -end - diff --git a/controls/V-92963.rb b/controls/V-92963.rb deleted file mode 100644 index 47267bb..0000000 --- a/controls/V-92963.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control 'V-92963' do - title "Windows Server 2019 Deny log on through Remote Desktop Services user -right on domain controllers must be configured to prevent unauthenticated -access." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on through Remote Desktop Services\" user right defines the -accounts that are prevented from logging on using Remote Desktop Services. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc 'rationale', '' - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -through Remote Desktop Services\" user right, this is a finding: - - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SID(s) are not defined for the -\"SeDenyRemoteInteractiveLogonRight\" user right, this is a finding. - - S-1-5-32-546 (Guests)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on through Remote Desktop Services\" to include the following: - - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000297-GPOS-00115' - tag 'gid': 'V-92963' - tag 'rid': 'SV-103051r1_rule' - tag 'stig_id': 'WN19-DC-000410' - tag 'fix_id': 'F-99209r1_fix' - tag 'cci': ['CCI-002314'] - tag 'nist': ['AC-17 (1)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should eq ['S-1-5-32-546'] } - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end diff --git a/controls/V-92965.rb b/controls/V-92965.rb deleted file mode 100644 index c348739..0000000 --- a/controls/V-92965.rb +++ /dev/null @@ -1,132 +0,0 @@ -# encoding: UTF-8 - -control "V-92965" do - title "Windows Server 2019 Deny log on through Remote Desktop Services user -right on domain-joined member servers must be configured to prevent access from -highly privileged domain accounts and all local accounts and from -unauthenticated access on all systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on through Remote Desktop Services\" user right defines the -accounts that are prevented from logging on using Remote Desktop Services. - - In an Active Directory Domain, denying logons to the Enterprise Admins and -Domain Admins groups on lower-trust systems helps mitigate the risk of -privilege escalation from credential theft attacks, which could lead to the -compromise of an entire domain. - - Local accounts on domain-joined systems must also be assigned this right to -decrease the risk of lateral movement resulting from credential theft attacks. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -through Remote Desktop Services\" user right, this is a finding: - - Domain Systems Only: - - Enterprise Admins group - - Domain Admins group - - Local account (see Note below) - - All Systems: - - Guests group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the -\"SeDenyRemoteInteractiveLogonRight\" user right, this is a finding. - - Domain Systems Only: - S-1-5-root domain-519 (Enterprise Admins) - S-1-5-domain-512 (Domain Admins) - S-1-5-113 (\"Local account\") - - All Systems: - S-1-5-32-546 (Guests) - - Note: \"Local account\" is referring to the Windows built-in security group." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on through Remote Desktop Services\" to include the following: - - Domain Systems Only: - - Enterprise Admins group - - Domain Admins group - - Local account (see Note below) - - All Systems: - - Guests group - - Note: \"Local account\" is referring to the Windows built-in security group." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000297-GPOS-00115' - tag 'gid': 'V-92965' - tag 'rid': 'SV-103053r1_rule' - tag 'stig_id': 'WN19-MS-000120' - tag 'fix_id': 'F-99211r1_fix' - tag 'cci': ["CCI-002314"] - tag 'nist': ["AC-17 (1)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.0 - desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do - skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - end - when '3' - domain_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Domain Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - domain_admin_sid = json(command: domain_query).params - enterprise_admin_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - enterprise_admin_sid = json(command: enterprise_admin_query).params - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should include "#{domain_admin_sid}" } - end - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should include "#{enterprise_admin_sid}" } - end - describe.one do - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should include "S-1-5-113" } - end - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should include "S-1-5-114" } - end - end - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should include 'S-1-5-32-546' } - end - when '2' - describe security_policy do - its('SeDenyRemoteInteractiveLogonRight') { should eq ['S-1-5-32-546'] } - end - end -end \ No newline at end of file diff --git a/controls/V-92967.rb b/controls/V-92967.rb deleted file mode 100644 index fe1fe63..0000000 --- a/controls/V-92967.rb +++ /dev/null @@ -1,59 +0,0 @@ -# encoding: UTF-8 - -control "V-92967" do - title "Windows Server 2019 must be configured to audit logon successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Logon records user logons. If this is an interactive logon, it is recorded -on the local system. If it is to a network share, it is recorded on the system -accessed." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Logon - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Logon/Logoff >> \"Audit Logon\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': "SRG-OS-000032-GPOS-00013" - tag 'satisfies': ["SRG-OS-000032-GPOS-00013", "SRG-OS-000470-GPOS-00214", -"SRG-OS-000472-GPOS-00217", "SRG-OS-000473-GPOS-00218", -"SRG-OS-000475-GPOS-00220"] - tag 'gid': 'V-92967' - tag 'rid': 'SV-103055r1_rule' - tag 'stig_id': 'WN19-AU-000190' - tag 'fix_id': 'F-99213r1_fix' - tag 'cci': ["CCI-000067", "CCI-000172"] - tag 'nist': ["AC-17 (1)", "AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Logon') { should eq 'Success' } - end - describe audit_policy do - its('Logon') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92969.rb b/controls/V-92969.rb deleted file mode 100644 index e218e93..0000000 --- a/controls/V-92969.rb +++ /dev/null @@ -1,59 +0,0 @@ -# encoding: UTF-8 - -control "V-92969" do - title "Windows Server 2019 must be configured to audit logon failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Logon records user logons. If this is an interactive logon, it is recorded -on the local system. If it is to a network share, it is recorded on the system -accessed." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Logon - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Logon/Logoff >> \"Audit Logon\" with \"Failure\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000032-GPOS-00013' - tag 'satisfies': ["SRG-OS-000032-GPOS-00013", "SRG-OS-000470-GPOS-00214", -"SRG-OS-000472-GPOS-00217", "SRG-OS-000473-GPOS-00218", -"SRG-OS-000475-GPOS-00220"] - tag 'gid': 'V-92969' - tag 'rid': 'SV-103057r1_rule' - tag 'stig_id': 'WN19-AU-000200' - tag 'fix_id': 'F-99215r1_fix' - tag 'cci': ["CCI-000067", "CCI-000172"] - tag 'nist': ["AC-17 (1)", "AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Logon') { should eq 'Failure' } - end - describe audit_policy do - its('Logon') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92971.rb b/controls/V-92971.rb deleted file mode 100644 index 1d316ce..0000000 --- a/controls/V-92971.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-92971" do - title "Windows Server 2019 Remote Desktop Services must require secure Remote -Procedure Call (RPC) communications." - desc "Allowing unsecure RPC communication exposes the system to -man-in-the-middle attacks and data disclosure attacks. A man-in-the-middle -attack occurs when an intruder captures packets between a client and server and -modifies them before allowing the packets to be exchanged. Usually the attacker -will modify the information in the packets in an attempt to cause either the -client or server to reveal sensitive information." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal -Services\\ - - Value Name: fEncryptRPCTraffic - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Remote Desktop Services >> -Remote Desktop Session Host >> Security >> \"Require secure RPC communication\" -to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000033-GPOS-00014' - tag 'satisfies': ["SRG-OS-000033-GPOS-00014", "SRG-OS-000250-GPOS-00093"] - tag 'gid': 'V-92971' - tag 'rid': 'SV-103059r1_rule' - tag 'stig_id': 'WN19-CC-000370' - tag 'fix_id': 'F-99217r1_fix' - tag 'cci': ["CCI-000068", "CCI-001453"] - tag 'nist': ["AC-17 (2)", "AC-17 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services') do - it { should have_property "fEncryptRPCTraffic"} - its("fEncryptRPCTraffic") { should cmp 1 } - end -end - diff --git a/controls/V-92973.rb b/controls/V-92973.rb deleted file mode 100644 index 3a39e9f..0000000 --- a/controls/V-92973.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-92973" do - title "Windows Server 2019 Remote Desktop Services must be configured with -the client connection encryption set to High Level." - desc "Remote connections must be encrypted to prevent interception of data -or sensitive information. Selecting \"High Level\" will ensure encryption of -Remote Desktop Services sessions in both directions." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal -Services\\ - - Value Name: MinEncryptionLevel - - Type: REG_DWORD - Value: 0x00000003 (3)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Remote Desktop Services >> -Remote Desktop Session Host >> Security >> \"Set client connection encryption -level\" to \"Enabled\" with \"High Level\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000033-GPOS-00014' - tag 'satisfies': ["SRG-OS-000033-GPOS-00014", "SRG-OS-000250-GPOS-00093"] - tag 'gid': 'V-92973' - tag 'rid': 'SV-103061r1_rule' - tag 'stig_id': 'WN19-CC-000380' - tag 'fix_id': 'F-99219r1_fix' - tag 'cci': ["CCI-000068", "CCI-001453"] - tag 'nist': ["AC-17 (2)", "AC-17 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services') do - it { should have_property "MinEncryptionLevel"} - its("MinEncryptionLevel") { should cmp 3 } - end -end - diff --git a/controls/V-92975.rb b/controls/V-92975.rb deleted file mode 100644 index 58a0a9d..0000000 --- a/controls/V-92975.rb +++ /dev/null @@ -1,139 +0,0 @@ -# encoding: UTF-8 - - control 'V-92975' do - title "Windows Server 2019 must automatically remove or disable temporary user accounts after #{input('temporary_account_period_phrase')}." - desc "If temporary user accounts remain active when no longer needed or for an excessive period, these accounts may be used to gain unauthorized access. To mitigate this risk, automated termination of all temporary accounts must be set upon account creation. - - Temporary accounts are established as part of normal account activation procedures when there is a need for short-term accounts without the demand for immediacy in account activation. - If temporary accounts are used, the operating system must be configured to automatically terminate these types of accounts after a #{input('org_name')[:acronym]}-defined time period of #{input('temporary_account_period_phrase')}. - To address access requirements, many operating systems may be integrated with enterprise-level authentication/access mechanisms that meet or exceed access control policy requirements." - desc 'rationale', '' - desc 'check', "Review temporary user accounts for expiration dates. - Determine if temporary user accounts are used and identify any that exist. If none exist, this is NA. - - Domain Controllers: - Open \"PowerShell\". - Enter \"Search-ADAccount -AccountExpiring | FT Name, AccountExpirationDate\". - If \"AccountExpirationDate\" has not been defined within #{input('temporary_account_period_phrase')} for any temporary user account, this is a finding. - - Member servers and standalone systems: - Open \"Command Prompt\". - Run \"Net user [username]\", where [username] is the name of the temporary user account. - If \"Account expires\" has not been defined within #{input('temporary_account_period_phrase')} for any temporary user account, this is a finding." - desc 'fix', "Configure temporary user accounts to automatically expire within #{input('temporary_account_period_phrase')}. - Domain accounts can be configured with an account expiration date, under \"Account\" properties. - Local accounts can be configured to expire with the command \"Net user [username] /expires:[mm/dd/yyyy]\", where username is the name of the temporary user account. - Delete any temporary user accounts that are no longer necessary." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000002-GPOS-00002' - tag 'gid': 'V-92975' - tag 'rid': 'SV-103063r1_rule' - tag 'stig_id': 'WN19-00-000300' - tag 'fix_id': 'F-99221r1_fix' - tag 'cci': ['CCI-000016'] - tag 'nist': ['AC-2 (2)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - expiring_accounts = [] - temporary_accounts = input('temp_accounts_domain') - unless temporary_accounts == [nil] - temporary_accounts.each do |temporary_account| - expiring_accounts << json({ command: "Get-ADUser -Identity #{temporary_account} -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json" }).params - end - end - ad_accounts = json({ command: "Get-ADUser -Filter 'Enabled -eq $true' -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json" }).params - if ad_accounts.empty? - impact 0.0 - describe 'This control is not applicable as no user accounts were found' do - skip 'This control is not applicable as no user accounts were found' - end - else - case ad_accounts - when Hash # One user account - if ad_accounts.fetch('AccountExpirationDate').nil? - impact 0.0 - describe 'This control is not applicable as no expiring user accounts were found' do - skip 'This control is not applicable as no expiring user accounts were found' - end - else - expiring_accounts << ad_accounts unless expiring_accounts.any? { |h| h['SamAccountName'] == ad_accounts.fetch('SamAccountName') } - end - when Array # Multiple user accounts - ad_accounts.each do |ad_account| - next if ad_account.fetch('AccountExpirationDate').nil? - expiring_accounts << ad_account unless expiring_accounts.any? { |h| h['SamAccountName'] == ad_account.fetch('SamAccountName') } - end - end - end - if expiring_accounts.empty? - impact 0.0 - describe 'This control is not applicable as no expiring user accounts were found' do - skip 'This control is not applicable as no expiring user accounts were found' - end - else - expiring_accounts.each do |expiring_account| - account_name = expiring_account.fetch('SamAccountName') - creation_date = Date.parse(expiring_account.fetch('WhenCreated')) - expiration_date = Date.parse(expiring_account.fetch('AccountExpirationDate')) - date_difference = expiration_date.mjd - creation_date.mjd - describe "Account expiration set for #{account_name}" do - subject { date_difference } - it { should cmp <= input('temporary_account_period') } - end - end - end - - else - expiring_users = [] - temporary_accounts = input('temp_accounts_local') - unless temporary_accounts == [nil] - temporary_accounts.each do |temporary_account| - expiring_users << json({ command: "Get-LocalUser -Name #{temporary_account} | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json" }).params - end - end - local_users = json({ command: "Get-LocalUser * | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json" }).params - if local_users.empty? - impact 0.0 - describe 'This control is not applicable as no user accounts were found' do - skip 'This control is not applicable as no user accounts were found' - end - else - case local_users - when Hash # One user account - if local_users.fetch('AccountExpires').nil? || local_user.fetch('PasswordLastSet').nil? - impact 0.0 - describe 'This control is not applicable as no expiring user accounts with password last set date were found' do - skip 'This control is not applicable as no expiring user accounts password last set date were found' - end - else - expiring_users << local_users unless expiring_users.any? { |h| h['Name'] == local_users.fetch('Name') } - end - when Array # Multiple user accounts - local_users.each do |local_user| - next if local_user.fetch('AccountExpires').nil? || local_user.fetch('PasswordLastSet').nil? - expiring_users << local_user unless expiring_users.any? { |h| h['Name'] == local_user.fetch('Name') } - end - end - end - if expiring_users.empty? - impact 0.0 - describe 'This control is not applicable as no expiring user accounts with password last set date were found' do - skip 'This control is not applicable as no expiring user accounts with password last set date were found' - end - else - expiring_users.each do |expiring_account| - user_name = expiring_account.fetch('Name') - password_date = Date.parse(expiring_account.fetch('PasswordLastSet')) - expiration_date = Date.parse(expiring_account.fetch('AccountExpires')) - date_difference = expiration_date.mjd - password_date.mjd - describe "Account expiration set for #{user_name}" do - subject { date_difference } - it { should cmp <= input('temporary_account_period') } - end - end - end - end - end \ No newline at end of file diff --git a/controls/V-92977.rb b/controls/V-92977.rb deleted file mode 100644 index e4586ab..0000000 --- a/controls/V-92977.rb +++ /dev/null @@ -1,85 +0,0 @@ -# encoding: UTF-8 - -control "V-92977" do - title "Windows Server 2019 must automatically remove or disable emergency accounts after the crisis is resolved or within #{input('emergency_account_period_phrase')}." - desc "Emergency administrator accounts are privileged accounts established in response to crisis situations where the need for rapid account activation is required. Therefore, emergency account activation may bypass normal account authorization processes. If these accounts are automatically disabled, system maintenance during emergencies may not be possible, thus adversely affecting system availability. - Emergency administrator accounts are different from infrequently used accounts (i.e., local logon accounts used by system administrators when network or normal logon/access is not available). Infrequently used accounts are not subject to automatic termination dates. Emergency accounts are accounts created in response to crisis situations, usually for use by maintenance personnel. The automatic expiration or disabling time period may be extended as needed until the crisis is resolved; however, it must not be extended indefinitely. A permanent account should be established for privileged users who need long-term maintenance accounts. - To address access requirements, many operating systems can be integrated with enterprise-level authentication/access mechanisms that meet or exceed access control policy requirements." - desc "rationale", "" - desc 'check', "Determine if emergency administrator accounts are used and identify any that exist. If none exist, this is NA. - If emergency administrator accounts cannot be configured with an expiration date due to an ongoing crisis, the accounts must be disabled or removed when the crisis is resolved. - If emergency administrator accounts have not been configured with an expiration date or have not been disabled or removed following the resolution of a crisis, this is a finding. - - Domain Controllers: - Open \"PowerShell\". - Enter \"Search-ADAccount -AccountExpiring | FT Name, AccountExpirationDate\". - If \"AccountExpirationDate\" has been defined and is not within #{input('emergency_account_period_phrase')} for an emergency administrator account, this is a finding. - - Member servers and standalone systems: - Open \"Command Prompt\". - Run \"Net user [username]\", where [username] is the name of the emergency account. - If \"Account expires\" has been defined and is not within #{input('emergency_account_period_phrase')} for an emergency administrator account, this is a finding." - desc 'fix', "Remove emergency administrator accounts after a crisis has been resolved or configure the accounts to automatically expire within #{input('emergency_account_period_phrase')}. - Domain accounts can be configured with an account expiration date, under \"Account\" properties. - Local accounts can be configured to expire with the command \"Net user [username] /expires:[mm/dd/yyyy]\", where username is the name of the temporary user account." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000123-GPOS-00064' - tag 'gid': 'V-92977' - tag 'rid': 'SV-103065r1_rule' - tag 'stig_id': 'WN19-00-000310' - tag 'fix_id': 'F-99223r1_fix' - tag 'cci': ["CCI-001682"] - tag 'nist': ["AC-2 (2)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - emergency_accounts_list = input('emergency_accounts_domain') - if emergency_accounts_list == [nil] - impact 0.0 - describe 'There are no Emergency Account listed for this Control' do - skip 'This becomes a manual check if the input emergency_accounts_domain is not assigned a value' - end - else - emergency_accounts = [] - emergency_accounts_list.each do |emergency_account| - emergency_accounts << json({ command: "Get-ADUser -Identity #{emergency_account} -Properties WhenCreated, AccountExpirationDate | Select-Object -Property SamAccountName, @{Name='WhenCreated';Expression={$_.WhenCreated.ToString('yyyy-MM-dd')}}, @{Name='AccountExpirationDate';Expression={$_.AccountExpirationDate.ToString('yyyy-MM-dd')}}| ConvertTo-Json"}).params - end - emergency_accounts.each do |emergency_account| - account_name = emergency_account.fetch("SamAccountName") - creation_date = Date.parse(emergency_account.fetch("WhenCreated")) - expiration_date = Date.parse(emergency_account.fetch("AccountExpirationDate")) - date_difference = expiration_date.mjd - creation_date.mjd - describe "Account expiration set for #{account_name}" do - subject { date_difference } - it { should cmp <= input('emergency_account_period')} - end - end - end - - else - emergency_accounts_list = input('emergency_accounts_local') - if emergency_accounts_list == [nil] - impact 0.0 - describe 'There are no Emergency Account listed for this Control' do - skip 'This is not applicable as there are no Emergency Account listed for this Control' - end - else - emergency_accounts = [] - emergency_accounts_list.each do |emergency_account| - emergency_accounts << json({ command: "Get-LocalUser -Name #{emergency_account} | Select-Object -Property Name, @{Name='PasswordLastSet';Expression={$_.PasswordLastSet.ToString('yyyy-MM-dd')}}, @{Name='AccountExpires';Expression={$_.AccountExpires.ToString('yyyy-MM-dd')}} | ConvertTo-Json"}).params - end - emergency_accounts.each do |emergency_account| - user_name = emergency_account.fetch("Name") - password_date = Date.parse(emergency_account.fetch("PasswordLastSet")) - expiration_date = Date.parse(emergency_account.fetch("AccountExpires")) - date_difference = expiration_date.mjd - password_date.mjd - describe "Account expiration set for #{user_name}" do - subject { date_difference } - it { should cmp <= input('emergency_account_period')} - end - end - end - end -end \ No newline at end of file diff --git a/controls/V-92979.rb b/controls/V-92979.rb deleted file mode 100644 index 75699d0..0000000 --- a/controls/V-92979.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-92979" do - title "Windows Server 2019 must be configured to audit Account Management - -Security Group Management successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Security Group Management records events such as creating, deleting, or -changing security groups, including changes in group members." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Management >> Security Group Management - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit Security Group -Management\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000004-GPOS-00004' - tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", -"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", -"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] - tag 'gid': 'V-92979' - tag 'rid': 'SV-103067r1_rule' - tag 'stig_id': 'WN19-AU-000100' - tag 'fix_id': 'F-99225r1_fix' - tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", -"CCI-001405", "CCI-002130"] - tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 -(4)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Security Group Management') { should eq 'Success' } - end - describe audit_policy do - its('Security Group Management') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92981.rb b/controls/V-92981.rb deleted file mode 100644 index 2b4d298..0000000 --- a/controls/V-92981.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-92981" do - title "Windows Server 2019 must be configured to audit Account Management - -User Account Management successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - User Account Management records events such as creating, changing, -deleting, renaming, disabling, or enabling user accounts." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Management >> User Account Management - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit User Account -Management\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000004-GPOS-00004' - tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", -"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", -"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] - tag 'gid': 'V-92981' - tag 'rid': 'SV-103069r1_rule' - tag 'stig_id': 'WN19-AU-000110' - tag 'fix_id': 'F-99227r1_fix' - tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", -"CCI-001405", "CCI-002130"] - tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 -(4)", "Rev_4"] - - describe.one do - describe audit_policy do - its('User Account Management') { should eq 'Success' } - end - describe audit_policy do - its('User Account Management') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92983.rb b/controls/V-92983.rb deleted file mode 100644 index 4fefcc0..0000000 --- a/controls/V-92983.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-92983" do - title "Windows Server 2019 must be configured to audit Account Management - -User Account Management failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - User Account Management records events such as creating, changing, -deleting, renaming, disabling, or enabling user accounts." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Management >> User Account Management - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit User Account -Management\" with \"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000004-GPOS-00004' - tag 'satisfies': ["SRG-OS-000004-GPOS-00004", "SRG-OS-000239-GPOS-00089", -"SRG-OS-000240-GPOS-00090", "SRG-OS-000241-GPOS-00091", -"SRG-OS-000303-GPOS-00120", "SRG-OS-000476-GPOS-00221"] - tag 'gid': 'V-92983' - tag 'rid': 'SV-103071r1_rule' - tag 'stig_id': 'WN19-AU-000120' - tag 'fix_id': 'F-99229r1_fix' - tag 'cci': ["CCI-000018", "CCI-000172", "CCI-001403", "CCI-001404", -"CCI-001405", "CCI-002130"] - tag 'nist': ["AC-2 (4)", "AU-12 c", "AC-2 (4)", "AC-2 (4)", "AC-2 (4)", "AC-2 -(4)", "Rev_4"] - - describe.one do - describe audit_policy do - its('User Account Management') { should eq 'Failure' } - end - describe audit_policy do - its('User Account Management') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92985.rb b/controls/V-92985.rb deleted file mode 100644 index 28e531d..0000000 --- a/controls/V-92985.rb +++ /dev/null @@ -1,70 +0,0 @@ -# encoding: UTF-8 - -control 'V-92985' do - title "Windows Server 2019 must be configured to audit Account Management - -Computer Account Management successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Computer Account Management records events such as creating, changing, -deleting, renaming, disabling, or enabling computer accounts." - desc 'rationale', '' - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Management >> Computer Account Management - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit Computer Account -Management\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000004-GPOS-00004' - tag 'satisfies': %w(SRG-OS-000004-GPOS-00004 SRG-OS-000239-GPOS-00089 -SRG-OS-000240-GPOS-00090 SRG-OS-000241-GPOS-00091 -SRG-OS-000303-GPOS-00120 SRG-OS-000476-GPOS-00221) - tag 'gid': 'V-92985' - tag 'rid': 'SV-103073r1_rule' - tag 'stig_id': 'WN19-DC-000230' - tag 'fix_id': 'F-99231r1_fix' - tag 'cci': %w(CCI-000018 CCI-000172 CCI-001403 CCI-001404 -CCI-001405 CCI-002130) - tag 'nist': ['AC-2 (4)', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', "AC-2 -(4)", 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - describe.one do - describe audit_policy do - its('Computer Account Management') { should eq 'Success' } - end - describe audit_policy do - its('Computer Account Management') { should eq 'Success and Failure' } - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable' do - skip 'This system is not a domain controller, therefore this control is not applicable' - end - end -end diff --git a/controls/V-92987.rb b/controls/V-92987.rb deleted file mode 100644 index 20c1cb3..0000000 --- a/controls/V-92987.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-92987" do - title "Windows Server 2019 must be configured to audit Logon/Logoff - Account -Lockout successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Account Lockout events can be used to identify potentially malicious logon -attempts." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Account Lockout - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Logon/Logoff >> \"Audit Account Lockout\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000240-GPOS-00090' - tag 'satisfies': ["SRG-OS-000240-GPOS-00090", "SRG-OS-000470-GPOS-00214"] - tag 'gid': 'V-92987' - tag 'rid': 'SV-103075r1_rule' - tag 'stig_id': 'WN19-AU-000150' - tag 'fix_id': 'F-99233r1_fix' - tag 'cci': ["CCI-000172", "CCI-001404"] - tag 'nist': ["AU-12 c", "AC-2 (4)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Account Lockout') { should eq 'Success' } - end - describe audit_policy do - its('Account Lockout') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-92989.rb b/controls/V-92989.rb deleted file mode 100644 index 7334b34..0000000 --- a/controls/V-92989.rb +++ /dev/null @@ -1,72 +0,0 @@ - -control 'V-92985' do - title "Windows Server 2019 must be configured to audit Account Management - -Computer Account Management successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Computer Account Management records events such as creating, changing, -deleting, renaming, disabling, or enabling computer accounts." - desc 'rationale', '' - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Management >> Computer Account Management - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit Computer Account -Management\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000004-GPOS-00004' - tag 'satisfies': %w(SRG-OS-000004-GPOS-00004 SRG-OS-000239-GPOS-00089 -SRG-OS-000240-GPOS-00090 SRG-OS-000241-GPOS-00091 -SRG-OS-000303-GPOS-00120 SRG-OS-000476-GPOS-00221) - tag 'gid': 'V-92985' - tag 'rid': 'SV-103073r1_rule' - tag 'stig_id': 'WN19-DC-000230' - tag 'fix_id': 'F-99231r1_fix' - tag 'cci': %w(CCI-000018 CCI-000172 CCI-001403 CCI-001404 -CCI-001405 CCI-002130) - tag 'nist': ['AC-2 (4)', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', "AC-2 -(4)", 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.5 - describe.one do - describe audit_policy do - its('Computer Account Management') { should eq 'Success' } - end - describe audit_policy do - its('Computer Account Management') { should eq 'Success and Failure' } - end - end - when '2', '3' - impact 0.0 - desc 'This system is exempt from this control' - describe 'This system is exempt from this control' do - skip 'This system is exempt from this control' - end - end -end diff --git a/controls/V-92991.rb b/controls/V-92991.rb deleted file mode 100644 index f73b604..0000000 --- a/controls/V-92991.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-92991" do - title "Windows Server 2019 local volumes must use a format that supports NTFS -attributes." - desc "The ability to set access permissions and auditing is critical to -maintaining the security and proper access controls of a system. To support -this, volumes must be formatted using a file system that supports NTFS -attributes." - desc "rationale", "" - desc 'check', "Open \"Computer Management\". - - Select \"Disk Management\" under \"Storage\". - - For each local volume, if the file system does not indicate \"NTFS\", this -is a finding. - - \"ReFS\" (resilient file system) is also acceptable and would not be a -finding. - - This does not apply to system partitions such the Recovery and EFI System -Partition." - desc 'fix', "Format volumes to use NTFS or ReFS." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-92991' - tag 'rid': 'SV-103079r1_rule' - tag 'stig_id': 'WN19-00-000130' - tag 'fix_id': 'F-99237r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - get_volumes = command("wmic logicaldisk where DriveType=3 get FileSystem | findstr /r /v '^$' |Findstr /v 'FileSystem'").stdout.strip.split("\r\n") - - get_volumes.each do |volume| - volumes = volume.strip - describe.one do - describe 'The format local volumes' do - subject { volumes } - it { should eq 'NTFS' } - end - describe 'The format local volumes' do - subject { volumes } - it { should eq 'ReFS' } - end - end - end - if get_volumes.empty? - impact 0.0 - describe 'There are no local volumes' do - skip 'This control is not applicable' - end - end -end - diff --git a/controls/V-92993.rb b/controls/V-92993.rb deleted file mode 100644 index b532c3c..0000000 --- a/controls/V-92993.rb +++ /dev/null @@ -1,51 +0,0 @@ -# encoding: UTF-8 - -control "V-92993" do - title "Windows Server 2019 non-administrative accounts or groups must only -have print permissions on printer shares." - desc "Windows shares are a means by which files, folders, printers, and -other resources can be published for network users to access. Improper -configuration can permit access to devices and data beyond a user's need." - desc "rationale", "" - desc 'check', "Open \"Printers & scanners\" in \"Settings\". - - If there are no printers configured, this is NA. (Exclude Microsoft Print -to PDF and Microsoft XPS Document Writer, which do not support sharing.) - - For each printer: - - Select the printer and \"Manage\". - - Select \"Printer Properties\". - - Select the \"Sharing\" tab. - - If \"Share this printer\" is checked, select the \"Security\" tab. - - If any standard user accounts or groups have permissions other than -\"Print\", this is a finding. - - The default is for the \"Everyone\" group to be given \"Print\" permission. - - \"All APPLICATION PACKAGES\" and \"CREATOR OWNER\" are not standard user -accounts." - desc 'fix', "Configure the permissions on shared printers to restrict -standard users to only have Print permissions." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-92993' - tag 'rid': 'SV-103081r1_rule' - tag 'stig_id': 'WN19-00-000180' - tag 'fix_id': 'F-99239r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - describe "A manual review is required to verify that Non Administrative user accounts or groups only have print - permissions on printer shares" do - skip 'A manual review is required to verify that Non Administrative user accounts or groups only have print - permissions on printer shares' - end - -end - diff --git a/controls/V-92995.rb b/controls/V-92995.rb deleted file mode 100644 index 14a65c8..0000000 --- a/controls/V-92995.rb +++ /dev/null @@ -1,79 +0,0 @@ -# encoding: UTF-8 - -control "V-92995" do - title "Windows Server 2019 Access this computer from the network user right must only be assigned to the Administrators, Authenticated Users, and Enterprise Domain Controllers groups on domain controllers." - desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. - Accounts with the \"Access this computer from the network\" right may access resources on the system, and this right must be limited to those requiring it." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. - If any accounts or groups other than the following are granted the \"Access this computer from the network\" right, this is a finding. - - Administrators - - Authenticated Users - - Enterprise Domain Controllers - - For server core installations, run the following command: - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - Review the text file. - If any SIDs other than the following are granted the \"SeNetworkLogonRight\" user right, this is a finding. - S-1-5-32-544 (Administrators) - S-1-5-11 (Authenticated Users) - S-1-5-9 (Enterprise Domain Controllers) - - If an application requires this user right, this would not be a finding. - Vendor documentation must support the requirement for having the user right. - The requirement must be documented with the ISSO. - The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Access this computer from the network\" to include only the following accounts or groups: - - Administrators - - Authenticated Users - - Enterprise Domain Controllers" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-92995' - tag 'rid': 'SV-103083r1_rule' - tag 'stig_id': 'WN19-DC-000340' - tag 'fix_id': 'F-99241r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - active_network_access_users = security_policy.SeNetworkLogonRight.entries - allowed_network_access_users = input("allowed_network_access_users") - disallowed_network_access_users = input("disallowed_network_access_users") - unauthorized_users = [] - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - if domain_role == '4' || domain_role == '5' - active_network_access_users.each do |user| - next if allowed_network_access_users.include?(user) - unauthorized_users << user - end - disallowed_network_access_users.each do |user| - unless disallowed_network_access_users == [nil] || unauthorized_users.include?(user) - unauthorized_users << user - end - end - describe "Network Logon Privilege must be limited to" do - it "Authorized SIDs: #{allowed_network_access_users}" do - failure_message = "Unauthorized SIDs: #{unauthorized_users}" - expect(unauthorized_users).to be_empty, failure_message - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end - end -end \ No newline at end of file diff --git a/controls/V-92997.rb b/controls/V-92997.rb deleted file mode 100644 index 3b4fc50..0000000 --- a/controls/V-92997.rb +++ /dev/null @@ -1,70 +0,0 @@ -# encoding: UTF-8 - -control "V-92997" do - title "Windows Server 2019 Allow log on through Remote Desktop Services user -right must only be assigned to the Administrators group on domain controllers." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Allow log on through Remote Desktop Services\" user -right can access a system through Remote Desktop." - desc "rationale", "" - desc 'check', "This applies to domain controllers, it is NA for other systems. - - Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Allow -log on through Remote Desktop Services\" user right, this is a finding. - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeRemoteInteractiveLogonRight\" user right, this is a finding. - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Allow log -on through Remote Desktop Services\" to include only the following accounts or -groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-92997' - tag 'rid': 'SV-103085r1_rule' - tag 'stig_id': 'WN19-DC-000360' - tag 'fix_id': 'F-99243r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeRemoteInteractiveLogonRight') { should eq ['S-1-5-32-544'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-92999.rb b/controls/V-92999.rb deleted file mode 100644 index bf79eab..0000000 --- a/controls/V-92999.rb +++ /dev/null @@ -1,76 +0,0 @@ -# encoding: UTF-8 - -control "V-92999" do - title "Windows Server 2019 Deny access to this computer from the network user -right on domain controllers must be configured to prevent unauthenticated -access." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny access to this computer from the network\" user right defines -the accounts that are prevented from logging on from the network. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny access -to this computer from the network\" user right, this is a finding: - - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the \"SeDenyNetworkLogonRight\" -user right, this is a finding. - - S-1-5-32-546 (Guests)" - desc 'fix', " - Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny -access to this computer from the network\" to include the following: - - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-92999' - tag 'rid': 'SV-103087r1_rule' - tag 'stig_id': 'WN19-DC-000370' - tag 'fix_id': 'F-99245r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeDenyNetworkLogonRight') { should eq ['S-1-5-32-546'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93001.rb b/controls/V-93001.rb deleted file mode 100644 index a919b04..0000000 --- a/controls/V-93001.rb +++ /dev/null @@ -1,74 +0,0 @@ -# encoding: UTF-8 - -control "V-93001" do - title "Windows Server 2019 Deny log on as a batch job user right on domain -controllers must be configured to prevent unauthenticated access." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on as a batch job\" user right defines accounts that are -prevented from logging on to the system as a batch job, such as Task Scheduler. - - The Guests group must be assigned to prevent unauthenticated access." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -as a batch job\" user right, this is a finding: - - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SID(s) are not defined for the \"SeDenyBatchLogonRight\" -user right, this is a finding: - - S-1-5-32-546 (Guests)" - desc 'fix', " - Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on as a batch job\" to include the following: - - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93001' - tag 'rid': 'SV-103089r1_rule' - tag 'stig_id': 'WN19-DC-000380' - tag 'fix_id': 'F-99247r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeDenyBatchLogonRight') { should eq ['S-1-5-32-546'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93003.rb b/controls/V-93003.rb deleted file mode 100644 index acfa03d..0000000 --- a/controls/V-93003.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93003" do - title "Windows Server 2019 Deny log on as a service user right must be -configured to include no accounts or groups (blank) on domain controllers." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on as a service\" user right defines accounts that are -denied logon as a service. - - Incorrect configurations could prevent services from starting and result in -a denial of service." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are defined for the \"Deny log on as a service\" -user right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeDenyServiceLogonRight\" user right, this is -a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Deny log on as a service\" to include no entries (blank)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93003' - tag 'rid': 'SV-103091r1_rule' - tag 'stig_id': 'WN19-DC-000390' - tag 'fix_id': 'F-99249r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeDenyServiceLogonRight') { should eq [] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93005.rb b/controls/V-93005.rb deleted file mode 100644 index 6fd2f9c..0000000 --- a/controls/V-93005.rb +++ /dev/null @@ -1,75 +0,0 @@ -# encoding: UTF-8 - -control "V-93005" do - title "Windows Server 2019 Deny log on locally user right on domain -controllers must be configured to prevent unauthenticated access." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on locally\" user right defines accounts that are prevented -from logging on interactively. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -locally\" user right, this is a finding: - - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SID(s) are not defined for the -\"SeDenyInteractiveLogonRight\" user right, this is a finding: - - S-1-5-32-546 (Guests)" - desc 'fix', " - Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on locally\" to include the following: - - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93005' - tag 'rid': 'SV-103093r1_rule' - tag 'stig_id': 'WN19-DC-000400' - tag 'fix_id': 'F-99251r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeDenyInteractiveLogonRight') { should eq ['S-1-5-32-546'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93007.rb b/controls/V-93007.rb deleted file mode 100644 index 0358138..0000000 --- a/controls/V-93007.rb +++ /dev/null @@ -1,88 +0,0 @@ -# encoding: UTF-8 - -control "V-93007" do - title "Windows Server 2019 Access this computer from the network user right -must only be assigned to the Administrators and Authenticated Users groups on -domain-joined member servers and standalone systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Access this computer from the network\" user right may -access resources on the system, and this right must be limited to those -requiring it." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Access -this computer from the network\" user right, this is a finding: - - - Administrators - - Authenticated Users - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeNetworkLogonRight\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - S-1-5-11 (Authenticated Users) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', " - Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Access -this computer from the network\" to include only the following accounts or -groups: - - - Administrators - - Authenticated Users" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93007' - tag 'rid': 'SV-103095r1_rule' - tag 'stig_id': 'WN19-MS-000070' - tag 'fix_id': 'F-99253r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - impact 0.0 - describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do - skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' - end - else - describe security_policy do - its('SeNetworkLogonRight') { should eq ['S-1-5-11', 'S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93009.rb b/controls/V-93009.rb deleted file mode 100644 index 023f3db..0000000 --- a/controls/V-93009.rb +++ /dev/null @@ -1,139 +0,0 @@ -# encoding: UTF-8 - -control "V-93009" do - title "Windows Server 2019 Deny access to this computer from the network user -right on domain-joined member servers must be configured to prevent access from -highly privileged domain accounts and local accounts and from unauthenticated -access on all systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny access to this computer from the network\" user right defines -the accounts that are prevented from logging on from the network. - - In an Active Directory Domain, denying logons to the Enterprise Admins and -Domain Admins groups on lower-trust systems helps mitigate the risk of -privilege escalation from credential theft attacks, which could lead to the -compromise of an entire domain. - - Local accounts on domain-joined systems must also be assigned this right to -decrease the risk of lateral movement resulting from credential theft attacks. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny access -to this computer from the network\" user right, this is a finding: - - Domain Systems Only: - - Enterprise Admins group - - Domain Admins group - - \"Local account and member of Administrators group\" or \"Local account\" -(see Note below) - - All Systems: - - Guests group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the \"SeDenyNetworkLogonRight\" -user right, this is a finding. - - Domain Systems Only: - S-1-5-root domain-519 (Enterprise Admins) - S-1-5-domain-512 (Domain Admins) - S-1-5-114 (\"Local account and member of Administrators group\") or -S-1-5-113 (\"Local account\") - - All Systems: - S-1-5-32-546 (Guests) - - Note: These are built-in security groups. \"Local account\" is more -restrictive but may cause issues on servers such as systems that provide -failover clustering." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny -access to this computer from the network\" to include the following: - - Domain Systems Only: - - Enterprise Admins group - - Domain Admins group - - \"Local account and member of Administrators group\" or \"Local account\" -(see Note below) - - All Systems: - - Guests group - - Note: These are built-in security groups. \"Local account\" is more -restrictive but may cause issues on servers such as systems that provide -failover clustering." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93009' - tag 'rid': 'SV-103097r1_rule' - tag 'stig_id': 'WN19-MS-000080' - tag 'fix_id': 'F-99255r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.0 - desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do - skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - end - when '3' - domain_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Domain Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - domain_admin_sid = json(command: domain_query).params - enterprise_admin_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - enterprise_admin_sid = json(command: enterprise_admin_query).params - describe security_policy do - its('SeDenyNetworkLogonRight') { should include "#{domain_admin_sid}" } - end - describe security_policy do - its('SeDenyNetworkLogonRight') { should include "#{enterprise_admin_sid}" } - end - describe.one do - describe security_policy do - its('SeDenyNetworkLogonRight') { should include "S-1-5-113" } - end - describe security_policy do - its('SeDenyNetworkLogonRight') { should include "S-1-5-114" } - end - end - describe security_policy do - its('SeDenyNetworkLogonRight') { should include 'S-1-5-32-546' } - end - when '2' - describe security_policy do - its('SeDenyNetworkLogonRight') { should eq ['S-1-5-32-546'] } - end - end -end diff --git a/controls/V-93011.rb b/controls/V-93011.rb deleted file mode 100644 index 738f538..0000000 --- a/controls/V-93011.rb +++ /dev/null @@ -1,112 +0,0 @@ -# encoding: UTF-8 - -control "V-93011" do - title "Windows Server 2019 Deny log on as a batch job user right on -domain-joined member servers must be configured to prevent access from highly -privileged domain accounts and from unauthenticated access on all systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on as a batch job\" user right defines accounts that are -prevented from logging on to the system as a batch job, such as Task Scheduler. - - In an Active Directory Domain, denying logons to the Enterprise Admins and -Domain Admins groups on lower-trust systems helps mitigate the risk of -privilege escalation from credential theft attacks, which could lead to the -compromise of an entire domain. - - The Guests group must be assigned to prevent unauthenticated access." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -as a batch job\" user right, this is a finding: - - Domain Systems Only: - - Enterprise Admins Group - - Domain Admins Group - - All Systems: - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the \"SeDenyBatchLogonRight\" -user right, this is a finding. - - Domain Systems Only: - S-1-5-root domain-519 (Enterprise Admins) - S-1-5-domain-512 (Domain Admins) - - All Systems: - S-1-5-32-546 (Guests)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on as a batch job\" to include the following: - - Domain Systems Only: - - Enterprise Admins Group - - Domain Admins Group - - All Systems: - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93011' - tag 'rid': 'SV-103099r1_rule' - tag 'stig_id': 'WN19-MS-000090' - tag 'fix_id': 'F-99257r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.0 - desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do - skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - end - when '2' - describe security_policy do - its('SeDenyBatchLogonRight') { should eq ['S-1-5-32-546'] } - end - when '3' - domain_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Domain Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - domain_admin_sid = json(command: domain_query).params - enterprise_admin_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - enterprise_admin_sid = json(command: enterprise_admin_query).params - describe security_policy do - its('SeDenyBatchLogonRight') { should include "#{domain_admin_sid}" } - end - describe security_policy do - its('SeDenyBatchLogonRight') { should include "#{enterprise_admin_sid}" } - end - describe security_policy do - its('SeDenyBatchLogonRight') { should include 'S-1-5-32-546' } - end - end -end diff --git a/controls/V-93013.rb b/controls/V-93013.rb deleted file mode 100644 index b4e1f30..0000000 --- a/controls/V-93013.rb +++ /dev/null @@ -1,106 +0,0 @@ -# encoding: UTF-8 - -control "V-93013" do - title "Windows Server 2019 Deny log on as a service user right on -domain-joined member servers must be configured to prevent access from highly -privileged domain accounts. No other groups or accounts must be assigned this -right." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on as a service\" user right defines accounts that are -denied logon as a service. - - In an Active Directory Domain, denying logons to the Enterprise Admins and -Domain Admins groups on lower-trust systems helps mitigate the risk of -privilege escalation from credential theft attacks, which could lead to the -compromise of an entire domain. - - Incorrect configurations could prevent services from starting and result in -a denial of service." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -as a service\" user right on domain-joined systems, this is a finding: - - - Enterprise Admins Group - - Domain Admins Group - - If any accounts or groups are defined for the \"Deny log on as a service\" -user right on non-domain-joined systems, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the \"SeDenyServiceLogonRight\" -user right on domain-joined systems, this is a finding: - - S-1-5-root domain-519 (Enterprise Admins) - S-1-5-domain-512 (Domain Admins) - - If any SIDs are defined for the user right on non-domain-joined systems, -this is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on as a service\" to include the following: - - Domain systems: - - Enterprise Admins Group - - Domain Admins Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93013' - tag 'rid': 'SV-103101r1_rule' - tag 'stig_id': 'WN19-MS-000100' - tag 'fix_id': 'F-99259r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.0 - desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do - skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - end - when '3' - domain_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Domain Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - domain_admin_sid = json(command: domain_query).params - enterprise_admin_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - enterprise_admin_sid = json(command: enterprise_admin_query).params - describe security_policy do - its('SeDenyServiceLogonRight') { should include "#{domain_admin_sid}" } - end - describe security_policy do - its('SeDenyServiceLogonRight') { should include "#{enterprise_admin_sid}" } - end - when '2' - describe security_policy do - its('SeDenyServiceLogonRight') { should be_empty } - end - end -end diff --git a/controls/V-93015.rb b/controls/V-93015.rb deleted file mode 100644 index 1cd6956..0000000 --- a/controls/V-93015.rb +++ /dev/null @@ -1,113 +0,0 @@ -# encoding: UTF-8 - -control "V-93015" do - title "Windows Server 2019 Deny log on locally user right on domain-joined -member servers must be configured to prevent access from highly privileged -domain accounts and from unauthenticated access on all systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Deny log on locally\" user right defines accounts that are prevented -from logging on interactively. - - In an Active Directory Domain, denying logons to the Enterprise Admins and -Domain Admins groups on lower-trust systems helps mitigate the risk of -privilege escalation from credential theft attacks, which could lead to the -compromise of an entire domain. - - The Guests group must be assigned this right to prevent unauthenticated -access." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If the following accounts or groups are not defined for the \"Deny log on -locally\" user right, this is a finding: - - Domain Systems Only: - - Enterprise Admins Group - - Domain Admins Group - - All Systems: - - Guests Group - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If the following SIDs are not defined for the -\"SeDenyInteractiveLogonRight\" user right, this is a finding: - - Domain Systems Only: - S-1-5-root domain-519 (Enterprise Admins) - S-1-5-domain-512 (Domain Admins) - - All Systems: - S-1-5-32-546 (Guests)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Deny log -on locally\" to include the following: - - Domain Systems Only: - - Enterprise Admins Group - - Domain Admins Group - - All Systems: - - Guests Group" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93015' - tag 'rid': 'SV-103103r1_rule' - tag 'stig_id': 'WN19-MS-000110' - tag 'fix_id': 'F-99261r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - case domain_role - when '4', '5' - impact 0.0 - desc 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - describe 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' do - skip 'This system is dedicated to the management of Active Directory, therefore this system is exempt from this control' - end - when '2' - describe security_policy do - its('SeDenyInteractiveLogonRight') { should eq ['S-1-5-32-546'] } - end - when '3' - domain_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Domain Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - domain_admin_sid = json(command: domain_query).params - enterprise_admin_query = <<-EOH - $group = New-Object System.Security.Principal.NTAccount('Enterprise Admins') - $sid = ($group.Translate([security.principal.securityidentifier])).value - $sid | ConvertTo-Json - EOH - - enterprise_admin_sid = json(command: enterprise_admin_query).params - describe security_policy do - its('SeDenyInteractiveLogonRight') { should include "#{domain_admin_sid}" } - end - describe security_policy do - its('SeDenyInteractiveLogonRight') { should include "#{enterprise_admin_sid}" } - end - describe security_policy do - its('SeDenyInteractiveLogonRight') { should include 'S-1-5-32-546' } - end - end -end diff --git a/controls/V-93017.rb b/controls/V-93017.rb deleted file mode 100644 index 10054db..0000000 --- a/controls/V-93017.rb +++ /dev/null @@ -1,63 +0,0 @@ -# encoding: UTF-8 - -control "V-93017" do - title "Windows Server 2019 Allow log on locally user right must only be -assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Allow log on locally\" user right can log on -interactively to a system." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Allow -log on locally\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeInteractiveLogonRight\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Allow log -on locally\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000080-GPOS-00048' - tag 'gid': 'V-93017' - tag 'rid': 'SV-103105r1_rule' - tag 'stig_id': 'WN19-UR-000030' - tag 'fix_id': 'F-99263r1_fix' - tag 'cci': ["CCI-000213"] - tag 'nist': ["AC-3", "Rev_4"] - - describe security_policy do - its('SeInteractiveLogonRight') { should eq ['S-1-5-32-544'] } - end -end - diff --git a/controls/V-93019.rb b/controls/V-93019.rb deleted file mode 100644 index 55ab0a6..0000000 --- a/controls/V-93019.rb +++ /dev/null @@ -1,104 +0,0 @@ -control 'V-93019' do - title "Windows Server 2019 permissions for the system drive root directory - (usually C:\\) must conform to minimum requirements." - desc "Changing the system's file and directory permissions allows the - possibility of unauthorized and anonymous modification to the operating system - and installed applications. - - The default permissions are adequate when the Security Option \"Network - access: Let Everyone permissions apply to anonymous users\" is set to - \"Disabled\" (WN19-SO-000240)." - desc 'rationale', '' - desc 'check', "The default permissions are adequate when the Security Option \"Network - access: Let Everyone permissions apply to anonymous users\" is set to - \"Disabled\" (WN19-SO-000240). - - Review the permissions for the system drive's root directory (usually - C:\\). Non-privileged groups such as Users or Authenticated Users must not have - greater than \"Read & execute\" permissions except where noted as defaults. - Individual accounts must not be used to assign permissions. - - If permissions are not as restrictive as the default permissions listed - below, this is a finding. - - Viewing in File Explorer: - - View the Properties of the system drive's root directory. - - Select the \"Security\" tab, and the \"Advanced\" button. - - Default permissions: - C:\\ - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - SYSTEM - Full control - This folder, subfolders, and files - Administrators - Full control - This folder, subfolders, and files - Users - Read & execute - This folder, subfolders, and files - Users - Create folders/append data - This folder and subfolders - Users - Create files/write data - Subfolders only - CREATOR OWNER - Full Control - Subfolders and files only - - Alternately, use icacls: - - Open \"Command Prompt (Admin)\". - - Enter \"icacls\" followed by the directory: - - \"icacls c:\\\" - - The following results should be displayed: - - c:\\ - NT AUTHORITY\\SYSTEM:(OI)(CI)(F) - BUILTIN\\Administrators:(OI)(CI)(F) - BUILTIN\\Users:(OI)(CI)(RX) - BUILTIN\\Users:(CI)(AD) - BUILTIN\\Users:(CI)(IO)(WD) - CREATOR OWNER:(OI)(CI)(IO)(F) - Successfully processed 1 files; Failed processing 0 files" - desc 'fix', " - Maintain the default permissions for the system drive's root directory and - configure the Security Option \"Network access: Let Everyone permissions apply - to anonymous users\" to \"Disabled\" (WN19-SO-000240). - - Default Permissions - C:\\ - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - SYSTEM - Full control - This folder, subfolders, and files - Administrators - Full control - This folder, subfolders, and files - Users - Read & execute - This folder, subfolders, and files - Users - Create folders/append data - This folder and subfolders - Users - Create files/write data - Subfolders only - CREATOR OWNER - Full Control - Subfolders and files only" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000312-GPOS-00122' - tag 'satisfies': %w(SRG-OS-000312-GPOS-00122 SRG-OS-000312-GPOS-00123 -SRG-OS-000312-GPOS-00124) - tag 'gid': 'V-93019' - tag 'rid': 'SV-103107r1_rule' - tag 'stig_id': 'WN19-00-000140' - tag 'fix_id': 'F-99265r1_fix' - tag 'cci': ['CCI-002165'] - tag 'nist': ['AC-3 (4)', 'Rev_4'] - - expected_c_perm = input('c_perm') - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'EveryoneIncludesAnonymous' } - its('EveryoneIncludesAnonymous') { should eq 0 } - end - c_perm = json(command: "icacls 'C:\\' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub('C:\\ ', '') } - describe 'C:\\ permissions are set correctly on folder structure' do - subject { c_perm.eql? expected_c_perm } - it { should eq true } - end - end -end diff --git a/controls/V-93021.rb b/controls/V-93021.rb deleted file mode 100644 index 6f513d6..0000000 --- a/controls/V-93021.rb +++ /dev/null @@ -1,125 +0,0 @@ -# encoding: UTF-8 - -control "V-93021" do - title "Windows Server 2019 permissions for program file directories must -conform to minimum requirements." - desc "Changing the system's file and directory permissions allows the -possibility of unauthorized and anonymous modification to the operating system -and installed applications. - - The default permissions are adequate when the Security Option \"Network -access: Let Everyone permissions apply to anonymous users\" is set to -\"Disabled\" (WN19-SO-000240)." - desc "rationale", "" - desc 'check', "The default permissions are adequate when the Security Option \"Network -access: Let Everyone permissions apply to anonymous users\" is set to -\"Disabled\" (WN19-SO-000240). - - Review the permissions for the program file directories (Program Files and -Program Files [x86]). Non-privileged groups such as Users or Authenticated -Users must not have greater than \"Read & execute\" permissions. Individual -accounts must not be used to assign permissions. - - If permissions are not as restrictive as the default permissions listed -below, this is a finding. - - Viewing in File Explorer: - - For each folder, view the Properties. - - Select the \"Security\" tab, and the \"Advanced\" button. - - Default permissions: - \\Program Files and \\Program Files (x86) - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - TrustedInstaller - Full control - This folder and subfolders - SYSTEM - Modify - This folder only - SYSTEM - Full control - Subfolders and files only - Administrators - Modify - This folder only - Administrators - Full control - Subfolders and files only - Users - Read & execute - This folder, subfolders and files - CREATOR OWNER - Full control - Subfolders and files only - ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and -files - ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, -subfolders, and files - - Alternately, use icacls: - - Open a Command prompt (admin). - - Enter \"icacls\" followed by the directory: - - 'icacls \"c:\\program files\"' - 'icacls \"c:\\program files (x86)\"' - - The following results should be displayed for each when entered: - - c:\\program files (c:\\program files (x86)) - NT SERVICE\\TrustedInstaller:(F) - NT SERVICE\\TrustedInstaller:(CI)(IO)(F) - NT AUTHORITY\\SYSTEM:(M) - NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) - BUILTIN\\Administrators:(M) - BUILTIN\\Administrators:(OI)(CI)(IO)(F) - BUILTIN\\Users:(RX) - BUILTIN\\Users:(OI)(CI)(IO)(GR,GE) - CREATOR OWNER:(OI)(CI)(IO)(F) - APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(RX) - APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(GR,GE) - APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION PACKAGES:(RX) - APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION -PACKAGES:(OI)(CI)(IO)(GR,GE) - Successfully processed 1 files; Failed processing 0 files" - desc 'fix', " - Maintain the default permissions for the program file directories and -configure the Security Option \"Network access: Let Everyone permissions apply -to anonymous users\" to \"Disabled\" (WN19-SO-000240). - - Default permissions: - \\Program Files and \\Program Files (x86) - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - TrustedInstaller - Full control - This folder and subfolders - SYSTEM - Modify - This folder only - SYSTEM - Full control - Subfolders and files only - Administrators - Modify - This folder only - Administrators - Full control - Subfolders and files only - Users - Read & execute - This folder, subfolders, and files - CREATOR OWNER - Full control - Subfolders and files only - ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and -files - ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, -subfolders, and files" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000312-GPOS-00122' - tag 'satisfies': ["SRG-OS-000312-GPOS-00122", "SRG-OS-000312-GPOS-00123", -"SRG-OS-000312-GPOS-00124"] - tag 'gid': 'V-93021' - tag 'rid': 'SV-103109r1_rule' - tag 'stig_id': 'WN19-00-000150' - tag 'fix_id': 'F-99267r1_fix' - tag 'cci': ["CCI-002165"] - tag 'nist': ["AC-3 (4)", "Rev_4"] - - c_program_files_perm = json( command: "icacls 'C:\\Program Files' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Program Files ", '') } - describe "c:\\Program Files permissions are set correctly on folder structure" do - subject { c_program_files_perm.eql? input('c_program_files_perm') } - it { should eq true } - end - - c_program_filesx86_perm = json( command: "icacls 'C:\\Program Files (x86)' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Program Files (x86) ", '') } - describe "c:\\Program Files(x86) permissions are set correctly on folder structure" do - subject { c_program_filesx86_perm.eql? input('c_program_files_perm') } - it { should eq true } - end -end - diff --git a/controls/V-93023.rb b/controls/V-93023.rb deleted file mode 100644 index 89cc9c3..0000000 --- a/controls/V-93023.rb +++ /dev/null @@ -1,116 +0,0 @@ -# encoding: UTF-8 - -control "V-93023" do - title "Windows Server 2019 permissions for the Windows installation directory -must conform to minimum requirements." - desc "Changing the system's file and directory permissions allows the -possibility of unauthorized and anonymous modification to the operating system -and installed applications. - - The default permissions are adequate when the Security Option \"Network -access: Let Everyone permissions apply to anonymous users\" is set to -\"Disabled\" (WN19-SO-000240)." - desc "rationale", "" - desc 'check', "The default permissions are adequate when the Security Option \"Network -access: Let Everyone permissions apply to anonymous users\" is set to -\"Disabled\" (WN19-SO-000240). - - Review the permissions for the Windows installation directory (usually -C:\\Windows). Non-privileged groups such as Users or Authenticated Users must -not have greater than \"Read & execute\" permissions. Individual accounts must -not be used to assign permissions. - - If permissions are not as restrictive as the default permissions listed -below, this is a finding: - - Viewing in File Explorer: - - For each folder, view the Properties. - - Select the \"Security\" tab and the \"Advanced\" button. - - Default permissions: - \\Windows - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - TrustedInstaller - Full control - This folder and subfolders - SYSTEM - Modify - This folder only - SYSTEM - Full control - Subfolders and files only - Administrators - Modify - This folder only - Administrators - Full control - Subfolders and files only - Users - Read & execute - This folder, subfolders, and files - CREATOR OWNER - Full control - Subfolders and files only - ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and -files - ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, -subfolders, and files - - Alternately, use icacls: - - Open a Command prompt (admin). - - Enter \"icacls\" followed by the directory: - - \"icacls c:\\windows\" - - The following results should be displayed for each when entered: - - c:\\windows - NT SERVICE\\TrustedInstaller:(F) - NT SERVICE\\TrustedInstaller:(CI)(IO)(F) - NT AUTHORITY\\SYSTEM:(M) - NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) - BUILTIN\\Administrators:(M) - BUILTIN\\Administrators:(OI)(CI)(IO)(F) - BUILTIN\\Users:(RX) - BUILTIN\\Users:(OI)(CI)(IO)(GR,GE) - CREATOR OWNER:(OI)(CI)(IO)(F) - APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(RX) - APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(GR,GE) - APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION PACKAGES:(RX) - APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION -PACKAGES:(OI)(CI)(IO)(GR,GE) - Successfully processed 1 files; Failed processing 0 files" - desc 'fix', "Maintain the default file ACLs and configure the Security Option \"Network -access: Let Everyone permissions apply to anonymous users\" to \"Disabled\" -(WN19-SO-000240). - - Default permissions: - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - TrustedInstaller - Full control - This folder and subfolders - SYSTEM - Modify - This folder only - SYSTEM - Full control - Subfolders and files only - Administrators - Modify - This folder only - Administrators - Full control - Subfolders and files only - Users - Read & execute - This folder, subfolders, and files - CREATOR OWNER - Full control - Subfolders and files only - ALL APPLICATION PACKAGES - Read & execute - This folder, subfolders, and -files - ALL RESTRICTED APPLICATION PACKAGES - Read & execute - This folder, -subfolders, and files" - impact 0.5 - tag 'severity': nil - tag 'gtitle': "SRG-OS-000312-GPOS-00122" - tag 'satisfies': ["SRG-OS-000312-GPOS-00122", "SRG-OS-000312-GPOS-00123", -"SRG-OS-000312-GPOS-00124"] - tag 'gid': 'V-93023' - tag 'rid': 'SV-103111r1_rule' - tag 'stig_id': 'WN19-00-000160' - tag 'fix_id': 'F-99269r1_fix' - tag 'cci': ["CCI-002165"] - tag 'nist': ["AC-3 (4)", "Rev_4"] - - c_windows_perm = json( command: "icacls 'C:\\Windows' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("C:\\Windows ", '') } - describe "C:\\Windows permissions are set correctly on folder structure" do - subject { c_windows_perm.eql? input('c_windows_perm') } - it { should eq true } - end -end - diff --git a/controls/V-93025.rb b/controls/V-93025.rb deleted file mode 100644 index d79db70..0000000 --- a/controls/V-93025.rb +++ /dev/null @@ -1,139 +0,0 @@ - control 'V-93025' do - title "Windows Server 2019 default permissions for the HKEY_LOCAL_MACHINE -registry hive must be maintained." - desc "The registry is integral to the function, security, and stability of -the Windows system. Changing the system's registry permissions allows the -possibility of unauthorized and anonymous modification to the operating system." - desc 'rationale', '' - desc 'check', "Review the registry permissions for the keys of the HKEY_LOCAL_MACHINE hive -noted below. - - If any non-privileged groups such as Everyone, Users, or Authenticated -Users have greater than Read permission, this is a finding. - - If permissions are not as restrictive as the default permissions listed -below, this is a finding: - - Run \"Regedit\". - - Right-click on the registry areas noted below. - - Select \"Permissions\" and the \"Advanced\" button. - - HKEY_LOCAL_MACHINE\\SECURITY - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - SYSTEM - Full Control - This key and subkeys - Administrators - Special - This key and subkeys - - HKEY_LOCAL_MACHINE\\SOFTWARE - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - Users - Read - This key and subkeys - Administrators - Full Control - This key and subkeys - SYSTEM - Full Control - This key and subkeys - CREATOR OWNER - Full Control - This key and subkeys - ALL APPLICATION PACKAGES - Read - This key and subkeys - - HKEY_LOCAL_MACHINE\\SYSTEM - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - Users - Read - This key and subkeys - Administrators - Full Control - This key and subkeys - SYSTEM - Full Control - This key and subkeys - CREATOR OWNER - Full Control - Subkeys only - ALL APPLICATION PACKAGES - Read - This key and subkeys - - Other examples under the noted keys may also be sampled. There may be some -instances where non-privileged groups have greater than Read permission. - - Microsoft has given Read permission to the SOFTWARE and SYSTEM registry -keys in Windows Server 2019 to the following SID, this is currently not a -finding. - -S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 - - If the defaults have not been changed, these are not a finding." - desc 'fix', " - Maintain the default permissions for the HKEY_LOCAL_MACHINE registry hive. - - The default permissions of the higher-level keys are noted below. - - HKEY_LOCAL_MACHINE\\SECURITY - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - SYSTEM - Full Control - This key and subkeys - Administrators - Special - This key and subkeys - - HKEY_LOCAL_MACHINE\\SOFTWARE - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - Users - Read - This key and subkeys - Administrators - Full Control - This key and subkeys - SYSTEM - Full Control - This key and subkeys - CREATOR OWNER - Full Control - This key and subkeys - ALL APPLICATION PACKAGES - Read - This key and subkeys - - HKEY_LOCAL_MACHINE\\SYSTEM - - Type - \"Allow\" for all - Inherited from - \"None\" for all - Principal - Access - Applies to - Users - Read - This key and subkeys - Administrators - Full Control - This key and subkeys - SYSTEM - Full Control - This key and subkeys - CREATOR OWNER - Full Control - Subkeys only - ALL APPLICATION PACKAGES - Read - This key and subkeys - - Microsoft has also given Read permission to the SOFTWARE and SYSTEM -registry keys in Windows Server 2019 to the following SID. - -S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93025' - tag 'rid': 'SV-103113r1_rule' - tag 'stig_id': 'WN19-00-000170' - tag 'fix_id': 'F-99271r1_fix' - tag 'cci': ['CCI-002235'] - tag 'nist': ['AC-6 (10)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - hklm_system = powershell('(Get-Acl -Path HKLM:System).AccessToString').stdout.lines.collect(&:strip) - describe 'Registry Key Security are set correctly on folder structure' do - subject { hklm_system.eql? input('reg_system_perms_dc') } - it { should eq true } - end - else - hklm_software = powershell('(Get-Acl -Path HKLM:Software).AccessToString').stdout.lines.collect(&:strip) - describe 'Registry Key Software permissions are set correctly on folder structure' do - subject { hklm_software.eql? input('reg_software_perms') } - it { should eq true } - end - - hklm_security = powershell('(Get-Acl -Path HKLM:Security).AccessToString').stdout.lines.collect(&:strip) - describe 'Registry Key Security are set correctly on folder structure' do - subject { hklm_security.eql? input('reg_security_perms') } - it { should eq true } - end - - hklm_system = powershell('(Get-Acl -Path HKLM:System).AccessToString').stdout.lines.collect(&:strip) - describe 'Registry Key System are set correctly on folder structure' do - subject { hklm_system.eql? input('reg_system_perms') } - it { should eq true } - end - end - end diff --git a/controls/V-93027.rb b/controls/V-93027.rb deleted file mode 100644 index e881185..0000000 --- a/controls/V-93027.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93027" do - title "Windows Server 2019 must only allow administrators responsible for the -domain controller to have Administrator rights on the system." - desc "An account that does not have Administrator duties must not have -Administrator rights. Such rights would allow the account to bypass or modify -required security restrictions on that machine and make it vulnerable to attack. - - System administrators must log on to systems using only accounts with the -minimum level of authority necessary. - - Standard user accounts must not be members of the built-in Administrators -group." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Review the Administrators group. Only the appropriate administrator groups -or accounts responsible for administration of the system may be members of the -group. - - Standard user accounts must not be members of the local administrator group. - - If prohibited accounts are members of the local administrators group, this -is a finding. - - If the built-in Administrator account or other required administrative -accounts are found on the system, this is not a finding." - desc 'fix', " - Configure the Administrators group to include only administrator groups or -accounts that are responsible for the system. - - Remove any standard user accounts." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93027' - tag 'rid': 'SV-103115r1_rule' - tag 'stig_id': 'WN19-DC-000010' - tag 'fix_id': 'F-99273r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - administrators = input('local_administrators_dc') - administrator_group = command("net localgroup Administrators | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") - if administrator_group.empty? - impact 0.0 - describe 'There are no users with administrative privileges' do - skip 'This control is not applicable' - end - else - administrator_group.each do |user| - describe user.to_s do - it { should be_in administrators } - end - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93029.rb b/controls/V-93029.rb deleted file mode 100644 index 3a511c8..0000000 --- a/controls/V-93029.rb +++ /dev/null @@ -1,90 +0,0 @@ -control 'V-93029' do - title "Windows Server 2019 permissions on the Active Directory data files -must only allow System and Administrators access." - desc "Improper access permissions for directory data-related files could -allow unauthorized users to read, modify, or delete directory data or audit -trails." - desc 'rationale', '' - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Run \"Regedit\". - - Navigate to -\"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\". - - Note the directory locations in the values for: - - Database log files path - DSA Database file - - By default, they will be \\Windows\\NTDS. - - If the locations are different, the following will need to be run for each. - - Open \"Command Prompt (Admin)\". - - Navigate to the NTDS directory (\\Windows\\NTDS by default). - - Run \"icacls *.*\". - - If the permissions on each file are not as restrictive as the following, -this is a finding: - - NT AUTHORITY\\SYSTEM:(I)(F) - BUILTIN\\Administrators:(I)(F) - - (I) - permission inherited from parent container - (F) - full access" - desc 'fix', "Maintain the permissions on NTDS database and log files as follows: - - NT AUTHORITY\\SYSTEM:(I)(F) - BUILTIN\\Administrators:(I)(F) - - (I) - permission inherited from parent container - (F) - full access" - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93029' - tag 'rid': 'SV-103117r1_rule' - tag 'stig_id': 'WN19-DC-000070' - tag 'fix_id': 'F-99275r1_fix' - tag 'cci': ['CCI-002235'] - tag 'nist': ['AC-6 (10)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - # Command Gets the Location of the Property Required - ntds_database_logs_files_path = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "Database log files path" | ConvertTo-Json').params - # Command Gets the Location of the Property Required - ntds_dsa_working_directory = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "DSA Working Directory" | ConvertTo-Json').params - expected_permissions = input('ntds_permissions') - if domain_role == '4' || domain_role == '5' - if ntds_database_logs_files_path == ntds_dsa_working_directory - perms = json(command: "icacls '#{ntds_dsa_working_directory}\\*.*' | convertto-json").params.map(&:strip)[0..-3].map { |e| e.gsub(/^[^\s]*\s/, '') }.reject(&:empty?) - describe "Permissions on each file in #{ntds_dsa_working_directory} is set" do - subject { (perms - expected_permissions).empty? } - it { should eq true } - end - else - # Command Gets Permissions on Folder Path - icacls_permissions_ntds_logs = json(command: "icacls '#{ntds_database_logs_files_path}\\*.*' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub(/^[^\s]*\s/, '') }.reject(&:empty?) - # Command Gets the Location of the Property Required - ntds_dsa_file_path = json(command: 'Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters | Select-Object -ExpandProperty "DSA Database file" | ConvertTo-Json').params - # Command Gets Permissions on file ntds.dit - icacls_permissions_ntds_dsa_file = json(command: "icacls '#{ntds_dsa_file_path}' | ConvertTo-Json").params.map(&:strip)[0..-3].map { |e| e.gsub("#{ntds_dsa_file_path} ", '') } - describe 'Permissions on NTDS Database Log Files Path is set to' do - subject { (icacls_permissions_ntds_logs - expected_permissions).empty? } - it { should eq true } - end - describe 'Permissions on NTDS Database DSA File is set to' do - subject { (icacls_permissions_ntds_dsa_file - expected_permissions).empty? } - it { should eq true } - end - end - else - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end diff --git a/controls/V-93031.rb b/controls/V-93031.rb deleted file mode 100644 index 6ca40ab..0000000 --- a/controls/V-93031.rb +++ /dev/null @@ -1,115 +0,0 @@ -# encoding: UTF-8 - -control "V-93031" do - title "Windows Server 2019 Active Directory SYSVOL directory must have the -proper access control permissions." - desc "Improper access permissions for directory data files could allow -unauthorized users to read, modify, or delete directory data. - - The SYSVOL directory contains public files (to the domain) such as policies -and logon scripts. Data in shared subdirectories are replicated to all domain -controllers in a domain." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Open a command prompt. - - Run \"net share\". - - Make note of the directory location of the SYSVOL share. - - By default, this will be \\Windows\\SYSVOL\\sysvol. For this requirement, -permissions will be verified at the first SYSVOL directory level. - - If any standard user accounts or groups have greater than \"Read & -execute\" permissions, this is a finding. - - The default permissions noted below meet this requirement: - - Open \"Command Prompt\". - - Run \"icacls c:\\Windows\\SYSVOL\". - - The following results should be displayed: - - NT AUTHORITY\\Authenticated Users:(RX) - NT AUTHORITY\\Authenticated Users:(OI)(CI)(IO)(GR,GE) - BUILTIN\\Server Operators:(RX) - BUILTIN\\Server Operators:(OI)(CI)(IO)(GR,GE) - BUILTIN\\Administrators:(M,WDAC,WO) - BUILTIN\\Administrators:(OI)(CI)(IO)(F) - NT AUTHORITY\\SYSTEM:(F) - NT AUTHORITY\\SYSTEM:(OI)(CI)(IO)(F) - CREATOR OWNER:(OI)(CI)(IO)(F) - - (RX) - Read & execute - - Run \"icacls /help\" to view definitions of other permission codes. - - Alternately, open \"File Explorer\". - - Navigate to \\Windows\\SYSVOL (or the directory noted previously if -different). - - Right-click the directory and select properties. - - Select the \"Security\" tab and click \"Advanced\". - - Default permissions: - - C:\\Windows\\SYSVOL - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - Authenticated Users - Read & execute - This folder, subfolder, and files - Server Operators - Read & execute- This folder, subfolder, and files - Administrators - Special - This folder only (Special = Basic Permissions: -all selected except Full control) - CREATOR OWNER - Full control - Subfolders and files only - Administrators - Full control - Subfolders and files only - SYSTEM - Full control - This folder, subfolders, and files" - desc "fix", " - Maintain the permissions on the SYSVOL directory. Do not allow greater than -\"Read & execute\" permissions for standard user accounts or groups. The -defaults below meet this requirement: - - C:\\Windows\\SYSVOL - Type - \"Allow\" for all - Inherited from - \"None\" for all - - Principal - Access - Applies to - - Authenticated Users - Read & execute - This folder, subfolder, and files - Server Operators - Read & execute- This folder, subfolder, and files - Administrators - Special - This folder only (Special = Basic Permissions: -all selected except Full control) - CREATOR OWNER - Full control - Subfolders and files only - Administrators - Full control - Subfolders and files only - SYSTEM - Full control - This folder, subfolders, and files" - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93031' - tag 'rid': 'SV-103119r1_rule' - tag 'stig_id': 'WN19-DC-000080' - tag 'fix_id': 'F-99277r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - sysvol_perm = json( command: "icacls 'c:\\Windows\\SYSVOL' | ConvertTo-Json").params.map { |e| e.strip }[0..-3].map{ |e| e.gsub("c:\\Windows\\SYSVOL ", '') } - - describe "c:\\ permissions are set correctly on folder structure" do - subject { sysvol_perm.eql? input('c_windows_sysvol_perm') } - it { should eq true } - end - else - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93033.rb b/controls/V-93033.rb deleted file mode 100644 index 19365ba..0000000 --- a/controls/V-93033.rb +++ /dev/null @@ -1,117 +0,0 @@ -# encoding: UTF-8 - -control "V-93033" do - title "Windows Server 2019 Active Directory Group Policy objects must have -proper access control permissions." - desc "When directory service database objects do not have appropriate access -control permissions, it may be possible for malicious users to create, read, -update, or delete the objects and degrade or destroy the integrity of the data. -When the directory service is used for identification, authentication, or -authorization functions, a compromise of the database objects could lead to a -compromise of all systems relying on the directory service. - - For Active Directory (AD), the Group Policy objects require special -attention. In a distributed administration model (i.e., help desk), Group -Policy objects are more likely to have access permissions changed from the -secure defaults. If inappropriate access permissions are defined for Group -Policy objects, this could allow an intruder to change the security policy -applied to all domain client computers (workstations and servers)." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the permissions on Group Policy objects. - - Open \"Group Policy Management\" (available from various menus or run -\"gpmc.msc\"). - - Navigate to \"Group Policy Objects\" in the domain being reviewed (Forest ->> Domains >> Domain). - - For each Group Policy object: - - Select the Group Policy object item in the left pane. - - Select the \"Delegation\" tab in the right pane. - - Select the \"Advanced\" button. - - Select each Group or user name. - - View the permissions. - - If any standard user accounts or groups have \"Allow\" permissions greater -than \"Read\" and \"Apply group policy\", this is a finding. - - Other access permissions that allow the objects to be updated are -considered findings unless specifically documented by the ISSO. - - The default permissions noted below satisfy this requirement. - - The permissions shown are at the summary level. More detailed permissions -can be viewed by selecting the next \"Advanced\" button, the desired Permission -entry, and the \"Edit\" button. - - Authenticated Users - Read, Apply group policy, Special permissions - - The special permissions for Authenticated Users are for Read-type -Properties. If detailed permissions include any Create, Delete, Modify, or -Write Permissions or Properties, this is a finding. - - The special permissions for the following default groups are not the focus -of this requirement and may include a wide range of permissions and properties: - - CREATOR OWNER - Special permissions - SYSTEM - Read, Write, Create all child objects, Delete all child objects, -Special permissions - Domain Admins - Read, Write, Create all child objects, Delete all child -objects, Special permissions - Enterprise Admins - Read, Write, Create all child objects, Delete all child -objects, Special permissions - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions - - The Domain Admins and Enterprise Admins will not have the \"Delete all -child objects\" permission on the two default Group Policy objects: Default -Domain Policy and Default Domain Controllers Policy. They will have this -permission o'n organization created Group Policy objects." - desc 'fix', "Maintain the permissions on Group Policy objects to not allow greater than -\"Read\" and \"Apply group policy\" for standard user accounts or groups. The -default permissions below meet this requirement: - - Authenticated Users - Read, Apply group policy, Special permissions - - The special permissions for Authenticated Users are for Read-type -Properties. - - CREATOR OWNER - Special permissions - SYSTEM - Read, Write, Create all child objects, Delete all child objects, -Special permissions - Domain Admins - Read, Write, Create all child objects, Delete all child -objects, Special permissions - Enterprise Admins - Read, Write, Create all child objects, Delete all child -objects, Special permissions - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions - - Document any other access permissions that allow the objects to be updated -with the ISSO. - - The Domain Admins and Enterprise Admins will not have the \"Delete all -child objects\" permission on the two default Group Policy objects: Default -Domain Policy and Default Domain Controllers Policy. They will have this -permission on created Group Policy objects." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93033' - tag 'rid': 'SV-103121r1_rule' - tag 'stig_id': 'WN19-DC-000090' - tag 'fix_id': 'F-99279r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - #Checked Code in 2016 and it is not a validate way of checking permissions, Until a command is put together that can get all GPO's in a Domain and then check all permissions, this is manually - describe 'A manual review is required to ensure all Group Policies have the correct permisions' do - skip 'A manual review is required to ensure all Group Policies have the correct permisions' - end - -end - diff --git a/controls/V-93035.rb b/controls/V-93035.rb deleted file mode 100644 index 001d6d5..0000000 --- a/controls/V-93035.rb +++ /dev/null @@ -1,188 +0,0 @@ -# encoding: UTF-8 - -control "V-93035" do - title "Windows Server 2019 Active Directory Domain Controllers Organizational Unit (OU) object must have the proper access control permissions." - desc "When Active Directory objects do not have appropriate access control permissions, it may be possible for malicious users to create, read, update, or delete the objects and degrade or destroy the integrity of the data. When the directory service is used for identification, authentication, or authorization functions, a compromise of the database objects could lead to a compromise of all systems that rely on the directory service. - - The Domain Controllers OU object requires special attention as the Domain Controllers are central to the configuration and management of the domain. - Inappropriate access permissions defined for the Domain Controllers OU could allow an intruder or unauthorized personnel to make changes that could lead to the compromise of the domain." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the permissions on the Domain Controllers OU. - Open \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"). - Select \"Advanced Features\" in the \"View\" menu if not previously selected. - Select the \"Domain Controllers\" OU (folder in folder icon). - Right-click and select \"Properties\". - Select the \"Security\" tab. - If the permissions on the Domain Controllers OU do not restrict changes to System, Domain Admins, Enterprise Admins and Administrators, this is a finding. - - The default permissions listed below satisfy this requirement. - Domains supporting Microsoft Exchange will have additional Exchange related permissions on the Domain Controllers OU. These may include some change related permissions and are not a finding. - The permissions shown are at the summary level. More detailed permissions can be viewed by selecting the \"Advanced\" button, the desired Permission entry, and the \"View\" or \"Edit\" button. - Except where noted otherwise, the special permissions may include a wide range of permissions and properties and are acceptable for this requirement. - - CREATOR OWNER - Special permissions - SELF - Special permissions - Authenticated Users - Read, Special permissions - The special permissions for Authenticated Users are Read types. - If detailed permissions include any Create, Delete, Modify, or Write Permissions or Properties, this is a finding. - - SYSTEM - Full Control - Domain Admins - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions - Enterprise Admins - Full Control - Key Admins - Special permissions - Enterprise Key Admins - Special permissions - Administrators - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions - Pre-Windows 2000 Compatible Access - Special permissions - The Special permissions for Pre-Windows 2000 Compatible Access are Read types. - - If detailed permissions include any Create, Delete, Modify, or Write Permissions or Properties, this is a finding. - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" - desc 'fix', "Limit the permissions on the Domain Controllers OU to restrict changes to System, Domain Admins, Enterprise Admins and Administrators. - The default permissions listed below satisfy this requirement. - Domains supporting Microsoft Exchange will have additional Exchange related permissions on the Domain Controllers OU. These may include some change related permissions. - - CREATOR OWNER - Special permissions - SELF - Special permissions - Authenticated Users - Read, Special permissions - The special permissions for Authenticated Users are Read types. - SYSTEM - Full Control - Domain Admins - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions - Enterprise Admins - Full Control - Key Admins - Special permissions - Enterprise Key Admins - Special permissions - Administrators - Read, Write, Create all child objects, Generate resultant set of policy (logging), Generate resultant set of policy (planning), Special permissions - Pre-Windows 2000 Compatible Access - Special permissions - The special permissions for Pre-Windows 2000 Compatible Access are Read types. - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93035' - tag 'rid': 'SV-103123r1_rule' - tag 'stig_id': 'WN19-DC-000100' - tag 'fix_id': 'F-99281r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - perm_query = <<-EOH - import-module ActiveDirectory - Set-Location ad: - $distinguishedName = (Get-ADDomain).DistinguishedName - $acl_rules = (Get-Acl "OU=Domain Controllers,$distinguishedName").Access - $acl_rules | ConvertTo-Csv | ConvertFrom-Csv | ConvertTo-Json - EOH - - acl_rules = json(command: perm_query).params - netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\ENTERPRISE DOMAIN CONTROLLERS" } - its(['ActiveDirectoryRights']) { should cmp "GenericRead"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\Authenticated Users" } - its(['ActiveDirectoryRights']) { should cmp "GenericRead"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Admins" } - its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, GenericRead, WriteDacl, WriteOwner"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } - its(['ActiveDirectoryRights']) { should cmp "ReadProperty"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty, ExtendedRight"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "#{netbiosname}\\Enterprise Admins" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } - its(['ActiveDirectoryRights']) { should cmp "ListChildren"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } - its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, Delete, GenericRead, WriteDacl, WriteOwner"} - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93037.rb b/controls/V-93037.rb deleted file mode 100644 index b7c6a25..0000000 --- a/controls/V-93037.rb +++ /dev/null @@ -1,262 +0,0 @@ -# encoding: UTF-8 - -control "V-93037" do - title "Windows Server 2019 organization created Active Directory -Organizational Unit (OU) objects must have proper access control permissions." - desc "When directory service database objects do not have appropriate access -control permissions, it may be possible for malicious users to create, read, -update, or delete the objects and degrade or destroy the integrity of the data. -When the directory service is used for identification, authentication, or -authorization functions, a compromise of the database objects could lead to a -compromise of all systems that rely on the directory service. - - For Active Directory, the OU objects require special attention. In a -distributed administration model (i.e., help desk), OU objects are more likely -to have access permissions changed from the secure defaults. If inappropriate -access permissions are defined for OU objects, it could allow an intruder to -add or delete users in the OU. This could result in unauthorized access to data -or a denial of service (DoS) to authorized users." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the permissions on domain-defined OUs. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - For each OU that is defined (folder in folder icon) excluding the Domain -Controllers OU: - - Right-click the OU and select \"Properties\". - - Select the \"Security\" tab. - - If the Allow type permissions on the OU are not at least as restrictive as -those below, this is a finding. - - The permissions shown are at the summary level. More detailed permissions -can be viewed by selecting the \"Advanced\" button, the desired Permission -entry, and the \"Edit\" or \"View\" button. - - Except where noted otherwise, the special permissions may include a wide -range of permissions and properties and are acceptable for this requirement. - - CREATOR OWNER - Special permissions - - Self - Special permissions - - Authenticated Users - Read, Special permissions - - The Special permissions for Authenticated Users are Read type. If detailed -permissions include any Create, Delete, Modify, or Write Permissions or -Properties, this is a finding. - - SYSTEM - Full Control - - Domain Admins - Full Control - - Enterprise Admins - Full Control - - Key Admins - Special permissions - - Enterprise Key Admins - Special permissions - - Administrators - Read, Write, Create all child objects, Generate resultant -set of policy (logging), Generate resultant set of policy (planning), Special -permissions - - Pre-Windows 2000 Compatible Access - Special permissions - - The Special permissions for Pre-Windows 2000 Compatible Access are for Read -types. If detailed permissions include any Create, Delete, Modify, or Write -Permissions or Properties, this is a finding. - - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions - - If an ISSO-approved distributed administration model (help desk or other -user support staff) is implemented, permissions above Read may be allowed for -groups documented by the ISSO. - - If any OU with improper permissions includes identification or -authentication data (e.g., accounts, passwords, or password hash data) used by -systems to determine access control, the severity is CAT I (e.g., OUs that -include user accounts, including service/application accounts). - - If an OU with improper permissions does not include identification and -authentication data used by systems to determine access control, the severity -is CAT II (e.g., Workstation, Printer OUs)." - desc 'fix', "Maintain the Allow type permissions on domain-defined OUs to be at least as -restrictive as the defaults below. - - Document any additional permissions above Read with the ISSO if an approved -distributed administration model (help desk or other user support staff) is -implemented. - - CREATOR OWNER - Special permissions - - Self - Special permissions - - Authenticated Users - Read, Special permissions - - The special permissions for Authenticated Users are Read type. - - SYSTEM - Full Control - - Domain Admins - Full Control - - Enterprise Admins - Full Control - - Key Admins - Special permissions - - Enterprise Key Admins - Special permissions - - Administrators - Read, Write, Create all child objects, Generate resultant -set of policy (logging), Generate resultant set of policy (planning), Special -permissions - - Pre-Windows 2000 Compatible Access - Special permissions - - The special permissions for Pre-Windows 2000 Compatible Access are for Read -types. - - ENTERPRISE DOMAIN CONTROLLERS - Read, Special permissions" - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93037' - tag 'rid': 'SV-103125r1_rule' - tag 'stig_id': 'WN19-DC-000110' - tag 'fix_id': 'F-99283r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-Json').params - ou_list = json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params - if ou_list.is_a?(String) - ou_list = [] - ou_list << json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params - end - exclude_dc = json(command: "Get-ADOrganizationalUnit -filter * -SearchBase '#{distinguishedName}' | Where-Object {$_.distinguishedname -like 'OU=Domain Controllers,#{distinguishedName}'} | Select-Object -ExpandProperty distinguishedname | ConvertTo-Json").params - ou_list.delete(exclude_dc) - netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] - if ou_list.empty? - impact 0.0 - describe 'This control is not applicable as no domain-defined OUs were found (excluding the Domain Controllers OU)' do - skip 'This control is not applicable as no domain-defined OUs were found (excluding the Domain Controllers OU)' - end - else - ou_list.each do |ou| - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'#{ou}').Access | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\ENTERPRISE DOMAIN CONTROLLERS" } - its(['ActiveDirectoryRights']) { should cmp "GenericRead"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\Authenticated Users" } - its(['ActiveDirectoryRights']) { should cmp "GenericRead"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SYSTEM" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } - its(['ActiveDirectoryRights']) { should cmp "CreateChild, Self, WriteProperty, ExtendedRight, Delete, GenericRead, WriteDacl, WriteOwner"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "BUILTIN\\Pre-Windows 2000 Compatible Access" } - its(['ActiveDirectoryRights']) { should cmp "ListChildren"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Admins" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "#{netbiosname}\\Enterprise Admins" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty, ExtendedRight"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "ReadProperty, WriteProperty"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - end - end - end - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['IdentityReference']) { should cmp "NT AUTHORITY\\SELF" } - its(['ActiveDirectoryRights']) { should cmp "Self"} - end - end - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93039.rb b/controls/V-93039.rb deleted file mode 100644 index ce829e5..0000000 --- a/controls/V-93039.rb +++ /dev/null @@ -1,71 +0,0 @@ -# encoding: UTF-8 - -control "V-93039" do - title "Windows Server 2019 Add workstations to domain user right must only be -assigned to the Administrators group on domain controllers." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Add workstations to domain\" right may add computers to -a domain. This could result in unapproved or incorrectly configured systems -being added to a domain." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Add -workstations to domain\" right, this is a finding. - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeMachineAccountPrivilege\" user right, this is a finding. - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Add -workstations to domain\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93039' - tag 'rid': 'SV-103127r1_rule' - tag 'stig_id': 'WN19-DC-000350' - tag 'fix_id': 'F-99285r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeMachineAccountPrivilege') { should eq ['S-1-5-32-544'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93041.rb b/controls/V-93041.rb deleted file mode 100644 index 53e5a21..0000000 --- a/controls/V-93041.rb +++ /dev/null @@ -1,75 +0,0 @@ -# encoding: UTF-8 - -control "V-93041" do - title "Windows Server 2019 Enable computer and user accounts to be trusted -for delegation user right must only be assigned to the Administrators group on -domain controllers." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Enable computer and user accounts to be trusted for delegation\" user -right allows the \"Trusted for Delegation\" setting to be changed. This could -allow unauthorized users to impersonate other users." - desc "rationale", "" - desc 'check', "This applies to domain controllers. A separate version applies to other -systems. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Enable -computer and user accounts to be trusted for delegation\" user right, this is a -finding. - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeEnableDelegationPrivilege\" user right, this is a finding. - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Enable -computer and user accounts to be trusted for delegation\" to include only the -following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93041' - tag 'rid': 'SV-103129r1_rule' - tag 'stig_id': 'WN19-DC-000420' - tag 'fix_id': 'F-99287r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('SeEnableDelegationPrivilege') { should eq ['S-1-5-32-544'] } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93043.rb b/controls/V-93043.rb deleted file mode 100644 index e485688..0000000 --- a/controls/V-93043.rb +++ /dev/null @@ -1,84 +0,0 @@ -# encoding: UTF-8 - -control "V-93043" do - title "Windows Server 2019 must only allow administrators responsible for the -member server or standalone system to have Administrator rights on the system." - desc "An account that does not have Administrator duties must not have -Administrator rights. Such rights would allow the account to bypass or modify -required security restrictions on that machine and make it vulnerable to attack. - - System administrators must log on to systems using only accounts with the -minimum level of authority necessary. - - For domain-joined member servers, the Domain Admins group must be replaced -by a domain member server administrator group (see V-36433 in the Active -Directory Domain STIG). Restricting highly privileged accounts from the local -Administrators group helps mitigate the risk of privilege escalation resulting -from credential theft attacks. - - Standard user accounts must not be members of the built-in Administrators -group." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Open \"Computer Management\". - - Navigate to \"Groups\" under \"Local Users and Groups\". - - Review the local \"Administrators\" group. - - Only administrator groups or accounts responsible for administration of the -system may be members of the group. - - For domain-joined member servers, the Domain Admins group must be replaced -by a domain member server administrator group. - - Standard user accounts must not be members of the local Administrator group. - - If accounts that do not have responsibility for administration of the -system are members of the local Administrators group, this is a finding. - - If the built-in Administrator account or other required administrative -accounts are found on the system, this is not a finding." - desc 'fix', "Configure the local \"Administrators\" group to include only administrator -groups or accounts responsible for administration of the system. - - For domain-joined member servers, replace the Domain Admins group with a -domain member server administrator group. - - Remove any standard user accounts." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93043' - tag 'rid': 'SV-103131r1_rule' - tag 'stig_id': 'WN19-MS-000010' - tag 'fix_id': 'F-99289r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - impact 0.0 - describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do - skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' - end - else - administrators = input('local_administrators_member') - administrator_group = command("Get-LocalGroupMember -Group \"Administrators\" | select -ExpandProperty Name | ForEach-Object {$_ -replace \"$env:COMPUTERNAME\\\\\" -replace \"\"}").stdout.strip.split("\r\n") - if administrator_group.empty? - impact 0.0 - describe 'There are no users with administrative privileges' do - skip 'This control is not applicable' - end - else - administrator_group.each do |user| - describe user.to_s do - it { should be_in administrators } - end - end - end - end -end \ No newline at end of file diff --git a/controls/V-93045.rb b/controls/V-93045.rb deleted file mode 100644 index c9dffcf..0000000 --- a/controls/V-93045.rb +++ /dev/null @@ -1,64 +0,0 @@ -# encoding: UTF-8 - -control "V-93045" do - title "Windows Server 2019 must restrict remote calls to the Security Account -Manager (SAM) to Administrators on domain-joined member servers and standalone -systems." - desc "The Windows SAM stores users' passwords. Restricting Remote Procedure -Call (RPC) connections to the SAM to Administrators helps protect those -credentials." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems; it is NA for domain -controllers. - - If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: RestrictRemoteSAM - - Value Type: REG_SZ - Value: O:BAG:BAD:(A;;RC;;;BA)" - desc 'fix', "Navigate to the policy Computer Configuration >> Windows Settings >> -Security Settings >> Local Policies >> Security Options >> \"Network access: -Restrict clients allowed to make remote calls to SAM\". - Select \"Edit Security\" to configure the \"Security descriptor:\". - - Add \"Administrators\" in \"Group or user names:\" if it is not already -listed (this is the default). - - Select \"Administrators\" in \"Group or user names:\". - - Select \"Allow\" for \"Remote Access\" in \"Permissions for -\"Administrators\". - - Click \"OK\". - - The \"Security descriptor:\" must be populated with -\"O:BAG:BAD:(A;;RC;;;BA) for the policy to be enforced." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93045' - tag 'rid': 'SV-103133r1_rule' - tag 'stig_id': 'WN19-MS-000060' - tag 'fix_id': 'F-99291r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - impact 0.0 - describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do - skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa') do - it { should have_property "RestrictRemoteSAM"} - its('RestrictRemoteSAM') { should cmp "O:BAG:BAD:(A;;RC;;;BA)" } - end - end -end - diff --git a/controls/V-93047.rb b/controls/V-93047.rb deleted file mode 100644 index 6fd69a1..0000000 --- a/controls/V-93047.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93047" do - title "Windows Server 2019 Enable computer and user accounts to be trusted -for delegation user right must not be assigned to any groups or accounts on -domain-joined member servers and standalone systems." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Enable computer and user accounts to be trusted for delegation\" user -right allows the \"Trusted for Delegation\" setting to be changed. This could -allow unauthorized users to impersonate other users." - desc "rationale", "" - desc 'check', "This applies to member servers and standalone systems. A separate version -applies to domain controllers. - - Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are granted the \"Enable computer and user -accounts to be trusted for delegation\" user right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeEnableDelegationPrivilege\" user right, -this is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Enable computer and user accounts to be trusted for -delegation\" to be defined but containing no entries (blank)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93047' - tag 'rid': 'SV-103135r1_rule' - tag 'stig_id': 'WN19-MS-000130' - tag 'fix_id': 'F-99293r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - end - if domain_role == '4' || domain_role == '5' - impact 0.0 - describe 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' do - skip 'This system is a domain controller, therefore this control is not applicable as it only applies to member servers' - end - else - describe security_policy do - its('SeEnableDelegationPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93049.rb b/controls/V-93049.rb deleted file mode 100644 index 92d718d..0000000 --- a/controls/V-93049.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93049" do - title "Windows Server 2019 Access Credential Manager as a trusted caller user -right must not be assigned to any groups or accounts." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Access Credential Manager as a trusted caller\" user -right may be able to retrieve the credentials of other accounts from Credential -Manager." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are granted the \"Access Credential Manager as a -trusted caller\" user right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeTrustedCredManAccessPrivilege\" user right, -this is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Access Credential Manager as a trusted caller\" to be defined -but containing no entries (blank)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93049' - tag 'rid': 'SV-103137r1_rule' - tag 'stig_id': 'WN19-UR-000010' - tag 'fix_id': 'F-99295r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeTrustedCredManAccessPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93051.rb b/controls/V-93051.rb deleted file mode 100644 index 7a14725..0000000 --- a/controls/V-93051.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93051" do - title "Windows Server 2019 Act as part of the operating system user right -must not be assigned to any groups or accounts." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Act as part of the operating system\" user right can -assume the identity of any user and gain access to resources that the user is -authorized to access. Any accounts with this right can take complete control of -a system." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups (to include administrators), are granted the -\"Act as part of the operating system\" user right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeTcbPrivilege\" user right, this is a -finding. - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060). - - Passwords for accounts with this user right must be protected as highly -privileged accounts." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Act as part of the operating system\" to be defined but -containing no entries (blank)." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93051' - tag 'rid': 'SV-103139r1_rule' - tag 'stig_id': 'WN19-UR-000020' - tag 'fix_id': 'F-99297r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeTcbPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93053.rb b/controls/V-93053.rb deleted file mode 100644 index 30d3bc2..0000000 --- a/controls/V-93053.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93053" do - title "Windows Server 2019 Back up files and directories user right must only -be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Back up files and directories\" user right can -circumvent file and directory permissions and could allow access to sensitive -data." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Back -up files and directories\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the \"SeBackupPrivilege\" -user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Back up -files and directories\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93053' - tag 'rid': 'SV-103141r1_rule' - tag 'stig_id': 'WN19-UR-000040' - tag 'fix_id': 'F-99299r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeBackupPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93055.rb b/controls/V-93055.rb deleted file mode 100644 index 85a8215..0000000 --- a/controls/V-93055.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-93055" do - title "Windows Server 2019 Create a pagefile user right must only be assigned -to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Create a pagefile\" user right can change the size of a -pagefile, which could affect system performance." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Create -a pagefile\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeCreatePagefilePrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Create a -pagefile\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93055' - tag 'rid': 'SV-103143r1_rule' - tag 'stig_id': 'WN19-UR-000050' - tag 'fix_id': 'F-99301r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeCreatePagefilePrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93057.rb b/controls/V-93057.rb deleted file mode 100644 index eb8de76..0000000 --- a/controls/V-93057.rb +++ /dev/null @@ -1,70 +0,0 @@ -# encoding: UTF-8 - -control "V-93057" do - title "Windows Server 2019 Create a token object user right must not be -assigned to any groups or accounts." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Create a token object\" user right allows a process to create an -access token. This could be used to provide elevated rights and compromise a -system." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are granted the \"Create a token object\" user -right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeCreateTokenPrivilege\" user right, this is -a finding. - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060). - - Passwords for application accounts with this user right must be protected -as highly privileged accounts." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Create a token object\" to be defined but containing no entries -(blank)." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93057' - tag 'rid': 'SV-103145r1_rule' - tag 'stig_id': 'WN19-UR-000060' - tag 'fix_id': 'F-99303r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeCreateTokenPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93059.rb b/controls/V-93059.rb deleted file mode 100644 index 29845e3..0000000 --- a/controls/V-93059.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93059" do - title "Windows Server 2019 Create global objects user right must only be assigned to Administrators, Service, Local Service, and Network Service." - desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. - Accounts with the \"Create global objects\" user right can create objects that are available to all sessions, which could affect processes in otherusers' sessions." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. - If any accounts or groups other than the following are granted the \"Create global objects\" user right, this is a finding: - - Administrators - - Service - - Local Service - - Network Service - - For server core installations, run the following command: - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - Review the text file. - If any SIDs other than the following are granted the \"SeCreateGlobalPrivilege\" user right, this is a finding: - S-1-5-32-544 (Administrators) - S-1-5-6 (Service) - S-1-5-19 (Local Service) - S-1-5-20 (Network Service) - - If an application requires this user right, this would not be a finding. - Vendor documentation must support the requirement for having the user right. - The requirement must be documented with the ISSO. - The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Create global objects\" to include only the following accounts or groups: - - Administrators - - Service - - Local Service - - Network Service" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93059' - tag 'rid': 'SV-103147r1_rule' - tag 'stig_id': 'WN19-UR-000070' - tag 'fix_id': 'F-99305r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - active_global_privilege_users = security_policy.SeCreateGlobalPrivilege.entries - allowed_global_privilege_users = input("allowed_global_privilege_users") - disallowed_global_privilege_users = input("disallowed_global_privilege_users") - unauthorized_users = [] - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - active_global_privilege_users.each do |user| - next if allowed_global_privilege_users.include?(user) - unauthorized_users << user - end - disallowed_global_privilege_users.each do |user| - unless disallowed_global_privilege_users == [nil] || unauthorized_users.include?(user) - unauthorized_users << user - end - end - describe "Global Object Creation Privilege must be limited to" do - it "Authorized SIDs: #{allowed_global_privilege_users}" do - failure_message = "Unauthorized SIDs: #{unauthorized_users}" - expect(unauthorized_users).to be_empty, failure_message - end - end - end -end \ No newline at end of file diff --git a/controls/V-93061.rb b/controls/V-93061.rb deleted file mode 100644 index 40fc1d6..0000000 --- a/controls/V-93061.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93061" do - title "Windows Server 2019 Create permanent shared objects user right must -not be assigned to any groups or accounts." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Create permanent shared objects\" user right could -expose sensitive data by creating shared objects." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are granted the \"Create permanent shared -objects\" user right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeCreatePermanentPrivilege\" user right, this -is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Create permanent shared objects\" to be defined but containing -no entries (blank)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93061' - tag 'rid': 'SV-103149r1_rule' - tag 'stig_id': 'WN19-UR-000080' - tag 'fix_id': 'F-99307r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeCreatePermanentPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93063.rb b/controls/V-93063.rb deleted file mode 100644 index a9da034..0000000 --- a/controls/V-93063.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control "V-93063" do - title "Windows Server 2019 Create symbolic links user right must only be -assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Create symbolic links\" user right can create pointers -to other objects, which could expose the system to attack." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Create -symbolic links\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeCreateSymbolicLinkPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - - Systems that have the Hyper-V role will also have \"Virtual Machines\" -given this user right (this may be displayed as \"NT Virtual Machine\\Virtual -Machines\", SID S-1-5-83-0). This is not a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Create -symbolic links\" to include only the following accounts or groups: - - - Administrators - - Systems that have the Hyper-V role will also have \"Virtual Machines\" -given this user right. If this needs to be added manually, enter it as \"NT -Virtual Machine\\Virtual Machines\". " - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93063' - tag 'rid': 'SV-103151r1_rule' - tag 'stig_id': 'WN19-UR-000090' - tag 'fix_id': 'F-99309r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeCreateSymbolicLinkPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93065.rb b/controls/V-93065.rb deleted file mode 100644 index 96897e0..0000000 --- a/controls/V-93065.rb +++ /dev/null @@ -1,76 +0,0 @@ -# encoding: UTF-8 - -control "V-93065" do - title "Windows Server 2019 Debug programs: user right must only be assigned -to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Debug programs\" user right can attach a debugger to -any process or to the kernel, providing complete access to sensitive and -critical operating system components. This right is given to Administrators in -the default configuration." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Debug -programs\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the \"SeDebugPrivilege\" -user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060). - - Passwords for application accounts with this user right must be protected -as highly privileged accounts." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Debug -programs\" to include only the following accounts or groups: - - - Administrators" - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93065' - tag 'rid': 'SV-103153r1_rule' - tag 'stig_id': 'WN19-UR-000100' - tag 'fix_id': 'F-99311r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeDebugPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93067.rb b/controls/V-93067.rb deleted file mode 100644 index 82e2b7a..0000000 --- a/controls/V-93067.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93067" do - title "Windows Server 2019 Force shutdown from a remote system user right -must only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Force shutdown from a remote system\" user right can -remotely shut down a system, which could result in a denial of service." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Force -shutdown from a remote system\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeRemoteShutdownPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Force -shutdown from a remote system\" to include only the following accounts or -groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93067' - tag 'rid': 'SV-103155r1_rule' - tag 'stig_id': 'WN19-UR-000110' - tag 'fix_id': 'F-99313r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeRemoteShutdownPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93069.rb b/controls/V-93069.rb deleted file mode 100644 index 8a22398..0000000 --- a/controls/V-93069.rb +++ /dev/null @@ -1,66 +0,0 @@ -# encoding: UTF-8 - -control "V-93069" do - title "Windows Server 2019 Generate security audits user right must only be assigned to Local Service and Network Service." - desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. - The \"Generate security audits\" user right specifies users and processes that can generate Security Log audit records, which must only be the system service accounts defined." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. - If any accounts or groups other than the following are granted the \"Generate security audits\" user right, this is a finding: - - Local Service - - Network Service - - For server core installations, run the following command: - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - Review the text file. - If any SIDs other than the following are granted the \"SeAuditPrivilege\" user right, this is a finding: - S-1-5-19 (Local Service) - S-1-5-20 (Network Service) - - If an application requires this user right, this would not be a finding. - Vendor documentation must support the requirement for having the user right. - The requirement must be documented with the ISSO. - The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Generate security audits\" to include only the following accounts or groups: - - Local Service - - Network Service" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93069' - tag 'rid': 'SV-103157r1_rule' - tag 'stig_id': 'WN19-UR-000120' - tag 'fix_id': 'F-99315r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - active_audit_privilege_users = security_policy.SeAuditPrivilege.entries - allowed_audit_privilege_users = input("allowed_audit_privilege_users") - disallowed_audit_privilege_users = input("disallowed_audit_privilege_users") - unauthorized_users = [] - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - active_audit_privilege_users.each do |user| - next if allowed_audit_privilege_users.include?(user) - unauthorized_users << user - end - disallowed_audit_privilege_users.each do |user| - unless disallowed_audit_privilege_users == [nil] || unauthorized_users.include?(user) - unauthorized_users << user - end - end - describe "Security Audit Generation Privilege must be limited to" do - it "Authorized SIDs: #{allowed_audit_privilege_users}" do - failure_message = "Unauthorized SIDs: #{unauthorized_users}" - expect(unauthorized_users).to be_empty, failure_message - end - end - end -end \ No newline at end of file diff --git a/controls/V-93071.rb b/controls/V-93071.rb deleted file mode 100644 index 3006a9f..0000000 --- a/controls/V-93071.rb +++ /dev/null @@ -1,91 +0,0 @@ -# encoding: UTF-8 - -control "V-93071" do - title "Windows Server 2019 Impersonate a client after authentication user -right must only be assigned to Administrators, Service, Local Service, and -Network Service." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Impersonate a client after authentication\" user right allows a -program to impersonate another user or account to run on their behalf. An -attacker could use this to elevate privileges." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the -\"Impersonate a client after authentication\" user right, this is a finding: - - - Administrators - - Service - - Local Service - - Network Service - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeImpersonatePrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - S-1-5-6 (Service) - S-1-5-19 (Local Service) - S-1-5-20 (Network Service) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> -\"Impersonate a client after authentication\" to include only the following -accounts or groups: - - - Administrators - - Service - - Local Service - - Network Service" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93071' - tag 'rid': 'SV-103159r1_rule' - tag 'stig_id': 'WN19-UR-000130' - tag 'fix_id': 'F-99317r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeImpersonatePrivilege') { should include "S-1-5-32-544" } - end - describe security_policy do - its('SeImpersonatePrivilege') { should include "S-1-5-6" } - end - describe security_policy do - its('SeImpersonatePrivilege') { should include "S-1-5-19" } - end - describe security_policy do - its('SeImpersonatePrivilege') { should include "S-1-5-20" } - end - end -end diff --git a/controls/V-93073.rb b/controls/V-93073.rb deleted file mode 100644 index 32c9ead..0000000 --- a/controls/V-93073.rb +++ /dev/null @@ -1,47 +0,0 @@ -# encoding: UTF-8 - -control "V-93073" do - title "Windows Server 2019 Increase scheduling priority: user right must only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, administrative, and other high-level capabilities. - Accounts with the \"Increase scheduling priority\" user right can change a scheduling priority, causing performance issues or a denial of service." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment. - If any accounts or groups other than the following are granted the \"Increase scheduling priority\" user right, this is a finding: - - Administrators - - For server core installations, run the following command: - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - Review the text file. - If any SIDs other than the following are granted the \"SeIncreaseBasePriorityPrivilege\" user right, this is a finding: - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - Vendor documentation must support the requirement for having the user right. - The requirement must be documented with the ISSO. - The application account must meet requirements for application account passwords, such as length (WN19-00-000050) and required frequency of changes (WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assignment >> \"Increase scheduling priority\" to include only the following accounts or groups: - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93073' - tag 'rid': 'SV-103161r1_rule' - tag 'stig_id': 'WN19-UR-000140' - tag 'fix_id': 'F-99319r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeIncreaseBasePriorityPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end \ No newline at end of file diff --git a/controls/V-93075.rb b/controls/V-93075.rb deleted file mode 100644 index 4dadb56..0000000 --- a/controls/V-93075.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93075" do - title "Windows Server 2019 Load and unload device drivers user right must -only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Load and unload device drivers\" user right allows a user to load -device drivers dynamically on a system. This could be used by an attacker to -install malicious code." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Load -and unload device drivers\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeLoadDriverPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Load and -unload device drivers\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93075' - tag 'rid': 'SV-103163r1_rule' - tag 'stig_id': 'WN19-UR-000150' - tag 'fix_id': 'F-99321r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeLoadDriverPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93077.rb b/controls/V-93077.rb deleted file mode 100644 index 1d28efe..0000000 --- a/controls/V-93077.rb +++ /dev/null @@ -1,67 +0,0 @@ -# encoding: UTF-8 - -control "V-93077" do - title "Windows Server 2019 Lock pages in memory user right must not be -assigned to any groups or accounts." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - The \"Lock pages in memory\" user right allows physical memory to be -assigned to processes, which could cause performance issues or a denial of -service." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups are granted the \"Lock pages in memory\" user -right, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs are granted the \"SeLockMemoryPrivilege\" user right, this is a -finding. - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> User Rights -Assignment >> \"Lock pages in memory\" to be defined but containing no entries -(blank)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93077' - tag 'rid': 'SV-103165r1_rule' - tag 'stig_id': 'WN19-UR-000160' - tag 'fix_id': 'F-99323r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeLockMemoryPrivilege') { should eq [] } - end - end -end - diff --git a/controls/V-93079.rb b/controls/V-93079.rb deleted file mode 100644 index 1ea7782..0000000 --- a/controls/V-93079.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93079" do - title "Windows Server 2019 Modify firmware environment values user right must -only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Modify firmware environment values\" user right can -change hardware configuration environment variables. This could result in -hardware failures or a denial of service." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Modify -firmware environment values\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeSystemEnvironmentPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Modify -firmware environment values\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93079' - tag 'rid': 'SV-103167r1_rule' - tag 'stig_id': 'WN19-UR-000180' - tag 'fix_id': 'F-99325r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeSystemEnvironmentPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93081.rb b/controls/V-93081.rb deleted file mode 100644 index 01614fd..0000000 --- a/controls/V-93081.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93081" do - title "Windows Server 2019 Perform volume maintenance tasks user right must -only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Perform volume maintenance tasks\" user right can -manage volume and disk configurations. This could be used to delete volumes, -resulting in data loss or a denial of service." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the -\"Perform volume maintenance tasks\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeManageVolumePrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Perform -volume maintenance tasks\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93081' - tag 'rid': 'SV-103169r1_rule' - tag 'stig_id': 'WN19-UR-000190' - tag 'fix_id': 'F-99327r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeManageVolumePrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93083.rb b/controls/V-93083.rb deleted file mode 100644 index 539f87c..0000000 --- a/controls/V-93083.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93083" do - title "Windows Server 2019 Profile single process user right must only be -assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Profile single process\" user right can monitor -non-system processes performance. An attacker could use this to identify -processes to attack." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the -\"Profile single process\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeProfileSingleProcessPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators)" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Profile -single process\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93083' - tag 'rid': 'SV-103171r1_rule' - tag 'stig_id': 'WN19-UR-000200' - tag 'fix_id': 'F-99329r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeProfileSingleProcessPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93085.rb b/controls/V-93085.rb deleted file mode 100644 index 7a237cb..0000000 --- a/controls/V-93085.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93085" do - title "Windows Server 2019 Restore files and directories user right must only -be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Restore files and directories\" user right can -circumvent file and directory permissions and could allow access to sensitive -data. It could also be used to overwrite more current data." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the -\"Restore files and directories\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the \"SeRestorePrivilege\" -user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Restore -files and directories\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93085' - tag 'rid': 'SV-103173r1_rule' - tag 'stig_id': 'WN19-UR-000210' - tag 'fix_id': 'F-99331r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeRestorePrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93087.rb b/controls/V-93087.rb deleted file mode 100644 index 3911a24..0000000 --- a/controls/V-93087.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93087" do - title "Windows Server 2019 Take ownership of files or other objects user -right must only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Take ownership of files or other objects\" user right -can take ownership of objects and make changes." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Take -ownership of files or other objects\" user right, this is a finding: - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeTakeOwnershipPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Take -ownership of files or other objects\" to include only the following accounts or -groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000324-GPOS-00125' - tag 'gid': 'V-93087' - tag 'rid': 'SV-103175r1_rule' - tag 'stig_id': 'WN19-UR-000220' - tag 'fix_id': 'F-99333r1_fix' - tag 'cci': ["CCI-002235"] - tag 'nist': ["AC-6 (10)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeTakeOwnershipPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93089.rb b/controls/V-93089.rb deleted file mode 100644 index e95d375..0000000 --- a/controls/V-93089.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93089" do - title "Windows Server 2019 must be configured to audit Account Management - -Other Account Management Events successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Other Account Management Events records events such as the access of a -password hash or the Password Policy Checking API being called." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding: - - Account Management >> Other Account Management Events - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Management >> \"Audit Other Account Management -Events\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", -"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] - tag 'gid': 'V-93089' - tag 'rid': 'SV-103177r1_rule' - tag 'stig_id': 'WN19-AU-000090' - tag 'fix_id': 'F-99335r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Other Account Management Events') { should eq 'Success' } - end - describe audit_policy do - its('Other Account Management Events') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93091.rb b/controls/V-93091.rb deleted file mode 100644 index 1429a5b..0000000 --- a/controls/V-93091.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93091" do - title "Windows Server 2019 must be configured to audit Detailed Tracking - -Process Creation successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Process Creation records events related to the creation of a process and -the source." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Detailed Tracking >> Process Creation - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Detailed Tracking >> \"Audit Process Creation\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215"] - tag 'gid': 'V-93091' - tag 'rid': 'SV-103179r1_rule' - tag 'stig_id': 'WN19-AU-000140' - tag 'fix_id': 'F-99337r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Process Creation') { should eq 'Success' } - end - describe audit_policy do - its('Process Creation') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93093.rb b/controls/V-93093.rb deleted file mode 100644 index 446de4b..0000000 --- a/controls/V-93093.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93093" do - title "Windows Server 2019 must be configured to audit Policy Change - Audit -Policy Change successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Policy Change records events related to changes in audit policy." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Policy Change >> Audit Policy Change - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Policy Change >> \"Audit Audit Policy Change\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93093' - tag 'rid': 'SV-103181r1_rule' - tag 'stig_id': 'WN19-AU-000260' - tag 'fix_id': 'F-99339r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Audit Policy Change') { should eq 'Success' } - end - describe audit_policy do - its('Audit Policy Change') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93095.rb b/controls/V-93095.rb deleted file mode 100644 index a6fb1c4..0000000 --- a/controls/V-93095.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93095" do - title "Windows Server 2019 must be configured to audit Policy Change - Audit -Policy Change failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Policy Change records events related to changes in audit policy." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Policy Change >> Audit Policy Change - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Policy Change >> \"Audit Audit Policy Change\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93095' - tag 'rid': 'SV-103183r1_rule' - tag 'stig_id': 'WN19-AU-000270' - tag 'fix_id': 'F-99341r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Audit Policy Change') { should eq 'Failure' } - end - describe audit_policy do - its('Audit Policy Change') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93097.rb b/controls/V-93097.rb deleted file mode 100644 index 4e59ec0..0000000 --- a/controls/V-93097.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93097" do - title "Windows Server 2019 must be configured to audit Policy Change - -Authentication Policy Change successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Authentication Policy Change records events related to changes in -authentication policy, including Kerberos policy and Trust changes." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Policy Change >> Authentication Policy Change - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Policy Change >> \"Audit Authentication Policy -Change\" with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", -"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] - tag 'gid': 'V-93097' - tag 'rid': 'SV-103185r1_rule' - tag 'stig_id': 'WN19-AU-000280' - tag 'fix_id': 'F-99343r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Authentication Policy Change') { should eq 'Success' } - end - describe audit_policy do - its('Authentication Policy Change') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93099.rb b/controls/V-93099.rb deleted file mode 100644 index 1da4fae..0000000 --- a/controls/V-93099.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93099" do - title "Windows Server 2019 must be configured to audit Policy Change - -Authorization Policy Change successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Authorization Policy Change records events related to changes in user -rights, such as \"Create a token object\"." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Policy Change >> Authorization Policy Change - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Policy Change >> \"Audit Authorization Policy Change\" -with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", -"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] - tag 'gid': 'V-93099' - tag 'rid': 'SV-103187r1_rule' - tag 'stig_id': 'WN19-AU-000290' - tag 'fix_id': 'F-99345r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Authentication Policy Change') { should eq 'Success' } - end - describe audit_policy do - its('Authentication Policy Change') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93101.rb b/controls/V-93101.rb deleted file mode 100644 index 7306cf8..0000000 --- a/controls/V-93101.rb +++ /dev/null @@ -1,59 +0,0 @@ -# encoding: UTF-8 - -control "V-93101" do - title "Windows Server 2019 must be configured to audit Privilege Use - -Sensitive Privilege Use successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Sensitive Privilege Use records events related to use of sensitive -privileges, such as \"Act as part of the operating system\" or \"Debug -programs\"." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Privilege Use >> Sensitive Privilege Use - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Privilege Use >> \"Audit Sensitive Privilege Use\" -with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", -"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] - tag 'gid': 'V-93101' - tag 'rid': 'SV-103189r1_rule' - tag 'stig_id': 'WN19-AU-000300' - tag 'fix_id': 'F-99347r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Sensitive Privilege Use') { should eq 'Success' } - end - describe audit_policy do - its('Sensitive Privilege Use') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93103.rb b/controls/V-93103.rb deleted file mode 100644 index 379a85f..0000000 --- a/controls/V-93103.rb +++ /dev/null @@ -1,60 +0,0 @@ -# encoding: UTF-8 - -control "V-93103" do - title "Windows Server 2019 must be configured to audit Privilege Use - -Sensitive Privilege Use failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Sensitive Privilege Use records events related to use of sensitive -privileges, such as \"Act as part of the operating system\" or \"Debug -programs\"." - desc "rationale", "" - desc 'check', " - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Privilege Use >> Sensitive Privilege Use - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Privilege Use >> \"Audit Sensitive Privilege Use\" -with \"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000064-GPOS-00033", -"SRG-OS-000462-GPOS-00206", "SRG-OS-000466-GPOS-00210"] - tag 'gid': 'V-93103' - tag 'rid': 'SV-103191r1_rule' - tag 'stig_id': 'WN19-AU-000310' - tag 'fix_id': 'F-99349r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Sensitive Privilege Use') { should eq 'Failure' } - end - describe audit_policy do - its('Sensitive Privilege Use') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93105.rb b/controls/V-93105.rb deleted file mode 100644 index fd8db82..0000000 --- a/controls/V-93105.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93105" do - title "Windows Server 2019 must be configured to audit System - IPsec Driver -successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - IPsec Driver records events related to the IPsec Driver, such as dropped -packets." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> IPsec Driver - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit IPsec Driver\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93105' - tag 'rid': 'SV-103193r1_rule' - tag 'stig_id': 'WN19-AU-000320' - tag 'fix_id': 'F-99351r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('IPsec Driver') { should eq 'Success' } - end - describe audit_policy do - its('IPsec Driver') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93107.rb b/controls/V-93107.rb deleted file mode 100644 index cccea91..0000000 --- a/controls/V-93107.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93107" do - title "Windows Server 2019 must be configured to audit System - IPsec Driver -failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - IPsec Driver records events related to the IPsec Driver, such as dropped -packets." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> IPsec Driver - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit IPsec Driver\" with \"Failure\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93107' - tag 'rid': 'SV-103195r1_rule' - tag 'stig_id': 'WN19-AU-000330' - tag 'fix_id': 'F-99353r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('IPsec Driver') { should eq 'Failure' } - end - describe audit_policy do - its('IPsec Driver') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93109.rb b/controls/V-93109.rb deleted file mode 100644 index b4c7cb2..0000000 --- a/controls/V-93109.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93109" do - title "Windows Server 2019 must be configured to audit System - Other System -Events successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Other System Events records information related to cryptographic key -operations and the Windows Firewall service." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> Other System Events - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit Other System Events\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93109' - tag 'rid': 'SV-103197r1_rule' - tag 'stig_id': 'WN19-AU-000340' - tag 'fix_id': 'F-99355r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Other System Events') { should eq 'Success' } - end - describe audit_policy do - its('Other System Events') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93111.rb b/controls/V-93111.rb deleted file mode 100644 index 4e1d974..0000000 --- a/controls/V-93111.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93111" do - title "Windows Server 2019 must be configured to audit System - Other System -Events failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Other System Events records information related to cryptographic key -operations and the Windows Firewall service." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> Other System Events - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit Other System Events\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': "SRG-OS-000327-GPOS-00127" - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': "V-93111" - tag 'rid': "SV-103199r1_rule" - tag 'stig_id': "WN19-AU-000350" - tag 'fix_id': "F-99357r1_fix" - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Other System Events') { should eq 'Failure' } - end - describe audit_policy do - its('Other System Events') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93113.rb b/controls/V-93113.rb deleted file mode 100644 index a623ab4..0000000 --- a/controls/V-93113.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93113" do - title "Windows Server 2019 must be configured to audit System - Security -State Change successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Security State Change records events related to changes in the security -state, such as startup and shutdown of the system." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> Security State Change - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit Security State Change\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93113' - tag 'rid': 'SV-103201r1_rule' - tag 'stig_id': 'WN19-AU-000360' - tag 'fix_id': 'F-99359r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Security State Change') { should eq 'Success' } - end - describe audit_policy do - its('Security State Change') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93115.rb b/controls/V-93115.rb deleted file mode 100644 index 2749bfc..0000000 --- a/controls/V-93115.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93115" do - title "Windows Server 2019 must be configured to audit System - Security -System Extension successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Security System Extension records events related to extension code being -loaded by the security subsystem." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> Security System Extension - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit Security System Extension\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93115' - tag 'rid': 'SV-103203r1_rule' - tag 'stig_id': 'WN19-AU-000370' - tag 'fix_id': 'F-99361r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('Security System Extension') { should eq 'Success' } - end - describe audit_policy do - its('Security System Extension') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93117.rb b/controls/V-93117.rb deleted file mode 100644 index d0fb4c9..0000000 --- a/controls/V-93117.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93117" do - title "Windows Server 2019 must be configured to audit System - System -Integrity successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - System Integrity records events related to violations of integrity to the -security subsystem." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> System Integrity - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit System Integrity\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215", -"SRG-OS-000471-GPOS-00216", "SRG-OS-000477-GPOS-00222"] - tag 'gid': 'V-93117' - tag 'rid': 'SV-103205r1_rule' - tag 'stig_id': 'WN19-AU-000380' - tag 'fix_id': 'F-99363r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('System Integrity') { should eq 'Success' } - end - describe audit_policy do - its('System Integrity') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93119.rb b/controls/V-93119.rb deleted file mode 100644 index be3c222..0000000 --- a/controls/V-93119.rb +++ /dev/null @@ -1,59 +0,0 @@ -# encoding: UTF-8 - -control "V-93119" do - title "Windows Server 2019 must be configured to audit System - System -Integrity failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - System Integrity records events related to violations of integrity to the -security subsystem." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - System >> System Integrity - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> System >> \"Audit System Integrity\" with \"Failure\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000471-GPOS-00215", -"SRG-OS-000471-GPOS-00216", "SRG-OS-000477-GPOS-00222"] - tag 'gid': 'V-93119' - tag 'rid': 'SV-103207r1_rule' - tag 'stig_id': 'WN19-AU-000390' - tag 'fix_id': 'F-99365r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - describe.one do - describe audit_policy do - its('System Integrity') { should eq 'Failure' } - end - describe audit_policy do - its('System Integrity') { should eq 'Success and Failure' } - end - end - -end - diff --git a/controls/V-93121.rb b/controls/V-93121.rb deleted file mode 100644 index 287a597..0000000 --- a/controls/V-93121.rb +++ /dev/null @@ -1,183 +0,0 @@ -# encoding: UTF-8 - -control "V-93121" do - title "Windows Server 2019 Active Directory Group Policy objects must be -configured with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes Group Policy objects. Because changes to these objects can -significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for all Group Policy objects. - - Open \"Group Policy Management\" (available from various menus or run -\"gpmc.msc\"). - - Navigate to \"Group Policy Objects\" in the domain being reviewed (Forest ->> Domains >> Domain). - - For each Group Policy object: - - Select the Group Policy object item in the left pane. - - Select the \"Delegation\" tab in the right pane. - - Select the \"Advanced\" button. - - Select the \"Advanced\" button again and then the \"Auditing\" tab. - - If the audit settings for any Group Policy object are not at least as -inclusive as those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Applies to - This object and all descendant objects or Descendant -groupPolicyContainer objects - - The three Success types listed below are defaults inherited from the Parent -Object. Where Special is listed in the summary screens for Access, detailed -Permissions are provided for reference. - - Type - Success - Principal - Everyone - Access - Special (Permissions: Write all properties, Modify permissions; -Properties: all \"Write\" type selected) - Inherited from - Parent Object - Applies to - Descendant groupPolicyContainer objects - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - blank (Permissions: none selected; Properties: one instance - -Write gPLink, one instance - Write gPOptions) - Inherited from - Parent Object - Applies to - Descendant Organization Unit Objects" - desc 'fix', "Configure the audit settings for Group Policy objects to include the -following: - - This can be done at the Policy level in Active Directory to apply to all -group policies. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Select \"Advanced Features\" from the \"View\" Menu. - - Navigate to [Domain] >> System >> Policies in the left panel. - - Right click \"Policies\", select \"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button. - - Select the \"Auditing\" tab. - - Type - Fail - Principal - Everyone - Access - Full Control - Applies to - This object and all descendant objects or Descendant -groupPolicyContainer objects - - The three Success types listed below are defaults inherited from the Parent -Object. Where Special is listed in the summary screens for Access, detailed -Permissions are provided for reference. - - Type - Success - Principal - Everyone - Access - Special (Permissions: Write all properties, Modify permissions; -Properties: all \"Write\" type selected) - Inherited from - Parent Object - Applies to - Descendant groupPolicyContainer objects - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - blank (Permissions: none selected; Properties: one instance - -Write gPLink, one instance - Write gPOptions) - Inherited from - Parent Object - Applies to - Descendant Organization Unit Objects" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93121' - tag 'rid': 'SV-103209r1_rule' - tag 'stig_id': 'WN19-DC-000170' - tag 'fix_id': 'F-99367r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedNames = json(command: "Get-ADObject -Filter { objectclass -eq 'groupPolicyContainer'} | foreach {$_.DistinguishedName} | ConvertTo-JSON").params - distinguishedNames.each do |distinguishedName| - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - if acl_rules.is_a?(Hash) - acl_rules = [JSON.parse(acl_rules.to_json)] - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll" } - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl" } - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "All" } - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty" } - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "Descendents" } - end - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93123.rb b/controls/V-93123.rb deleted file mode 100644 index c751095..0000000 --- a/controls/V-93123.rb +++ /dev/null @@ -1,223 +0,0 @@ -# encoding: UTF-8 - -control "V-93123" do - title "Windows Server 2019 Active Directory Domain object must be configured -with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes the Domain object. Because changes to these objects can -significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for the Domain object. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the domain being reviewed in the left pane. - - Right-click the domain name and select \"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - If the audit settings on the Domain object are not at least as inclusive as -those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - Applies to - This object only - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - None - Applies to - Special - - Type - Success - Principal - Domain Users - Access - All extended rights - Inherited from - None - Applies to - This object only - - Type - Success - Principal - Administrators - Access - All extended rights - Inherited from - None - Applies to - This object only - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Permissions: Write all properties, Modify permissions, -Modify owner)" - desc 'fix', " - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the domain being reviewed in the left pane. - - Right-click the domain name and select \"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - Configure the audit settings for Domain object to include the following: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - Applies to - This object only - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - None - Applies to - Special - - Type - Success - Principal - Domain Users - Access - All extended rights - Inherited from - None - Applies to - This object only - - Type - Success - Principal - Administrators - Access - All extended rights - Inherited from - None - Applies to - This object only - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Permissions: Write all properties, Modify permissions, -Modify owner.)" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93123' - tag 'rid': 'SV-103211r1_rule' - tag 'stig_id': 'WN19-DC-000180' - tag 'fix_id': 'F-99369r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params - distinguishedName = "\'#{distinguishedName}\'" - netbiosname = json(command: 'Get-ADDomain | Select NetBIOSName | ConvertTo-JSON').params['NetBIOSName'] - acl_rules = json(command: "(Get-ACL -Audit -Path AD:#{distinguishedName}).Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl, WriteOwner"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "BUILTIN\\Administrators" } - its(['ActiveDirectoryRights']) { should cmp "ExtendedRight"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "#{netbiosname}\\Domain Users" } - its(['ActiveDirectoryRights']) { should cmp "ExtendedRight"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "All" } - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93125.rb b/controls/V-93125.rb deleted file mode 100644 index 2a83f89..0000000 --- a/controls/V-93125.rb +++ /dev/null @@ -1,166 +0,0 @@ -# encoding: UTF-8 - -control "V-93125" do - title "Windows Server 2019 Active Directory Infrastructure object must be -configured with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes the Infrastructure object. Because changes to these objects can -significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for Infrastructure object. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the domain being reviewed in the left pane. - - Right-click the \"Infrastructure\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - If the audit settings on the Infrastructure object are not at least as -inclusive as those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - (Access - Special = Permissions: Write all properties, All extended rights, -Change infrastructure master) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain)" - desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the domain being reviewed in the left pane. - - Right-click the \"Infrastructure\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - Configure the audit settings for Infrastructure object to include the -following: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - (Access - Special = Permissions: Write all properties, All extended rights, -Change infrastructure master) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain)" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93125' - tag 'rid': 'SV-103213r1_rule' - tag 'stig_id': 'WN19-DC-000190' - tag 'fix_id': 'F-99371r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=Infrastructure,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty, ExtendedRight"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "Descendents" } - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93127.rb b/controls/V-93127.rb deleted file mode 100644 index 610d1b6..0000000 --- a/controls/V-93127.rb +++ /dev/null @@ -1,198 +0,0 @@ -# encoding: UTF-8 - -control "V-93127" do - title "Windows Server 2019 Active Directory Domain Controllers Organizational -Unit (OU) object must be configured with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes the Domain Controller OU object. Because changes to these objects -can significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for the Domain Controller OU object. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the \"Domain Controllers OU\" under the domain being reviewed in the -left pane. - - Right-click the \"Domain Controllers OU\" object and select \"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - If the audit settings on the Domain Controllers OU object are not at least -as inclusive as those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - Applies to - This object and all descendant objects - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Permissions: all create, delete and modify permissions) - - Type - Success - Principal - Everyone - Access - Write all properties - Inherited from - None - Applies to - This object and all descendant objects - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain) - Applies to - Descendant Organizational Unit objects" - desc 'fix', " - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select the \"Domain Controllers OU\" under the domain being reviewed in the -left pane. - - Right-click the \"Domain Controllers OU\" object and select \"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - Configure the audit settings for Domain Controllers OU object to include -the following: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Permissions: all create, delete and modify permissions) - - Type - Success - Principal - Everyone - Access - Write all properties - Inherited from - None - Applies to - This object and all descendant objects - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain) - Applies to - Descendant Organizational Unit objects" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93127' - tag 'rid': 'SV-103215r1_rule' - tag 'stig_id': 'WN19-DC-000200' - tag 'fix_id': 'F-99373r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'OU=Domain Controllers,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "CreateChild, DeleteChild, DeleteTree, Delete, WriteDacl, WriteOwner"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "All" } - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "All" } - end - end - end - - - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93129.rb b/controls/V-93129.rb deleted file mode 100644 index 650ad52..0000000 --- a/controls/V-93129.rb +++ /dev/null @@ -1,171 +0,0 @@ -# encoding: UTF-8 - -control "V-93129" do - title "Windows Server 2019 Active Directory AdminSDHolder object must be -configured with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes the AdminSDHolder object. Because changes to these objects can -significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for the \"AdminSDHolder\" object. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select \"System\" under the domain being reviewed in the left pane. - - Right-click the \"AdminSDHolder\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - If the audit settings on the \"AdminSDHolder\" object are not at least as -inclusive as those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - Applies to - This object only - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Write all properties, Modify permissions, Modify owner) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain) - Applies to - Descendant Organizational Unit objects" - desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select \"System\" under the domain being reviewed in the left pane. - - Right-click the \"AdminSDHolder\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - Configure the audit settings for AdminSDHolder object to include the -following: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - Applies to - This object only - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - Applies to - This object only - (Access - Special = Write all properties, Modify permissions, Modify owner) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain) - Applies to - Descendant Organizational Unit objects" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93129' - tag 'rid': 'SV-103217r1_rule' - tag 'stig_id': 'WN19-DC-000210' - tag 'fix_id': 'F-99375r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=AdminSDHolder,CN=System,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty, WriteDacl, WriteOwner"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "Descendents" } - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93131.rb b/controls/V-93131.rb deleted file mode 100644 index b076e9f..0000000 --- a/controls/V-93131.rb +++ /dev/null @@ -1,167 +0,0 @@ -# encoding: UTF-8 - -control "V-93131" do - title "Windows Server 2019 Active Directory RID Manager$ object must be -configured with proper audit settings." - desc "When inappropriate audit settings are configured for directory service -database objects, it may be possible for a user or process to update the data -without generating any tracking data. The impact of missing audit data is -related to the type of object. A failure to capture audit data for objects used -by identification, authentication, or authorization functions could degrade or -eliminate the ability to track changes to access policy for systems or data. - - For Active Directory (AD), there are a number of critical object types in -the domain naming context of the AD database for which auditing is essential. -This includes the RID Manager$ object. Because changes to these objects can -significantly impact access controls or the availability of systems, the -absence of auditing data makes it impossible to identify the source of changes -that impact the confidentiality, integrity, and availability of data and -systems throughout an AD domain. The lack of proper auditing can result in -insufficient forensic evidence needed to investigate an incident and prosecute -the intruder." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Review the auditing configuration for the \"RID Manager$\" object. - - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select \"System\" under the domain being reviewed in the left pane. - - Right-click the \"RID Manager$\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - If the audit settings on the \"RID Manager$\" object are not at least as -inclusive as those below, this is a finding: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - (Access - Special = Write all properties, All extended rights, Change RID -master) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain)" - desc 'fix', "Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - - Ensure \"Advanced Features\" is selected in the \"View\" menu. - - Select \"System\" under the domain being reviewed in the left pane. - - Right-click the \"RID Manager$\" object in the right pane and select -\"Properties\". - - Select the \"Security\" tab. - - Select the \"Advanced\" button and then the \"Auditing\" tab. - - Configure the audit settings for RID Manager$ object to include the -following: - - Type - Fail - Principal - Everyone - Access - Full Control - Inherited from - None - - The success types listed below are defaults. Where Special is listed in the -summary screens for Access, detailed Permissions are provided for reference. -Various Properties selections may also exist by default. - - Type - Success - Principal - Everyone - Access - Special - Inherited from - None - (Access - Special = Write all properties, All extended rights, Change RID -master) - - Two instances with the following summary information will be listed: - - Type - Success - Principal - Everyone - Access - (blank) - Inherited from - (CN of domain)" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93131' - tag 'rid': 'SV-103219r1_rule' - tag 'stig_id': 'WN19-DC-000220' - tag 'fix_id': 'F-99377r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - distinguishedName = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-JSON').params - acl_rules = json(command: "(Get-ACL -Audit -Path AD:'CN=RID Manager$,CN=System,#{distinguishedName}').Audit | ConvertTo-CSV | ConvertFrom-CSV | ConvertTo-JSON").params - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Failure" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "GenericAll"} - end - end - end - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty, ExtendedRight"} - its(['IsInherited']) { should cmp "False" } - its(['InheritanceType']) { should cmp "None" } - end - end - end - - - describe.one do - acl_rules.each do |acl_rule| - describe "Audit rule property for principal: #{acl_rule['IdentityReference']}" do - subject { acl_rule } - its(['AuditFlags']) { should cmp "Success" } - its(['IdentityReference']) { should cmp "Everyone" } - its(['ActiveDirectoryRights']) { should cmp "WriteProperty"} - its(['IsInherited']) { should cmp "True" } - its(['InheritanceType']) { should cmp "Descendents" } - end - end - end - else - impact 0.0 - desc 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93133.rb b/controls/V-93133.rb deleted file mode 100644 index 422eb85..0000000 --- a/controls/V-93133.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93133" do - title "Windows Server 2019 must be configured to audit DS Access - Directory -Service Access successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Directory Service Access records events related to users accessing an -Active Directory object." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - DS Access >> Directory Service Access - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> DS Access >> \"Directory Service Access\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': "SRG-OS-000327-GPOS-00127" - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': "V-93133" - tag 'rid': "SV-103221r1_rule" - tag 'stig_id': "WN19-DC-000240" - tag 'fix_id': "F-99379r1_fix" - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - describe.one do - describe audit_policy do - its('Directory Service Access') { should eq 'Success' } - end - describe audit_policy do - its('Directory Service Access') { should eq 'Success and Failure' } - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93135.rb b/controls/V-93135.rb deleted file mode 100644 index 13006d2..0000000 --- a/controls/V-93135.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93135" do - title "Windows Server 2019 must be configured to audit DS Access - Directory -Service Access failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Directory Service Access records events related to users accessing an -Active Directory object." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - DS Access >> Directory Service Access - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> DS Access >> \"Directory Service Access\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93135' - tag 'rid': 'SV-103223r1_rule' - tag 'stig_id': 'WN19-DC-000250' - tag 'fix_id': 'F-99381r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - describe.one do - describe audit_policy do - its('Directory Service Access') { should eq 'Failure' } - end - describe audit_policy do - its('Directory Service Access') { should eq 'Success and Failure' } - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93137.rb b/controls/V-93137.rb deleted file mode 100644 index 6bb0f5f..0000000 --- a/controls/V-93137.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93137" do - title "Windows Server 2019 must be configured to audit DS Access - Directory -Service Changes successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Directory Service Changes records events related to changes made to -objects in Active Directory Domain Services." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - DS Access >> Directory Service Changes - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> DS Access >> \"Directory Service Changes\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93137' - tag 'rid': 'SV-103225r1_rule' - tag 'stig_id': 'WN19-DC-000260' - tag 'fix_id': 'F-99383r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - describe.one do - describe audit_policy do - its('Directory Service Changes') { should eq 'Success' } - end - describe audit_policy do - its('Directory Service Changes') { should eq 'Success and Failure' } - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93139.rb b/controls/V-93139.rb deleted file mode 100644 index 0ff455c..0000000 --- a/controls/V-93139.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93139" do - title "Windows Server 2019 must be configured to audit DS Access - Directory -Service Changes failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Directory Service Changes records events related to changes made to -objects in Active Directory Domain Services." - desc "rationale", "" - desc 'check', "This applies to domain controllers. It is NA for other systems. - - Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - DS Access >> Directory Service Changes - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> DS Access >> \"Directory Service Changes\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000327-GPOS-00127' - tag 'satisfies': ["SRG-OS-000327-GPOS-00127", "SRG-OS-000458-GPOS-00203", -"SRG-OS-000463-GPOS-00207", "SRG-OS-000468-GPOS-00212"] - tag 'gid': 'V-93139' - tag 'rid': 'SV-103227r1_rule' - tag 'stig_id': 'WN19-DC-000270' - tag 'fix_id': 'F-99385r1_fix' - tag 'cci': ["CCI-000172", "CCI-002234"] - tag 'nist': ["AU-12 c", "AC-6 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - if domain_role == '4' || domain_role == '5' - describe.one do - describe audit_policy do - its('Directory Service Changes') { should eq 'Failure' } - end - describe audit_policy do - its('Directory Service Changes') { should eq 'Success and Failure' } - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end - diff --git a/controls/V-93141.rb b/controls/V-93141.rb deleted file mode 100644 index f3c708f..0000000 --- a/controls/V-93141.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93141" do - title "Windows Server 2019 must have the number of allowed bad logon attempts -configured to #{input('max_pass_lockout')} or less." - desc "The account lockout feature, when enabled, prevents brute-force -password attacks on the system. The higher this value is, the less effective -the account lockout feature will be in protecting the local system. The number -of bad logon attempts must be reasonably small to minimize the possibility of a -successful password attack while allowing for honest errors made during normal -user logon." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Account Policies >> Account Lockout Policy. - - If the \"Account lockout threshold\" is \"0\" or more than \"#{input('max_pass_lockout')}\" attempts, -this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - - If \"LockoutBadCount\" equals \"0\" or is greater than \"#{input('max_pass_lockout')}\" in the file, -this is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Account Policies >> Account Lockout -Policy >> \"Account lockout threshold\" to \"#{input('max_pass_lockout')}\" or fewer invalid logon -attempts (excluding \"0\", which is unacceptable)." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000021-GPOS-00005' - tag 'gid': 'V-93141' - tag 'rid': 'SV-103229r1_rule' - tag 'stig_id': 'WN19-AC-000020' - tag 'fix_id': 'F-99387r1_fix' - tag 'cci': ["CCI-000044"] - tag 'nist': ["AC-7 a", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('LockoutBadCount') { should be <= input('max_pass_lockout') } - end - describe security_policy do - its('LockoutBadCount') { should be > 0 } - end - end -end - diff --git a/controls/V-93143.rb b/controls/V-93143.rb deleted file mode 100644 index 51dea17..0000000 --- a/controls/V-93143.rb +++ /dev/null @@ -1,53 +0,0 @@ -# encoding: UTF-8 - -control "V-93143" do - title "Windows Server 2019 must have the period of time before the bad logon -counter is reset configured to #{input('pass_lock_time')} minutes or greater." - desc "The account lockout feature, when enabled, prevents brute-force -password attacks on the system. This parameter specifies the period of time -that must pass after failed logon attempts before the counter is reset to -\"0\". The smaller this value is, the less effective the account lockout -feature will be in protecting the local system." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Account Policies >> Account Lockout Policy. - - If the \"Reset account lockout counter after\" value is less than \"#{input('pass_lock_time')}\" -minutes, this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - - If \"ResetLockoutCount\" is less than \"#{input('pass_lock_time')}\" in the file, this is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Account Policies >> Account Lockout -Policy >> \"Reset account lockout counter after\" to at least \"#{input('pass_lock_time')}\" minutes." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000021-GPOS-00005' - tag 'satisfies': ["SRG-OS-000021-GPOS-00005", "SRG-OS-000329-GPOS-00128"] - tag 'gid': 'V-93143' - tag 'rid': 'SV-103231r1_rule' - tag 'stig_id': 'WN19-AC-000030' - tag 'fix_id': 'F-99389r1_fix' - tag 'cci': ["CCI-000044", "CCI-002238"] - tag 'nist': ["AC-7 a", "AC-7 b", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('ResetLockoutCount') { should be >= input('pass_lock_time') } - end - end -end - diff --git a/controls/V-93145.rb b/controls/V-93145.rb deleted file mode 100644 index 2c64fad..0000000 --- a/controls/V-93145.rb +++ /dev/null @@ -1,64 +0,0 @@ -# encoding: UTF-8 - -control "V-93145" do - title "Windows Server 2019 account lockout duration must be configured to #{input('pass_lock_duration')} -minutes or greater." - desc "The account lockout feature, when enabled, prevents brute-force -password attacks on the system. This parameter specifies the period of time -that an account will remain locked after the specified number of failed logon -attempts." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Account Policies >> Account Lockout Policy. - - If the \"Account lockout duration\" is less than \"#{input('pass_lock_duration')}\" minutes (excluding -\"0\"), this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - - If \"LockoutDuration\" is less than \"#{input('pass_lock_duration')}\" (excluding \"0\") in the file, -this is a finding. - - Configuring this to \"0\", requiring an administrator to unlock the -account, is more restrictive and is not a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Account Policies >> Account Lockout Policy >> \"Account -lockout duration\" to \"#{input('pass_lock_duration')}\" minutes or greater. - - A value of \"0\" is also acceptable, requiring an administrator to unlock -the account." - impact 0.5 - tag severity: nil - tag gtitle: 'SRG-OS-000329-GPOS-00128' - tag gid: 'V-93145' - tag rid: 'SV-103233r1_rule' - tag stig_id: 'WN19-AC-000010' - tag fix_id: 'F-99391r1_fix' - tag cci: ["CCI-002238"] - tag nist: ["AC-7 b", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - pass_lock_duration = input('pass_lock_duration') - describe.one do - describe security_policy do - its('LockoutDuration') { should be >= pass_lock_duration } - end - describe security_policy do - its('LockoutDuration') { should cmp == 0 } - end - end - end -end - diff --git a/controls/V-93147.rb b/controls/V-93147.rb deleted file mode 100644 index 8137867..0000000 --- a/controls/V-93147.rb +++ /dev/null @@ -1,55 +0,0 @@ -# encoding: UTF-8 - -control "V-93147" do - title "Windows Server 2019 required legal notice must be configured to -display before console logon." - desc "Failure to display the logon banner prior to a logon attempt will -negate legal proceedings resulting from unauthorized access to system resources." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: LegalNoticeText - - Value Type: REG_SZ - Value: See message text below - - #{input('LegalNoticeText')}" - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> Security Options >> \"Interactive -Logon: Message text for users attempting to log on\" to the following: - - #{input('LegalNoticeText')}" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000023-GPOS-00006' - tag 'satisfies': ["SRG-OS-000023-GPOS-00006", "SRG-OS-000024-GPOS-00007", -"SRG-OS-000228-GPOS-00088"] - tag 'gid': 'V-93147' - tag 'rid': 'SV-103235r1_rule' - tag 'stig_id': 'WN19-SO-000130' - tag 'fix_id': 'F-99393r1_fix' - tag 'cci': ["CCI-000048", "CCI-000050", "CCI-001384", "CCI-001385", -"CCI-001386", "CCI-001387", "CCI-001388"] - tag 'nist': ["AC-8 a", "AC-8 b", "AC-8 c 1", "AC-8 c 2", "AC-8 c 2", "AC-8 c -2", "AC-8 c 3", "Rev_4"] - -describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'LegalNoticeText' } - end - - key = registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System').LegalNoticeText.to_s - - k = key.gsub("\u0000", '') - legal_notice_text = input('LegalNoticeText') - - describe 'The required legal notice text' do - subject { k.scan(/[\w().;,!]/).join } - it { should cmp legal_notice_text.scan(/[\w().;,!]/).join } - end -end - diff --git a/controls/V-93149.rb b/controls/V-93149.rb deleted file mode 100644 index ab5262b..0000000 --- a/controls/V-93149.rb +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: UTF-8 - -control "V-93149" do - title "Windows Server 2019 title for legal banner dialog box must be configured with the appropriate text." - desc "Failure to display the logon banner prior to a logon attempt will negate legal proceedings resulting from unauthorized access to system resources." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: LegalNoticeCaption - - Value Type: REG_SZ - Value: See message title options below - - \"#{input('LegalNoticeCaption').join("\", \"")}\", or an organization-defined equivalent. - - If an organization-defined title is used, it can in no case contravene or modify the language of the banner text required in WN19-SO-000150. - - Automated tools may only search for the titles defined above. If an organization-defined title is used, a manual review will be required." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive Logon: Message title for users attempting to log on\" to \"#{input('LegalNoticeCaption').join("\", \"")}\", or an organization-defined equivalent. - - If an organization-defined title is used, it can in no case contravene or modify the language of the message text required in WN19-SO-000150." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000023-GPOS-00006' - tag 'satisfies': ["SRG-OS-000023-GPOS-00006", "SRG-OS-000228-GPOS-00088"] - tag 'gid': 'V-93149' - tag 'rid': 'SV-103237r1_rule' - tag 'stig_id': 'WN19-SO-000140' - tag 'fix_id': 'F-99395r1_fix' - tag 'cci': ["CCI-000048", "CCI-001384", "CCI-001385", "CCI-001386", "CCI-001387", "CCI-001388"] - tag 'nist': ["AC-8 a", "AC-8 c 1", "AC-8 c 2", "AC-8 c 2", "AC-8 c 2", "AC-8 c 3", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'LegalNoticeCaption' } - its('LegalNoticeCaption') { should be_in input('LegalNoticeCaption') } - end -end \ No newline at end of file diff --git a/controls/V-93151.rb b/controls/V-93151.rb deleted file mode 100644 index 33e1672..0000000 --- a/controls/V-93151.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93151" do - title "Windows Server 2019 must force audit policy subcategory settings to -override audit policy category settings." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - This setting allows administrators to enable more precise auditing -capabilities." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: SCENoApplyLegacyAuditPolicy - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Local Policies >> Security Options >> -\"Audit: Force audit policy subcategory settings (Windows Vista or later) to -override audit policy category settings\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000062-GPOS-00031' - tag 'gid': 'V-93151' - tag 'rid': 'SV-103239r1_rule' - tag 'stig_id': 'WN19-SO-000050' - tag 'fix_id': 'F-99397r1_fix' - tag 'cci': ["CCI-000169"] - tag 'nist': ["AU-12 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa') do - it { should have_property 'SCENoApplyLegacyAuditPolicy' } - its('SCENoApplyLegacyAuditPolicy') { should cmp 1 } - end -end \ No newline at end of file diff --git a/controls/V-93153.rb b/controls/V-93153.rb deleted file mode 100644 index ae5173c..0000000 --- a/controls/V-93153.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93153" do - title "Windows Server 2019 must be configured to audit Account Logon - -Credential Validation successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Credential Validation records events related to validation tests on -credentials for a user account logon." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Logon >> Credential Validation - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Logon >> \"Audit Credential Validation\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'gid': 'V-93153' - tag 'rid': 'SV-103241r1_rule' - tag 'stig_id': 'WN19-AU-000070' - tag 'fix_id': 'F-99399r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Credential Validation') { should eq 'Success' } - end - describe audit_policy do - its('Credential Validation') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93155.rb b/controls/V-93155.rb deleted file mode 100644 index 7b872da..0000000 --- a/controls/V-93155.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93155" do - title "Windows Server 2019 must be configured to audit Account Logon - -Credential Validation failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Credential Validation records events related to validation tests on -credentials for a user account logon." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Account Logon >> Credential Validation - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Account Logon >> \"Audit Credential Validation\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'gid': 'V-93155' - tag 'rid': 'SV-103243r1_rule' - tag 'stig_id': 'WN19-AU-000080' - tag 'fix_id': 'F-99401r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Credential Validation') { should eq 'Failure' } - end - describe audit_policy do - its('Credential Validation') { should eq 'Success and Failure' } - end - end - -end - diff --git a/controls/V-93157.rb b/controls/V-93157.rb deleted file mode 100644 index e855dbb..0000000 --- a/controls/V-93157.rb +++ /dev/null @@ -1,62 +0,0 @@ -# encoding: UTF-8 - -control "V-93157" do - title "Windows Server 2019 must be configured to audit Detailed Tracking - -Plug and Play Events successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Plug and Play activity records events related to the successful connection -of external devices." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Detailed Tracking >> Plug and Play Events - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Advanced Audit Policy Configuration >> System Audit -Policies >> Detailed Tracking >> \"Audit PNP Activity\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000474-GPOS-00219' - tag 'gid': 'V-93157' - tag 'rid': 'SV-103245r1_rule' - tag 'stig_id': 'WN19-AU-000130' - tag 'fix_id': 'F-99403r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Plug and Play Events') { should eq 'Success' } - end - describe audit_policy do - its('Plug and Play Events') { should eq 'Success and Failure' } - end - describe command("AuditPol /get /category:* | Findstr /c:'Plug and Play Events'") do - its('stdout') { should match /Plug and Play Events Success/ } - end - describe command("AuditPol /get /category:* | Findstr /c:'Plug and Play Events'") do - its('stdout') { should match /Plug and Play Events Success and Failure/ } - end - end -end - diff --git a/controls/V-93159.rb b/controls/V-93159.rb deleted file mode 100644 index 9242fc0..0000000 --- a/controls/V-93159.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93159" do - title "Windows Server 2019 must be configured to audit Logon/Logoff - Group -Membership successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Audit Group Membership records information related to the group membership -of a user's logon token." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Group Membership - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Advanced Audit Policy Configuration >> System Audit -Policies >> Logon/Logoff >> \"Audit Group Membership\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'gid': 'V-93159' - tag 'rid': 'SV-103247r1_rule' - tag 'stig_id': 'WN19-AU-000170' - tag 'fix_id': 'F-99405r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Group Membership') { should eq 'Success' } - end - describe audit_policy do - its('Group Membership') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93161.rb b/controls/V-93161.rb deleted file mode 100644 index d322b99..0000000 --- a/controls/V-93161.rb +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: UTF-8 - -control "V-93161" do - title "Windows Server 2019 must be configured to audit Logon/Logoff - Special -Logon successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Special Logon records special logons that have administrative privileges -and can be used to elevate processes." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Special Logon - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Logon/Logoff >> \"Audit Special Logon\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'satisfies': ["SRG-OS-000470-GPOS-00214", "SRG-OS-000472-GPOS-00217", -"SRG-OS-000473-GPOS-00218", "SRG-OS-000475-GPOS-00220"] - tag 'gid': 'V-93161' - tag 'rid': 'SV-103249r1_rule' - tag 'stig_id': 'WN19-AU-000210' - tag 'fix_id': 'F-99407r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Special Logon') { should eq 'Success' } - end - describe audit_policy do - its('Special Logon') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93163.rb b/controls/V-93163.rb deleted file mode 100644 index 089f832..0000000 --- a/controls/V-93163.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93163" do - title "Windows Server 2019 must be configured to audit Object Access - Other -Object Access Events successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Auditing for other object access records events related to the management -of task scheduler jobs and COM+ objects." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Object Access >> Other Object Access Events - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Object Access >> \"Audit Other Object Access Events\" -with \"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'gid': 'V-93163' - tag 'rid': 'SV-103251r1_rule' - tag 'stig_id': 'WN19-AU-000220' - tag 'fix_id': 'F-99409r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Other Object Access Events') { should eq 'Success' } - end - describe audit_policy do - its('Other Object Access Events') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93165.rb b/controls/V-93165.rb deleted file mode 100644 index ec50d05..0000000 --- a/controls/V-93165.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93165" do - title "Windows Server 2019 must be configured to audit Object Access - Other -Object Access Events failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Auditing for other object access records events related to the management -of task scheduler jobs and COM+ objects." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Object Access >> Other Object Access Events - Failure" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Object Access >> \"Audit Other Object Access Events\" -with \"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000470-GPOS-00214' - tag 'gid': 'V-93165' - tag 'rid': 'SV-103253r1_rule' - tag 'stig_id': 'WN19-AU-000230' - tag 'fix_id': 'F-99411r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Other Object Access Events') { should eq 'Failure' } - end - describe audit_policy do - its('Other Object Access Events') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93167.rb b/controls/V-93167.rb deleted file mode 100644 index e17a312..0000000 --- a/controls/V-93167.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-93167" do - title "Windows Server 2019 must be configured to audit Object Access - -Removable Storage successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Removable Storage auditing under Object Access records events related to -access attempts on file system objects on removable storage devices." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Object Access >> Removable Storage - Success - - Virtual machines or systems that use network attached storage may generate -excessive audit events for secondary virtual drives or the network attached -storage when this setting is enabled. This may be set to Not Configured in such -cases and would not be a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Object Access >> \"Audit Removable Storage\" with -\"Success\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000474-GPOS-00219' - tag 'gid': 'V-93167' - tag 'rid': 'SV-103255r1_rule' - tag 'stig_id': 'WN19-AU-000240' - tag 'fix_id': 'F-99413r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Removable Storage') { should eq 'Success' } - end - describe audit_policy do - its('Removable Storage') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93169.rb b/controls/V-93169.rb deleted file mode 100644 index e6301db..0000000 --- a/controls/V-93169.rb +++ /dev/null @@ -1,61 +0,0 @@ -# encoding: UTF-8 - -control "V-93169" do - title "Windows Server 2019 must be configured to audit Object Access - -Removable Storage failures." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Removable Storage auditing under Object Access records events related to -access attempts on file system objects on removable storage devices." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Object Access >> Removable Storage - Failure - - Virtual machines or systems that use network attached storage may generate -excessive audit events for secondary virtual drives or the network attached -storage when this setting is enabled. This may be set to Not Configured in such -cases and would not be a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Object Access >> \"Audit Removable Storage\" with -\"Failure\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000474-GPOS-00219' - tag 'gid': 'V-93169' - tag 'rid': 'SV-103257r1_rule' - tag 'stig_id': 'WN19-AU-000250' - tag 'fix_id': 'F-99415r1_fix' - tag 'cci': ["CCI-000172"] - tag 'nist': ["AU-12 c", "Rev_4"] - - describe.one do - describe audit_policy do - its('Removable Storage') { should eq 'Failure' } - end - describe audit_policy do - its('Removable Storage') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93171.rb b/controls/V-93171.rb deleted file mode 100644 index c8ae54d..0000000 --- a/controls/V-93171.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93171" do - title "Windows Server 2019 must be configured to audit logoff successes." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Logoff records user logoffs. If this is an interactive logoff, it is -recorded on the local system. If it is to a network share, it is recorded on -the system accessed." - desc "rationale", "" - desc 'check', "Security Option \"Audit: Force audit policy subcategory settings (Windows -Vista or later) to override audit policy category settings\" must be set to -\"Enabled\" (WN19-SO-000050) for the detailed auditing subcategories to be -effective. - - Use the \"AuditPol\" tool to review the current Audit Policy configuration: - - Open \"PowerShell\" or a \"Command Prompt\" with elevated privileges (\"Run -as administrator\"). - - Enter \"AuditPol /get /category:*\" - - Compare the \"AuditPol\" settings with the following: - - If the system does not audit the following, this is a finding. - - Logon/Logoff >> Logoff - Success" - desc 'fix', "Configure the policy value for Computer Configuration >> -Windows Settings >> Security Settings >> Advanced Audit Policy Configuration >> -System Audit Policies >> Logon/Logoff >> \"Audit Logoff\" with \"Success\" -selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000472-GPOS-00217' - tag 'satisfies': ["SRG-OS-000472-GPOS-00217", "SRG-OS-000480-GPOS-00227"] - tag 'gid': 'V-93171' - tag 'rid': 'SV-103259r1_rule' - tag 'stig_id': 'WN19-AU-000180' - tag 'fix_id': 'F-99417r1_fix' - tag 'cci': ["CCI-000172", "CCI-000366"] - tag 'nist': ["AU-12 c", "CM-6 b", "Rev_4"] - - describe.one do - describe audit_policy do - its('Logoff') { should eq 'Success' } - end - describe audit_policy do - its('Logoff') { should eq 'Success and Failure' } - end - end -end - diff --git a/controls/V-93173.rb b/controls/V-93173.rb deleted file mode 100644 index dda2f52..0000000 --- a/controls/V-93173.rb +++ /dev/null @@ -1,46 +0,0 @@ -# encoding: UTF-8 - -control "V-93173" do - title "Windows Server 2019 command line data must be included in process -creation events." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Enabling \"Include command line data for process creation events\" will -record the command line information with the process creation events in the -log. This can provide additional detail when malware has run on a system." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Audit\\ - - Value Name: ProcessCreationIncludeCmdLine_Enabled - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> System >> Audit Process Creation >> \"Include -command line in process creation events\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000042-GPOS-00020' - tag 'gid': 'V-93173' - tag 'rid': 'SV-103261r1_rule' - tag 'stig_id': 'WN19-CC-000090' - tag 'fix_id': 'F-99419r1_fix' - tag 'cci': ["CCI-000135"] - tag 'nist': ["AU-3 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit') do - it { should have_property 'ProcessCreationIncludeCmdLine_Enabled' } - its('ProcessCreationIncludeCmdLine_Enabled') { should cmp 1 } - end -end - diff --git a/controls/V-93175.rb b/controls/V-93175.rb deleted file mode 100644 index 182f46d..0000000 --- a/controls/V-93175.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-93175" do - title "Windows Server 2019 PowerShell script block logging must be enabled." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. -Collecting this data is essential for analyzing the security of information -assets and detecting signs of suspicious and unexpected behavior. - - Enabling PowerShell script block logging will record detailed information -from the processing of PowerShell commands and scripts. This can provide -additional detail when malware has run on a system." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ScriptBlockLogging\\ - - Value Name: EnableScriptBlockLogging - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Windows PowerShell >> \"Turn -on PowerShell Script Block Logging\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000042-GPOS-00020' - tag 'gid': 'V-93175' - tag 'rid': 'SV-103263r1_rule' - tag 'stig_id': 'WN19-CC-000460' - tag 'fix_id': 'F-99421r1_fix' - tag 'cci': ["CCI-000135"] - tag 'nist': ["AU-3 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging') do - it { should have_property 'EnableScriptBlockLogging' } - its('EnableScriptBlockLogging') { should cmp 1 } - end -end - diff --git a/controls/V-93177.rb b/controls/V-93177.rb deleted file mode 100644 index e189f0c..0000000 --- a/controls/V-93177.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93177" do - title "Windows Server 2019 Application event log size must be configured to -32768 KB or greater." - desc "Inadequate log size will cause the log to fill up quickly. This may -prevent audit events from being recorded properly and require frequent -attention by administrative personnel." - desc "rationale", "" - desc 'check', "If the system is configured to write events directly to an audit server, -this is NA. - - If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path:\\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\Application\\ - - Value Name: MaxSize - - Type: REG_DWORD - Value: 0x00008000 (32768) (or greater)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Event Log Service >> -Application >> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a -\"Maximum Log Size (KB)\" of \"32768\" or greater." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000341-GPOS-00132' - tag 'gid': 'V-93177' - tag 'rid': 'SV-103265r1_rule' - tag 'stig_id': 'WN19-CC-000270' - tag 'fix_id': 'F-99423r1_fix' - tag 'cci': ["CCI-001849"] - tag 'nist': ["AU-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application') do - it { should have_property 'MaxSize' } - its('MaxSize') { should cmp >= 32768 } - end -end - diff --git a/controls/V-93179.rb b/controls/V-93179.rb deleted file mode 100644 index e5fed1e..0000000 --- a/controls/V-93179.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93179" do - title "Windows Server 2019 Security event log size must be configured to -196608 KB or greater." - desc "Inadequate log size will cause the log to fill up quickly. This may -prevent audit events from being recorded properly and require frequent -attention by administrative personnel." - desc "rationale", "" - desc 'check', "If the system is configured to write events directly to an audit server, -this is NA. - - If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\Security\\ - - Value Name: MaxSize - - Type: REG_DWORD - Value: 0x00030000 (196608) (or greater)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Event Log Service >> Security ->> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a \"Maximum -Log Size (KB)\" of \"196608\" or greater." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000341-GPOS-00132' - tag 'gid': 'V-93179' - tag 'rid': 'SV-103267r1_rule' - tag 'stig_id': 'WN19-CC-000280' - tag 'fix_id': 'F-99425r1_fix' - tag 'cci': ["CCI-001849"] - tag 'nist': ["AU-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security') do - it { should have_property 'MaxSize' } - its('MaxSize') { should cmp >= 196608 } - end -end - diff --git a/controls/V-93181.rb b/controls/V-93181.rb deleted file mode 100644 index d45b04f..0000000 --- a/controls/V-93181.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93181" do - title "Windows Server 2019 System event log size must be configured to 32768 -KB or greater." - desc "Inadequate log size will cause the log to fill up quickly. This may -prevent audit events from being recorded properly and require frequent -attention by administrative personnel." - desc "rationale", "" - desc 'check', "If the system is configured to write events directly to an audit server, -this is NA. - - If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\EventLog\\System\\ - - Value Name: MaxSize - - Type: REG_DWORD - Value: 0x00008000 (32768) (or greater)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Event Log Service >> System ->> \"Specify the maximum log file size (KB)\" to \"Enabled\" with a \"Maximum -Log Size (KB)\" of \"32768\" or greater." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000341-GPOS-00132' - tag 'gid': 'V-93181' - tag 'rid': 'SV-103269r1_rule' - tag 'stig_id': 'WN19-CC-000290' - tag 'fix_id': 'F-99427r1_fix' - tag 'cci': ["CCI-001849"] - tag 'nist': ["AU-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System') do - it { should have_property 'MaxSize' } - its('MaxSize') { should cmp >= 32768 } - end -end - diff --git a/controls/V-93183.rb b/controls/V-93183.rb deleted file mode 100644 index db22e32..0000000 --- a/controls/V-93183.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: UTF-8 - -control "V-93183" do - title "Windows Server 2019 audit records must be backed up to a different -system or media than the system being audited." - desc "Protection of log data includes assuring the log data is not -accidentally lost or deleted. Audit information stored in one location is -vulnerable to accidental or incidental deletion or alteration." - desc "rationale", "" - desc 'check', "Determine if a process to back up log data to a different system or media -than the system being audited has been implemented. - - If it has not, this is a finding." - desc 'fix', "Establish and implement a process for backing up log data to -another system or media other than the system being audited." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000342-GPOS-00133' - tag 'gid': 'V-93183' - tag 'rid': 'SV-103271r1_rule' - tag 'stig_id': 'WN19-AU-000010' - tag 'fix_id': 'F-99429r1_fix' - tag 'cci': ["CCI-001851"] - tag 'nist': ["AU-4 (1)", "Rev_4"] - - describe 'A manual review is required to verify audit records are being backed up onto a different system or media than the system being audited' do - skip 'A manual review is required to verify audit records are being backed up onto a different system or media than the system being audited' - end -end - diff --git a/controls/V-93185.rb b/controls/V-93185.rb deleted file mode 100644 index 57f5cc1..0000000 --- a/controls/V-93185.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: UTF-8 - -control "V-93185" do - title "Windows Server 2019 must, at a minimum, off-load audit records of -interconnected systems in real time and off-load standalone systems weekly." - desc "Protection of log data includes assuring the log data is not -accidentally lost or deleted. Audit information stored in one location is -vulnerable to accidental or incidental deletion or alteration." - desc "rationale", "" - desc 'check', "Verify the audit records, at a minimum, are off-loaded for interconnected -systems in real time and off-loaded for standalone systems weekly. - - If they are not, this is a finding." - desc 'fix', "Configure the system to, at a minimum, off-load audit records -of interconnected systems in real time and off-load standalone systems weekly." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000479-GPOS-00224' - tag 'gid': 'V-93185' - tag 'rid': 'SV-103273r1_rule' - tag 'stig_id': 'WN19-AU-000020' - tag 'fix_id': 'F-99431r1_fix' - tag 'cci': ["CCI-001851"] - tag 'nist': ["AU-4 (1)", "Rev_4"] - - describe "A manual review is required to verify the operating system is, at a minimum, off-loading audit records of interconnected systems in real time and off-loading standalone systems weekly" do - skip "A manual review is required to verify the operating system is, at a minimum, off-loading audit records of interconnected systems in real time and off-loading standalone systems weekly" - end -end - diff --git a/controls/V-93187.rb b/controls/V-93187.rb deleted file mode 100644 index cee2d15..0000000 --- a/controls/V-93187.rb +++ /dev/null @@ -1,97 +0,0 @@ -control 'V-93187' do - title "The Windows Server 2019 time service must synchronize with an - appropriate #{input('org_name')[:acronym]} time source." - desc "The Windows Time Service controls time synchronization settings. Time - synchronization is essential for authentication and auditing purposes. If the - Windows Time Service is used, it must synchronize with a secure, authorized - time source. Domain-joined systems are automatically configured to synchronize - with domain controllers. If an NTP server is configured, it must synchronize - with a secure, authorized time source." - desc 'rationale', '' - desc 'check', "Review the Windows time service configuration. - - Open an elevated \"Command Prompt\" (run as administrator). - - Enter \"W32tm /query /configuration\". - - Domain-joined systems (excluding the domain controller with the PDC - emulator role): - - If the value for \"Type\" under \"NTP Client\" is not \"NT5DS\", this is a - finding. - - Other systems: - - If systems are configured with a \"Type\" of \"NTP\", including standalone - systems and the domain controller with the PDC Emulator role, and do not have a - #{input('org_name')[:acronym]} time server defined for \"NTPServer\", this is a finding. - - To determine the domain controller with the PDC Emulator role: - - Open \"PowerShell\". - - Enter \"Get-ADDomain | FT PDCEmulator\"." - desc 'fix', "Configure the system to synchronize time with an appropriate #{input('org_name')[:acronym]} time - source. - - Domain-joined systems use NT5DS to synchronize time from other systems in - the domain by default. - - If the system needs to be configured to an NTP server, configure the system - to point to an authorized time server by setting the policy value for Computer - Configuration >> Administrative Templates >> System >> Windows Time Service >> - Time Providers >> \"Configure Windows NTP Client\" to \"Enabled\", and - configure the \"NtpServer\" field to point to an appropriate #{input('org_name')[:acronym]} time server. - - The US Naval Observatory operates stratum 1 time servers, identified at - http://tycho.usno.navy.mil/ntp.html. Time synchronization will occur through a - hierarchy of time servers down to the local level. Clients and lower-level - servers will synchronize with an authorized time server in the hierarchy." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000355-GPOS-00143' - tag 'gid': 'V-93187' - tag 'rid': 'SV-103275r1_rule' - tag 'stig_id': 'WN19-00-000440' - tag 'fix_id': 'F-99433r1_fix' - tag 'cci': ['CCI-001891'] - tag 'nist': ['AU-8 (1) (a)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - forest_pdce = powershell('(Get-ADDomain).PDCEmulator').stdout.strip - if forest_pdce.downcase.include? sys_info.hostname.downcase - # forest pdc emulator should be uniquely configured. - describe w32time_config do - its('type') { should cmp 'NTP' } - its('ntpserver') do - should be_in input('ntp_servers') - end - end - else - # just a normal domain controller - describe w32time_config do - its('type') { should cmp 'NT5DS' } - end - end - elsif domain_role == '3' - # just a memberserver - describe.one do - describe w32time_config do - its('type') { should cmp 'NT5DS' } - end - describe w32time_config do - its('type') { should cmp 'ALLSYNC' } - end - end - else - # just a stand alone system - describe w32time_config do - its('type') { should cmp 'NTP' } - its('ntpserver') do - should be_in input('ntp_servers') - end - end - end -end diff --git a/controls/V-93189.rb b/controls/V-93189.rb deleted file mode 100644 index 373f033..0000000 --- a/controls/V-93189.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control "V-93189" do - title "Windows Server 2019 permissions for the Application event log must -prevent access by non-privileged accounts." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. The -Application event log may be susceptible to tampering if proper permissions are -not applied." - desc "rationale", "" - desc 'check', "Navigate to the Application event log file. - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" -folder. However, the logs may have been moved to another folder. - - If the permissions for the \"Application.evtx\" file are not as restrictive -as the default permissions listed below, this is a finding: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control" - desc 'fix', "Configure the permissions on the Application event log file -(Application.evtx) to prevent access by non-privileged accounts. The default -permissions listed below satisfy this requirement: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. - - If the location of the logs has been changed, when adding Eventlog to the -permissions, it must be entered as \"NT Service\\Eventlog\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000057-GPOS-00027' - tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", -"SRG-OS-000059-GPOS-00029"] - tag 'gid': 'V-93189' - tag 'rid': 'SV-103277r1_rule' - tag 'stig_id': 'WN19-AU-000030' - tag 'fix_id': 'F-99435r1_fix' - tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] - tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] - - get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip - system_root = get_system_root[11..get_system_root.length] - - systemroot = system_root.strip - - winevt_logs_application = <<-EOH - $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\Application.evtx).AccessToString - write-output $output - EOH - - # raw powershell output - raw_logs_application = powershell(winevt_logs_application).stdout.strip - - # clean results cleans up the extra line breaks - clean_logs_application = raw_logs_application.lines.collect(&:strip) - - describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\Application.evtx' do - subject { clean_logs_application } - it { should cmp input('winevt_logs_application_perms') } - end -end - diff --git a/controls/V-93191.rb b/controls/V-93191.rb deleted file mode 100644 index 5f9160f..0000000 --- a/controls/V-93191.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control "V-93191" do - title "Windows Server 2019 permissions for the Security event log must -prevent access by non-privileged accounts." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. The -Security event log may disclose sensitive information or be susceptible to -tampering if proper permissions are not applied." - desc "rationale", "" - desc 'check', "Navigate to the Security event log file. - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" -folder. However, the logs may have been moved to another folder. - - If the permissions for the \"Security.evtx\" file are not as restrictive as -the default permissions listed below, this is a finding: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control" - desc 'fix', "Configure the permissions on the Security event log file (Security.evtx) to -prevent access by non-privileged accounts. The default permissions listed below -satisfy this requirement: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. - - If the location of the logs has been changed, when adding Eventlog to the -permissions, it must be entered as \"NT Service\\Eventlog\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000057-GPOS-00027' - tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", -"SRG-OS-000059-GPOS-00029"] - tag 'gid': 'V-93191' - tag 'rid': 'SV-103279r1_rule' - tag 'stig_id': 'WN19-AU-000040' - tag 'fix_id': 'F-99437r1_fix' - tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] - tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] - - get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip - system_root = get_system_root[11..get_system_root.length] - - systemroot = system_root.strip - - winevt_logs_security = <<-EOH - $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\Security.evtx).AccessToString - write-output $output - EOH - - # raw powershell output - raw_logs_security = powershell(winevt_logs_security).stdout.strip - - # clean results cleans up the extra line breaks - clean_logs_security = raw_logs_security.lines.collect(&:strip) - - describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\Security.evtx' do - subject { clean_logs_security } - it { should cmp input('winevt_logs_security_perms') } - end -end - diff --git a/controls/V-93193.rb b/controls/V-93193.rb deleted file mode 100644 index 4d95f7f..0000000 --- a/controls/V-93193.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control "V-93193" do - title "Windows Server 2019 permissions for the System event log must prevent -access by non-privileged accounts." - desc "Maintaining an audit trail of system activity logs can help identify -configuration errors, troubleshoot service disruptions, and analyze compromises -that have occurred, as well as detect attacks. Audit logs are necessary to -provide a trail of evidence in case the system or network is compromised. The -System event log may be susceptible to tampering if proper permissions are not -applied." - desc "rationale", "" - desc 'check', "Navigate to the System event log file. - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" -folder. However, the logs may have been moved to another folder. - - If the permissions for the \"System.evtx\" file are not as restrictive as -the default permissions listed below, this is a finding: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control" - desc 'fix', "Configure the permissions on the System event log file (System.evtx) to -prevent access by non-privileged accounts. The default permissions listed below -satisfy this requirement: - - Eventlog - Full Control - SYSTEM - Full Control - Administrators - Full Control - - The default location is the \"%SystemRoot%\\System32\\winevt\\Logs\" folder. - - If the location of the logs has been changed, when adding Eventlog to the -permissions, it must be entered as \"NT Service\\Eventlog\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000057-GPOS-00027' - tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", -"SRG-OS-000059-GPOS-00029"] - tag 'gid': 'V-93193' - tag 'rid': 'SV-103281r1_rule' - tag 'stig_id': 'WN19-AU-000050' - tag 'fix_id': 'F-99439r1_fix' - tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164"] - tag 'nist': ["AU-9", "AU-9", "AU-9", "Rev_4"] - - get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip - system_root = get_system_root[11..get_system_root.length] - - systemroot = system_root.strip - - winevt_logs_system = <<-EOH - $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\WINEVT\\LOGS\\System.evtx).AccessToString - write-output $output - EOH - - # raw powershell output - raw_logs_system = powershell(winevt_logs_system).stdout.strip - - # clean results cleans up the extra line breaks - clean_logs_system = raw_logs_system.lines.collect(&:strip) - - describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\WINEVT\LOGS\System.evtx' do - subject { clean_logs_system } - it { should cmp input('winevt_logs_system_perms') } - end -end - diff --git a/controls/V-93195.rb b/controls/V-93195.rb deleted file mode 100644 index b3cac95..0000000 --- a/controls/V-93195.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93195" do - title "Windows Server 2019 Event Viewer must be protected from unauthorized -modification and deletion." - desc "Protecting audit information also includes identifying and protecting -the tools used to view and manipulate log data. Therefore, protecting audit -tools is necessary to prevent unauthorized operation on audit information. - - Operating systems providing tools to interface with audit information will -leverage user permissions and roles identifying the user accessing the tools -and the corresponding rights the user enjoys in order to make access decisions -regarding the modification or deletion of audit tools." - desc "rationale", "" - desc 'check', "Navigate to \"%SystemRoot%\\System32\". - - View the permissions on \"Eventvwr.exe\". - - If any groups or accounts other than TrustedInstaller have \"Full control\" -or \"Modify\" permissions, this is a finding. - - The default permissions below satisfy this requirement: - - TrustedInstaller - Full Control - Administrators, SYSTEM, Users, ALL APPLICATION PACKAGES, ALL RESTRICTED -APPLICATION PACKAGES - Read & Execute" - desc 'fix', "Configure the permissions on the \"Eventvwr.exe\" file to prevent -modification by any groups or accounts other than TrustedInstaller. The default -permissions listed below satisfy this requirement: - - TrustedInstaller - Full Control - Administrators, SYSTEM, Users, ALL APPLICATION PACKAGES, ALL RESTRICTED -APPLICATION PACKAGES - Read & Execute - - The default location is the \"%SystemRoot%\\System32\" folder." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000257-GPOS-00098' - tag 'satisfies': ["SRG-OS-000257-GPOS-00098", "SRG-OS-000258-GPOS-00099"] - tag 'gid': 'V-93195' - tag 'rid': 'SV-103283r1_rule' - tag 'stig_id': 'WN19-AU-000060' - tag 'fix_id': 'F-99441r1_fix' - tag 'cci': ["CCI-001494", "CCI-001495"] - tag 'nist': ["AU-9", "AU-9", "Rev_4"] - - get_system_root = command('Get-ChildItem Env: | Findstr SystemRoot').stdout.strip - system_root = get_system_root[11..get_system_root.length] - - systemroot = system_root.strip - - eventvwr = <<-EOH - $output = (Get-Acl -Path #{systemroot}\\SYSTEM32\\Eventvwr.exe).AccessToString - write-output $output - EOH - - # raw powershell output - raw_eventvwr = powershell(eventvwr).stdout.strip - - # clean results cleans up the extra line breaks - clean_eventvwr = raw_eventvwr.lines.collect(&:strip) - - describe 'Verify the default registry permissions for the keys note below of the C:\Windows\System32\Eventvwr.exe' do - subject { clean_eventvwr } - it { should cmp input('eventvwr_perms') } - end -end - diff --git a/controls/V-93197.rb b/controls/V-93197.rb deleted file mode 100644 index 26b4242..0000000 --- a/controls/V-93197.rb +++ /dev/null @@ -1,79 +0,0 @@ -# encoding: UTF-8 - -control "V-93197" do - title "Windows Server 2019 Manage auditing and security log user right must -only be assigned to the Administrators group." - desc "Inappropriate granting of user rights can provide system, -administrative, and other high-level capabilities. - - Accounts with the \"Manage auditing and security log\" user right can -manage the security log and change auditing configurations. This could be used -to clear evidence of tampering." - desc "rationale", "" - desc 'check', "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - If any accounts or groups other than the following are granted the \"Manage -auditing and security log\" user right, this is a finding. - - - Administrators - - For server core installations, run the following command: - - Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt - - Review the text file. - - If any SIDs other than the following are granted the -\"SeSecurityPrivilege\" user right, this is a finding: - - S-1-5-32-544 (Administrators) - - If the organization has an Auditors group, the assignment of this group to -the user right would not be a finding. - - If an application requires this user right, this would not be a finding. - - Vendor documentation must support the requirement for having the user right. - - The requirement must be documented with the ISSO. - - The application account must meet requirements for application account -passwords, such as length (WN19-00-000050) and required frequency of changes -(WN19-00-000060)." - desc 'fix', "Configure the policy value for Computer Configuration >> Windows Settings ->> Security Settings >> Local Policies >> User Rights Assignment >> \"Manage -auditing and security log\" to include only the following accounts or groups: - - - Administrators" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000057-GPOS-00027' - tag 'satisfies': ["SRG-OS-000057-GPOS-00027", "SRG-OS-000058-GPOS-00028", -"SRG-OS-000059-GPOS-00029", "SRG-OS-000063-GPOS-00032", -"SRG-OS-000337-GPOS-00129"] - tag 'gid': 'V-93197' - tag 'rid': 'SV-103285r1_rule' - tag 'stig_id': 'WN19-UR-000170' - tag 'fix_id': 'F-99443r1_fix' - tag 'cci': ["CCI-000162", "CCI-000163", "CCI-000164", "CCI-000171", -"CCI-001914"] - tag 'nist': ["AU-9", "AU-9", "AU-9", "AU-12 b", "AU-12 (3)", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - describe 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' do - skip 'This system is a Server Core Installation, and a manual check will need to be performed with command Secedit /Export /Areas User_Rights /cfg c:\\path\\filename.txt' - end - else - describe security_policy do - its('SeSecurityPrivilege') { should eq ['S-1-5-32-544'] } - end - end -end - diff --git a/controls/V-93199.rb b/controls/V-93199.rb deleted file mode 100644 index 3d477eb..0000000 --- a/controls/V-93199.rb +++ /dev/null @@ -1,38 +0,0 @@ -# encoding: UTF-8 - -control "V-93199" do - title "Windows Server 2019 must prevent users from changing installation -options." - desc "Installation options for applications are typically controlled by -administrators. This setting prevents users from changing installation options -that may bypass security features." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ - - Value Name: EnableUserControl - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Windows Installer >> \"Allow -user control over installs\" to \"Disabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000362-GPOS-00149' - tag 'gid': 'V-93199' - tag 'rid': 'SV-103287r1_rule' - tag 'stig_id': 'WN19-CC-000420' - tag 'fix_id': 'F-99445r1_fix' - tag 'cci': ["CCI-001812"] - tag 'nist': ["CM-11 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do - it { should have_property 'EnableUserControl' } - its('EnableUserControl') { should cmp 0 } - end -end - diff --git a/controls/V-93201.rb b/controls/V-93201.rb deleted file mode 100644 index a14f9ad..0000000 --- a/controls/V-93201.rb +++ /dev/null @@ -1,38 +0,0 @@ -# encoding: UTF-8 - -control "V-93201" do - title "Windows Server 2019 must disable the Windows Installer Always install -with elevated privileges option." - desc "Standard user accounts must not be granted elevated privileges. -Enabling Windows Installer to elevate privileges when installing applications -can allow malicious persons and applications to gain full control of a system." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ - - Value Name: AlwaysInstallElevated - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Windows Installer >> \"Always -install with elevated privileges\" to \"Disabled\"." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000362-GPOS-00149' - tag 'gid': 'V-93201' - tag 'rid': 'SV-103289r1_rule' - tag 'stig_id': 'WN19-CC-000430' - tag 'fix_id': 'F-99447r1_fix' - tag 'cci': ["CCI-001812"] - tag 'nist': ["CM-11 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do - it { should have_property 'AlwaysInstallElevated' } - its('AlwaysInstallElevated') { should cmp 0 } - end -end - diff --git a/controls/V-93203.rb b/controls/V-93203.rb deleted file mode 100644 index 7411dcb..0000000 --- a/controls/V-93203.rb +++ /dev/null @@ -1,36 +0,0 @@ -# encoding: UTF-8 - -control "V-93203" do - title "Windows Server 2019 system files must be monitored for unauthorized -changes." - desc "Monitoring system files for changes against a baseline on a regular -basis may help detect the possible introduction of malicious code on a system." - desc "rationale", "" - desc 'check', "Determine whether the system is monitored for unauthorized changes to -system files (e.g., *.exe, *.bat, *.com, *.cmd, and *.dll) against a baseline -on a weekly basis. - - If system files are not monitored for unauthorized changes, this is a -finding. - - A properly configured HBSS Policy Auditor 5.2 or later File Integrity -Monitor (FIM) module will meet the requirement for file integrity checking. The -Asset module within HBSS does not meet this requirement." - desc 'fix', "Monitor the system for unauthorized changes to system files -(e.g., *.exe, *.bat, *.com, *.cmd, and *.dll) against a baseline on a weekly -basis. This can be done with the use of various monitoring tools." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000363-GPOS-00150' - tag 'gid': 'V-93203' - tag 'rid': 'SV-103291r1_rule' - tag 'stig_id': 'WN19-00-000220' - tag 'fix_id': 'F-99449r1_fix' - tag 'cci': ["CCI-001744"] - tag 'nist': ["CM-3 (5)", "Rev_4"] - - describe 'A manual review is required to ensure system files are monitored for unauthorized changes' do - skip 'A manual review is required to ensure system files are monitored for unauthorized changes' - end -end - diff --git a/controls/V-93205.rb b/controls/V-93205.rb deleted file mode 100644 index 5e33b6a..0000000 --- a/controls/V-93205.rb +++ /dev/null @@ -1,54 +0,0 @@ -# encoding: UTF-8 - -control "V-93205" do - title "Windows Server 2019 administrative accounts must not be used with -applications that access the Internet, such as web browsers, or with potential -Internet sources, such as email." - desc "Using applications that access the Internet or have potential Internet -sources using administrative privileges exposes a system to compromise. If a -flaw in an application is exploited while running as a privileged user, the -entire system could be compromised. Web browsers and email are common attack -vectors for introducing malicious code and must not be run with an -administrative account. - - Since administrative accounts may generally change or work around technical -restrictions for running a web browser or other applications, it is essential -that policy require administrative accounts to not access the Internet or use -applications such as email. - - The policy should define specific exceptions for local service -administration. These exceptions may include HTTP(S)-based tools that are used -for the administration of the local system, services, or attached devices. - - Whitelisting can be used to enforce the policy to ensure compliance." - desc "rationale", "" - desc 'check', "Determine whether organization policy, at a minimum, prohibits -administrative accounts from using applications that access the Internet, such -as web browsers, or with potential Internet sources, such as email, except as -necessary for local service administration. - - If it does not, this is a finding. - - The organization may use technical means such as whitelisting to prevent -the use of browsers and mail applications to enforce this requirement." - desc 'fix', "Establish a policy, at minimum, to prohibit administrative accounts from -using applications that access the Internet, such as web browsers, or with -potential Internet sources, such as email. Ensure the policy is enforced. - - The organization may use technical means such as whitelisting to prevent -the use of browsers and mail applications to enforce this requirement." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93205' - tag 'rid': 'SV-103293r1_rule' - tag 'stig_id': 'WN19-00-000030' - tag 'fix_id': 'F-99451r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe "A manual review is required to verify that administrative accounts are not being used with applications that access the Internet, such as web browsers, or with potential Internet sources, such as email" do - skip "A manual review is required to verify that administrative accounts are not being used with applications that access the Internet, such as web browsers, or with potential Internet sources, such as email" - end -end - diff --git a/controls/V-93207.rb b/controls/V-93207.rb deleted file mode 100644 index 51637ea..0000000 --- a/controls/V-93207.rb +++ /dev/null @@ -1,46 +0,0 @@ -# encoding: UTF-8 - -control "V-93207" do - title "Windows Server 2019 members of the Backup Operators group must have -separate accounts for backup duties and normal operational tasks." - desc "Backup Operators are able to read and write to any file in the system, -regardless of the rights assigned to it. Backup and restore rights permit users -to circumvent the file access restrictions present on NTFS disk drives for -backup and restore purposes. Members of the Backup Operators group must have -separate logon accounts for performing backup duties." - desc "rationale", "" - desc 'check', "If no accounts are members of the Backup Operators group, this is NA. - - Verify users with accounts in the Backup Operators group have a separate -user account for backup functions and for performing normal user tasks. - - If users with accounts in the Backup Operators group do not have separate -accounts for backup functions and standard user functions, this is a finding." - desc 'fix', "Ensure each member of the Backup Operators group has separate -accounts for backup functions and standard user functions." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93207' - tag 'rid': 'SV-103295r1_rule' - tag 'stig_id': 'WN19-00-000040' - tag 'fix_id': 'F-99453r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - backup_operators_group = command("net localgroup 'Backup Operators' | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") - backup_operators = input('backup_operators') - if backup_operators_group.empty? - impact 0.0 - describe 'Backup Operators Group Empty' do - skip 'The control is N/A as there are no users in the Backup Operators group' - end - else - backup_operators_group.each do |user| - describe user do - it { should be_in backup_operators } - end - end - end -end - diff --git a/controls/V-93209.rb b/controls/V-93209.rb deleted file mode 100644 index a812181..0000000 --- a/controls/V-93209.rb +++ /dev/null @@ -1,76 +0,0 @@ -# encoding: UTF-8 - -control "V-93209" do - title "Windows Server 2019 manually managed application account passwords must be changed at least every #{input('app_password_age')} days or when a system administrator with knowledge of the password leaves the organization." - desc "Setting application account passwords to expire may cause applications to stop functioning. However, not changing them on a regular basis exposes them to attack. If managed service accounts are used, this alleviates the need to manually change application account passwords." - desc "rationale", "" - desc 'check', "Determine if manually managed application/service accounts exist. If none exist, this is NA. - If passwords for manually managed application/service accounts are not changed at least every #{input('app_password_age')} days or when an administrator with knowledge of the password leaves the organization, this is a finding. - Identify manually managed application/service accounts. - To determine the date a password was last changed: - - Domain controllers: - Open \"PowerShell\". - Enter \"Get-AdUser -Identity [application account name] -Properties PasswordLastSet | FT Name, PasswordLastSet\", where [application account name] is the name of the manually managed application/service account. - If the \"PasswordLastSet\" date is more than #{input('app_password_age')} days old, this is a finding. - - Member servers and standalone systems: - Open \"Command Prompt\". - Enter 'Net User [application account name] | Find /i \"Password Last Set\"', where [application account name] is the name of the manually managed application/service account. - If the \"Password Last Set\" date is more than #{input('app_password_age')} days old, this is a finding." - desc 'fix', "Change passwords for manually managed application/service accounts at least every #{input('app_password_age')} days or when an administrator with knowledge of the password leaves the organization. - It is recommended that system-managed service accounts be used whenever possible." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93209' - tag 'rid': 'SV-103297r1_rule' - tag 'stig_id': 'WN19-00-000060' - tag 'fix_id': 'F-99455r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - application_accounts_domain = input('application_accounts_domain') - application_accounts_local = input('application_accounts_local') - app_password_age = input('app_password_age') - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - if application_accounts_domain.empty? - impact 0.0 - describe 'There are no application accounts are listed for this control' do - skip 'This is not applicable since no application accounts are listed for this control' - end - else - application_accounts_domain.each do |user| - password_set_date = json({ command: "Get-ADUser -Identity #{user} -Properties PasswordLastSet | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-#{app_password_age})} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }).params - date = password_set_date['DateTime'] - describe 'Password Last Set' do - it "Date should not be more that #{app_password_age} days for Application Account: #{user} " do - failure_message = "Password Date is: #{date}" - expect(date).to be_nil, failure_message - end - end - end - end - else - if application_accounts_local.empty? - impact 0.0 - describe 'There are no application accounts are listed for this control' do - skip 'This is not applicable since no application accounts are listed for this control' - end - else - application_accounts_local.each do |user| - local_password_set_date = json({ command: "Get-LocalUser -name #{user} | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-#{app_password_age})} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }).params - date = local_password_set_date['DateTime'] - describe 'Password Last Set' do - it "Date should not be more that #{app_password_age} days for Application Account: #{user} " do - failure_message = "Password Date is: #{date}" - expect(date).to be_nil, failure_message - end - end - end - end - end -end diff --git a/controls/V-93211.rb b/controls/V-93211.rb deleted file mode 100644 index ac42e43..0000000 --- a/controls/V-93211.rb +++ /dev/null @@ -1,73 +0,0 @@ -control 'V-93211' do - title "The password for the krbtgt account on a domain must be reset at least -every 180 days." - desc "The krbtgt account acts as a service account for the Kerberos Key -Distribution Center (KDC) service. The account and password are created when a -domain is created and the password is typically not changed. If the krbtgt -account is compromised, attackers can create valid Kerberos Ticket Granting -Tickets (TGT). - The password must be changed twice to effectively remove the password -history. Changing once, waiting for replication to complete and the amount of -time equal to or greater than the maximum Kerberos ticket lifetime, and -changing again reduces the risk of issues." - desc 'rationale', '' - desc 'check', "This requirement is applicable to domain controllers; it is NA for other -systems. - Open \"Windows PowerShell\". - Enter \"Get-ADUser krbtgt -Property PasswordLastSet\". - If the \"PasswordLastSet\" date is more than 180 days old, this is a -finding." - desc 'fix', "Reset the password for the krbtgt account a least every 180 days. The -password must be changed twice to effectively remove the password history. -Changing once, waiting for replication to complete and changing again reduces -the risk of issues. Changing twice in rapid succession forces clients to -re-authenticate (including application services) but is desired if a compromise -is suspected. - PowerShell scripts are available to accomplish this such as at the -following link: - https://gallery.technet.microsoft.com/Reset-the-krbtgt-account-581a9e51 - Open \"Active Directory Users and Computers\" (available from various menus -or run \"dsa.msc\"). - Select \"Advanced Features\" in the \"View\" menu if not previously -selected. - Select the \"Users\" node. - Right click on the krbtgt account and select \"Reset password\" - Enter a password that meets password complexity requirements. - Clear the \"User must change password at next logon\" check box. - The system will automatically change this to a system-generated complex -password." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93211' - tag 'rid': 'SV-103299r3_rule' - tag 'stig_id': 'WN19-DC-000430' - tag 'fix_id': 'F-99457r1_fix' - tag 'cci': ['CCI-000366'] - tag 'nist': ['CM-6 b', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - password_set_date = json(command: 'New-TimeSpan -Start (Get-ADUser krbtgt -Property PasswordLastSet).PAsswordLastSet | where -filter { $_.Days -gt 180 } | ConvertTo-JSON').params - date = password_set_date['Days'] - if date.nil? - describe 'krbtgt Account is within 180 days since password change' do - subject { date } - its(date) { should eq nil } - end - else - describe 'Password Last Set' do - it 'krbtgt Account Password Last Set Date is' do - failure_message = "Password Date should not be more than 180 Days: #{date}" - expect(date).to be_empty, failure_message - end - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end diff --git a/controls/V-93213.rb b/controls/V-93213.rb deleted file mode 100644 index 84211c5..0000000 --- a/controls/V-93213.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93213" do - title "Windows Server 2019 domain-joined systems must have a Trusted Platform -Module (TPM) enabled and ready for use." - desc "Credential Guard uses virtualization-based security to protect data -that could be used in credential theft attacks if compromised. A number of -system requirements must be met in order for Credential Guard to be configured -and enabled properly. Without a TPM enabled and ready for use, Credential Guard -keys are stored in a less secure method using software." - desc "rationale", "" - desc 'check', "For standalone systems, this is NA. - - Current hardware and virtual environments may not support -virtualization-based security features, including Credential Guard, due to -specific supporting requirements including a TPM, UEFI with Secure Boot, and -the capability to run the Hyper-V feature within a virtual machine. - - Verify the system has a TPM and it is ready for use. - - Run \"tpm.msc\". - - Review the sections in the center pane. - - \"Status\" must indicate it has been configured with a message such as -\"The TPM is ready for use\" or \"The TPM is on and ownership has been taken\". - - TPM Manufacturer Information - Specific Version = 2.0 or 1.2 - - If a TPM is not found or is not ready for use, this is a finding." - desc 'fix', "Ensure domain-joined systems have a TPM that is configured for use. -(Versions 2.0 or 1.2 support Credential Guard.) - - The TPM must be enabled in the firmware. - - Run \"tpm.msc\" for configuration options in Windows." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93213' - tag 'rid': 'SV-103301r1_rule' - tag 'stig_id': 'WN19-00-000090' - tag 'fix_id': 'F-99459r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip - - if sys_info.manufacturer == "VMware, Inc." - impact 0.0 - describe 'This System is NA for Control V-93213, This is a VMware Virtual Machine.' do - skip 'This System is NA for Control V-93213, This is a VMware Virtual Machine.' - end - elsif is_domain == 'WORKGROUP' - impact 0.0 - describe 'This system is not joined to a domain, therefore this control is Not Applicable' do - skip 'This system is not joined to a domain, therefore this control is Not Applicable' - end - else - tpm_ready = command('Get-Tpm | select -expand TpmReady').stdout.strip - tpm_present = command('Get-Tpm | select -expand TpmPresent').stdout.strip - describe 'Trusted Platform Module (TPM) TpmReady' do - subject { tpm_ready } - it { should eq 'True' } - end - describe 'Trusted Platform Module (TPM) TpmPresent' do - subject { tpm_present } - it { should eq 'True' } - end - end -end - diff --git a/controls/V-93215.rb b/controls/V-93215.rb deleted file mode 100644 index 92f786d..0000000 --- a/controls/V-93215.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93215" do - title "Windows Server 2019 must be maintained at a supported servicing level." - desc "Systems at unsupported servicing levels will not receive security -updates for new vulnerabilities, which leave them subject to exploitation. -Systems must be maintained at a servicing level supported by the vendor with -new security updates." - desc "rationale", "" - desc 'check', "Open \"Command Prompt\". - - Enter \"winver.exe\". - - If the \"About Windows\" dialog box does not display \"Microsoft Windows -Server Version 1809 (Build 17763.xxx)\" or greater, this is a finding. - - Preview versions must not be used in a production environment." - desc 'fix', "Update the system to a Version 1809 (Build 17763.xxx) or -greater." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93215' - tag 'rid': 'SV-103303r1_rule' - tag 'stig_id': 'WN19-00-000100' - tag 'fix_id': 'F-99461r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - releaseid = registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId - current_build_number = registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').CurrentBuildNumber - describe 'Microsoft Windows 2019 needs to be higher that release 1809' do - subject { releaseid } - it { should cmp >= 1809} - end - describe 'Microsoft Windows 2019 needs to be higher that build number 17763' do - subject { current_build_number } - it { should cmp >= 17763} - end -end - - diff --git a/controls/V-93217.rb b/controls/V-93217.rb deleted file mode 100644 index f212126..0000000 --- a/controls/V-93217.rb +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: UTF-8 - -control "V-93217" do - title "Windows Server 2019 must use an anti-virus program." - desc "Malicious software can establish a base on individual desktops and -servers. Employing an automated mechanism to detect this type of software will -aid in elimination of the software from the operating system." - desc "rationale", "" - desc 'check', "Verify an anti-virus solution is installed on the system. The anti-virus -solution may be bundled with an approved host-based security solution. - - If there is no anti-virus solution installed on the system, this is a -finding." - desc 'fix', "Install an anti-virus solution on the system." - impact 0.7 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93217' - tag 'rid': 'SV-103305r1_rule' - tag 'stig_id': 'WN19-00-000110' - tag 'fix_id': 'F-99463r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe windows_feature('Windows-Defender') do - it { should be_installed } - end - describe registry_key('HKLM\SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion') do - it { should exist } - end - describe registry_key('HKLM\SOFTWARE\McAfee/DesktopProtection\szProductVer') do - it { should exist } - end - describe registry_key('HKLM\SOFTWARE\McAfee\Endpoint\AV') do - it { should exist } - it { should have_property 'ProductVersion' } - end - end -end diff --git a/controls/V-93219.rb b/controls/V-93219.rb deleted file mode 100644 index 3f9f98d..0000000 --- a/controls/V-93219.rb +++ /dev/null @@ -1,38 +0,0 @@ -# encoding: UTF-8 - -control "V-93219" do - title "Windows Server 2019 must have a host-based intrusion detection or -prevention system." - desc "A properly configured Host-based Intrusion Detection System (HIDS) or -Host-based Intrusion Prevention System (HIPS) provides another level of defense -against unauthorized access to critical servers. With proper configuration and -logging enabled, such a system can stop and/or alert for many attempts to gain -unauthorized access to resources." - desc "rationale", "" - desc 'check', "Determine whether there is a HIDS or HIPS on each server. - - If the HIPS component of HBSS is installed and active on the host and the -alerts of blocked activity are being logged and monitored, this meets the -requirement. - - A HIDS device is not required on a system that has the role as the Network -Intrusion Device (NID). However, this exception needs to be documented with the -ISSO. - - If a HIDS is not installed on the system, this is a finding." - desc 'fix', "Install a HIDS or HIPS on each server." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93219' - tag 'rid': 'SV-103307r1_rule' - tag 'stig_id': 'WN19-00-000120' - tag 'fix_id': 'F-99465r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe 'A manual review is required to determine whether this server has a host-based Intrusion Detection System installed' do - skip 'A manual review is required to determine whether this server has a host-based Intrusion Detection System installed' - end -end - diff --git a/controls/V-93221.rb b/controls/V-93221.rb deleted file mode 100644 index 58b7965..0000000 --- a/controls/V-93221.rb +++ /dev/null @@ -1,38 +0,0 @@ -# encoding: UTF-8 - -control "V-93221" do - title "Windows Server 2019 must have software certificate installation files -removed." - desc "Use of software certificates and their accompanying installation files -for end users to access resources is less secure than the use of hardware-based -certificates." - desc "rationale", "" - desc 'check', "Search all drives for *.p12 and *.pfx files. - - If any files with these extensions exist, this is a finding. - - This does not apply to server-based applications that have a requirement -for .p12 certificate files or Adobe PreFlight certificate files. Some -applications create files with extensions of .p12 that are not certificate -installation files. Removal of non-certificate installation files from systems -is not required. These must be documented with the ISSO." - desc 'fix', "Remove any certificate installation files (*.p12 and *.pfx) found on a -system. - - Note: This does not apply to server-based applications that have a -requirement for .p12 certificate files or Adobe PreFlight certificate files." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93221' - tag 'rid': 'SV-103309r2_rule' - tag 'stig_id': 'WN19-00-000240' - tag 'fix_id': 'F-101007r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe command('where /R c: *.p12 *.pfx') do - its('stdout') { should eq '' } - end -end - diff --git a/controls/V-93223.rb b/controls/V-93223.rb deleted file mode 100644 index 7f2f79e..0000000 --- a/controls/V-93223.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93223" do - title "Windows Server 2019 FTP servers must be configured to prevent -anonymous logons." - desc "The FTP service allows remote users to access shared files and -directories. Allowing anonymous FTP connections makes user auditing difficult. - - Using accounts that have administrator privileges to log on to FTP risks -that the userid and password will be captured on the network and give -administrator access to an unauthorized user." - desc "rationale", "" - desc 'check', "If FTP is not installed on the system, this is NA. - - Open \"Internet Information Services (IIS) Manager\". - - Select the server. - - Double-click \"FTP Authentication\". - - If the \"Anonymous Authentication\" status is \"Enabled\", this is a -finding." - desc 'fix', "Configure the FTP service to prevent anonymous logons. - - Open \"Internet Information Services (IIS) Manager\". - - Select the server. - - Double-click \"FTP Authentication\". - - Select \"Anonymous Authentication\". - - Select \"Disabled\" under \"Actions\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93223' - tag 'rid': 'SV-103311r1_rule' - tag 'stig_id': 'WN19-00-000420' - tag 'fix_id': 'F-99469r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - is_ftp_installed = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip - if is_ftp_installed == 'False' - impact 0.0 - describe 'FTP is not installed' do - skip 'Control not applicable' - end - else - describe 'File Transfer Protocol (FTP) servers must be configured to prevent anonymous logons' do - skip 'is a manual check' - end - end -end - diff --git a/controls/V-93225.rb b/controls/V-93225.rb deleted file mode 100644 index c4d0cb2..0000000 --- a/controls/V-93225.rb +++ /dev/null @@ -1,49 +0,0 @@ -# encoding: UTF-8 - -control "V-93225" do - title "Windows Server 2019 FTP servers must be configured to prevent access -to the system drive." - desc "The FTP service allows remote users to access shared files and -directories that could provide access to system resources and compromise the -system, especially if the user can gain access to the root directory of the -boot drive." - desc "rationale", "" - desc 'check', "If FTP is not installed on the system, this is NA. - - Open \"Internet Information Services (IIS) Manager\". - - Select \"Sites\" under the server name. - - For any sites with a Binding that lists FTP, right-click the site and -select \"Explore\". - - If the site is not defined to a specific folder for shared FTP resources, -this is a finding. - - If the site includes any system areas such as root of the drive, Program -Files, or Windows directories, this is a finding." - desc 'fix', "Configure the FTP sites to allow access only to specific FTP -shared resources. Do not allow access to other areas of the system." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93225' - tag 'rid': 'SV-103313r1_rule' - tag 'stig_id': 'WN19-00-000430' - tag 'fix_id': 'F-99471r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - is_ftp_installed = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip - if is_ftp_installed == 'False' - impact 0.0 - describe 'FTP is not installed' do - skip 'Control not applicable' - end - else - describe 'Configure the FTP sites to allow access only to specific FTP shared resources. Do not allow access to other areas of the system.' do - skip 'Configure the FTP sites to allow access only to specific FTP shared resources. Do not allow access to other areas of the system.' - end - end -end - diff --git a/controls/V-93227.rb b/controls/V-93227.rb deleted file mode 100644 index e278429..0000000 --- a/controls/V-93227.rb +++ /dev/null @@ -1,68 +0,0 @@ -# encoding: UTF-8 - -control "V-93227" do - title "Windows Server 2019 must have orphaned security identifiers (SIDs) -removed from user rights." - desc "Accounts or groups given rights on a system may show up as unresolved -SIDs for various reasons including deletion of the accounts or groups. If the -account or group objects are reanimated, there is a potential they may still -have rights no longer intended. Valid domain accounts or groups may also show -up as unresolved SIDs if a connection to the domain cannot be established for -some reason." - desc "rationale", "" - desc 'check', "Review the effective User Rights setting in Local Group Policy Editor. - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows -Settings >> Security Settings >> Local Policies >> User Rights Assignment. - - Review each User Right listed for any unresolved SIDs to determine whether -they are valid, such as due to being temporarily disconnected from the domain. -(Unresolved SIDs have the format that begins with \"*S-1-\".) - - If any unresolved SIDs exist and are not for currently valid accounts or -groups, this is a finding. - - For server core installations, run the following command: - - Secedit /export /areas USER_RIGHTS /cfg c:\\path\\UserRights.txt - - The results in the file identify user right assignments by SID instead of -group name. Review the SIDs for unidentified ones. A list of typical SIDs \\ -Groups is below, search Microsoft for articles on well-known SIDs for others. - - If any unresolved SIDs exist and are not for currently valid accounts or -groups, this is a finding. - - SID - Group - S-1-5-11 - Authenticated Users - S-1-5-113 - Local account - S-1-5-114 - Local account and member of Administrators group - S-1-5-19 - Local Service - S-1-5-20 - Network Service - S-1-5-32-544 - Administrators - S-1-5-32-546 - Guests - S-1-5-6 - Service - S-1-5-9 - Enterprise Domain Controllers - S-1-5-domain-512 - Domain Admins - S-1-5-root domain-519 - Enterprise Admins - S-1-5-80-3139157870-2983391045-3678747466-658725712-1809340420 - NT -Service\\WdiServiceHost" - desc 'fix', "Remove any unresolved SIDs found in User Rights assignments and -determined to not be for currently valid accounts or groups by removing the -accounts or groups from the appropriate group policy." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93227' - tag 'rid': 'SV-103315r1_rule' - tag 'stig_id': 'WN19-00-000450' - tag 'fix_id': 'F-99473r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe "A manual review is required to ensure orphaned security identifiers (SIDs) are removed from user rights on Windows Server 2019" do - skip 'A manual review is required to ensure orphaned security identifiers (SIDs) are removed from user rights on Windows Server 2019' - end - end - diff --git a/controls/V-93229.rb b/controls/V-93229.rb deleted file mode 100644 index fdf9784..0000000 --- a/controls/V-93229.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93229" do - title "Windows Server 2019 systems must have Unified Extensible Firmware -Interface (UEFI) firmware and be configured to run in UEFI mode, not Legacy -BIOS." - desc "UEFI provides additional security features in comparison to legacy -BIOS firmware, including Secure Boot. UEFI is required to support additional -security features in Windows, including Virtualization Based Security and -Credential Guard. Systems with UEFI that are operating in \"Legacy BIOS\" mode -will not support these security features." - desc "rationale", "" - desc 'check', "Some older systems may not have UEFI firmware. This is currently a CAT III; -it will be raised in severity at a future date when broad support of Windows -hardware and firmware requirements are expected to be met. Devices that have -UEFI firmware must run in \"UEFI\" mode. - - Verify the system firmware is configured to run in \"UEFI\" mode, not -\"Legacy BIOS\". - - Run \"System Information\". - - Under \"System Summary\", if \"BIOS Mode\" does not display \"UEFI\", this -is a finding." - desc 'fix', "Configure UEFI firmware to run in \"UEFI\" mode, not \"Legacy -BIOS\" mode." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93229' - tag 'rid': 'SV-103317r1_rule' - tag 'stig_id': 'WN19-00-000460' - tag 'fix_id': 'F-99475r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - uefi_boot = json( command: 'Confirm-SecureBootUEFI | ConvertTo-Json').params - describe 'Confirm-Secure Boot UEFI is required to be enabled on System' do - subject { uefi_boot } - it { should_not eq 'False' } - end -end - diff --git a/controls/V-93231.rb b/controls/V-93231.rb deleted file mode 100644 index d569559..0000000 --- a/controls/V-93231.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93231" do - title "Windows Server 2019 must have Secure Boot enabled." - desc "Secure Boot is a standard that ensures systems boot only to a trusted -operating system. Secure Boot is required to support additional security -features in Windows, including Virtualization Based Security and Credential -Guard. If Secure Boot is turned off, these security features will not function." - desc "rationale", "" - desc 'check', "Some older systems may not have UEFI firmware. This is currently a CAT III; -it will be raised in severity at a future date when broad support of Windows -hardware and firmware requirements are expected to be met. Devices that have -UEFI firmware must have Secure Boot enabled. - - Run \"System Information\". - - Under \"System Summary\", if \"Secure Boot State\" does not display \"On\", -this is a finding. - - On server core installations, run the following PowerShell command: - - Confirm-SecureBootUEFI - - If a value of \"True\" is not returned, this is a finding." - desc 'fix', "Enable Secure Boot in the system firmware." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93231' - tag 'rid': 'SV-103319r1_rule' - tag 'stig_id': 'WN19-00-000470' - tag 'fix_id': 'F-99477r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - uefi_boot = json( command: 'Confirm-SecureBootUEFI | ConvertTo-Json').params - describe 'Confirm-Secure Boot UEFI is required to be enabled on System' do - subject { uefi_boot } - it { should_not eq 'False' } - end -end - diff --git a/controls/V-93233.rb b/controls/V-93233.rb deleted file mode 100644 index 912d606..0000000 --- a/controls/V-93233.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-93233" do - title "Windows Server 2019 Internet Protocol version 6 (IPv6) source routing -must be configured to the highest protection level to prevent IP source -routing." - desc "Configuring the system to disable IPv6 source routing protects against -spoofing." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters\\ - - Value Name: DisableIPSourceRouting - - Type: REG_DWORD - Value: 0x00000002 (2)" - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative -Templates >> MSS (Legacy) >> \"MSS: (DisableIPSourceRouting IPv6) IP source -routing protection level (protects against packet spoofing)\" to \"Enabled\" -with \"Highest protection, source routing is completely disabled\" selected. - - This policy setting requires the installation of the MSS-Legacy custom -templates included with the STIG package. \"MSS-Legacy.admx\" and -\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and -\\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.3 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93233" - tag rid: "SV-103321r1_rule" - tag stig_id: "WN19-CC-000030" - tag fix_id: "F-99479r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters') do - it { should have_property 'DisableIPSourceRouting' } - its('DisableIPSourceRouting') { should cmp 2} - end -end - diff --git a/controls/V-93235.rb b/controls/V-93235.rb deleted file mode 100644 index 76f2f75..0000000 --- a/controls/V-93235.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93235" do - title "Windows Server 2019 source routing must be configured to the highest -protection level to prevent Internet Protocol (IP) source routing." - desc "Configuring the system to disable IP source routing protects against -spoofing." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ - - Value Name: DisableIPSourceRouting - - Value Type: REG_DWORD - Value: 0x00000002 (2)" - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative -Templates >> MSS (Legacy) >> \"MSS: (DisableIPSourceRouting) IP source routing -protection level (protects against packet spoofing)\" to \"Enabled\" with -\"Highest protection, source routing is completely disabled\" selected. - - This policy setting requires the installation of the MSS-Legacy custom -templates included with the STIG package. \"MSS-Legacy.admx\" and -\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and -\\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93235' - tag 'rid': 'SV-103323r1_rule' - tag 'stig_id': 'WN19-CC-000040' - tag 'fix_id': 'F-99481r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do - it { should have_property 'DisableIPSourceRouting' } - its('DisableIPSourceRouting') { should cmp 2} - end -end - diff --git a/controls/V-93237.rb b/controls/V-93237.rb deleted file mode 100644 index f24e88e..0000000 --- a/controls/V-93237.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-93237" do - title "Windows Server 2019 must be configured to prevent Internet Control -Message Protocol (ICMP) redirects from overriding Open Shortest Path First -(OSPF)-generated routes." - desc "Allowing ICMP redirect of routes can lead to traffic not being routed -properly. When disabled, this forces ICMP to be routed via the shortest path -first." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ - - Value Name: EnableICMPRedirect - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative -Templates >> MSS (Legacy) >> \"MSS: (EnableICMPRedirect) Allow ICMP redirects -to override OSPF generated routes\" to \"Disabled\". - - This policy setting requires the installation of the MSS-Legacy custom -templates included with the STIG package. \"MSS-Legacy.admx\" and -\"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and -\\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.3 - tag severity: nil - tag gtitle: 'SRG-OS-000480-GPOS-00227' - tag gid: 'V-93237' - tag rid: 'SV-103325r1_rule' - tag stig_id: 'WN19-CC-000050' - tag fix_id: 'F-99483r1_fix' - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do - it { should have_property 'EnableICMPRedirect' } - its('EnableICMPRedirect') { should cmp 0} - end -end - diff --git a/controls/V-93239.rb b/controls/V-93239.rb deleted file mode 100644 index 2c224c8..0000000 --- a/controls/V-93239.rb +++ /dev/null @@ -1,37 +0,0 @@ -# encoding: UTF-8 - -control "V-93239" do - title "Windows Server 2019 insecure logons to an SMB server must be disabled." - desc "Insecure guest logons allow unauthenticated access to shared folders. -Shared resources on a system must require authentication to establish proper -access." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\LanmanWorkstation\\ - - Value Name: AllowInsecureGuestAuth - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Network >> Lanman Workstation >> \"Enable insecure -guest logons\" to \"Disabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93239' - tag 'rid': 'SV-103327r1_rule' - tag 'stig_id': 'WN19-CC-000070' - tag 'fix_id': 'F-99485r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation') do - it { should have_property 'AllowInsecureGuestAuth' } - its('AllowInsecureGuestAuth') { should cmp 0} - end -end - diff --git a/controls/V-93241.rb b/controls/V-93241.rb deleted file mode 100644 index 54eef8d..0000000 --- a/controls/V-93241.rb +++ /dev/null @@ -1,69 +0,0 @@ - - -control 'V-93241' do - title "Windows Server 2019 hardened Universal Naming Convention (UNC) paths - must be defined to require mutual authentication and integrity for at least the - \\\\*\\SYSVOL and \\\\*\\NETLOGON shares." - desc "Additional security requirements are applied to UNC paths specified in - hardened UNC paths before allowing access to them. This aids in preventing - tampering with or spoofing of connections to these paths." - desc 'rationale', '' - desc 'check', "This requirement is applicable to domain-joined systems. For standalone - systems, this is NA. - - If the following registry values do not exist or are not configured as - specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: - \\SOFTWARE\\Policies\\Microsoft\\Windows\\NetworkProvider\\HardenedPaths\\ - - Value Name: \\\\*\\NETLOGON - Value Type: REG_SZ - Value: RequireMutualAuthentication=1, RequireIntegrity=1 - - Value Name: \\\\*\\SYSVOL - Value Type: REG_SZ - Value: RequireMutualAuthentication=1, RequireIntegrity=1 - - Additional entries would not be a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative - Templates >> Network >> Network Provider >> \"Hardened UNC Paths\" to - \"Enabled\" with at least the following configured in \"Hardened UNC Paths\" - (click the \"Show\" button to display): - - Value Name: \\\\*\\SYSVOL - Value: RequireMutualAuthentication=1, RequireIntegrity=1 - - Value Name: \\\\*\\NETLOGON - Value: RequireMutualAuthentication=1, RequireIntegrity=1" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93241' - tag 'rid': 'SV-103329r1_rule' - tag 'stig_id': 'WN19-CC-000080' - tag 'fix_id': 'F-99487r1_fix' - tag 'cci': ['CCI-000366'] - tag 'nist': ['CM-6 b', 'Rev_4'] - - is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip - keyvalue_netlogon = '\\\\*\\NETLOGON' - keyvalue_sysvol = '\\\\*\\SYSVOL' - - if is_domain == 'WORKGROUP' - impact 0.0 - describe 'The system is not a member of a domain, control is NA' do - skip 'The system is not a member of a domain, control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths') do - it { should have_property keyvalue_sysvol } - its(keyvalue_sysvol) { should cmp 'RequireMutualAuthentication=1, RequireIntegrity=1' } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths') do - it { should have_property keyvalue_netlogon } - its(keyvalue_netlogon) { should cmp 'RequireMutualAuthentication=1, RequireIntegrity=1' } - end - end -end diff --git a/controls/V-93243.rb b/controls/V-93243.rb deleted file mode 100644 index 9ef39e8..0000000 --- a/controls/V-93243.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93243" do - title "Windows Server 2019 must be configured to enable Remote host allows -delegation of non-exportable credentials." - desc "An exportable version of credentials is provided to remote hosts when -using credential delegation which exposes them to theft on the remote host. -Restricted Admin mode or Remote Credential Guard allow delegation of -non-exportable credentials providing additional protection of the credentials. -Enabling this configures the host to support Restricted Admin mode or Remote -Credential Guard." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Policies\\Microsoft\\Windows\\CredentialsDelegation\\ - - Value Name: AllowProtectedCreds - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> System >> Credentials Delegation >> \"Remote host -allows delegation of non-exportable credentials\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93243' - tag 'rid': 'SV-103331r1_rule' - tag 'stig_id': 'WN19-CC-000100' - tag 'fix_id': 'F-99489r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation') do - it { should have_property 'AllowProtectedCreds' } - its('AllowProtectedCreds') { should cmp 1 } - end -end - diff --git a/controls/V-93245.rb b/controls/V-93245.rb deleted file mode 100644 index 905ff31..0000000 --- a/controls/V-93245.rb +++ /dev/null @@ -1,114 +0,0 @@ -# encoding: UTF-8 - -control "V-93245" do - title "Windows Server 2019 virtualization-based security must be enabled with -the platform security level configured to Secure Boot or Secure Boot with DMA -Protection." - desc "Virtualization Based Security (VBS) provides the platform for the -additional security features Credential Guard and virtualization-based -protection of code integrity. Secure Boot is the minimum security level, with -DMA protection providing additional memory protection. DMA Protection requires -a CPU that supports input/output memory management unit (IOMMU)." - desc "rationale", "" - desc 'check', "For standalone systems, this is NA. - - Current hardware and virtual environments may not support -virtualization-based security features, including Credential Guard, due to -specific supporting requirements, including a TPM, UEFI with Secure Boot, and -the capability to run the Hyper-V feature within a virtual machine. - - Open \"PowerShell\" with elevated privileges (run as administrator). - - Enter the following: - - \"Get-CimInstance -ClassName Win32_DeviceGuard -Namespace -root\\Microsoft\\Windows\\DeviceGuard\" - - If \"RequiredSecurityProperties\" does not include a value of \"2\" -indicating \"Secure Boot\" (e.g., \"{1, 2}\"), this is a finding. - - If \"Secure Boot and DMA Protection\" is configured, \"3\" will also be -displayed in the results (e.g., \"{1, 2, 3}\"). - - If \"VirtualizationBasedSecurityStatus\" is not a value of \"2\" indicating -\"Running\", this is a finding. - - Alternately: - - Run \"System Information\". - - Under \"System Summary\", verify the following: - - If \"Device Guard Virtualization based security\" does not display -\"Running\", this is a finding. - - If \"Device Guard Required Security Properties\" does not display \"Base -Virtualization Support, Secure Boot\", this is a finding. - - If \"Secure Boot and DMA Protection\" is configured, \"DMA Protection\" -will also be displayed (e.g., \"Base Virtualization Support, Secure Boot, DMA -Protection\"). - - The policy settings referenced in the Fix section will configure the -following registry values. However, due to hardware requirements, the registry -values alone do not ensure proper function. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\\ - - Value Name: EnableVirtualizationBasedSecurity - Value Type: REG_DWORD - Value: 0x00000001 (1) - - Value Name: RequirePlatformSecurityFeatures - Value Type: REG_DWORD - Value: 0x00000001 (1) (Secure Boot only) or 0x00000003 (3) (Secure Boot and -DMA Protection) - - A Microsoft TechNet article on Credential Guard, including system -requirement details, can be found at the following link: - - https://technet.microsoft.com/itpro/windows/keep-secure/credential-guard" - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative -Templates >> System >> Device Guard >> \"Turn On Virtualization Based -Security\" to \"Enabled\" with \"Secure Boot\" or \"Secure Boot and DMA -Protection\" selected. - - A Microsoft TechNet article on Credential Guard, including system -requirement details, can be found at the following link: - - https://technet.microsoft.com/itpro/windows/keep-secure/credential-guard" - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93245' - tag 'rid': 'SV-103333r1_rule' - tag 'stig_id': 'WN19-CC-000110' - tag 'fix_id': 'F-99491r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - is_domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip - if is_domain == 'WORKGROUP' - impact 0.0 - describe 'The system is not a member of a domain, control is NA' do - skip 'The system is not a member of a domain, control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do - it { should have_property 'EnableVirtualizationBasedSecurity' } - its('EnableVirtualizationBasedSecurity') { should cmp 1 } - end - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do - it { should have_property 'RequirePlatformSecurityFeatures' } - its('RequirePlatformSecurityFeatures') { should cmp 1 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard') do - it { should have_property 'RequirePlatformSecurityFeatures' } - its('RequirePlatformSecurityFeatures') { should cmp 3 } - end - end - end -end - diff --git a/controls/V-93249.rb b/controls/V-93249.rb deleted file mode 100644 index 76d7b2e..0000000 --- a/controls/V-93249.rb +++ /dev/null @@ -1,63 +0,0 @@ -# encoding: UTF-8 - -control "V-93249" do - title "Windows Server 2019 Early Launch Antimalware, Boot-Start Driver -Initialization Policy must prevent boot drivers identified as bad." - desc "Compromised boot drivers can introduce malware prior to protection -mechanisms that load after initialization. The Early Launch Antimalware driver -can limit allowed drivers based on classifications determined by the malware -protection application. At a minimum, drivers determined to be bad must not be -allowed." - desc "rationale", "" - desc 'check', "The default behavior is for Early Launch Antimalware - Boot-Start Driver -Initialization policy to enforce \"Good, unknown and bad but critical\" -(preventing \"bad\"). - - If the registry value name below does not exist, this is not a finding. - - If it exists and is configured with a value of \"0x00000007 (7)\", this is -a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Policies\\EarlyLaunch\\ - - Value Name: DriverLoadPolicy - - Value Type: REG_DWORD - Value: 0x00000001 (1), 0x00000003 (3), or 0x00000008 (8) (or if the Value -Name does not exist) - - Possible values for this setting are: - 8 - Good only - 1 - Good and unknown - 3 - Good, unknown and bad but critical - 7 - All (which includes \"bad\" and would be a finding)" - desc 'fix', "The default behavior is for Early Launch Antimalware - Boot-Start Driver -Initialization policy to enforce \"Good, unknown and bad but critical\" -(preventing \"bad\"). - - If this needs to be corrected or a more secure setting is desired, -configure the policy value for Computer Configuration >> Administrative -Templates >> System >> Early Launch Antimalware >> \"Boot-Start Driver -Initialization Policy\" to \"Not Configured\" or \"Enabled\" with any option -other than \"All\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93249' - tag 'rid': 'SV-103337r1_rule' - tag 'stig_id': 'WN19-CC-000130' - tag 'fix_id': 'F-99495r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch') do - it { should_not have_property 'DriverLoadPolicy' } - end - describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch') do - its('DriverLoadPolicy') { should_not be 7 } - end - end -end - diff --git a/controls/V-93251.rb b/controls/V-93251.rb deleted file mode 100644 index f743755..0000000 --- a/controls/V-93251.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93251" do - title "Windows Server 2019 group policy objects must be reprocessed even if -they have not changed." - desc "Registry entries for group policy settings can potentially be changed -from the required configuration. This could occur as part of troubleshooting or -by a malicious process on a compromised system. Enabling this setting and then -selecting the \"Process even if the Group Policy objects have not changed\" -option ensures the policies will be reprocessed even if none have been changed. -This way, any unauthorized changes are forced to match the domain-based group -policy settings again." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Group Policy\\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\\ - - Value Name: NoGPOListChanges - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> System >> Group Policy >> \"Configure registry -policy processing\" to \"Enabled\" with the option \"Process even if the Group -Policy objects have not changed\" selected." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93251' - tag 'rid': 'SV-103339r1_rule' - tag 'stig_id': 'WN19-CC-000140' - tag 'fix_id': 'F-99497r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}') do - it { should have_property 'NoGPOListChanges' } - its('NoGPOListChanges') { should cmp 0 } - end -end - diff --git a/controls/V-93253.rb b/controls/V-93253.rb deleted file mode 100644 index 6a7e31f..0000000 --- a/controls/V-93253.rb +++ /dev/null @@ -1,47 +0,0 @@ -# encoding: UTF-8 - -control "V-93253" do - title "Windows Server 2019 users must be prompted to authenticate when the -system wakes from sleep (on battery)." - desc "A system that does not require authentication when resuming from sleep -may provide access to unauthorized users. Authentication must always be -required when accessing a system. This setting ensures users are prompted for a -password when the system wakes from sleep (on battery)." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\\ - - Value Name: DCSettingIndex - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> System >> Power Management >> Sleep Settings >> -\"Require a password when a computer wakes (on battery)\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93253' - tag 'rid': 'SV-103341r1_rule' - tag 'stig_id': 'WN19-CC-000180' - tag 'fix_id': 'F-99499r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - if sys_info.manufacturer == 'VMware, Inc.' - impact 0.0 - describe 'This is a Virtual Machine; This Control is NA.' do - skip 'This is a Virtual Machine; This Control is NA.' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51') do - it { should have_property 'DCSettingIndex' } - its('DCSettingIndex') { should cmp 1 } - end - end -end - diff --git a/controls/V-93255.rb b/controls/V-93255.rb deleted file mode 100644 index 55182e6..0000000 --- a/controls/V-93255.rb +++ /dev/null @@ -1,47 +0,0 @@ -# encoding: UTF-8 - -control "V-93255" do - title "Windows Server 2019 users must be prompted to authenticate when the -system wakes from sleep (plugged in)." - desc "A system that does not require authentication when resuming from sleep -may provide access to unauthorized users. Authentication must always be -required when accessing a system. This setting ensures users are prompted for a -password when the system wakes from sleep (plugged in)." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\\ - - Value Name: ACSettingIndex - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> System >> Power Management >> Sleep Settings >> -\"Require a password when a computer wakes (plugged in)\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93255' - tag 'rid': 'SV-103343r1_rule' - tag 'stig_id': 'WN19-CC-000190' - tag 'fix_id': 'F-99501r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - if sys_info.manufacturer == 'VMware, Inc.' - impact 0.0 - describe 'This is a Virtual Machine; This Control is NA.' do - skip 'This is a Virtual Machine; This Control is NA.' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51') do - it { should have_property 'ACSettingIndex' } - its('ACSettingIndex') { should cmp 1 } - end - end -end - diff --git a/controls/V-93257.rb b/controls/V-93257.rb deleted file mode 100644 index 72f8cff..0000000 --- a/controls/V-93257.rb +++ /dev/null @@ -1,49 +0,0 @@ -# encoding: UTF-8 - -control "V-93257" do - title "Windows Server 2019 Telemetry must be configured to Security or Basic." - desc "Some features may communicate with the vendor, sending system -information or downloading data or components for the feature. Limiting this -capability will prevent potentially sensitive information from being sent -outside the enterprise. The \"Security\" option for Telemetry configures the -lowest amount of data, effectively none outside of the Malicious Software -Removal Tool (MSRT), Defender, and telemetry client settings. \"Basic\" sends -basic diagnostic and usage data and may be required to support some Microsoft -services." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\\ - - Value Name: AllowTelemetry - - Type: REG_DWORD - Value: 0x00000000 (0) (Security), 0x00000001 (1) (Basic)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> Data Collection and Preview -Builds>> \"Allow Telemetry\" to \"Enabled\" with \"0 - Security [Enterprise -Only]\" or \"1 - Basic\" selected in \"Options\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93257' - tag 'rid': 'SV-103345r1_rule' - tag 'stig_id': 'WN19-CC-000250' - tag 'fix_id': 'F-99503r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection') do - it { should have_property 'AllowTelemetry' } - its('AllowTelemetry') { should cmp 0 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection') do - it { should have_property 'AllowTelemetry' } - its('AllowTelemetry') { should cmp 1 } - end - end -end - diff --git a/controls/V-93259.rb b/controls/V-93259.rb deleted file mode 100644 index a7c67fe..0000000 --- a/controls/V-93259.rb +++ /dev/null @@ -1,72 +0,0 @@ -# encoding: UTF-8 - -control "V-93259" do - title "Windows Server 2019 Windows Update must not obtain updates from other -PCs on the Internet." - desc "Windows Update can obtain updates from additional sources instead of -Microsoft. In addition to Microsoft, updates can be obtained from and sent to -PCs on the local network as well as on the Internet. This is part of the -Windows Update trusted process, however to minimize outside exposure, obtaining -updates from or sending to systems on the Internet must be prevented." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeliveryOptimization\\ - - Value Name: DODownloadMode - - Value Type: REG_DWORD - Value: 0x00000000 (0) - No peering (HTTP Only) - 0x00000001 (1) - Peers on same NAT only (LAN) - 0x00000002 (2) - Local Network / Private group peering (Group) - 0x00000063 (99) - Simple download mode, no peering (Simple) - 0x00000064 (100) - Bypass mode, Delivery Optimization not used (Bypass) - - A value of 0x00000003 (3), Internet, is a finding." - desc 'fix', "Configure the policy value for Computer Configuration >> Administrative -Templates >> Windows Components >> Delivery Optimization >> \"Download Mode\" -to \"Enabled\" with any option except \"Internet\" selected. - - Acceptable selections include: - - Bypass (100) - Group (2) - HTTP only (0) - LAN (1) - Simple (99)" - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93259' - tag 'rid': 'SV-103347r1_rule' - tag 'stig_id': 'WN19-CC-000260' - tag 'fix_id': 'F-99505r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do - it { should have_property 'DODownloadMode' } - its('DODownloadMode') { should cmp 0 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do - it { should have_property 'DODownloadMode' } - its('DODownloadMode') { should cmp 1 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do - it { should have_property 'DODownloadMode' } - its('DODownloadMode') { should cmp 2 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do - it { should have_property 'DODownloadMode' } - its('DODownloadMode') { should cmp 99 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization') do - it { should have_property 'DODownloadMode' } - its('DODownloadMode') { should cmp 100 } - end - end -end diff --git a/controls/V-93261.rb b/controls/V-93261.rb deleted file mode 100644 index 584a57c..0000000 --- a/controls/V-93261.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93261" do - title "Windows Server 2019 Turning off File Explorer heap termination on -corruption must be disabled." - desc "Legacy plug-in applications may continue to function when a File -Explorer session has become corrupt. Disabling this feature will prevent this." - desc "rationale", "" - desc 'check', "The default behavior is for File Explorer heap termination on corruption to -be enabled. - - If the registry Value Name below does not exist, this is not a finding. - - If it exists and is configured with a value of \"0\", this is not a finding. - - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ - - Value Name: NoHeapTerminationOnCorruption - - Value Type: REG_DWORD - Value: 0x00000000 (0) (or if the Value Name does not exist)" - desc 'fix', "The default behavior is for File Explorer heap termination on corruption to -be disabled. - - If this needs to be corrected, configure the policy value for Computer -Configuration >> Administrative Templates >> Windows Components >> File -Explorer >> \"Turn off heap termination on corruption\" to \"Not Configured\" -or \"Disabled\"." - impact 0.3 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93261' - tag 'rid': 'SV-103349r1_rule' - tag 'stig_id': 'WN19-CC-000320' - tag 'fix_id': 'F-99507r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do - it { should_not have_property 'NoHeapTerminationOnCorruption' } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do - it { should have_property 'NoHeapTerminationOnCorruption' } - its('NoHeapTerminationOnCorruption') { should_not be 1 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do - it { should have_property 'NoHeapTerminationOnCorruption' } - its('NoHeapTerminationOnCorruption') { should cmp 0 } - end - end -end - diff --git a/controls/V-93263.rb b/controls/V-93263.rb deleted file mode 100644 index bb8e78b..0000000 --- a/controls/V-93263.rb +++ /dev/null @@ -1,57 +0,0 @@ -# encoding: UTF-8 - -control "V-93263" do - title "Windows Server 2019 File Explorer shell protocol must run in protected -mode." - desc "The shell protocol will limit the set of folders that applications can -open when run in protected mode. Restricting files an application can open to a -limited set of folders increases the security of Windows." - desc "rationale", "" - desc 'check', "The default behavior is for shell protected mode to be turned on for File -Explorer. - - If the registry value name below does not exist, this is not a finding. - - If it exists and is configured with a value of \"0\", this is not a finding. - - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: -\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ - - Value Name: PreXPSP2ShellProtocolBehavior - - Value Type: REG_DWORD - Value: 0x00000000 (0) (or if the Value Name does not exist)" - desc 'fix', "The default behavior is for shell protected mode to be turned on for File -Explorer. - - If this needs to be corrected, configure the policy value for Computer -Configuration >> Administrative Templates >> Windows Components >> File -Explorer >> \"Turn off shell protocol protected mode\" to \"Not Configured\" or -\"Disabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93263' - tag 'rid': 'SV-103351r1_rule' - tag 'stig_id': 'WN19-CC-000330' - tag 'fix_id': 'F-99509r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do - it { should_not have_property 'PreXPSP2ShellProtocolBehavior' } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do - it { should have_property 'PreXPSP2ShellProtocolBehavior' } - its('PreXPSP2ShellProtocolBehavior') { should_not be 1 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer') do - it { should have_property 'PreXPSP2ShellProtocolBehavior' } - its('PreXPSP2ShellProtocolBehavior') { should cmp 0 } - end - end -end \ No newline at end of file diff --git a/controls/V-93265.rb b/controls/V-93265.rb deleted file mode 100644 index a30a589..0000000 --- a/controls/V-93265.rb +++ /dev/null @@ -1,37 +0,0 @@ -# encoding: UTF-8 - -control "V-93265" do - title "Windows Server 2019 must prevent attachments from being downloaded -from RSS feeds." - desc "Attachments from RSS feeds may not be secure. This setting will -prevent attachments from being downloaded from RSS feeds." - desc "rationale", "" - desc 'check', "If the following registry value does not exist or is not configured as -specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Feeds\\ - - Value Name: DisableEnclosureDownload - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc 'fix', "Configure the policy value for Computer Configuration >> -Administrative Templates >> Windows Components >> RSS Feeds >> \"Prevent -downloading of enclosures\" to \"Enabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93265' - tag 'rid': 'SV-103353r1_rule' - tag 'stig_id': 'WN19-CC-000390' - tag 'fix_id': 'F-99511r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do - it { should have_property 'DisableEnclosureDownload' } - its('DisableEnclosureDownload') { should cmp 1 } - end -end - diff --git a/controls/V-93267.rb b/controls/V-93267.rb deleted file mode 100644 index 1ebdc0b..0000000 --- a/controls/V-93267.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93267" do - title "Windows Server 2019 users must be notified if a web-based program -attempts to install software." - desc "Web-based programs may attempt to install malicious software on a -system. Ensuring users are notified if a web-based program attempts to install -software allows them to refuse the installation." - desc "rationale", "" - desc 'check', "The default behavior is for Internet Explorer to warn users and select -whether to allow or refuse installation when a web-based program attempts to -install software on the system. - - If the registry value name below does not exist, this is not a finding. - - If it exists and is configured with a value of \"0\", this is not a finding. - - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\ - - Value Name: SafeForScripting - - Value Type: REG_DWORD - Value: 0x00000000 (0) (or if the Value Name does not exist)" - desc 'fix', "The default behavior is for Internet Explorer to warn users and select -whether to allow or refuse installation when a web-based program attempts to -install software on the system. - - If this needs to be corrected, configure the policy value for Computer -Configuration >> Administrative Templates >> Windows Components >> Windows -Installer >> \"Prevent Internet Explorer security prompt for Windows Installer -scripts\" to \"Not Configured\" or \"Disabled\"." - impact 0.5 - tag 'severity': nil - tag 'gtitle': 'SRG-OS-000480-GPOS-00227' - tag 'gid': 'V-93267' - tag 'rid': 'SV-103355r1_rule' - tag 'stig_id': 'WN19-CC-000440' - tag 'fix_id': 'F-99513r1_fix' - tag 'cci': ["CCI-000366"] - tag 'nist': ["CM-6 b", "Rev_4"] - - describe.one do - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do - it { should_not have_property 'SafeForScripting' } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do - its('SafeForScripting') { should_not be 1 } - end - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer') do - its('SafeForScripting') { should cmp 0 } - end - end -end diff --git a/controls/V-93269.rb b/controls/V-93269.rb deleted file mode 100644 index 8af9457..0000000 --- a/controls/V-93269.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93269" do - title "Windows Server 2019 must disable automatically signing in the last interactive user after a system-initiated restart." - desc "Windows can be configured to automatically sign the user back in after a Windows Update restart. Some protections are in place to help ensure this is done in a secure fashion; however, disabling this will prevent the caching of credentials for this purpose and also ensure the user is aware of the restart." - desc "rationale", "" - desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: DisableAutomaticRestartSignOn - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Logon Options >> \"Sign-in last interactive user automatically after a system-initiated restart\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00229" - tag gid: "V-93269" - tag rid: "SV-103357r1_rule" - tag stig_id: "WN19-CC-000450" - tag fix_id: "F-99515r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System') do - it { should have_property 'DisableAutomaticRestartSignOn' } - its('DisableAutomaticRestartSignOn') { should cmp 1 } - end -end \ No newline at end of file diff --git a/controls/V-93271.rb b/controls/V-93271.rb deleted file mode 100644 index c2402fa..0000000 --- a/controls/V-93271.rb +++ /dev/null @@ -1,52 +0,0 @@ -# encoding: UTF-8 - -control "V-93271" do - title "Windows Server 2019 directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access." - desc "To the extent that anonymous access to directory data (outside the root DSE) is permitted, read access control of the data is effectively disabled. If other means of controlling access (such as network restrictions) are compromised, there may be nothing else to protect the confidentiality of sensitive directory data." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Open \"Command Prompt\" (not elevated). - Run \"ldp.exe\". - From the \"Connection menu\", select \"Bind\". - Clear the User, Password, and Domain fields. - Select \"Simple bind\" for the Bind type and click \"OK\". - Confirmation of anonymous access will be displayed at the end: - res = ldap_simple_bind_s - Authenticated as: 'NT AUTHORITY\\ANONYMOUS LOGON' - From the \"Browse\" menu, select \"Search\". - In the Search dialog, enter the DN of the domain naming context (generally something like \"dc=disaost,dc=mil\") in the Base DN field. - Clear the Attributes field and select \"Run\". - Error messages should display related to Bind and user not authenticated. - - If attribute data is displayed, anonymous access is enabled to the domain naming context and this is a finding. - The following network controls allow the finding severity to be downgraded to a CAT II since these measures lower the risk associated with anonymous access. - Network hardware ports at the site are subject to 802.1x authentication or MAC address restrictions. - Premise firewall or host restrictions prevent access to ports 389, 636, 3268, and 3269 from client hosts not explicitly identified by domain (.mil) or IP address." - desc "fix", "Configure directory data (outside the root DSE) of a non-public directory to prevent anonymous access. - For AD, there are multiple configuration items that could enable anonymous access. - Changing the access permissions on the domain naming context object (from the secure defaults) could enable anonymous access. If the check procedures indicate this is the cause, the process that was used to change the permissions should be reversed. This could have been through the Windows Support Tools ADSI Edit console (adsiedit.msc). - The dsHeuristics option is used. This is addressed in check V-8555 in the AD Forest STIG." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93271" - tag rid: "SV-103359r1_rule" - tag stig_id: "WN19-DC-000150" - tag fix_id: "F-99517r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe 'Directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access.' do - skip 'Directory data (outside the root DSE) of a non-public directory must be configured to prevent anonymous access is a manual control' - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93273.rb b/controls/V-93273.rb deleted file mode 100644 index ff45648..0000000 --- a/controls/V-93273.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93273" do - title "Windows Server 2019 domain controllers must be configured to allow reset of machine account passwords." - desc "Enabling this setting on all domain controllers in a domain prevents domain members from changing their computer account passwords. If these passwords are weak or compromised, the inability to change them may leave these computers vulnerable." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: RefusePasswordChange - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain controller: Refuse machine account password changes\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93273" - tag rid: "SV-103361r1_rule" - tag stig_id: "WN19-DC-000330" - tag fix_id: "F-99519r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'RefusePasswordChange' } - its('RefusePasswordChange') { should cmp 0 } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93275.rb b/controls/V-93275.rb deleted file mode 100644 index ec3bffb..0000000 --- a/controls/V-93275.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93275" do - title "Windows Server 2019 must limit the caching of logon credentials to four or less on domain-joined member servers." - desc "The default Windows configuration caches the last logon credentials for users who log on interactively to a system. This feature is provided for system availability reasons, such as the user's machine being disconnected from the network or domain controllers being unavailable. Even though the credential cache is well protected, if a system is attacked, an unauthorized individual may isolate the password to a domain user account using a password-cracking program and gain access to the domain." - desc "rationale", "" - desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\ - - Value Name: CachedLogonsCount - - Value Type: REG_SZ - Value: 4 (or less)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive Logon: Number of previous logons to cache (in case Domain Controller is not available)\" to \"4\" logons or less." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93275" - tag rid: "SV-103363r1_rule" - tag stig_id: "WN19-MS-000050" - tag fix_id: "F-99521r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '3' - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon') do - it { should have_property 'CachedLogonsCount' } - its('CachedLogonsCount') { should cmp <= 4 } - end - else - impact 0.0 - describe 'This requirement is only applicable to member servers' do - skip 'This control is NA as the requirement is only applicable to member servers' - end - end -end diff --git a/controls/V-93277.rb b/controls/V-93277.rb deleted file mode 100644 index fec471e..0000000 --- a/controls/V-93277.rb +++ /dev/null @@ -1,66 +0,0 @@ -# encoding: UTF-8 - -control "V-93277" do - title "Windows Server 2019 must be running Credential Guard on domain-joined member servers." - desc "Credential Guard uses virtualization-based security to protect data that could be used in credential theft attacks if compromised. This authentication information, which was stored in the Local Security Authority (LSA) in previous versions of Windows, is isolated from the rest of operating system and can only be accessed by privileged system software." - desc "rationale", "" - desc "check", "For domain controllers and standalone systems, this is NA. - - Current hardware and virtual environments may not support virtualization-based security features, including Credential Guard, due to specific supporting requirements, including a TPM, UEFI with Secure Boot, and the capability to run the Hyper-V feature within a virtual machine. - - Open \"PowerShell\" with elevated privileges (run as administrator). - Enter the following: - \"Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\\Microsoft\\Windows\\DeviceGuard\" - If \"SecurityServicesRunning\" does not include a value of \"1\" (e.g., \"{1, 2}\"), this is a finding. - - Alternately: - Run \"System Information\". - Under \"System Summary\", verify the following: - If \"Device Guard Security Services Running\" does not list \"Credential Guard\", this is a finding. - The policy settings referenced in the Fix section will configure the following registry value. However, due to hardware requirements, the registry value alone does not ensure proper function. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\\ - - Value Name: LsaCfgFlags - Value Type: REG_DWORD - Value: 0x00000001 (1) (Enabled with UEFI lock) - - A Microsoft article on Credential Guard system requirement can be found at the following link: - https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-requirements" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Device Guard >> \"Turn On Virtualization Based Security\" to \"Enabled\" with \"Enabled with UEFI lock\" selected for \"Credential Guard Configuration\". - A Microsoft article on Credential Guard system requirement can be found at the following link: https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-requirements" - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93277" - tag rid: "SV-103365r1_rule" - tag stig_id: "WN19-MS-000140" - tag fix_id: "F-99523r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - security_services = command('Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\\Microsoft\\Windows\\DeviceGuard | Select -ExpandProperty "SecurityServicesRunning"').stdout.strip.split("\r\n") - - if domain_role == '0' || domain_role == '2' - impact 0.0 - describe 'This is NA for standalone systems' do - skip 'This is NA for standalone systems' - end - elsif domain_role == '4' || domain_role == '5' - impact 0.0 - describe 'This is NA for domain controllers' do - skip 'This is NA for domain controllers' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard') do - it { should have_property 'LsaCfgFlags' } - its('LsaCfgFlags') { should cmp 1 } - end - describe "Security Services Running should include 1" do - subject { security_services } - it { should include "1" } - end - end -end \ No newline at end of file diff --git a/controls/V-93279.rb b/controls/V-93279.rb deleted file mode 100644 index 3486acf..0000000 --- a/controls/V-93279.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93279" do - title "Windows Server 2019 must prevent local accounts with blank passwords from being used from the network." - desc "An account without a password can allow unauthorized access to a system as only the username would be required. Password policies should prevent accounts with blank passwords from existing on a system. However, if a local account with a blank password does exist, enabling this setting will prevent network access, limiting the account to local console logon only." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: LimitBlankPasswordUse - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Limit local account use of blank passwords to console logon only\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93279" - tag rid: "SV-103367r1_rule" - tag stig_id: "WN19-SO-000020" - tag fix_id: "F-99525r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\Currentcontrolset\\Control\\Lsa') do - it { should have_property 'Limitblankpassworduse' } - its('Limitblankpassworduse') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93281.rb b/controls/V-93281.rb deleted file mode 100644 index 639fc11..0000000 --- a/controls/V-93281.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93281" do - title "Windows Server 2019 built-in administrator account must be renamed." - desc "The built-in administrator account is a well-known account subject to attack. Renaming this account to an unidentified name improves the protection of this account and the system." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. - - If the value for \"Accounts: Rename administrator account\" is not set to a value other than \"Administrator\", this is a finding. - - For server core installations, run the following command: - - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - - If \"NewAdministratorName\" is not something other than \"Administrator\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Rename administrator account\" to a name other than \"Administrator\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93281" - tag rid: "SV-103369r1_rule" - tag stig_id: "WN19-SO-000030" - tag fix_id: "F-99527r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe security_policy do - its('NewAdministratorName') { should_not cmp "Administrator" } - end -end diff --git a/controls/V-93283.rb b/controls/V-93283.rb deleted file mode 100644 index 0a07d8f..0000000 --- a/controls/V-93283.rb +++ /dev/null @@ -1,29 +0,0 @@ -# encoding: UTF-8 - -control "V-93283" do - title "Windows Server 2019 built-in guest account must be renamed." - desc "The built-in guest account is a well-known user account on all Windows systems and, as initially installed, does not require a password. This can allow access to system resources by unauthorized users. Renaming this account to an unidentified name improves the protection of this account and the system." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. - If the value for \"Accounts: Rename guest account\" is not set to a value other than \"Guest\", this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"NewGuestName\" is not something other than \"Guest\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Rename guest account\" to a name other than \"Guest\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93283" - tag rid: "SV-103371r1_rule" - tag stig_id: "WN19-SO-000040" - tag fix_id: "F-99529r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe security_policy do - its('NewGuestName') { should_not eq "Guest" } - end -end \ No newline at end of file diff --git a/controls/V-93285.rb b/controls/V-93285.rb deleted file mode 100644 index e2ecebd..0000000 --- a/controls/V-93285.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93285" do - title "Windows Server 2019 maximum age for machine account passwords must be configured to #{input('maximum_password_age_machine')} days or less." - desc "Computer account passwords are changed automatically on a regular basis. This setting controls the maximum password age that a machine account may have. This must be set to no more than #{input('maximum_password_age_machine')} days, ensuring the machine changes its password monthly." - desc "rationale", "" - desc "check", "This is the default configuration for this setting (#{input('maximum_password_age_machine')} days). - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: MaximumPasswordAge - - Value Type: REG_DWORD - Value: 0x000000#{input('maximum_password_age_machine').to_s(16)} (#{input('maximum_password_age_machine')}) (or less, but not 0)" - desc "fix", "This is the default configuration for this setting (#{input('maximum_password_age_machine')} days). - Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Maximum machine account password age\" to \"#{input('maximum_password_age_machine')}\" or less (excluding \"0\", which is unacceptable)." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93285" - tag rid: "SV-103373r1_rule" - tag stig_id: "WN19-SO-000100" - tag fix_id: "F-99531r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'MaximumPasswordAge' } - its('MaximumPasswordAge') { should be_between(1,input('maximum_password_age_machine')) } - end -end diff --git a/controls/V-93287.rb b/controls/V-93287.rb deleted file mode 100644 index 27bfd0d..0000000 --- a/controls/V-93287.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93287" do - title "Windows Server 2019 Smart Card removal option must be configured to Force Logoff or Lock Workstation." - desc "Unattended systems are susceptible to unauthorized use and must be locked. Configuring a system to lock when a smart card is removed will ensure the system is inaccessible when unattended." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\ - - Value Name: scremoveoption - - Value Type: REG_SZ - Value: 1 (Lock Workstation) or 2 (Force Logoff) - - If configuring this on servers causes issues, such as terminating users' remote sessions, and the organization has a policy in place that any other sessions on the servers, such as administrative console logons, are manually locked or logged off when unattended or not in use, this would be acceptable. This must be documented with the ISSO." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Interactive logon: Smart card removal behavior\" to \"Lock Workstation\" or \"Force Logoff\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93287" - tag rid: "SV-103375r1_rule" - tag stig_id: "WN19-SO-000150" - tag fix_id: "F-99533r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon') do - it { should have_property 'scremoveoption' } - its('scremoveoption') { should be_between("1", "2") } - end -end \ No newline at end of file diff --git a/controls/V-93289.rb b/controls/V-93289.rb deleted file mode 100644 index ae5a207..0000000 --- a/controls/V-93289.rb +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: UTF-8 - -control "V-93289" do - title "Windows Server 2019 must not allow anonymous SID/Name translation." - desc "Allowing anonymous SID/Name translation can provide sensitive information for accessing a system. Only authorized users must be able to perform such translations." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. - - If the value for \"Network access: Allow anonymous SID/Name translation\" is not set to \"Disabled\", this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Allow anonymous SID/Name translation\" to \"Disabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93289" - tag rid: "SV-103377r1_rule" - tag stig_id: "WN19-SO-000210" - tag fix_id: "F-99535r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe security_policy do - its('LSAAnonymousNameLookup') { should eq 0 } - end -end \ No newline at end of file diff --git a/controls/V-93291.rb b/controls/V-93291.rb deleted file mode 100644 index 5a37202..0000000 --- a/controls/V-93291.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93291" do - title "Windows Server 2019 must not allow anonymous enumeration of Security Account Manager (SAM) accounts." - desc "Anonymous enumeration of SAM accounts allows anonymous logon users (null session connections) to list all accounts names, thus providing a list of potential points to attack the system." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: RestrictAnonymousSAM - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Do not allow anonymous enumeration of SAM accounts\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93291" - tag rid: "SV-103379r1_rule" - tag stig_id: "WN19-SO-000220" - tag fix_id: "F-99537r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'RestrictAnonymousSAM' } - its('RestrictAnonymousSAM') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93293.rb b/controls/V-93293.rb deleted file mode 100644 index 0ef749b..0000000 --- a/controls/V-93293.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93293" do - title "Windows Server 2019 must be configured to prevent anonymous users from having the same permissions as the Everyone group." - desc "Access by anonymous users must be restricted. If this setting is enabled, anonymous users have the same rights and permissions as the built-in Everyone group. Anonymous users must not have these permissions or rights." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: EveryoneIncludesAnonymous - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Let Everyone permissions apply to anonymous users\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93293" - tag rid: "SV-103381r1_rule" - tag stig_id: "WN19-SO-000240" - tag fix_id: "F-99539r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'EveryoneIncludesAnonymous' } - its('EveryoneIncludesAnonymous') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93295.rb b/controls/V-93295.rb deleted file mode 100644 index 6486e9c..0000000 --- a/controls/V-93295.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93295" do - title "Windows Server 2019 services using Local System that use Negotiate when reverting to NTLM authentication must use the computer identity instead of authenticating anonymously." - desc "Services using Local System that use Negotiate when reverting to NTLM authentication may gain unauthorized access if allowed to authenticate anonymously versus using the computer identity." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\ - - Value Name: UseMachineId - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow Local System to use computer identity for NTLM\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93295" - tag rid: "SV-103383r1_rule" - tag stig_id: "WN19-SO-000260" - tag fix_id: "F-99541r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'UseMachineId' } - its('UseMachineId') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93297.rb b/controls/V-93297.rb deleted file mode 100644 index 92cbd20..0000000 --- a/controls/V-93297.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93297" do - title "Windows Server 2019 must prevent NTLM from falling back to a Null session." - desc "NTLM sessions that are allowed to fall back to Null (unauthenticated) sessions may gain unauthorized access." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\MSV1_0\\ - - Value Name: allownullsessionfallback - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow LocalSystem NULL session fallback\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93297" - tag rid: "SV-103385r1_rule" - tag stig_id: "WN19-SO-000270" - tag fix_id: "F-99543r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do - it { should have_property 'allownullsessionfallback' } - its('allownullsessionfallback') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93299.rb b/controls/V-93299.rb deleted file mode 100644 index 1c7800a..0000000 --- a/controls/V-93299.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93299" do - title "Windows Server 2019 must prevent PKU2U authentication using online identities." - desc "PKU2U is a peer-to-peer authentication protocol. This setting prevents online identities from authenticating to domain-joined systems. Authentication will be centrally managed with Windows user accounts." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\LSA\\pku2u\\ - - Value Name: AllowOnlineID - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Allow PKU2U authentication requests to this computer to use online identities\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93299" - tag rid: "SV-103387r1_rule" - tag stig_id: "WN19-SO-000280" - tag fix_id: "F-99545r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\pku2u') do - it { should have_property 'AllowOnlineID' } - its('AllowOnlineID') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93301.rb b/controls/V-93301.rb deleted file mode 100644 index bf81f05..0000000 --- a/controls/V-93301.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93301" do - title "Windows Server 2019 LAN Manager authentication level must be configured to send NTLMv2 response only and to refuse LM and NTLM." - desc "The Kerberos v5 authentication protocol is the default for authentication of users who are logging on to domain accounts. NTLM, which is less secure, is retained in later Windows versions for compatibility with clients and servers that are running earlier versions of Windows or applications that still use it. It is also used to authenticate logons to standalone computers that are running later versions." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: LmCompatibilityLevel - - Value Type: REG_DWORD - Value: 0x00000005 (5)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: LAN Manager authentication level\" to \"Send NTLMv2 response only. Refuse LM & NTLM\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93301" - tag rid: "SV-103389r1_rule" - tag stig_id: "WN19-SO-000310" - tag fix_id: "F-99547r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'LmCompatibilityLevel' } - its('LmCompatibilityLevel') { should cmp == 5 } - end -end \ No newline at end of file diff --git a/controls/V-93303.rb b/controls/V-93303.rb deleted file mode 100644 index c413b42..0000000 --- a/controls/V-93303.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93303" do - title "Windows Server 2019 must be configured to at least negotiate signing for LDAP client signing." - desc "This setting controls the signing requirements for LDAP clients. This must be set to \"Negotiate signing\" or \"Require signing\", depending on the environment and type of LDAP server in use." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LDAP\\ - - Value Name: LDAPClientIntegrity - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: LDAP client signing requirements\" to \"Negotiate signing\" at a minimum." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93303" - tag rid: "SV-103391r1_rule" - tag stig_id: "WN19-SO-000320" - tag fix_id: "F-99549r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LDAP') do - it { should have_property 'LDAPClientIntegrity' } - its('LDAPClientIntegrity') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93305.rb b/controls/V-93305.rb deleted file mode 100644 index 843c50c..0000000 --- a/controls/V-93305.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93305" do - title "Windows Server 2019 session security for NTLM SSP-based clients must be configured to require NTLMv2 session security and 128-bit encryption." - desc "Microsoft has implemented a variety of security support providers for use with Remote Procedure Call (RPC) sessions. All of the options must be enabled to ensure the maximum security level." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0\\ - - Value Name: NTLMMinClientSec - - Value Type: REG_DWORD - Value: 0x20080000 (537395200)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Minimum session security for NTLM SSP based (including secure RPC) clients\" to \"Require NTLMv2 session security\" and \"Require 128-bit encryption\" (all options selected)." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93305" - tag rid: "SV-103393r1_rule" - tag stig_id: "WN19-SO-000330" - tag fix_id: "F-99551r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do - it { should have_property 'NTLMMinClientSec' } - its('NTLMMinClientSec') { should cmp == 537395200 } - end -end \ No newline at end of file diff --git a/controls/V-93307.rb b/controls/V-93307.rb deleted file mode 100644 index 5be9d54..0000000 --- a/controls/V-93307.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93307" do - title "Windows Server 2019 session security for NTLM SSP-based servers must be configured to require NTLMv2 session security and 128-bit encryption." - desc "Microsoft has implemented a variety of security support providers for use with Remote Procedure Call (RPC) sessions. All of the options must be enabled to ensure the maximum security level." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0\\ - - Value Name: NTLMMinServerSec - - Value Type: REG_DWORD - Value: 0x20080000 (537395200)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Minimum session security for NTLM SSP based (including secure RPC) servers\" to \"Require NTLMv2 session security\" and \"Require 128-bit encryption\" (all options selected)." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93307" - tag rid: "SV-103395r1_rule" - tag stig_id: "WN19-SO-000340" - tag fix_id: "F-99553r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\MSV1_0') do - it { should have_property 'NTLMMinServerSec' } - its('NTLMMinServerSec') { should cmp == 537395200 } - end -end \ No newline at end of file diff --git a/controls/V-93309.rb b/controls/V-93309.rb deleted file mode 100644 index cea801f..0000000 --- a/controls/V-93309.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93309" do - title "Windows Server 2019 default permissions of global system objects must be strengthened." - desc "Windows systems maintain a global list of shared system resources such as DOS device names, mutexes, and semaphores. Each type of object is created with a default Discretionary Access Control List (DACL) that specifies who can access the objects with what permissions. When this policy is enabled, the default DACL is stronger, allowing non-administrative users to read shared objects but not to modify shared objects they did not create." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\ - - Value Name: ProtectionMode - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System objects: Strengthen default permissions of internal system objects (e.g., Symbolic Links)\" to \"Enabled\"." - impact 0.3 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93309" - tag rid: "SV-103397r1_rule" - tag stig_id: "WN19-SO-000370" - tag fix_id: "F-99555r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager') do - it { should have_property 'ProtectionMode' } - its('ProtectionMode') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93311.rb b/controls/V-93311.rb deleted file mode 100644 index 4c8bf9f..0000000 --- a/controls/V-93311.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93311" do - title "Windows Server 2019 must preserve zone information when saving attachments." - desc "Attachments from outside sources may contain malicious code. Preserving zone of origin (Internet, intranet, local, restricted) information on file attachments allows Windows to determine risk." - desc "rationale", "" - desc "check", "The default behavior is for Windows to mark file attachments with their zone information. - - If the registry Value Name below does not exist, this is not a finding. - If it exists and is configured with a value of \"2\", this is not a finding. - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_CURRENT_USER - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Attachments\\ - - Value Name: SaveZoneInformation - - Value Type: REG_DWORD - Value: 0x00000002 (2) (or if the Value Name does not exist)" - desc "fix", "The default behavior is for Windows to mark file attachments with their zone information. - - If this needs to be corrected, configure the policy value for User Configuration >> Administrative Templates >> Windows Components >> Attachment Manager >> \"Do not preserve zone information in file attachments\" to \"Not Configured\" or \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93311" - tag rid: "SV-103399r1_rule" - tag stig_id: "WN19-UC-000010" - tag fix_id: "F-99557r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - if registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments').has_property?('SaveZoneInformation') - describe registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments') do - its('SaveZoneInformation') { should cmp 2 } - end - else - describe registry_key('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments') do - it { should_not have_property 'SaveZoneInformation' } - end - end -end \ No newline at end of file diff --git a/controls/V-93369.rb b/controls/V-93369.rb deleted file mode 100644 index 34a9df3..0000000 --- a/controls/V-93369.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93369" do - title "Windows Server 2019 users with Administrative privileges must have separate accounts for administrative duties and normal operational tasks." - desc "Using a privileged account to perform routine functions makes the computer vulnerable to malicious software inadvertently introduced during a session that has been granted full privileges." - desc "rationale", "" - desc "check", "Verify each user with administrative privileges has been assigned a unique administrative account separate from their standard user account. - If users with administrative privileges do not have separate accounts for administrative functions and standard user functions, this is a finding." - desc "fix", "Ensure each user with administrative privileges has a separate account for user duties and one for privileged duties." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00227" - tag gid: "V-93369" - tag rid: "SV-103457r1_rule" - tag stig_id: "WN19-00-000010" - tag fix_id: "F-99615r1_fix" - tag cci: ["CCI-000366"] - tag nist: ["CM-6 b", "Rev_4"] - - administrators = input('administrators') - administrator_group = command("net localgroup Administrators | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split("\r\n") - administrator_group.each do |user| - describe user.to_s do - it { should be_in administrators } - end - end - if administrator_group.empty? - impact 0.0 - describe 'There are no users with administrative privileges' do - skip 'There are no users with administrative privileges so this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93373.rb b/controls/V-93373.rb deleted file mode 100644 index fcc203c..0000000 --- a/controls/V-93373.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93373" do - title "Windows Server 2019 Autoplay must be turned off for non-volume devices." - desc "Allowing AutoPlay to execute may introduce malicious code to a system. AutoPlay begins reading from a drive as soon as media is inserted into the drive. As a result, the setup file of programs or music on audio media may start. This setting will disable AutoPlay for non-volume devices, such as Media Transfer Protocol (MTP) devices." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ - - Value Name: NoAutoplayfornonVolume - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Disallow Autoplay for non-volume devices\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000368-GPOS-00154" - tag gid: "V-93373" - tag rid: "SV-103459r1_rule" - tag stig_id: "WN19-CC-000210" - tag fix_id: "F-99617r1_fix" - tag cci: ["CCI-001764"] - tag nist: ["CM-7 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\Explorer') do - it { should have_property 'NoAutoplayfornonVolume' } - its('NoAutoplayfornonVolume') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93375.rb b/controls/V-93375.rb deleted file mode 100644 index bc027c0..0000000 --- a/controls/V-93375.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93375" do - title "Windows Server 2019 default AutoRun behavior must be configured to prevent AutoRun commands." - desc "Allowing AutoRun commands to execute may introduce malicious code to a system. Configuring this setting prevents AutoRun commands from executing." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ - - Value Name: NoAutorun - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Set the default behavior for AutoRun\" to \"Enabled\" with \"Do not execute any autorun commands\" selected." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000368-GPOS-00154" - tag gid: "V-93375" - tag rid: "SV-103461r1_rule" - tag stig_id: "WN19-CC-000220" - tag fix_id: "F-99619r1_fix" - tag cci: ["CCI-001764"] - tag nist: ["CM-7 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer') do - it { should have_property 'NoAutorun' } - its('NoAutorun') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93377.rb b/controls/V-93377.rb deleted file mode 100644 index 0cc1224..0000000 --- a/controls/V-93377.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93377" do - title "Windows Server 2019 AutoPlay must be disabled for all drives." - desc "Allowing AutoPlay to execute may introduce malicious code to a system. AutoPlay begins reading from a drive as soon media is inserted into the drive. As a result, the setup file of programs or music on audio media may start. By default, AutoPlay is disabled on removable drives, such as the floppy disk drive (but not the CD-ROM drive) and on network drives. Enabling this policy disables AutoPlay on all drives." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\Explorer\\ - - Value Name: NoDriveTypeAutoRun - - Type: REG_DWORD - Value: 0x000000ff (255)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> AutoPlay Policies >> \"Turn off AutoPlay\" to \"Enabled\" with \"All Drives\" selected." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000368-GPOS-00154" - tag gid: "V-93377" - tag rid: "SV-103463r1_rule" - tag stig_id: "WN19-CC-000230" - tag fix_id: "F-99621r1_fix" - tag cci: ["CCI-001764"] - tag nist: ["CM-7 (2)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer') do - it { should have_property 'NoDriveTypeAutoRun' } - its('NoDriveTypeAutoRun') { should cmp == 255 } - end -end \ No newline at end of file diff --git a/controls/V-93379.rb b/controls/V-93379.rb deleted file mode 100644 index c7c303b..0000000 --- a/controls/V-93379.rb +++ /dev/null @@ -1,45 +0,0 @@ -# encoding: UTF-8 - -control "V-93379" do - title "Windows Server 2019 must employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs." - desc "Using a whitelist provides a configuration management method to allow the execution of only authorized software. Using only authorized software decreases risk by limiting the number of potential vulnerabilities. - The organization must identify authorized software programs and only permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting." - desc "rationale", "" - desc "check", "This is applicable to unclassified systems. For other systems, this is NA. - - Verify the operating system employs a deny-all, permit-by-exception policy to allow the execution of authorized software programs. - If an application whitelisting program is not in use on the system, this is a finding. - Configuration of whitelisting applications will vary by the program. - AppLocker is a whitelisting application built into Windows Server. A deny-by-default implementation is initiated by enabling any AppLocker rules within a category, only allowing what is specified by defined rules. - If AppLocker is used, perform the following to view the configuration of AppLocker: - - Open \"PowerShell\". - If the AppLocker PowerShell module has not been imported previously, execute the following first: - Import-Module AppLocker - Execute the following command, substituting [c:\\temp\\file.xml] with a location and file name appropriate for the system: - Get-AppLockerPolicy -Effective -XML > c:\\temp\\file.xml - This will produce an xml file with the effective settings that can be viewed in a browser or opened in a program such as Excel for review. - Implementation guidance for AppLocker is available in the NSA paper \"Application Whitelisting using Microsoft AppLocker\" at the following link: - https://www.iad.gov/iad/library/ia-guidance/tech-briefs/application-whitelisting-using-microsoft-applocker.cfm" - desc "fix", "Configure an application whitelisting program to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs. - - Configuration of whitelisting applications will vary by the program. AppLocker is a whitelisting application built into Windows Server. - If AppLocker is used, it is configured through group policy in Computer Configuration >> Windows Settings >> Security Settings >> Application Control Policies >> AppLocker. - Implementation guidance for AppLocker is available in the NSA paper \"Application Whitelisting using Microsoft AppLocker\" at the following link: - https://www.iad.gov/iad/library/ia-guidance/tech-briefs/application-whitelisting-using-microsoft-applocker.cfm" - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000370-GPOS-00155" - tag gid: "V-93379" - tag rid: "SV-103465r1_rule" - tag stig_id: "WN19-00-000080" - tag fix_id: "F-99623r1_fix" - tag cci: ["CCI-001774"] - tag nist: ["CM-7 (5) (b)", "Rev_4"] - - describe "A manual review is required to ensure the operating system employs a deny-all, permit-by-exception - policy to allow the execution of authorized software programs" do - skip 'A manual review is required to ensure the operating system employs a deny-all, permit-by-exception - policy to allow the execution of authorized software programs' - end -end \ No newline at end of file diff --git a/controls/V-93381.rb b/controls/V-93381.rb deleted file mode 100644 index f2738bc..0000000 --- a/controls/V-93381.rb +++ /dev/null @@ -1,26 +0,0 @@ -# encoding: UTF-8 - -control "V-93381" do - title "Windows Server 2019 must have the roles and features required by the system documented." - desc "Unnecessary roles and features increase the attack surface of a system. Limiting roles and features of a system to only those necessary reduces this potential. The standard installation option (previously called Server Core) further reduces this when selected at installation." - desc "rationale", "" - desc "check", "Required roles and features will vary based on the function of the individual system. - - Roles and features specifically required to be disabled per the STIG are identified in separate requirements. - If the organization has not documented the roles and features required for the system(s), this is a finding. - The PowerShell command \"Get-WindowsFeature\" will list all roles and features with an \"Install State\"." - desc "fix", "Document the roles and features required for the system to operate. Uninstall any that are not required." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93381" - tag rid: "SV-103467r1_rule" - tag stig_id: "WN19-00-000270" - tag fix_id: "F-99625r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe 'A manual review is required to verify that the roles and features required by the system are documented' do - skip 'A manual review is required to verify that the roles and features required by the system are documented' - end -end \ No newline at end of file diff --git a/controls/V-93383.rb b/controls/V-93383.rb deleted file mode 100644 index 9ca7121..0000000 --- a/controls/V-93383.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93383" do - title "Windows Server 2019 must not have the Fax Server role installed." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - - Enter \"Get-WindowsFeature | Where Name -eq Fax\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"Fax Server\" role. - - Start \"Server Manager\". - Select the server with the role. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"Fax Server\" on the \"Roles\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93383" - tag rid: "SV-103469r1_rule" - tag stig_id: "WN19-00-000320" - tag fix_id: "F-99627r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe windows_feature('fax') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93385.rb b/controls/V-93385.rb deleted file mode 100644 index ed2e0d1..0000000 --- a/controls/V-93385.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93385" do - title "Windows Server 2019 must not have the Peer Name Resolution Protocol installed." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - - Enter \"Get-WindowsFeature | Where Name -eq PNRP\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"Peer Name Resolution Protocol\" feature. - - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"Peer Name Resolution Protocol\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93385" - tag rid: "SV-103471r1_rule" - tag stig_id: "WN19-00-000340" - tag fix_id: "F-99629r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe windows_feature('PNRP') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93387.rb b/controls/V-93387.rb deleted file mode 100644 index 6b675e3..0000000 --- a/controls/V-93387.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93387" do - title "Windows Server 2019 must not have Simple TCP/IP Services installed." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - - Enter \"Get-WindowsFeature | Where Name -eq Simple-TCPIP\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"Simple TCP/IP Services\" feature. - - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"Simple TCP/IP Services\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93387" - tag rid: "SV-103473r1_rule" - tag stig_id: "WN19-00-000350" - tag fix_id: "F-99631r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe windows_feature('Simple-TCPIP') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93389.rb b/controls/V-93389.rb deleted file mode 100644 index 0189af7..0000000 --- a/controls/V-93389.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93389" do - title "Windows Server 2019 must not have the TFTP Client installed." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - - Enter \"Get-WindowsFeature | Where Name -eq TFTP-Client\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"TFTP Client\" feature. - - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"TFTP Client\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93389" - tag rid: "SV-103475r1_rule" - tag stig_id: "WN19-00-000370" - tag fix_id: "F-99633r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe windows_feature('TFTP-Client') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93391.rb b/controls/V-93391.rb deleted file mode 100644 index f190e34..0000000 --- a/controls/V-93391.rb +++ /dev/null @@ -1,49 +0,0 @@ -# encoding: UTF-8 - -control "V-93391" do - title "Windows Server 2019 must not the Server Message Block (SMB) v1 protocol installed." - desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks and is not FIPS compliant." - desc "rationale", "" - desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019. This is the preferred method, however if WN19-00-000390 and WN19-00-000400 are configured, this is NA. - - Open \"Windows PowerShell\" with elevated privileges (run as administrator). - Enter \"Get-WindowsFeature -Name FS-SMB1\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the SMBv1 protocol. - - Open \"Windows PowerShell\" with elevated privileges (run as administrator). - Enter \"Uninstall-WindowsFeature -Name FS-SMB1 -Restart\". - (Omit the Restart parameter if an immediate restart of the system cannot be done.) - - Alternately: - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"SMB 1.0/CIFS File Sharing Support\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93391" - tag rid: "SV-103477r1_rule" - tag stig_id: "WN19-00-000380" - tag fix_id: "F-99635r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - if powershell("Get-ItemPropertyValue 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters' -Name SMB1").stdout.strip == "0" && powershell("Get-ItemPropertyValue 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10' -Name Start").stdout.strip == "4" - impact 0.0 - describe 'Controls V-93393 and V-93395 configuration successful' do - skip 'This is NA as the successful configuration of Controls V-93393 (STIG ID# WN19-00-000390) and V-93395 (STIG ID# WN19-00-000400) meets the requirement' - end - else - state = powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip - describe "Server Message Block (SMB) v1 protocol msut not be installed" do - subject { state } - it { should_not eq "Installed" } - end - end -end \ No newline at end of file diff --git a/controls/V-93393.rb b/controls/V-93393.rb deleted file mode 100644 index fd6e57d..0000000 --- a/controls/V-93393.rb +++ /dev/null @@ -1,48 +0,0 @@ -# encoding: UTF-8 - -control "V-93393" do - title "Windows Server 2019 must have the Server Message Block (SMB) v1 protocol disabled on the SMB server." - desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks as well as not being FIPS compliant." - desc "rationale", "" - desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019, if WN19-00-000380 is configured, this is NA. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\\ - - Value Name: SMB1 - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Configure SMBv1 Server\" to \"Disabled\". - - The system must be restarted for the change to take effect. - - This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \"SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93393" - tag rid: "SV-103479r1_rule" - tag stig_id: "WN19-00-000390" - tag fix_id: "F-99637r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - if powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip == "Installed" - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do - it { should have_property 'SMB1' } - its('SMB1') { should cmp == 0 } - end - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10') do - it { should have_property 'Start' } - its('Start') { should cmp == 4 } - end - else - impact 0.0 - describe 'Control V-93391 configuration successful' do - skip 'This is NA as the successful configuration of Control V-93391 (STIG ID# WN19-00-000380) meets the requirement' - end - end -end \ No newline at end of file diff --git a/controls/V-93395.rb b/controls/V-93395.rb deleted file mode 100644 index 8529303..0000000 --- a/controls/V-93395.rb +++ /dev/null @@ -1,48 +0,0 @@ -# encoding: UTF-8 - -control "V-93395" do - title "Windows Server 2019 must have the Server Message Block (SMB) v1 protocol disabled on the SMB client." - desc "SMBv1 is a legacy protocol that uses the MD5 algorithm as part of SMB. MD5 is known to be vulnerable to a number of attacks such as collision and preimage attacks as well as not being FIPS compliant." - desc "rationale", "" - desc "check", "Different methods are available to disable SMBv1 on Windows Server 2019, if WN19-00-000380 is configured, this is NA. - - If the following registry value is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10\\ - - Value Name: Start - - Type: REG_DWORD - Value: 0x00000004 (4)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Configure SMBv1 client driver\" to \"Enabled\" with \"Disable driver (recommended)\" selected for \"Configure MrxSmb10 driver\". - - The system must be restarted for the changes to take effect. - - This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \"SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93395" - tag rid: "SV-103481r1_rule" - tag stig_id: "WN19-00-000400" - tag fix_id: "F-99639r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - if powershell("Get-WindowsFeature -Name FS-SMB1 | Select -ExpandProperty 'InstallState'").stdout.strip == "Installed" - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do - it { should have_property 'SMB1' } - its('SMB1') { should cmp == 0 } - end - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10') do - it { should have_property 'Start' } - its('Start') { should cmp == 4 } - end - else - impact 0.0 - describe 'Control V-93391 configuration successful' do - skip 'This is NA as the successful configuration of Control V-93391 (STIG ID# WN19-00-000380) meets the requirement' - end - end -end \ No newline at end of file diff --git a/controls/V-93397.rb b/controls/V-93397.rb deleted file mode 100644 index a58da1b..0000000 --- a/controls/V-93397.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93397" do - title "Windows Server 2019 must not have Windows PowerShell 2.0 installed." - desc "Windows PowerShell 5.x added advanced logging features that can provide additional detail when malware has been run on a system. Disabling the Windows PowerShell 2.0 mitigates against a downgrade attack that evades the Windows PowerShell 5.x script block logging feature." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - Enter \"Get-WindowsFeature | Where Name -eq PowerShell-v2\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"Windows PowerShell 2.0 Engine\". - - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"Windows PowerShell 2.0 Engine\" under \"Windows PowerShell\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93397" - tag rid: "SV-103483r1_rule" - tag stig_id: "WN19-00-000410" - tag fix_id: "F-99641r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe windows_feature('PowerShell-v2') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93399.rb b/controls/V-93399.rb deleted file mode 100644 index 51c8c52..0000000 --- a/controls/V-93399.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93399" do - title "Windows Server 2019 must prevent the display of slide shows on the lock screen." - desc "Slide shows that are displayed on the lock screen could display sensitive information to unauthorized personnel. Turning off this feature will limit access to the information to a logged-on user." - desc "rationale", "" - desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\\ - - Value Name: NoLockScreenSlideshow - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Control Panel >> Personalization >> \"Prevent enabling lock screen slide show\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93399" - tag rid: "SV-103485r1_rule" - tag stig_id: "WN19-CC-000010" - tag fix_id: "F-99643r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization') do - it { should have_property 'NoLockScreenSlideshow' } - its('NoLockScreenSlideshow') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93401.rb b/controls/V-93401.rb deleted file mode 100644 index 761eca4..0000000 --- a/controls/V-93401.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93401" do - title "Windows Server 2019 must have WDigest Authentication disabled." - desc "When the WDigest Authentication protocol is enabled, plain-text passwords are stored in the Local Security Authority Subsystem Service (LSASS),exposing them to theft. WDigest is disabled by default in Windows Server 2019. This setting ensures this is enforced." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\Wdigest\\ - - Value Name: UseLogonCredential - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"WDigest Authentication (disabling may require KB2871997)\" to \"Disabled\". - - This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \" SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93401" - tag rid: "SV-103487r1_rule" - tag stig_id: "WN19-CC-000020" - tag fix_id: "F-99645r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\Wdigest') do - it { should have_property 'UseLogonCredential' } - its('UseLogonCredential') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93403.rb b/controls/V-93403.rb deleted file mode 100644 index 45f95c6..0000000 --- a/controls/V-93403.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93403" do - title "Windows Server 2019 downloading print driver packages over HTTP must be turned off." - desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. - - This setting prevents the computer from downloading print driver packages over HTTP." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\\ - - Value Name: DisableWebPnPDownload - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Internet Communication Management >> Internet Communication settings >> \"Turn off downloading of print drivers over HTTP\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93403" - tag rid: "SV-103489r1_rule" - tag stig_id: "WN19-CC-000150" - tag fix_id: "F-99647r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers') do - it { should have_property 'DisableWebPnPDownload' } - its('DisableWebPnPDownload') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93405.rb b/controls/V-93405.rb deleted file mode 100644 index 610b2d9..0000000 --- a/controls/V-93405.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93405" do - title "Windows Server 2019 printing over HTTP must be turned off." - desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. - - This setting prevents the client computer from printing over HTTP, which allows the computer to print to printers on the intranet as well as the Internet." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\\ - - Value Name: DisableHTTPPrinting - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Internet Communication Management >> Internet Communication settings >> \"Turn off printing over HTTP\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93405" - tag rid: "SV-103491r1_rule" - tag stig_id: "WN19-CC-000160" - tag fix_id: "F-99649r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers') do - it { should have_property 'DisableHTTPPrinting' } - its('DisableHTTPPrinting') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93407.rb b/controls/V-93407.rb deleted file mode 100644 index 4d8bbd2..0000000 --- a/controls/V-93407.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93407" do - title "Windows Server 2019 network selection user interface (UI) must not be displayed on the logon screen." - desc "Enabling interaction with the network selection UI allows users to change connections to available networks without signing in to Windows." - desc "rationale", "" - desc "check", "Verify the registry value below. If it does not exist or is not configured as specified, this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ - - Value Name: DontDisplayNetworkSelectionUI - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Logon >> \"Do not display network selection UI\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93407" - tag rid: "SV-103493r1_rule" - tag stig_id: "WN19-CC-000170" - tag fix_id: "F-99651r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\System') do - it { should have_property 'DontDisplayNetworkSelectionUI' } - its('DontDisplayNetworkSelectionUI') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93409.rb b/controls/V-93409.rb deleted file mode 100644 index ec0489a..0000000 --- a/controls/V-93409.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93409" do - title "Windows Server 2019 Application Compatibility Program Inventory must be prevented from collecting data and sending the information to Microsoft." - desc "Some features may communicate with the vendor, sending system information or downloading data or components for the feature. Turning off this capability will prevent potentially sensitive information from being sent outside the enterprise and will prevent uncontrolled updates to the system. - - This setting will prevent the Program Inventory from collecting data about a system and sending the information to Microsoft." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat\\ - - Value Name: DisableInventory - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Application Compatibility >> \"Turn off Inventory Collector\" to \"Enabled\"." - impact 0.3 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93409" - tag rid: "SV-103495r1_rule" - tag stig_id: "WN19-CC-000200" - tag fix_id: "F-99653r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\AppCompat') do - it { should have_property 'DisableInventory' } - its('DisableInventory') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93411.rb b/controls/V-93411.rb deleted file mode 100644 index e4dc998..0000000 --- a/controls/V-93411.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93411" do - title "Windows Server 2019 Windows Defender SmartScreen must be enabled." - desc "Windows Defender SmartScreen helps protect systems from programs downloaded from the internet that may be malicious. Enabling SmartScreen can block potentially malicious programs or warn users." - desc "rationale", "" - desc "check", "This is applicable to unclassified systems; for other systems, this is NA. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ - - Value Name: EnableSmartScreen - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> File Explorer >> \"Configure Windows Defender SmartScreen\" to \"Enabled\" with either option \"Warn\" or \"Warn and prevent bypass\" selected. - Windows 2019 includes duplicate policies for this setting. It can also be configured under Computer Configuration >> Administrative Templates >> Windows Components >> Windows Defender SmartScreen >> Explorer." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93411" - tag rid: "SV-103497r2_rule" - tag stig_id: "WN19-CC-000300" - tag fix_id: "F-99655r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - if input('sensitive_system') == true || nil - impact 0.0 - describe 'This Control is Not Applicable to sensitive systems.' do - skip 'This Control is Not Applicable to sensitive systems.' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\System') do - it { should have_property 'EnableSmartScreen' } - its('EnableSmartScreen') { should cmp 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93413.rb b/controls/V-93413.rb deleted file mode 100644 index ef4febf..0000000 --- a/controls/V-93413.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93413" do - title "Windows Server 2019 must disable Basic authentication for RSS feeds over HTTP." - desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." - desc "rationale", "" - desc "check", "The default behavior is for the Windows RSS platform to not use Basic authentication over HTTP connections. - - If the registry value name below does not exist, this is not a finding. - If it exists and is configured with a value of \"0\", this is not a finding. - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Feeds\\ - - Value Name: AllowBasicAuthInClear - - Value Type: REG_DWORD - Value: 0x00000000 (0) (or if the Value Name does not exist)" - desc "fix", "The default behavior is for the Windows RSS platform to not use Basic authentication over HTTP connections. - If this needs to be corrected, configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> RSS Feeds >> \"Turn on Basic feed authentication over HTTP\" to \"Not Configured\" or \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93413" - tag rid: "SV-103499r1_rule" - tag stig_id: "WN19-CC-000400" - tag fix_id: "F-99657r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - if registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds').has_property?('AllowBasicAuthInClear') - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do - its('AllowBasicAuthInClear') { should cmp 0 } - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds') do - it { should_not have_property 'AllowBasicAuthInClear' } - end - end -end \ No newline at end of file diff --git a/controls/V-93415.rb b/controls/V-93415.rb deleted file mode 100644 index c05fa78..0000000 --- a/controls/V-93415.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93415" do - title "Windows Server 2019 must prevent Indexing of encrypted files." - desc "Indexing of encrypted files may expose sensitive data. This setting prevents encrypted files from being indexed." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\\ - - Value Name: AllowIndexingEncryptedStoresOrItems - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Search >> \"Allow indexing of encrypted files\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93415" - tag rid: "SV-103501r1_rule" - tag stig_id: "WN19-CC-000410" - tag fix_id: "F-99659r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search') do - it { should have_property 'AllowIndexingEncryptedStoresOrItems' } - its('AllowIndexingEncryptedStoresOrItems') { should cmp 0 } - end -end \ No newline at end of file diff --git a/controls/V-93417.rb b/controls/V-93417.rb deleted file mode 100644 index 698e177..0000000 --- a/controls/V-93417.rb +++ /dev/null @@ -1,56 +0,0 @@ -# encoding: UTF-8 - -control "V-93417" do - title "Windows Server 2019 domain controllers must run on a machine dedicated to that function." - desc "Executing application servers on the same host machine with a directory server may substantially weaken the security of the directory server. Web or database server applications usually require the addition of many programs and accounts, increasing the attack surface of the computer. - - Some applications require the addition of privileged accounts, providing potential sources of compromise. Some applications (such as Microsoft Exchange) may require the use of network ports or services conflicting with the directory server. In this case, non-standard ports might be selected, and this could interfere with intrusion detection or prevention services." - desc "rationale", "" - desc "check", "This applies to domain controllers, it is NA for other systems. - - Review the installed roles the domain controller is supporting. - Start \"Server Manager\". - Select \"AD DS\" in the left pane and the server name under \"Servers\" to the right. - Select \"Add (or Remove) Roles and Features\" from \"Tasks\" in the \"Roles and Features\" section. (Cancel before any changes are made.) - Determine if any additional server roles are installed. A basic domain controller setup will include the following: - - - Active Directory Domain Services - - DNS Server - - File and Storage Services - - If any roles not requiring installation on a domain controller are installed, this is a finding. - A Domain Name System (DNS) server integrated with the directory server (e.g., AD-integrated DNS) is an acceptable application. However, the DNS server must comply with the DNS STIG security requirements. - Run \"Programs and Features\". - Review installed applications. - If any applications are installed that are not required for the domain controller, this is a finding." - desc "fix", "Remove additional roles or applications such as web, database, and email from the domain controller." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93417" - tag rid: "SV-103503r1_rule" - tag stig_id: "WN19-DC-000130" - tag fix_id: "F-99661r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - role_list = [ - "Active Directory Domain Services", - "DNS Server", - "File and Storage Services" - ] - roles = json(command: "Get-WindowsFeature | Where {($_.installstate -eq 'installed') -and ($_.featuretype -eq 'role')} | foreach { $_.DisplayName } | ConvertTo-JSON").params - describe "The list of roles installed on the server" do - subject { roles } - it { should be_in role_list } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93419.rb b/controls/V-93419.rb deleted file mode 100644 index 3bda10b..0000000 --- a/controls/V-93419.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93419" do - title "Windows Server 2019 local users on domain-joined member servers must not be enumerated." - desc "The username is one part of logon credentials that could be used to gain access to a system. Preventing the enumeration of users limits this information to authorized personnel." - desc "rationale", "" - desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ - - Value Name: EnumerateLocalUsers - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Logon >> \"Enumerate local users on domain-joined computers\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000095-GPOS-00049" - tag gid: "V-93419" - tag rid: "SV-103505r1_rule" - tag stig_id: "WN19-MS-000030" - tag fix_id: "F-99663r1_fix" - tag cci: ["CCI-000381"] - tag nist: ["CM-7 a", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '3' - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\System') do - it { should have_property 'EnumerateLocalUsers' } - its('EnumerateLocalUsers') { should cmp 0 } - end - else - impact 0.0 - describe 'This control is not applicable as it only applies to member servers' do - skip 'This control is not applicable as it only applies to member servers' - end - end -end \ No newline at end of file diff --git a/controls/V-93421.rb b/controls/V-93421.rb deleted file mode 100644 index d290fde..0000000 --- a/controls/V-93421.rb +++ /dev/null @@ -1,46 +0,0 @@ -# encoding: UTF-8 - -control "V-93421" do - title "Windows Server 2019 must not have the Microsoft FTP service installed unless required by the organization." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption." - desc "rationale", "" - desc "check", "If the server has the role of an FTP server, this is NA. - - Open \"PowerShell\". - Enter \"Get-WindowsFeature | Where Name -eq Web-Ftp-Service\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding. - If the system has the role of an FTP server, this must be documented with the ISSO." - desc "fix", "Uninstall the \"FTP Server\" role. - - Start \"Server Manager\". - Select the server with the role. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"FTP Server\" under \"Web Server (IIS)\" on the \"Roles\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000096-GPOS-00050" - tag gid: "V-93421" - tag rid: "SV-103507r1_rule" - tag stig_id: "WN19-00-000330" - tag fix_id: "F-99665r1_fix" - tag cci: ["CCI-000382"] - tag nist: ["CM-7 b", "Rev_4"] - - ftp_server_state = command('Get-WindowsFeature Web-Ftp-Server | Select -Expand Installed').stdout.strip - - if input('ftp_server') == false - describe 'Microsoft FTP service must not be installed unless required' do - subject { ftp_server_state } - it { should eq 'False' } - end - else - impact 0.0 - describe 'This server has the role of an FTP server, therefore this control is NA' do - skip 'This server has the role of an FTP server, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93423.rb b/controls/V-93423.rb deleted file mode 100644 index 819147c..0000000 --- a/controls/V-93423.rb +++ /dev/null @@ -1,34 +0,0 @@ -# encoding: UTF-8 - -control "V-93423" do - title "Windows Server 2019 must not have the Telnet Client installed." - desc "Unnecessary services increase the attack surface of a system. Some of these services may not support required levels of authentication or encryption or may provide unauthorized access to the system." - desc "rationale", "" - desc "check", "Open \"PowerShell\". - - Enter \"Get-WindowsFeature | Where Name -eq Telnet-Client\". - If \"Installed State\" is \"Installed\", this is a finding. - An Installed State of \"Available\" or \"Removed\" is not a finding." - desc "fix", "Uninstall the \"Telnet Client\" feature. - - Start \"Server Manager\". - Select the server with the feature. - Scroll down to \"ROLES AND FEATURES\" in the right pane. - Select \"Remove Roles and Features\" from the drop-down \"TASKS\" list. - Select the appropriate server on the \"Server Selection\" page and click \"Next\". - Deselect \"Telnet Client\" on the \"Features\" page. - Click \"Next\" and \"Remove\" as prompted." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000096-GPOS-00050" - tag gid: "V-93423" - tag rid: "SV-103509r1_rule" - tag stig_id: "WN19-00-000360" - tag fix_id: "F-99667r1_fix" - tag cci: ["CCI-000382"] - tag nist: ["CM-7 b", "Rev_4"] - - describe windows_feature('Telnet-Client') do - it { should_not be_installed } - end -end \ No newline at end of file diff --git a/controls/V-93425.rb b/controls/V-93425.rb deleted file mode 100644 index dad3239..0000000 --- a/controls/V-93425.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93425" do - title "Windows Server 2019 must not save passwords in the Remote Desktop Client." - desc "Saving passwords in the Remote Desktop Client could allow an unauthorized user to establish a remote desktop session to another system. The system must be configured to prevent users from saving passwords in the Remote Desktop Client." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ - - Value Name: DisablePasswordSaving - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Connection Client >> \"Do not allow passwords to be saved\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93425" - tag rid: "SV-103511r1_rule" - tag stig_id: "WN19-CC-000340" - tag fix_id: "F-99669r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services') do - it { should have_property 'DisablePasswordSaving' } - its('DisablePasswordSaving') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93427.rb b/controls/V-93427.rb deleted file mode 100644 index b8d0be0..0000000 --- a/controls/V-93427.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93427" do - title "Windows Server 2019 Remote Desktop Services must always prompt a client for passwords upon connection." - desc "This setting controls the ability of users to supply passwords automatically as part of their remote desktop connection. Disabling this setting would allow anyone to use the stored credentials in a connection item to connect to the terminal server." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ - - Value Name: fPromptForPassword - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Session Host >> Security >> \"Always prompt for password upon connection\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93427" - tag rid: "SV-103513r1_rule" - tag stig_id: "WN19-CC-000360" - tag fix_id: "F-99671r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows NT\\Terminal Services') do - it { should have_property 'fPromptForPassword' } - its('fPromptForPassword') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93429.rb b/controls/V-93429.rb deleted file mode 100644 index 198d916..0000000 --- a/controls/V-93429.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93429" do - title "Windows Server 2019 Windows Remote Management (WinRM) service must not store RunAs credentials." - desc "Storage of administrative credentials could allow unauthorized access. Disallowing the storage of RunAs credentials for Windows Remote Management will prevent them from being used with plug-ins." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ - - Value Name: DisableRunAs - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Disallow WinRM from storing RunAs credentials\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93429" - tag rid: "SV-103515r1_rule" - tag stig_id: "WN19-CC-000520" - tag fix_id: "F-99673r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service') do - it { should have_property 'DisableRunAs' } - its('DisableRunAs') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93431.rb b/controls/V-93431.rb deleted file mode 100644 index 9730ff8..0000000 --- a/controls/V-93431.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93431" do - title "Windows Server 2019 User Account Control approval mode for the built-in Administrator must be enabled." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures the built-in Administrator account so that it runs in Admin Approval Mode." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: FilterAdministratorToken - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Admin Approval Mode for the Built-in Administrator account\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93431" - tag rid: "SV-103517r1_rule" - tag stig_id: "WN19-SO-000380" - tag fix_id: "F-99675r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'FilterAdministratorToken' } - its('FilterAdministratorToken') { should cmp == 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93433.rb b/controls/V-93433.rb deleted file mode 100644 index cbbd3f9..0000000 --- a/controls/V-93433.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93433" do - title "Windows Server 2019 User Account Control must automatically deny standard user requests for elevation." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting controls the behavior of elevation when requested by a standard user account." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: ConsentPromptBehaviorUser - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Behavior of the elevation prompt for standard users\" to \"Automatically deny elevation requests\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93433" - tag rid: "SV-103519r1_rule" - tag stig_id: "WN19-SO-000410" - tag fix_id: "F-99677r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'ConsentPromptBehaviorUser' } - its('ConsentPromptBehaviorUser') { should cmp == 0 } - end - end -end \ No newline at end of file diff --git a/controls/V-93435.rb b/controls/V-93435.rb deleted file mode 100644 index e9e99b6..0000000 --- a/controls/V-93435.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93435" do - title "Windows Server 2019 User Account Control must run all administrators in Admin Approval Mode, enabling UAC." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting enables UAC." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: EnableLUA - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Run all administrators in Admin Approval Mode\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000373-GPOS-00157" - tag satisfies: ["SRG-OS-000373-GPOS-00157", "SRG-OS-000373-GPOS-00156"] - tag gid: "V-93435" - tag rid: "SV-103521r1_rule" - tag stig_id: "WN19-SO-000440" - tag fix_id: "F-99679r1_fix" - tag cci: ["CCI-002038"] - tag nist: ["IA-11", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'EnableLUA' } - its('EnableLUA') { should cmp == 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93437.rb b/controls/V-93437.rb deleted file mode 100644 index 197494c..0000000 --- a/controls/V-93437.rb +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: UTF-8 - -control "V-93437" do - title "Windows Server 2019 shared user accounts must not be permitted." - desc "Shared accounts (accounts where two or more people log on with the same user identification) do not provide adequate identification and authentication. There is no way to provide for nonrepudiation or individual accountability for system access and resource usage." - desc "rationale", "" - desc "check", "Determine whether any shared accounts exist. If no shared accounts exist, this is NA. - - Shared accounts, such as required by an application, may be approved by the organization. This must be documented with the ISSO. Documentation must include the reason for the account, who has access to the account, and how the risk of using the shared account is mitigated to include monitoring account activity. - - If unapproved shared accounts exist, this is a finding." - desc "fix", "Remove unapproved shared accounts from the system. - - Document required shared accounts with the ISSO. Documentation must include the reason for the account, who has access to the account, and how the risk of using the shared account is mitigated to include monitoring account activity." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000104-GPOS-00051" - tag gid: "V-93437" - tag rid: "SV-103523r1_rule" - tag stig_id: "WN19-00-000070" - tag fix_id: "F-99681r1_fix" - tag cci: ["CCI-000764"] - tag nist: ["IA-2", "Rev_4"] - - describe 'This control needs to be check manually' do - skip 'Control not executed as this test is manual' - end -end \ No newline at end of file diff --git a/controls/V-93439.rb b/controls/V-93439.rb deleted file mode 100644 index af50f53..0000000 --- a/controls/V-93439.rb +++ /dev/null @@ -1,50 +0,0 @@ -# encoding: UTF-8 - -control "V-93439" do - title "Windows Server 2019 accounts must require passwords." - desc "The lack of password protection enables anyone to gain access to the information system, which opens a backdoor opportunity for intruders to compromise the system as well as other resources. Accounts on a system must require passwords." - desc "rationale", "" - desc "check", "Review the password required status for enabled user accounts. - Open \"PowerShell\". - - Domain Controllers: - Enter \"Get-Aduser -Filter * -Properties Passwordnotrequired |FT Name, Passwordnotrequired, Enabled\". - Exclude disabled accounts (e.g., DefaultAccount, Guest) and Trusted Domain Objects (TDOs). - If \"Passwordnotrequired\" is \"True\" or blank for any enabled user account, this is a finding. - - Member servers and standalone systems: - Enter 'Get-CimInstance -Class Win32_Useraccount -Filter \"PasswordRequired=False and LocalAccount=True\" | FT Name, PasswordRequired, Disabled, LocalAccount'. - Exclude disabled accounts (e.g., DefaultAccount, Guest). - If any enabled user accounts are returned with a \"PasswordRequired\" status of \"False\", this is a finding." - desc "fix", "Configure all enabled accounts to require passwords. - The password required flag can be set by entering the following on a command line: \"Net user [username] /passwordreq:yes\", substituting [username] with the name of the user account." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000104-GPOS-00051" - tag gid: "V-93439" - tag rid: "SV-103525r2_rule" - tag stig_id: "WN19-00-000200" - tag fix_id: "F-99683r1_fix" - tag cci: ["CCI-000764"] - tag nist: ["IA-2", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - ad_accounts = json({ command: "Get-ADUser -Filter \"(Enabled -eq $true) -And (PasswordNotRequired -eq $true)\" | Select -ExpandProperty Name | ConvertTo-Json" }).params - describe 'AD Accounts' do - it 'AD should not have any Accounts that have Password Not Required' do - failure_message = "Users that have Password Not Required: #{ad_accounts}" - expect(ad_accounts).to be_empty, failure_message - end - end - else - local_accounts = json({ command: "Get-CimInstance -Class Win32_Useraccount -Filter 'PasswordRequired=False and LocalAccount=True and Disabled=False' | Select -ExpandProperty Name | ConvertTo-Json" }).params - describe "Account or Accounts exists" do - it 'Server should not have Accounts with No Password Set' do - failure_message = "User or Users that have no Password Set: #{local_accounts}" - expect(local_accounts).to be_empty, failure_message - end - end - end -end \ No newline at end of file diff --git a/controls/V-93441.rb b/controls/V-93441.rb deleted file mode 100644 index e8441de..0000000 --- a/controls/V-93441.rb +++ /dev/null @@ -1,55 +0,0 @@ -# encoding: UTF-8 - -control "V-93441" do - title "Windows Server 2019 Active Directory user accounts, including administrators, must be configured to require the use of a Common Access Card (CAC), Personal Identity Verification (PIV)-compliant hardware token, or Alternate Logon Token (ALT) for user authentication." - desc "Smart cards such as the CAC support a two-factor authentication technique. This provides a higher level of trust in the asserted identity than use of the username and password for authentication." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Open \"PowerShell\". - Enter the following: - \"Get-ADUser -Filter {(Enabled -eq $True) -and (SmartcardLogonRequired -eq $False)} | FT Name\" - (\"DistinguishedName\" may be substituted for \"Name\" for more detailed output.) - If any user accounts, including administrators, are listed, this is a finding. - - Alternately: - To view sample accounts in \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"): - Select the Organizational Unit (OU) where the user accounts are located. (By default, this is the Users node; however, accounts may be under other organization-defined OUs.) - Right-click the sample user account and select \"Properties\". - Select the \"Account\" tab. - If any user accounts, including administrators, do not have \"Smart card is required for interactive logon\" checked in the \"Account Options\" area, this is a finding." - desc "fix", "Configure all user accounts, including administrator accounts, in Active Directory to enable the option \"Smart card is required for interactive logon\". - - Run \"Active Directory Users and Computers\" (available from various menus or run \"dsa.msc\"): - Select the OU where the user accounts are located. (By default this is the Users node; however, accounts may be under other organization-defined OUs.) - Right-click the user account and select \"Properties\". - Select the \"Account\" tab. - Check \"Smart card is required for interactive logon\" in the \"Account Options\" area." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000105-GPOS-00052" - tag satisfies: ["SRG-OS-000105-GPOS-00052", "SRG-OS-000106-GPOS-00053", "SRG-OS-000107-GPOS-00054", "SRG-OS-000108-GPOS-00055", "SRG-OS-000375-GPOS-00160"] - tag gid: "V-93441" - tag rid: "SV-103527r1_rule" - tag stig_id: "WN19-DC-000310" - tag fix_id: "F-99685r1_fix" - tag cci: ["CCI-000765", "CCI-000766", "CCI-000767", "CCI-000768", "CCI-001948"] - tag nist: ["IA-2 (1)", "IA-2 (2)", "IA-2 (3)", "IA-2 (4)", "IA-2 (11)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - accounts = json(command: "Get-ADUser -Filter {(Enabled -eq $True) -and (SmartcardLogonRequired -eq $False)} | Select -ExpandProperty Name | ConvertTo-Json").params - describe 'Accounts without smartcard logon required' do - it 'Accounts must be configured to require the use of a CAC, PIV or ALT' do - failure_message = "#{accounts}" - expect(accounts).to be_empty, failure_message - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93443.rb b/controls/V-93443.rb deleted file mode 100644 index b1713a9..0000000 --- a/controls/V-93443.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93443" do - title "Windows Server 2019 Kerberos user logon restrictions must be enforced." - desc "This policy setting determines whether the Kerberos Key Distribution Center (KDC) validates every request for a session ticket against the user rights policy of the target computer. The policy is enabled by default, which is the most secure setting for validating that access to target resources is not circumvented." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Verify the following is configured in the Default Domain Policy: - Open \"Group Policy Management\". - Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). - Right-click on the \"Default Domain Policy\". - Select \"Edit\". - Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. - - If the \"Enforce user logon restrictions\" is not set to \"Enabled\", this is a finding." - desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Enforce user logon restrictions\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000112-GPOS-00057" - tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] - tag gid: "V-93443" - tag rid: "SV-103529r1_rule" - tag stig_id: "WN19-DC-000020" - tag fix_id: "F-99687r1_fix" - tag cci: ["CCI-001941", "CCI-001942"] - tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('TicketValidateClient') { should eq 1 } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93445.rb b/controls/V-93445.rb deleted file mode 100644 index 0c9c516..0000000 --- a/controls/V-93445.rb +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: UTF-8 - -control "V-93445" do - title "Windows Server 2019 Kerberos service ticket maximum lifetime must be limited to 600 minutes or less." - desc "This setting determines the maximum amount of time (in minutes) that a granted session ticket can be used to access a particular service. Session tickets are used only to authenticate new connections with servers. Ongoing operations are not interrupted if the session ticket used to authenticate the connection expires during the connection." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Verify the following is configured in the Default Domain Policy: - Open \"Group Policy Management\". - Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). - Right-click on the \"Default Domain Policy\". - Select \"Edit\". - Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. - If the value for \"Maximum lifetime for service ticket\" is \"0\" or greater than \"600\" minutes, this is a finding." - desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for service ticket\" to a maximum of \"600\" minutes, but not \"0\", which equates to \"Ticket doesn't expire\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000112-GPOS-00057" - tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] - tag gid: "V-93445" - tag rid: "SV-103531r1_rule" - tag stig_id: "WN19-DC-000030" - tag fix_id: "F-99689r1_fix" - tag cci: ["CCI-001941", "CCI-001942"] - tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('MaxServiceAge') { should be_between(0,600) } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93447.rb b/controls/V-93447.rb deleted file mode 100644 index 65b8228..0000000 --- a/controls/V-93447.rb +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: UTF-8 - -control "V-93447" do - title "Windows Server 2019 Kerberos user ticket lifetime must be limited to 10 hours or less." - desc "In Kerberos, there are two types of tickets: Ticket Granting Tickets (TGTs) and Service Tickets. Kerberos tickets have a limited lifetime so the time an attacker has to implement an attack is limited. This policy controls how long TGTs can be renewed. With Kerberos, the user's initial authentication to the domain controller results in a TGT, which is then used to request Service Tickets to resources. Upon startup, each computer gets a TGT before requesting a service ticket to the domain controller and any other computers it needs to access. For services that start up under a specified user account, users must always get a TGT first and then get Service Tickets to all computers and services accessed." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Verify the following is configured in the Default Domain Policy: - Open \"Group Policy Management\". - Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). - Right-click on the \"Default Domain Policy\". - Select \"Edit\". - Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. - If the value for \"Maximum lifetime for user ticket\" is \"0\" or greater than \"10\" hours, this is a finding." - desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for user ticket\" to a maximum of \"10\" hours but not \"0\", which equates to \"Ticket doesn't expire\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000112-GPOS-00057" - tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] - tag gid: "V-93447" - tag rid: "SV-103533r1_rule" - tag stig_id: "WN19-DC-000040" - tag fix_id: "F-99691r1_fix" - tag cci: ["CCI-001941", "CCI-001942"] - tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('MaxTicketAge') { should be_between(1, 10) } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93449.rb b/controls/V-93449.rb deleted file mode 100644 index a9088e5..0000000 --- a/controls/V-93449.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93449" do - title "Windows Server 2019 Kerberos policy user ticket renewal maximum lifetime must be limited to seven days or less." - desc "This setting determines the period of time (in days) during which a user's Ticket Granting Ticket (TGT) may be renewed. This security configuration limits the amount of time an attacker has to crack the TGT and gain access." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Verify the following is configured in the Default Domain Policy: - Open \"Group Policy Management\". - Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). - Right-click on the \"Default Domain Policy\". - Select \"Edit\". - Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. - - If the \"Maximum lifetime for user ticket renewal\" is greater than \"7\" days, this is a finding." - desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum lifetime for user ticket renewal\" to a maximum of \"7\" days or less." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000112-GPOS-00057" - tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] - tag gid: "V-93449" - tag rid: "SV-103535r1_rule" - tag stig_id: "WN19-DC-000050" - tag fix_id: "F-99693r1_fix" - tag cci: ["CCI-001941", "CCI-001942"] - tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('MaxRenewAge') { should be <= 7 } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93451.rb b/controls/V-93451.rb deleted file mode 100644 index d21b1b3..0000000 --- a/controls/V-93451.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93451" do - title "Windows Server 2019 computer clock synchronization tolerance must be limited to five minutes or less." - desc "This setting determines the maximum time difference (in minutes) that Kerberos will tolerate between the time on a client's clock and the time on a server's clock while still considering the two clocks synchronous. In order to prevent replay attacks, Kerberos uses timestamps as part of its protocol definition. For timestamps to work properly, the clocks of the client and the server need to be in sync as much as possible." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - Verify the following is configured in the Default Domain Policy: - - Open \"Group Policy Management\". - Navigate to \"Group Policy Objects\" in the Domain being reviewed (Forest >> Domains >> Domain). - Right-click on the \"Default Domain Policy\". - Select \"Edit\". - Navigate to Computer Configuration >> Policies >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy. - - If the \"Maximum tolerance for computer clock synchronization\" is greater than \"5\" minutes, this is a finding." - desc "fix", "Configure the policy value in the Default Domain Policy for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Kerberos Policy >> \"Maximum tolerance for computer clock synchronization\" to a maximum of \"5\" minutes or less." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000112-GPOS-00057" - tag satisfies: ["SRG-OS-000112-GPOS-00057", "SRG-OS-000113-GPOS-00058"] - tag gid: "V-93451" - tag rid: "SV-103537r1_rule" - tag stig_id: "WN19-DC-000060" - tag fix_id: "F-99695r1_fix" - tag cci: ["CCI-001941", "CCI-001942"] - tag nist: ["IA-2 (8)", "IA-2 (9)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe security_policy do - its('MaxClockSkew') { should be <= 5 } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93453.rb b/controls/V-93453.rb deleted file mode 100644 index 495b2d9..0000000 --- a/controls/V-93453.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93453" do - title "Windows Server 2019 must restrict unauthenticated Remote Procedure Call (RPC) clients from connecting to the RPC server on domain-joined member servers and standalone systems." - desc "Unauthenticated RPC clients may allow anonymous access to sensitive information. Configuring RPC to restrict unauthenticated RPC clients from connecting to the RPC server will prevent anonymous connections." - desc "rationale", "" - desc "check", "This applies to member servers and standalone systems, it is NA for domain controllers. - - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Rpc\\ - - Value Name: RestrictRemoteClients - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> System >> Remote Procedure Call >> \"Restrict Unauthenticated RPC clients\" to \"Enabled\" with \"Authenticated\" selected." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000379-GPOS-00164" - tag gid: "V-93453" - tag rid: "SV-103539r1_rule" - tag stig_id: "WN19-MS-000040" - tag fix_id: "F-99697r1_fix" - tag cci: ["CCI-001967"] - tag nist: ["IA-3 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Rpc') do - it { should have_property 'RestrictRemoteClients' } - its('RestrictRemoteClients') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93455.rb b/controls/V-93455.rb deleted file mode 100644 index 6d55b1a..0000000 --- a/controls/V-93455.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93455" do - title "Windows Server 2019 computer account password must not be prevented from being reset." - desc "Computer account passwords are changed automatically on a regular basis. Disabling automatic password changes can make the system more vulnerable to malicious access. Frequent password changes can be a significant safeguard for the system. A new password for the computer account will be generated every 30 days." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: DisablePasswordChange - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Disable machine account password changes\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000379-GPOS-00164" - tag gid: "V-93455" - tag rid: "SV-103541r1_rule" - tag stig_id: "WN19-SO-000090" - tag fix_id: "F-99699r1_fix" - tag cci: ["CCI-001967"] - tag nist: ["IA-3 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'DisablePasswordChange' } - its('DisablePasswordChange') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93457.rb b/controls/V-93457.rb deleted file mode 100644 index 8c337f7..0000000 --- a/controls/V-93457.rb +++ /dev/null @@ -1,103 +0,0 @@ -# encoding: UTF-8 - -control 'V-93457' do - title 'Windows Server 2019 outdated or unused accounts must be removed or disabled.' - desc 'Outdated or unused accounts provide penetration points that may go undetected. Inactive accounts must be deleted if no longer necessary or, if still required, disabled until needed.' - desc 'rationale', '' - desc 'check', "Open \"Windows PowerShell\". - - Domain Controllers: - Enter \"Search-ADAccount -AccountInactive -UsersOnly -TimeSpan #{input('unused_account_age')}.00:00:00\" - This will return accounts that have not been logged on to for #{input('unused_account_age')} days, along with various attributes such as the Enabled status and LastLogonDate. - - Member servers and standalone systems: - Copy or enter the lines below to the PowerShell window and enter. (Entering twice may be required. Do not include the quotes at the beginning and end of the query.) - \"([ADSI]('WinNT://{0}' -f $env:COMPUTERNAME)).Children | Where { $_.SchemaClassName -eq 'user' } | ForEach { - $user = ([ADSI]$_.Path) - $lastLogin = $user.Properties.LastLogin.Value - $enabled = ($user.Properties.UserFlags.Value -band 0x2) -ne 0x2 - if ($lastLogin -eq $null) { - $lastLogin = 'Never' - } - Write-Host $user.Name $lastLogin $enabled - }\" - This will return a list of local accounts with the account name, last logon, and if the account is enabled (True/False). - For example: User1 10/31/2015 5:49:56 AM True - Review the list of accounts returned by the above queries to determine the finding validity for each account reported. - - Exclude the following accounts: - - Built-in administrator account (Renamed, SID ending in 500) - - Built-in guest account (Renamed, Disabled, SID ending in 501) - - Application accounts - - If any enabled accounts have not been logged on to within the past #{input('unused_account_age')} days, this is a finding. - - Inactive accounts that have been reviewed and deemed to be required must be documented with the ISSO." - desc 'fix', "Regularly review accounts to determine if they are still active. Remove or disable accounts that have not been used in the last #{input('unused_account_age')} days." - impact 0.5 - tag severity: nil - tag gtitle: 'SRG-OS-000118-GPOS-00060' - tag gid: 'V-93457' - tag rid: 'SV-103543r1_rule' - tag stig_id: 'WN19-00-000190' - tag fix_id: 'F-99701r1_fix' - tag cci: ['CCI-000795'] - tag nist: ['IA-4 e', 'Rev_4'] - - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - age = input('unused_account_age') - untracked_accounts = [] - - if domain_role == '4' || domain_role == '5' - - excluded_accounts_domain_check = json(command: 'Get-ADUser -Filter * | Where {($_.SID -like "*-500") -or ($_.SID -like "*-501")} | Select Name | ConvertTo-Json').params - excluded_accounts_domain = [] - excluded_accounts_domain_check.each { |account| excluded_accounts_domain << account["Name"] } - - ad_accounts = json({ command: "Search-ADAccount -AccountInactive -UsersOnly -Timespan #{age}.00:00:00 | Where -Property Enabled -eq $True | Select -ExpandProperty Name | ConvertTo-Json" }).params - unless ad_accounts.empty? - case ad_accounts - when String - (ad_account = []) << ad_accounts - untracked_accounts = ad_account - input('application_accounts_domain') - excluded_accounts_domain - when Array - untracked_accounts = ad_accounts - input('application_accounts_domain') - excluded_accounts_domain - end - end - - describe 'AD Accounts' do - it "AD should not have any Accounts that are Inactive over #{age} days" do - failure_message = "User(s) that have not logged into system in #{age} days #{untracked_accounts}" - expect(untracked_accounts).to be_empty, failure_message - end - end - - else - - excluded_accounts_local_check = json(command: 'Get-LocalUser | Where {($_.SID -like "*-500") -or ($_.SID -like "*-501")} | Select Name | ConvertTo-Json').params - excluded_accounts_local = [] - excluded_accounts_local_check.each do |account| - excluded_accounts_local << account["Name"] - end - - local_accounts = json({ command: "Get-LocalUser | Where-Object {$_.Enabled -eq 'True' -and $_.Lastlogon -le (Get-Date).AddDays(-#{age}) } | Select -ExpandProperty Name | ConvertTo-Json" }).params - - unless local_accounts.empty? - case local_accounts - when String - (local_account = []) << local_accounts - untracked_accounts = local_account - input('application_accounts_local') - excluded_accounts_local - when Array - untracked_accounts = local_accounts - input('application_accounts_local') - excluded_accounts_local - end - end - - describe 'Inactive account or accounts exists' do - it 'Server should not have inactive accounts' do - failure_message = "User(s) that have not logged into system in #{age} days: #{local_accounts}" - expect(local_accounts).to be_empty, failure_message - end - end - end -end \ No newline at end of file diff --git a/controls/V-93459.rb b/controls/V-93459.rb deleted file mode 100644 index 08f4599..0000000 --- a/controls/V-93459.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93459" do - title "Windows Server 2019 must have the built-in Windows password complexity policy enabled." - desc "The use of complex passwords increases their strength against attack. The built-in Windows password complexity policy requires passwords to contain at least three of the four types of characters (numbers, uppercase and lowercase letters, and special characters) and prevents the inclusion of user names or parts of user names." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for \"Password must meet complexity requirements\" is not set to \"Enabled\", this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"PasswordComplexity\" equals \"0\" in the file, this is a finding. - - Note: If an external password filter is in use that enforces all four character types and requires this setting to be set to \"Disabled\", this would not be considered a finding. If this setting does not affect the use of an external password filter, it must be enabled for fallback purposes." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Password must meet complexity requirements\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000069-GPOS-00037" - tag satisfies: ["SRG-OS-000069-GPOS-00037", "SRG-OS-000070-GPOS-00038", "SRG-OS-000071-GPOS-00039", "SRG-OS-000266-GPOS-00101"] - tag gid: "V-93459" - tag rid: "SV-103545r1_rule" - tag stig_id: "WN19-AC-000080" - tag fix_id: "F-99703r1_fix" - tag cci: ["CCI-000192", "CCI-000193", "CCI-000194", "CCI-001619"] - tag nist: ["IA-5 (1) (a)", "IA-5 (1) (a)", "IA-5 (1) (a)", "IA-5 (1) (a)", "Rev_4"] - - describe security_policy do - its('PasswordComplexity') { should eq input('enable_password_complexity') } - end -end \ No newline at end of file diff --git a/controls/V-93461.rb b/controls/V-93461.rb deleted file mode 100644 index acad751..0000000 --- a/controls/V-93461.rb +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: UTF-8 - -control "V-93461" do - title "Windows Server 2019 manually managed application account passwords must be at least #{input('minimum_password_length_manual')} characters in length." - desc "Application/service account passwords must be of sufficient length to prevent being easily cracked. Application/service accounts that are manually managed must have passwords at least #{input('minimum_password_length_manual')} characters in length." - desc "rationale", "" - desc "check", "Determine if manually managed application/service accounts exist. If none exist, this is NA. - - Verify the organization has a policy to ensure passwords for manually managed application/service accounts are at least #{input('minimum_password_length_manual')} characters in length. - - If such a policy does not exist or has not been implemented, this is a finding." - desc "fix", "Establish a policy that requires application/service account passwords that are manually managed to be at least #{input('minimum_password_length_manual')} characters in length. Ensure the policy is enforced." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000078-GPOS-00046" - tag gid: "V-93461" - tag rid: "SV-103547r1_rule" - tag stig_id: "WN19-00-000050" - tag fix_id: "F-99705r1_fix" - tag cci: ["CCI-000205"] - tag nist: ["IA-5 (1) (a)", "Rev_4"] - - mplm = input('minimum_password_length_manual') - - describe 'Please Check all Accounts that are used for Services or Applications to validate they meet the Password Length Policy, Control is a Manual Check' do - skip "Determine if manually managed application/service accounts exist. If none exist, this is NA. Verify the organization has a policy to ensure passwords for manually managed application/service accounts are at least #{mplm} characters in length." - end -end diff --git a/controls/V-93463.rb b/controls/V-93463.rb deleted file mode 100644 index 3e94b7f..0000000 --- a/controls/V-93463.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: UTF-8 - -control "V-93463" do - title "Windows Server 2019 minimum password length must be configured to #{input('minimum_password_length')} characters." - desc "Information systems not protected with strong password schemes (including passwords of minimum length) provide the opportunity for anyone to crack the password, thus gaining access to the system and compromising the device, information, or the local network." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for the \"Minimum password length,\" is less than \"#{input('minimum_password_length')}\" characters, this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"MinimumPasswordLength\" is less than \"#{input('minimum_password_length')}\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Minimum password length\" to \"#{input('minimum_password_length')}\" characters." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000078-GPOS-00046" - tag gid: "V-93463" - tag rid: "SV-103549r1_rule" - tag stig_id: "WN19-AC-000070" - tag fix_id: "F-99707r1_fix" - tag cci: ["CCI-000205"] - tag nist: ["IA-5 (1) (a)", "Rev_4"] - - describe security_policy do - its('MinimumPasswordLength') { should be >= input('minimum_password_length')} - end -end \ No newline at end of file diff --git a/controls/V-93465.rb b/controls/V-93465.rb deleted file mode 100644 index bfc6db1..0000000 --- a/controls/V-93465.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93465" do - title "Windows Server 2019 reversible password encryption must be disabled." - desc "Storing passwords using reversible encryption is essentially the same as storing clear-text versions of the passwords, which are easily compromised. For this reason, this policy must never be enabled." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for \"Store passwords using reversible encryption\" is not set to \"Disabled\", this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"ClearTextPassword\" equals \"1\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Store passwords using reversible encryption\" to \"Disabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000073-GPOS-00041" - tag gid: "V-93465" - tag rid: "SV-103551r1_rule" - tag stig_id: "WN19-AC-000090" - tag fix_id: "F-99709r1_fix" - tag cci: ["CCI-000196"] - tag nist: ["IA-5 (1) (c)", "Rev_4"] - - describe security_policy do - its('ClearTextPassword') { should eq 0 } - end -end \ No newline at end of file diff --git a/controls/V-93467.rb b/controls/V-93467.rb deleted file mode 100644 index 70a8d1d..0000000 --- a/controls/V-93467.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93467" do - title "Windows Server 2019 must be configured to prevent the storage of the LAN Manager hash of passwords." - desc "The LAN Manager hash uses a weak encryption algorithm and there are several tools available that use this hash to retrieve account passwords. This setting controls whether a LAN Manager hash of the password is stored in the SAM the next time the password is changed." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: NoLMHash - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Do not store LAN Manager hash value on next password change\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000073-GPOS-00041" - tag gid: "V-93467" - tag rid: "SV-103553r1_rule" - tag stig_id: "WN19-SO-000300" - tag fix_id: "F-99711r1_fix" - tag cci: ["CCI-000196"] - tag nist: ["IA-5 (1) (c)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'NoLMHash' } - its('NoLMHash') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93469.rb b/controls/V-93469.rb deleted file mode 100644 index ac346dd..0000000 --- a/controls/V-93469.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93469" do - title "Windows Server 2019 unencrypted passwords must not be sent to third-party Server Message Block (SMB) servers." - desc "Some non-Microsoft SMB servers only support unencrypted (plain-text) password authentication. Sending plain-text passwords across the network when authenticating to an SMB server reduces the overall security of the environment. Check with the vendor of the SMB server to determine if there is a way to support encrypted password authentication." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ - - Value Name: EnablePlainTextPassword - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft Network Client: Send unencrypted password to third-party SMB servers\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000074-GPOS-00042" - tag gid: "V-93469" - tag rid: "SV-103555r1_rule" - tag stig_id: "WN19-SO-000180" - tag fix_id: "F-99713r1_fix" - tag cci: ["CCI-000197"] - tag nist: ["IA-5 (1) (c)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do - it { should have_property 'EnablePlainTextPassword' } - its('EnablePlainTextPassword') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93471.rb b/controls/V-93471.rb deleted file mode 100644 index 22aa492..0000000 --- a/controls/V-93471.rb +++ /dev/null @@ -1,29 +0,0 @@ -# encoding: UTF-8 - -control "V-93471" do - title "Windows Server 2019 minimum password age must be configured to at least one day." - desc "Permitting passwords to be changed in immediate succession within the same day allows users to cycle passwords through their history database. This enables users to effectively negate the purpose of mandating periodic password changes." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for the \"Minimum password age\" is set to \"0\" days (\"Password can be changed immediately\"), this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"MinimumPasswordAge\" equals \"0\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Minimum password age\" to at least \"1\" day." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000075-GPOS-00043" - tag gid: "V-93471" - tag rid: "SV-103557r1_rule" - tag stig_id: "WN19-AC-000060" - tag fix_id: "F-99715r1_fix" - tag cci: ["CCI-000198"] - tag nist: ["IA-5 (1) (d)", "Rev_4"] - - describe security_policy do - its('MinimumPasswordAge') { should be >= input('minimum_password_age') } - end -end \ No newline at end of file diff --git a/controls/V-93473.rb b/controls/V-93473.rb deleted file mode 100644 index b968129..0000000 --- a/controls/V-93473.rb +++ /dev/null @@ -1,60 +0,0 @@ -# encoding: UTF-8 - -control "V-93473" do - title "Windows Server 2019 passwords for the built-in Administrator account must be changed at least every 60 days." - desc "The longer a password is in use, the greater the opportunity for someone to gain unauthorized knowledge of the password. The built-in Administrator account is not generally used and its password not may be changed as frequently as necessary. Changing the password for the built-in Administrator account on a regular basis will limit its exposure. - Organizations that use an automated tool, such Microsoft's Local Administrator Password Solution (LAPS), on domain-joined systems can configure this to occur more frequently. LAPS will change the password every \"30\" days by default." - desc "rationale", "" - desc "check", "Review the password last set date for the built-in Administrator account. - - Domain controllers: - Open \"PowerShell\". - Enter \"Get-ADUser -Filter * -Properties SID, PasswordLastSet | Where SID -Like \"*-500\" | Ft Name, SID, PasswordLastSet\". - If the \"PasswordLastSet\" date is greater than \"60\" days old, this is a finding. - - Member servers and standalone systems: - Open \"Command Prompt\". - Enter 'Net User [account name] | Find /i \"Password Last Set\"', where [account name] is the name of the built-in administrator account. - (The name of the built-in Administrator account must be changed to something other than \"Administrator\" per STIG requirements.) - If the \"PasswordLastSet\" date is greater than \"60\" days old, this is a finding." - desc "fix", "Change the built-in Administrator account password at least every \"60\" days. - Automated tools, such as Microsoft's LAPS, may be used on domain-joined member servers to accomplish this." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000076-GPOS-00044" - tag gid: "V-93473" - tag rid: "SV-103559r1_rule" - tag stig_id: "WN19-00-000020" - tag fix_id: "F-99717r1_fix" - tag cci: ["CCI-000199"] - tag nist: ["IA-5 (1) (d)", "Rev_4"] - - administrator = input('local_administrator') - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - password_set_date = json({ command: "Get-ADUser -Filter * -Properties SID, PasswordLastSet | Where-Object {$_.SID -like '*-500' -and $_.PasswordLastSet -lt ((Get-Date).AddDays(-60))} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json" }) - date = password_set_date["DateTime"] - describe "Password Last Set Date" do - it "The built-in Administrator account must be changed at least every 60 days." do - expect(date).to be_nil - end - end - else - if administrator == "Administrator" - describe 'The name of the built-in Administrator account:' do - it 'It must be changed to something other than "Administrator" per STIG requirements' do - failure_message = "Change the built-in Administrator account name to something other than: #{administrator}" - expect(administrator).not_to eq("Administrator"), failure_message - end - end - end - local_password_set_date = json({ command: "Get-LocalUser -name #{administrator} | Where-Object {$_.PasswordLastSet -le (Get-Date).AddDays(-60)} | Select-Object -ExpandProperty PasswordLastSet | ConvertTo-Json"}) - local_date = local_password_set_date["DateTime"] - describe "Password Last Set Date" do - it "The built-in Administrator account must be changed at least every 60 days." do - expect(local_date).to be_nil - end - end - end -end \ No newline at end of file diff --git a/controls/V-93475.rb b/controls/V-93475.rb deleted file mode 100644 index 78be128..0000000 --- a/controls/V-93475.rb +++ /dev/null @@ -1,70 +0,0 @@ -# encoding: UTF-8 - -control 'V-93475' do - title 'Windows Server 2019 passwords must be configured to expire.' - desc 'Passwords that do not expire or are reused increase the exposure of a password with greater probability of being discovered or cracked.' - desc 'rationale', '' - desc 'check', "Review the password never expires status for enabled user accounts. - Open \"PowerShell\". - - Domain Controllers: - Enter \"Search-ADAccount -PasswordNeverExpires -UsersOnly | FT Name, PasswordNeverExpires, Enabled\". - Exclude application accounts, disabled accounts (e.g., DefaultAccount, Guest) and the krbtgt account. - If any enabled user accounts are returned with a \"PasswordNeverExpires\" status of \"True\", this is a finding. - - Member servers and standalone systems: - Enter 'Get-CimInstance -Class Win32_Useraccount -Filter \"PasswordExpires=False and LocalAccount=True\" | FT Name, PasswordExpires, Disabled, LocalAccount'. - Exclude application accounts and disabled accounts (e.g., DefaultAccount, Guest). - If any enabled user accounts are returned with a \"PasswordExpires\" status of \"False\", this is a finding." - desc 'fix', "Configure all enabled user account passwords to expire. - Uncheck \"Password never expires\" for all enabled user accounts in Active Directory Users and Computers for domain accounts and Users in Computer Management for member servers and standalone systems. Document any exceptions with the ISSO." - impact 0.5 - tag severity: nil - tag gtitle: 'SRG-OS-000076-GPOS-00044' - tag gid: 'V-93475' - tag rid: 'SV-103561r1_rule' - tag stig_id: 'WN19-00-000210' - tag fix_id: 'F-99719r1_fix' - tag cci: ['CCI-000199'] - tag nist: ['IA-5 (1) (d)', 'Rev_4'] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - untracked_accounts = [] - - if domain_role == '4' || domain_role == '5' - ad_accounts = json({ command: "Search-ADAccount -PasswordNeverExpires -UsersOnly | Where-Object {$_.PasswordNeverExpires -eq 'True' -and $_.Enabled -eq 'True'} | Select -ExpandProperty Name | ConvertTo-Json" }).params - - application_accounts = input('application_accounts_domain') - excluded_accounts = input('excluded_accounts_domain') - - unless ad_accounts.empty? - ad_accounts = [ad_accounts] if ad_accounts.class == String - untracked_accounts = ad_accounts - application_accounts - excluded_accounts - end - - describe 'Untracked Accounts' do - it 'No Enabled Domain Account should be set to have Password Never Expire' do - failure_message = "Users Accounts are set to Password Never Expire: #{untracked_accounts}" - expect(untracked_accounts).to be_empty, failure_message - end - end - else - local_accounts = json({ command: "Get-CimInstance -Class Win32_Useraccount -Filter 'PasswordExpires=False and LocalAccount=True and Disabled=False' | Select -ExpandProperty Name | ConvertTo-Json" }).params - - application_accounts = input('application_accounts_local') - - excluded_accounts = input('excluded_accounts_local') - - unless local_accounts.empty? - local_accounts = [local_accounts] if local_accounts.class == String - untracked_accounts = local_accounts - application_accounts - excluded_accounts - end - - describe 'Account or Accounts exists' do - it 'Server should not have Accounts with Password Never Expire' do - failure_message = "User or Users have Password set to not expire: #{untracked_accounts}" - expect(untracked_accounts).to be_empty, failure_message - end - end - end -end diff --git a/controls/V-93477.rb b/controls/V-93477.rb deleted file mode 100644 index c8f19f3..0000000 --- a/controls/V-93477.rb +++ /dev/null @@ -1,29 +0,0 @@ -# encoding: UTF-8 - -control "V-93477" do - title "Windows Server 2019 maximum password age must be configured to 60 days or less." - desc "The longer a password is in use, the greater the opportunity for someone to gain unauthorized knowledge of the passwords. Scheduled changing of passwords hinders the ability of unauthorized system users to crack passwords and gain access to a system." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for the \"Maximum password age\" is greater than \"60\" days, this is a finding. - If the value is set to \"0\" (never expires), this is a finding. - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"MaximumPasswordAge\" is greater than \"60\" or equal to \"0\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Maximum password age\" to \"60\" days or less (excluding \"0\", which is unacceptable)." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000076-GPOS-00044" - tag gid: "V-93477" - tag rid: "SV-103563r1_rule" - tag stig_id: "WN19-AC-000050" - tag fix_id: "F-99721r1_fix" - tag cci: ["CCI-000199"] - tag nist: ["IA-5 (1) (d)", "Rev_4"] - - describe security_policy do - its('MaximumPasswordAge') { should be_between(1,input('maximum_password_age')) } - end -end \ No newline at end of file diff --git a/controls/V-93479.rb b/controls/V-93479.rb deleted file mode 100644 index 8224927..0000000 --- a/controls/V-93479.rb +++ /dev/null @@ -1,29 +0,0 @@ -# encoding: UTF-8 - -control "V-93479" do - title "Windows Server 2019 password history must be configured to #{input('password_history_size')} passwords remembered." - desc "A system is more vulnerable to unauthorized access when system users recycle the same password several times without being required to change to a unique password on a regularly scheduled basis. This enables users to effectively negate the purpose of mandating periodic password changes. The default value is \"#{input('password_history_size')}\" for Windows domain systems. #{input('org_name')[:acronym]} has decided this is the appropriate value for all Windows systems." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy. - If the value for \"Enforce password history\" is less than \"#{input('password_history_size')}\" passwords remembered, this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"PasswordHistorySize\" is less than \"#{input('password_history_size')}\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy >> \"Enforce password history\" to \"#{input('password_history_size')}\" passwords remembered." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000077-GPOS-00045" - tag gid: "V-93479" - tag rid: "SV-103565r1_rule" - tag stig_id: "WN19-AC-000040" - tag fix_id: "F-99723r1_fix" - tag cci: ["CCI-000200"] - tag nist: ["IA-5 (1) (e)", "Rev_4"] - - describe security_policy do - its('PasswordHistorySize') { should be >= input('password_history_size') } - end -end diff --git a/controls/V-93481.rb b/controls/V-93481.rb deleted file mode 100644 index 6c32d1e..0000000 --- a/controls/V-93481.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 - -control "V-93481" do - title "Windows Server 2019 domain controllers must have a PKI server certificate." - desc "Domain controllers are part of the chain of trust for PKI authentications. Without the appropriate certificate, the authenticity of the domain controller cannot be verified. Domain controllers must have a server certificate to establish authenticity as part of PKI authentications in the domain." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - Run \"MMC\". - Select \"Add/Remove Snap-in\" from the \"File\" menu. - Select \"Certificates\" in the left pane and click the \"Add >\" button. - Select \"Computer Account\" and click \"Next\". - Select the appropriate option for \"Select the computer you want this snap-in to manage\" and click \"Finish\". - Click \"OK\". - Select and expand the Certificates (Local Computer) entry in the left pane. - Select and expand the Personal entry in the left pane. - Select the Certificates entry in the left pane. - If no certificate for the domain controller exists in the right pane, this is a finding." - desc "fix", "Obtain a server certificate for the domain controller." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag gid: "V-93481" - tag rid: "SV-103567r1_rule" - tag stig_id: "WN19-DC-000280" - tag fix_id: "F-99725r1_fix" - tag cci: ["CCI-000185"] - tag nist: ["IA-5 (2) (a)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - certs = command("Get-ChildItem -Path Cert:\\LocalMachine\\My | ConvertTo-JSON").stdout - describe 'Verify that the domain controller has a PKI server certificate.' do - subject { certs } - it { should_not be_empty } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93483.rb b/controls/V-93483.rb deleted file mode 100644 index d3e0f4b..0000000 --- a/controls/V-93483.rb +++ /dev/null @@ -1,48 +0,0 @@ -# encoding: UTF-8 - -control "V-93483" do - title "Windows Server 2019 domain Controller PKI certificates must be issued by the #{input('org_name')[:acronym]} PKI or an approved External Certificate Authority (ECA)." - desc "A PKI implementation depends on the practices established by the Certificate Authority (CA) to ensure the implementation is secure. Without proper practices, the certificates issued by a CA have limited value in authentication functions. The use of multiple CAs from separate PKI implementations results in interoperability issues. If servers and clients do not have a common set of root CA certificates, they are not able to authenticate each other." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - Run \"MMC\". - Select \"Add/Remove Snap-in\" from the \"File\" menu. - Select \"Certificates\" in the left pane and click the \"Add >\" button. - Select \"Computer Account\" and click \"Next\". - Select the appropriate option for \"Select the computer you want this snap-in to manage\" and click \"Finish\". - Click \"OK\". - Select and expand the Certificates (Local Computer) entry in the left pane. - Select and expand the Personal entry in the left pane. - Select the Certificates entry in the left pane. In the right pane, examine the \"Issued By\" field for the certificate to determine the issuing CA. - If the \"Issued By\" field of the PKI certificate being used by the domain controller does not indicate the issuing CA is part of the #{input('org_name')[:acronym]} PKI or an approved ECA, this is a finding. - If the certificates in use are issued by a CA authorized by the Component's CIO, this is a CAT II finding. - There are multiple sources from which lists of valid #{input('org_name')[:acronym]} CAs and approved ECAs can be obtained: - - The Global Directory Service (GDS) website provides an online source. The address for this site is https://crl.gds.disa.mil. - - #{input('org_name')[:acronym]} Public Key Enablement (PKE) Engineering Support maintains the InstallRoot utility to manage #{input('org_name')[:acronym]} supported root certificates on Windows computers, which includes a list of authorized CAs. The utility package can be downloaded from the PKI and PKE Tools page on IASE: - http://iase.disa.mil/pki-pke/function_pages/tools.html" - desc "fix", "Obtain a server certificate for the domain controller issued by the #{input('org_name')[:acronym]} PKI or an approved ECA." - impact 0.7 - tag 'severity': nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag gid: "V-93483" - tag rid: "SV-103569r1_rule" - tag stig_id: "WN19-DC-000290" - tag fix_id: "F-99727r1_fix" - tag cci: ["CCI-000185"] - tag nist: ["IA-5 (2) (a)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe 'This control needs to be check manually' do - skip 'Control not executed as this test is manual' - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93485.rb b/controls/V-93485.rb deleted file mode 100644 index 0be4337..0000000 --- a/controls/V-93485.rb +++ /dev/null @@ -1,37 +0,0 @@ -# encoding: UTF-8 - -control "V-93485" do - title "Windows Server 2019 PKI certificates associated with user accounts must be issued by a DoD PKI or an approved External Certificate Authority (ECA)." - desc "A PKI implementation depends on the practices established by the Certificate Authority (CA) to ensure the implementation is secure. Without proper practices, the certificates issued by a CA have limited value in authentication functions." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - Review user account mappings to PKI certificates. - Open \"Windows PowerShell\". - Enter \"Get-ADUser -Filter * | FT Name, UserPrincipalName, Enabled\". - Exclude disabled accounts (e.g., DefaultAccount, Guest) and the krbtgt account. - If the User Principal Name (UPN) is not in the format of an individual's identifier for the certificate type and for the appropriate domain suffix, this is a finding. - For standard NIPRNet certificates, the individual's identifier is in the format of an Electronic Data Interchange - Personnel Identifier (EDI-PI). - Alt Tokens and other certificates may use a different UPN format than the EDI-PI which vary by organization. Verified these with the organization. - - NIPRNet Example: - - Name - User Principal Name - User1 - 1234567890@mil - - See PKE documentation for other network domain suffixes. - If the mappings are to certificates issued by a CA authorized by the Component's CIO, this is a CAT II finding." - desc "fix", "Map user accounts to PKI certificates using the appropriate User Principal Name (UPN) for the network. See PKE documentation for details." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag gid: "V-93485" - tag rid: "SV-103571r1_rule" - tag stig_id: "WN19-DC-000300" - tag fix_id: "F-99729r1_fix" - tag cci: ["CCI-000185"] - tag nist: ["IA-5 (2) (a)", "Rev_4"] - - describe 'This control needs to be check manually' do - skip 'Control not executed as this test is manual' - end -end \ No newline at end of file diff --git a/controls/V-93487.rb b/controls/V-93487.rb deleted file mode 100644 index a3a1799..0000000 --- a/controls/V-93487.rb +++ /dev/null @@ -1,118 +0,0 @@ -# encoding: UTF-8 - -control "V-93487" do - title "Windows Server 2019 must have the #{input('org_name')[:acronym]} Root Certificate Authority (CA) certificates installed in the Trusted Root Store." - desc "To ensure secure #{input('org_name')[:acronym]} websites and #{input('org_name')[:acronym]}-signed code are properly validated, the system must trust the #{input('org_name')[:acronym]} Root CAs. The #{input('org_name')[:acronym]} root certificates will ensure that the trust chain is established for server certificates issued from the #{input('org_name')[:acronym]} CAs." - desc "rationale", "" - desc "check", "The certificates and thumbprints referenced below apply to unclassified systems; see PKE documentation for other networks. - Open \"Windows PowerShell\" as an administrator. - Execute the following command: - Get-ChildItem -Path Cert:Localmachine\\root | Where Subject -Like \"*DoD*\" | FL Subject, Thumbprint, NotAfter - If the following certificate \"Subject\" and \"Thumbprint\" information is not displayed, this is a finding. - If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. - - Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: 8C941B34EA1EA6ED9AE2BC54CF687252B4C9B561 - NotAfter: 12/5/2029 - - Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: D73CA91102A2204A36459ED32213B467D7CE97FB - NotAfter: 12/30/2029 - - Subject: CN=DoD Root CA 4, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: B8269F25DBD937ECAFD4C35A9838571723F2D026 - NotAfter: 7/25/2032 - - Subject: CN=DoD Root CA 5, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: 4ECB5CC3095670454DA1CBD410FC921F46B8564B - NotAfter: 6/14/2041 - - Alternately, use the Certificates MMC snap-in: - Run \"MMC\". - Select \"File\", \"Add/Remove Snap-in\". - Select \"Certificates\" and click \"Add\". - Select \"Computer account\" and click \"Next\". - Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". - Click \"OK\". - Expand \"Certificates\" and navigate to \"Trusted Root Certification Authorities >> Certificates\". - For each of the DoD Root CA certificates noted below: - Right-click on the certificate and select \"Open\". - Select the \"Details\" Tab. - Scroll to the bottom and select \"Thumbprint\". - If the DoD Root CA certificates below are not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. - If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. - - DoD Root CA 2 - Thumbprint: 8C941B34EA1EA6ED9AE2BC54CF687252B4C9B561 - Valid to: Wednesday, December 5, 2029 - - DoD Root CA 3 - Thumbprint: D73CA91102A2204A36459ED32213B467D7CE97FB - Valid to: Sunday, December 30, 2029 - - DoD Root CA 4 - Thumbprint: B8269F25DBD937ECAFD4C35A9838571723F2D026 - Valid to: Sunday, July 25, 2032 - - DoD Root CA 5 - Thumbprint: 4ECB5CC3095670454DA1CBD410FC921F46B8564B - Valid to: Friday, June 14, 2041" - desc "fix", "Install the DoD Root CA certificates: - - DoD Root CA 2 - DoD Root CA 3 - DoD Root CA 4 - DoD Root CA 5 - - The InstallRoot tool is available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] - tag gid: "V-93487" - tag rid: "SV-103573r1_rule" - tag stig_id: "WN19-PK-000010" - tag fix_id: "F-99731r1_fix" - tag cci: ["CCI-000185", "CCI-002470"] - tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] - - if input('sensitive_system') == true - impact 0.0 - describe 'This Control is Not Applicable to sensitive systems.' do - skip 'This Control is Not Applicable to sensitive systems.' - end - else - dod_interoperability_certificates = JSON.parse(input('dod_interoperability_certificates').to_json) - query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\root | Where Subject -Like "*DoD*" | Select Subject, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }).params - - describe 'Verify DoD Root Certificate Authority (CA) certificates are installed in the Trusted Root Store.' do - subject { query } - it { should be_in dod_interoperability_certificates } - end - - unless query.empty? - case query - when Hash - query.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - when Array - query.each do |certs| - certs.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - end - end - end - end -end \ No newline at end of file diff --git a/controls/V-93489.rb b/controls/V-93489.rb deleted file mode 100644 index 0dd7172..0000000 --- a/controls/V-93489.rb +++ /dev/null @@ -1,116 +0,0 @@ -# encoding: UTF-8 - -control "V-93489" do - title "Windows Server 2019 must have the #{input('org_name')[:acronym]} Interoperability Root Certificate Authority (CA) cross-certificates installed in the Untrusted Certificates Store on unclassified systems." - desc "To ensure users do not experience denial of service when performing certificate-based authentication to #{input('org_name')[:acronym]} websites due to the system chaining to a root other than #{input('org_name')[:acronym]} Root CAs, the #{input('org_name')[:acronym]} Interoperability Root CA cross-certificates must be installed in the Untrusted Certificate Store. This requirement only applies to unclassified systems." - desc "rationale", "" - desc "check", "This is applicable to unclassified systems. It is NA for others. - Open \"PowerShell\" as an administrator. - Execute the following command: - Get-ChildItem -Path Cert:Localmachine\\disallowed | Where {$_.Issuer -Like \"*DoD Interoperability*\" -and $_.Subject -Like \"*DoD*\"} | FL Subject, Issuer, Thumbprint, NotAfter - If the following certificate \"Subject\", \"Issuer\", and \"Thumbprint\" information is not displayed, this is a finding. - If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. - - Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US - Issuer: CN=DoD Interoperability Root CA 1, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: 22BBE981F0694D246CC1472ED2B021DC8540A22F - NotAfter: 9/6/2019 - - Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US - Issuer: CN=DoD Interoperability Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 - NotAfter: 2/17/2019 - - Alternately, use the Certificates MMC snap-in: - Run \"MMC\". - Select \"File\", \"Add/Remove Snap-in\". - Select \"Certificates\" and click \"Add\". - Select \"Computer account\" and click \"Next\". - Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". - Click \"OK\". - Expand \"Certificates\" and navigate to \"Untrusted Certificates >> Certificates\". - For each certificate with \"DoD Root CA...\" under \"Issued To\" and \"DoD Interoperability Root CA...\" under \"Issued By\": - Right-click on the certificate and select \"Open\". - Select the \"Details\" Tab. - Scroll to the bottom and select \"Thumbprint\". - If the certificates below are not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. - If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. - - Issued To: DoD Root CA 2 - Issued By: DoD Interoperability Root CA 1 - Thumbprint: 22BBE981F0694D246CC1472ED2B021DC8540A22F - Valid to: Friday, September 6, 2019 - - Issued To: DoD Root CA 3 - Issued By: DoD Interoperability Root CA 2 - Thumbprint: FFAD03329B9E527A43EEC66A56F9CBB5393E6E13 - Valid to: Sunday, September 23, 2018 - - Issued To: DoD Root CA 3 - Issued By: DoD Interoperability Root CA 2 - Thumbprint: FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 - Valid to: Sunday, February 17, 2019" - desc "fix", "Install the DoD Interoperability Root CA cross-certificates on unclassified systems. - - Issued To - Issued By - Thumbprint - DoD Root CA 2 - DoD Interoperability Root CA 1 - 22BBE981F0694D246CC1472ED2B021DC8540A22F - - DoD Root CA 3 - DoD Interoperability Root CA 2 - FFAD03329B9E527A43EEC66A56F9CBB5393E6E13 - - DoD Root CA 3 - DoD Interoperability Root CA 2 - FCE1B1E25374DD94F5935BEB86CA643D8C8D1FF4 - - Administrators should run the Federal Bridge Certification Authority (FBCA) Cross-Certificate Removal Tool once as an administrator and once as the current user. - - The FBCA Cross-Certificate Remover Tool and User Guide are available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] - tag gid: "V-93489" - tag rid: "SV-103575r1_rule" - tag stig_id: "WN19-PK-000020" - tag fix_id: "F-99733r1_fix" - tag cci: ["CCI-000185", "CCI-002470"] - tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] - - if input('sensitive_system') == true - impact 0.0 - describe 'This Control is Not Applicable to sensitive systems.' do - skip 'This Control is Not Applicable to sensitive systems.' - end - else - dod_interoperability_certificates = JSON.parse(input('dod_interoperability_certificates').to_json) - query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\\\disallowed | Where {$_.Issuer -Like "*DoD Interoperability*" -and $_.Subject -Like "*DoD*"} | Select Subject, Issuer, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }).params - - describe 'Verify the DoD Interoperability cross-certificates are installed on unclassified systems as Untrusted Certificates.' do - subject { query } - it { should_not be_empty } - it { should be_in dod_interoperability_certificates } - end - - unless query.empty? - case query - when Hash - query.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - when Array - query.each do |certs| - certs.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - end - end - end - end -end \ No newline at end of file diff --git a/controls/V-93491.rb b/controls/V-93491.rb deleted file mode 100644 index 8ae3f3f..0000000 --- a/controls/V-93491.rb +++ /dev/null @@ -1,108 +0,0 @@ -# encoding: UTF-8 - -control "V-93491" do - title "Windows Server 2019 must have the US #{input('org_name')[:acronym]} CCEB Interoperability Root CA cross-certificates in the Untrusted Certificates Store on unclassified systems." - desc "To ensure users do not experience denial of service when performing certificate-based authentication to #{input('org_name')[:acronym]} websites due to the system chaining to a root other than #{input('org_name')[:acronym]} Root CAs, the US #{input('org_name')[:acronym]} CCEB Interoperability Root CA cross-certificates must be installed in the Untrusted Certificate Store. This requirement only applies to unclassified systems." - desc "rationale", "" - desc "check", "This is applicable to unclassified systems. It is NA for others. - Open \"PowerShell\" as an administrator. - Execute the following command: - Get-ChildItem -Path Cert:Localmachine\\disallowed | Where Issuer -Like \"*CCEB Interoperability*\" | FL Subject, Issuer, Thumbprint, NotAfter - If the following certificate \"Subject\", \"Issuer\", and \"Thumbprint\" information is not displayed, this is a finding. - If an expired certificate (\"NotAfter\" date) is not listed in the results, this is not a finding. - - Subject: CN=DoD Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US - Issuer: CN=US DoD CCEB Interoperability Root CA 1, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 - NotAfter: 3/9/2019 - - Subject: CN=DoD Root CA 3, OU=PKI, OU=DoD, O=U.S. Government, C=US - Issuer: CN=US DoD CCEB Interoperability Root CA 2, OU=PKI, OU=DoD, O=U.S. Government, C=US - Thumbprint: 929BF3196896994C0A201DF4A5B71F603FEFBF2E - NotAfter: 9/27/2019 - - Alternately, use the Certificates MMC snap-in: - Run \"MMC\". - Select \"File\", \"Add/Remove Snap-in\". - Select \"Certificates\" and click \"Add\". - Select \"Computer account\" and click \"Next\". - Select \"Local computer: (the computer this console is running on)\" and click \"Finish\". - Click \"OK\". - Expand \"Certificates\" and navigate to \"Untrusted Certificates >> Certificates\". - For each certificate with \"US DoD CCEB Interoperability Root CA ...\" under \"Issued By\": - Right-click on the certificate and select \"Open\". - Select the \"Details\" Tab. - Scroll to the bottom and select \"Thumbprint\". - If the certificate below is not listed or the value for the \"Thumbprint\" field is not as noted, this is a finding. - If an expired certificate (\"Valid to\" date) is not listed in the results, this is not a finding. - - Issued To: DoD Root CA 2 - Issued By: US DoD CCEB Interoperability Root CA 1 - Thumbprint: DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 - Valid to: Saturday, March 9, 2019 - - Issued To: DoD Root CA 3 - Issuer by: US DoD CCEB Interoperability Root CA 2 - Thumbprint: 929BF3196896994C0A201DF4A5B71F603FEFBF2E - Valid: Friday, September 27, 2019" - desc "fix", "Install the US DoD CCEB Interoperability Root CA cross-certificate on unclassified systems. - - Issued To - Issued By - Thumbprint - DoD Root CA 2 - US DoD CCEB Interoperability Root CA 1 - DA36FAF56B2F6FBA1604F5BE46D864C9FA013BA3 - - DoD Root CA 3 - US DoD CCEB Interoperability Root CA 2 - 929BF3196896994C0A201DF4A5B71F603FEFBF2E - - Administrators should run the Federal Bridge Certification Authority (FBCA) Cross-Certificate Removal Tool once as an administrator and once as the current user. - - The FBCA Cross-Certificate Remover Tool and User Guide are available on IASE at http://iase.disa.mil/pki-pke/Pages/tools.aspx." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000066-GPOS-00034" - tag satisfies: ["SRG-OS-000066-GPOS-00034", "SRG-OS-000403-GPOS-00182"] - tag gid: "V-93491" - tag rid: "SV-103577r1_rule" - tag stig_id: "WN19-PK-000030" - tag fix_id: "F-99735r1_fix" - tag cci: ["CCI-000185", "CCI-002470"] - tag nist: ["IA-5 (2) (a)", "SC-23 (5)", "Rev_4"] - - if input('sensitive_system') == 'true' - impact 0.0 - describe 'This Control is Not Applicable to sensitive systems.' do - skip 'This Control is Not Applicable to sensitive systems.' - end - else - dod_cceb_certificates = JSON.parse(input('dod_cceb_certificates').to_json) - query = json({ command: 'Get-ChildItem -Path Cert:Localmachine\\\\disallowed | Where {$_.Issuer -Like "*CCEB Interoperability*"} | Select Subject, Issuer, Thumbprint, @{Name=\'NotAfter\';Expression={"{0:dddd, MMMM dd, yyyy}" -f [datetime]$_.NotAfter}} | ConvertTo-Json' }) - - describe 'Verify the DoD CCEB CA certificates are installed as Untrusted Certificate.' do - subject { query.params } - it { should be_in dod_cceb_certificates } - end - - unless query.empty? - case query - when Hash - query.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - when Array - query.each do |certs| - certs.each do |key, value| - if key == "NotAfter" - cert_date = Date.parse(value) - describe cert_date do - it { should be >= Date.today } - end - end - end - end - end - end - end -end \ No newline at end of file diff --git a/controls/V-93493.rb b/controls/V-93493.rb deleted file mode 100644 index dc18290..0000000 --- a/controls/V-93493.rb +++ /dev/null @@ -1,36 +0,0 @@ -# encoding: UTF-8 - -control "V-93493" do - title "Windows Server 2019 users must be required to enter a password to access private keys stored on the computer." - desc "If the private key is discovered, an attacker can use the key to authenticate as an authorized user and gain access to the network infrastructure. - The cornerstone of the PKI is the private key used to encrypt or digitally sign information. - - If the private key is stolen, this will lead to the compromise of the authentication and non-repudiation gained through PKI because the attacker can use the private key to digitally sign documents and pretend to be the authorized user. - - Both the holders of a digital certificate and the issuing authority must protect the computers, storage devices, or whatever they use to keep the private keys." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Cryptography\\ - - Value Name: ForceKeyProtection - - Type: REG_DWORD - Value: 0x00000002 (2)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System cryptography: Force strong key protection for user keys stored on the computer\" to \"User must enter a password each time they use a key\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000067-GPOS-00035" - tag gid: "V-93493" - tag rid: "SV-103579r1_rule" - tag stig_id: "WN19-SO-000350" - tag fix_id: "F-99737r1_fix" - tag cci: ["CCI-000186"] - tag nist: ["IA-5 (2) (b)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Cryptography') do - it { should have_property 'ForceKeyProtection' } - its('ForceKeyProtection') { should cmp == 2 } - end -end \ No newline at end of file diff --git a/controls/V-93495.rb b/controls/V-93495.rb deleted file mode 100644 index 1981945..0000000 --- a/controls/V-93495.rb +++ /dev/null @@ -1,38 +0,0 @@ -# encoding: UTF-8 - -control "V-93495" do - title "Windows Server 2019 Kerberos encryption types must be configured to prevent the use of DES and RC4 encryption suites." - desc "Certain encryption types are no longer considered secure. The DES and RC4 encryption suites must not be used for Kerberos encryption. - Note: Organizations with domain controllers running earlier versions of Windows where RC4 encryption is enabled, selecting \"The other domain supports Kerberos AES Encryption\" on domain trusts, may be required to allow client communication across the trust relationship." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Kerberos\\Parameters\\ - - Value Name: SupportedEncryptionTypes - - Value Type: REG_DWORD - Value: 0x7ffffff8 (2147483640)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network security: Configure encryption types allowed for Kerberos\" to \"Enabled\" with only the following selected: - - AES128_HMAC_SHA1 - AES256_HMAC_SHA1 - Future encryption types - - Note: Organizations with domain controllers running earlier versions of Windows where RC4 encryption is enabled, selecting \"The other domain supports Kerberos AES Encryption\" on domain trusts, may be required to allow client communication across the trust relationship." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000120-GPOS-00061" - tag gid: "V-93495" - tag rid: "SV-103581r1_rule" - tag stig_id: "WN19-SO-000290" - tag fix_id: "F-99739r1_fix" - tag cci: ["CCI-000803"] - tag nist: ["IA-7", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Kerberos\\Parameters') do - it { should have_property 'SupportedEncryptionTypes' } - its('SupportedEncryptionTypes') { should cmp 2147483640 } - end -end \ No newline at end of file diff --git a/controls/V-93497.rb b/controls/V-93497.rb deleted file mode 100644 index b12a3a9..0000000 --- a/controls/V-93497.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: UTF-8 - -control "V-93497" do - title "Windows Server 2019 must have the built-in guest account disabled." - desc "A system faces an increased vulnerability threat if the built-in guest account is not disabled. This is a known account that exists on all Windows systems and cannot be deleted. This account is initialized during the installation of the operating system with no password assigned." - desc "rationale", "" - desc "check", "Verify the effective setting in Local Group Policy Editor. - - Run \"gpedit.msc\". - Navigate to Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options. - If the value for \"Accounts: Guest account status\" is not set to \"Disabled\", this is a finding. - - For server core installations, run the following command: - Secedit /Export /Areas SecurityPolicy /CFG C:\\Path\\FileName.Txt - If \"EnableGuestAccount\" equals \"1\" in the file, this is a finding." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Accounts: Guest account status\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000121-GPOS-00062" - tag gid: "V-93497" - tag rid: "SV-103583r1_rule" - tag stig_id: "WN19-SO-000010" - tag fix_id: "F-99741r1_fix" - tag cci: ["CCI-000804"] - tag nist: ["IA-8", "Rev_4"] - - describe security_policy do - its('EnableGuestAccount') { should cmp 0 } - end -end \ No newline at end of file diff --git a/controls/V-93499.rb b/controls/V-93499.rb deleted file mode 100644 index 493135c..0000000 --- a/controls/V-93499.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93499" do - title "Windows Server 2019 Windows Remote Management (WinRM) client must not allow unencrypted traffic." - desc "Unencrypted remote access to a system can allow sensitive information to be compromised. Windows remote management connections must be encrypted to prevent this." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ - - Value Name: AllowUnencryptedTraffic - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Allow unencrypted traffic\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000393-GPOS-00173" - tag satisfies: ["SRG-OS-000393-GPOS-00173", "SRG-OS-000394-GPOS-00174"] - tag gid: "V-93499" - tag rid: "SV-103585r1_rule" - tag stig_id: "WN19-CC-000480" - tag fix_id: "F-99743r1_fix" - tag cci: ["CCI-002890", "CCI-003123"] - tag nist: ["MA-4 (6)", "MA-4 (6)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do - it { should have_property 'AllowUnencryptedTraffic' } - its('AllowUnencryptedTraffic') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93501.rb b/controls/V-93501.rb deleted file mode 100644 index 2e308f7..0000000 --- a/controls/V-93501.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93501" do - title "Windows Server 2019 Windows Remote Management (WinRM) service must not allow unencrypted traffic." - desc "Unencrypted remote access to a system can allow sensitive information to be compromised. Windows remote management connections must be encrypted to prevent this." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ - - Value Name: AllowUnencryptedTraffic - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Allow unencrypted traffic\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000393-GPOS-00173" - tag satisfies: ["SRG-OS-000393-GPOS-00173", "SRG-OS-000394-GPOS-00174"] - tag gid: "V-93501" - tag rid: "SV-103587r1_rule" - tag stig_id: "WN19-CC-000510" - tag fix_id: "F-99745r1_fix" - tag cci: ["CCI-002890", "CCI-003123"] - tag nist: ["MA-4 (6)", "MA-4 (6)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Service') do - it { should have_property 'AllowUnencryptedTraffic' } - its('AllowUnencryptedTraffic') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93503.rb b/controls/V-93503.rb deleted file mode 100644 index 6a065e5..0000000 --- a/controls/V-93503.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93503" do - title "Windows Server 2019 Windows Remote Management (WinRM) client must not use Basic authentication." - desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ - - Value Name: AllowBasic - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Allow Basic authentication\" to \"Disabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000125-GPOS-00065" - tag gid: "V-93503" - tag rid: "SV-103589r1_rule" - tag stig_id: "WN19-CC-000470" - tag fix_id: "F-99747r1_fix" - tag cci: ["CCI-000877"] - tag nist: ["MA-4 c", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do - it { should have_property 'AllowBasic' } - its('AllowBasic') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93505.rb b/controls/V-93505.rb deleted file mode 100644 index 5a58412..0000000 --- a/controls/V-93505.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93505" do - title "Windows Server 2019 Windows Remote Management (WinRM) client must not use Digest authentication." - desc "Digest authentication is not as strong as other options and may be subject to man-in-the-middle attacks. Disallowing Digest authentication will reduce this potential." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\\ - - Value Name: AllowDigest - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Client >> \"Disallow Digest authentication\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000125-GPOS-00065" - tag gid: "V-93505" - tag rid: "SV-103591r1_rule" - tag stig_id: "WN19-CC-000490" - tag fix_id: "F-99749r1_fix" - tag cci: ["CCI-000877"] - tag nist: ["MA-4 c", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Client') do - it { should have_property 'AllowDigest' } - its('AllowDigest') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93507.rb b/controls/V-93507.rb deleted file mode 100644 index a89b1ba..0000000 --- a/controls/V-93507.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93507" do - title "Windows Server 2019 Windows Remote Management (WinRM) service must not use Basic authentication." - desc "Basic authentication uses plain-text passwords that could be used to compromise a system. Disabling Basic authentication will reduce this potential." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\\ - - Value Name: AllowBasic - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows Remote Management (WinRM) >> WinRM Service >> \"Allow Basic authentication\" to \"Disabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000125-GPOS-00065" - tag gid: "V-93507" - tag rid: "SV-103593r1_rule" - tag stig_id: "WN19-CC-000500" - tag fix_id: "F-99751r1_fix" - tag cci: ["CCI-000877"] - tag nist: ["MA-4 c", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WinRM\\Service') do - it { should have_property 'AllowBasic' } - its('AllowBasic') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93509.rb b/controls/V-93509.rb deleted file mode 100644 index 7c2c096..0000000 --- a/controls/V-93509.rb +++ /dev/null @@ -1,67 +0,0 @@ -# encoding: UTF-8 - -control 'V-93509' do - title "Windows Server 2019 directory service must be configured to terminate LDAP-based network connections to the directory server after #{input('maximum_idle_time_phrase')} of inactivity." - desc 'The failure to terminate inactive network connections increases the risk of a successful attack on the directory server. The longer an established session is in progress, the more time an attacker has to hijack the session, implement a means to passively intercept data, or compromise any protections on client access. For example, if an attacker gains control of a client computer, an existing (already authenticated) session with the directory server could allow access to the directory. The lack of confidentiality protection in LDAP-based sessions increases exposure to this vulnerability.' - desc 'rationale', '' - desc 'check', "This applies to domain controllers. It is NA for other systems. - Open an elevated \"Command Prompt\" (run as administrator). - Enter \"ntdsutil\". - At the \"ntdsutil:\" prompt, enter \"LDAP policies\". - At the \"ldap policy:\" prompt, enter \"connections\". - At the \"server connections:\" prompt, enter \"connect to server [host-name]\" - (where [host-name] is the computer name of the domain controller). - At the \"server connections:\" prompt, enter \"q\". - At the \"ldap policy:\" prompt, enter \"show values\". - If the value for MaxConnIdleTime is greater than \"#{input('maximum_idle_time')}\" (#{input('maximum_idle_time_phrase')}) or is not specified, this is a finding. - Enter \"q\" at the \"ldap policy:\" and \"ntdsutil:\" prompts to exit. - - Alternately, Dsquery can be used to display MaxConnIdleTime: - Open \"Command Prompt (Admin)\". - Enter the following command (on a single line). - dsquery * \"cn=Default Query Policy,cn=Query-Policies,cn=Directory Service, cn=Windows NT,cn=Services,cn=Configuration,dc=[forest-name]\" -attr LDAPAdminLimits - - The quotes are required and dc=[forest-name] is the fully qualified LDAP name of the domain being reviewed (e.g., dc=disaost,dc=mil). - If the results do not specify a \"MaxConnIdleTime\" or it has a value greater than \"#{input('maximum_idle_time')}\" (#{input('maximum_idle_time_phrase')}), this is a finding." - desc 'fix', "Configure the directory service to terminate LDAP-based network connections to the directory server after #{input('maximum_idle_time_phrase')} of inactivity. - Open an elevated \"Command prompt\" (run as administrator). - Enter \"ntdsutil\". - At the \"ntdsutil:\" prompt, enter \"LDAP policies\". - At the \"ldap policy:\" prompt, enter \"connections\". - At the \"server connections:\" prompt, enter \"connect to server [host-name]\" (where [host-name] is the computer name of the domain controller). - At the \"server connections:\" prompt, enter \"q\". - At the \"ldap policy:\" prompt, enter \"Set MaxConnIdleTime to #{input('maximum_idle_time')}\". - Enter \"Commit Changes\" to save. - Enter \"Show values\" to verify changes. - Enter \"q\" at the \"ldap policy:\" and \"ntdsutil:\" prompts to exit." - impact 0.3 - tag 'severity': '' - tag 'gtitle': "SRG-OS-000163-GPOS-00072" - tag 'gid': "V-93509" - tag 'rid': "SV-103595r1_rule" - tag 'stig_id': "WN19-DC-000160" - tag 'fix_id': "F-99753r1_fix" - tag 'cci': ["CCI-001133"] - tag 'nist': ["SC-10", "Rev_4"] - - forest_name = json(command: '(Get-ADDomain).DistinguishedName | ConvertTo-Json').params - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - query = command("dsquery * 'cn=Default Query Policy,cn=Query-Policies,cn=Directory Service, cn=Windows NT,cn=Services,cn=Configuration,#{forest_name}' -attr LDAPAdminLimits").stdout - ldap_admin_limits = parse_config(query.gsub(/;/, "\n")).params - describe "MaxConnIdleTime is configured" do - subject { ldap_admin_limits } - it { should include 'MaxConnIdleTime' } - end - describe "The MaxConnIdleTime" do - subject { ldap_admin_limits['MaxConnIdleTime'] } - it { should cmp <= input("maximum_idle_time") } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end diff --git a/controls/V-93511.rb b/controls/V-93511.rb deleted file mode 100644 index 145fb7d..0000000 --- a/controls/V-93511.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93511" do - title "Windows Server 2019 must be configured to use FIPS-compliant algorithms for encryption, hashing, and signing." - desc "This setting ensures the system uses algorithms that are FIPS-compliant for encryption, hashing, and signing. FIPS-compliant algorithms meet specific standards established by the U.S. Government and must be the algorithms used for all OS encryption functions." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy\\ - - Value Name: Enabled - - Value Type: REG_DWORD - Value: 0x00000001 (1) - - Clients with this setting enabled will not be able to communicate via digitally encrypted or signed protocols with servers that do not support these algorithms. Both the browser and web server must be configured to use TLS; otherwise. the browser will not be able to connect to a secure site." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000478-GPOS-00223" - tag gid: "V-93511" - tag rid: "SV-103597r1_rule" - tag stig_id: "WN19-SO-000360" - tag fix_id: "F-99755r1_fix" - tag cci: ["CCI-002450"] - tag nist: ["SC-13", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy') do - it { should have_property 'Enabled' } - its('Enabled') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93513.rb b/controls/V-93513.rb deleted file mode 100644 index e30164a..0000000 --- a/controls/V-93513.rb +++ /dev/null @@ -1,44 +0,0 @@ -# encoding: UTF-8 - -control "V-93513" do - title "Windows Server 2019 must use separate, NSA-approved (Type 1) cryptography to protect the directory data in transit for directory service implementations at a classified confidentiality level when replication data traverses a network cleared to a lower level than the data." - desc "Directory data that is not appropriately encrypted is subject to compromise. Commercial-grade encryption does not provide adequate protection when the classification level of directory data in transit is higher than the level of the network." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - Review the organization network diagram(s) or documentation to determine the level of classification for the network(s) over which replication data is transmitted. - - Determine the classification level of the Windows domain controller. - - If the classification level of the Windows domain controller is higher than the level of the networks, review the organization network diagram(s) and directory implementation documentation to determine if NSA-approved encryption is used to protect the replication network traffic. - - If the classification level of the Windows domain controller is higher than the level of the network traversed and NSA-approved encryption is not used, this is a finding." - desc "fix", "Configure NSA-approved (Type 1) cryptography to protect the directory data in transit for directory service implementations at a classified confidentiality level that transfer replication data through a network cleared to a lower level than the data." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000396-GPOS-00176" - tag gid: "V-93513" - tag rid: "SV-103599r1_rule" - tag stig_id: "WN19-DC-000140" - tag fix_id: "F-99757r1_fix" - tag cci: ["CCI-002450"] - tag nist: ["SC-13", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe "Separate, NSA-approved (Type 1) cryptography must be used to protect - the directory data in transit for directory service implementations at a - classified confidentiality level when replication data traverses a network - cleared to a lower level than the data." do - skip "Separate, NSA-approved (Type 1) cryptography must be used to protect - the directory data in transit for directory service implementations at a - classified confidentiality level when replication data traverses a network - cleared to a lower level than the data is a manual check" - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93515.rb b/controls/V-93515.rb deleted file mode 100644 index 67bb3ff..0000000 --- a/controls/V-93515.rb +++ /dev/null @@ -1,29 +0,0 @@ -# encoding: UTF-8 - -control "V-93515" do - title "Windows Server 2019 systems requiring data at rest protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest." - desc "This requirement addresses protection of user-generated data as well as operating system-specific configuration data. Organizations may choose to employ different mechanisms to achieve confidentiality and integrity protections, as appropriate, in accordance with the security category and/or classification of the information. - Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields)." - desc "rationale", "" - desc "check", "Verify systems that require additional protections due to factors such as inadequate physical protection or sensitivity of the data employ encryption to protect the confidentiality and integrity of all information at rest. - If they do not, this is a finding." - desc "fix", "Configure systems that require additional protections due to factors such as inadequate physical protection or sensitivity of the data to employ encryption to protect the confidentiality and integrity of all information at rest." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000185-GPOS-00079" - tag satisfies: ["SRG-OS-000185-GPOS-00079", "SRG-OS-000404-GPOS-00183", "SRG-OS-000405-GPOS-00184"] - tag gid: "V-93515" - tag rid: "SV-103601r1_rule" - tag stig_id: "WN19-00-000250" - tag fix_id: "F-99759r1_fix" - tag cci: ["CCI-001199", "CCI-002475", "CCI-002476"] - tag nist: ["SC-28", "SC-28 (1)", "SC-28 (1)", "Rev_4"] - - describe "A manual review is required to ensure systems requiring data at rest protections must employ cryptographic - mechanisms to prevent unauthorized disclosure and modification of the - information at rest." do - skip 'A manual review is required to ensure systems requiring data at rest protections must employ cryptographic - mechanisms to prevent unauthorized disclosure and modification of the - information at rest.' - end -end \ No newline at end of file diff --git a/controls/V-93517.rb b/controls/V-93517.rb deleted file mode 100644 index 2f9a6fc..0000000 --- a/controls/V-93517.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: UTF-8 - -control "V-93517" do - title "Windows Server 2019 administrator accounts must not be enumerated during elevation." - desc "Enumeration of administrator accounts when elevating can provide part of the logon information to an unauthorized user. This setting configures the system to always require users to type in a username and password to elevate a running application." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\CredUI\\ - - Value Name: EnumerateAdministrators - - Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Credential User Interface >> \"Enumerate administrator accounts on elevation\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93517" - tag rid: "SV-103603r1_rule" - tag stig_id: "WN19-CC-000240" - tag fix_id: "F-99761r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\CredUI') do - it { should have_property 'EnumerateAdministrators' } - its('EnumerateAdministrators') { should cmp == 0 } - end -end \ No newline at end of file diff --git a/controls/V-93519.rb b/controls/V-93519.rb deleted file mode 100644 index b4da034..0000000 --- a/controls/V-93519.rb +++ /dev/null @@ -1,45 +0,0 @@ -# encoding: UTF-8 - -control "V-93519" do - title "Windows Server 2019 local administrator accounts must have their privileged token filtered to prevent elevated privileges from being used over the network on domain-joined member servers." - desc "A compromised local administrator account can provide means for an attacker to move laterally between domain systems. - With User Account Control enabled, filtering the privileged token for local administrator accounts will prevent the elevated privileges of these accounts from being used over the network." - desc "rationale", "" - desc "check", "This applies to member servers. For domain controllers and standalone systems, this is NA. - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System - - Value Name: LocalAccountTokenFilterPolicy - - Type: REG_DWORD - Value: 0x00000000 (0) - - This setting may cause issues with some network scanning tools if local administrative accounts are used remotely. Scans should use domain accounts where possible. If a local administrative account must be used, temporarily enabling the privileged token by configuring the registry value to \"1\" may be required." - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MS Security Guide >> \"Apply UAC restrictions to local accounts on network logons\" to \"Enabled\". - This policy setting requires the installation of the SecGuide custom templates included with the STIG package. \"SecGuide.admx\" and \" SecGuide.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93519" - tag rid: "SV-103605r1_rule" - tag stig_id: "WN19-MS-000020" - tag fix_id: "F-99763r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '3' - describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'LocalAccountTokenFilterPolicy' } - its('LocalAccountTokenFilterPolicy') { should cmp == 0 } - end - else - impact 0.0 - describe 'This requirement is only applicable to member servers' do - skip 'This control is NA as the requirement is only applicable to member servers' - end - end -end \ No newline at end of file diff --git a/controls/V-93521.rb b/controls/V-93521.rb deleted file mode 100644 index 2bb96d8..0000000 --- a/controls/V-93521.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93521" do - title "Windows Server 2019 UIAccess applications must not be allowed to prompt for elevation without using the secure desktop." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting prevents User Interface Accessibility programs from disabling the secure desktop for elevation prompts." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: EnableUIADesktopToggle - - Value Type: REG_DWORD - Value: 0x00000000 (0)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop\" to \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93521" - tag rid: "SV-103607r1_rule" - tag stig_id: "WN19-SO-000390" - tag fix_id: "F-99765r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'EnableUIADesktopToggle' } - its('EnableUIADesktopToggle') { should cmp == 0 } - end - end -end \ No newline at end of file diff --git a/controls/V-93523.rb b/controls/V-93523.rb deleted file mode 100644 index 372fbbb..0000000 --- a/controls/V-93523.rb +++ /dev/null @@ -1,45 +0,0 @@ -# encoding: UTF-8 - -control "V-93523" do - title "Windows Server 2019 User Account Control must, at a minimum, prompt administrators for consent on the secure desktop." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures the elevation requirements for logged-on administrators to complete a task that requires raised privileges." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is default installation option for Windows Server 2019 versus Server with Desktop Experience). - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: ConsentPromptBehaviorAdmin - - Value Type: REG_DWORD - Value: 0x00000002 (2) (Prompt for consent on the secure desktop) - 0x00000001 (1) (Prompt for credentials on the secure desktop)" - desc "fix", " - Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode\" to \"Prompt for consent on the secure desktop\". - - The more secure option for this setting, \"Prompt for credentials on the secure desktop\", would also be acceptable." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93523" - tag rid: "SV-103609r1_rule" - tag stig_id: "WN19-SO-000400" - tag fix_id: "F-99767r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'ConsentPromptBehaviorAdmin' } - its('ConsentPromptBehaviorAdmin') { should be_between(1,2) } - end - end -end \ No newline at end of file diff --git a/controls/V-93525.rb b/controls/V-93525.rb deleted file mode 100644 index 2664f11..0000000 --- a/controls/V-93525.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93525" do - title "Windows Server 2019 User Account Control must be configured to detect application installations and prompt for elevation." - desc "User Account Control (UAC) is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting requires Windows to respond to application installation requests by prompting for credentials." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: EnableInstallerDetection - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Detect application installations and prompt for elevation\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93525" - tag rid: "SV-103611r1_rule" - tag stig_id: "WN19-SO-000420" - tag fix_id: "F-99769r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'EnableInstallerDetection' } - its('EnableInstallerDetection') { should cmp == 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93527.rb b/controls/V-93527.rb deleted file mode 100644 index e0817b7..0000000 --- a/controls/V-93527.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93527" do - title "Windows Server 2019 User Account Control (UAC) must only elevate UIAccess applications that are installed in secure locations." - desc "UAC is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures Windows to only allow applications installed in a secure location on the file system, such as the Program Files or the Windows\\System32 folders, to run with elevated privileges." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: EnableSecureUIAPaths - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Only elevate UIAccess applications that are installed in secure locations\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93527" - tag rid: "SV-103613r1_rule" - tag stig_id: "WN19-SO-000430" - tag fix_id: "F-99771r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'EnableSecureUIAPaths' } - its('EnableSecureUIAPaths') { should cmp == 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93529.rb b/controls/V-93529.rb deleted file mode 100644 index ab4879a..0000000 --- a/controls/V-93529.rb +++ /dev/null @@ -1,41 +0,0 @@ -# encoding: UTF-8 - -control "V-93529" do - title "Windows Server 2019 User Account Control (UAC) must virtualize file and registry write failures to per-user locations." - desc "UAC is a security mechanism for limiting the elevation of privileges, including administrative accounts, unless authorized. This setting configures non-UAC-compliant applications to run in virtualized file and registry entries in per-user locations, allowing them to run." - desc "rationale", "" - desc "check", "UAC requirements are NA for Server Core installations (this is the default installation option for Windows Server 2019 versus Server with Desktop Experience). - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\ - - Value Name: EnableVirtualization - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"User Account Control: Virtualize file and registry write failures to per-user locations\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000134-GPOS-00068" - tag gid: "V-93529" - tag rid: "SV-103615r1_rule" - tag stig_id: "WN19-SO-000450" - tag fix_id: "F-99773r1_fix" - tag cci: ["CCI-001084"] - tag nist: ["SC-3", "Rev_4"] - - os_type = command('Test-Path "$env:windir\explorer.exe"').stdout.strip - - if os_type == 'False' - impact 0.0 - describe 'This system is a Server Core Installation, control is NA' do - skip 'This system is a Server Core Installation control is NA' - end - else - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do - it { should have_property 'EnableVirtualization' } - its('EnableVirtualization') { should cmp == 1 } - end - end -end \ No newline at end of file diff --git a/controls/V-93531.rb b/controls/V-93531.rb deleted file mode 100644 index 0414104..0000000 --- a/controls/V-93531.rb +++ /dev/null @@ -1,54 +0,0 @@ -control 'V-93531' do - title 'Windows Server 2019 non-system-created file shares must limit access to groups that require it.' - desc 'Shares on a system provide network access. To prevent exposing sensitive information, where shares are necessary, permissions must be reconfigured to give the minimum access to accounts that require it.' - desc 'rationale', '' - desc 'check', "If only system-created shares such as \"ADMIN$\", \"C$\", and \"IPC$\" exist on the system, this is NA. (System-created shares will display a message that it has been shared for administrative purposes when \"Properties\" is selected.) - - Run \"Computer Management\". - Navigate to System Tools >> Shared Folders >> Shares. - Right-click any non-system-created shares. - Select \"Properties\". - Select the \"Share Permissions\" tab. - If the file shares have not been configured to restrict permissions to the specific groups or accounts that require access, this is a finding. - Select the \"Security\" tab. - If the permissions have not been configured to restrict permissions to the specific groups or accounts that require access, this is a finding." - desc 'fix', "If a non-system-created share is required on a system, configure the share and NTFS permissions to limit access to the specific groups or accounts that require it. - Remove any unnecessary non-system-created shares." - impact 0.5 - tag severity: nil - tag gtitle: 'SRG-OS-000138-GPOS-00069' - tag gid: 'V-93531' - tag rid: 'SV-103617r1_rule' - tag stig_id: 'WN19-00-000230' - tag fix_id: 'F-99775r1_fix' - tag cci: ['CCI-001090'] - tag nist: %w(SC-4 Rev_4) - - net_shares = json({ command: 'Get-SMBShare -Special $false | Where-Object -Property Name -notin C$,ADMIN$,IPC$,NETLOGON,SYSVOL | Select Name, Path | ConvertTo-Json' }).params - - if net_shares.empty? - impact 0.0 - describe 'No non-default file shares were detected' do - skip 'This control is NA' - end - else - case net_shares - when Hash - net_shares.each do |_key, value| - describe 'Unrestricted file shares' do - subject { command("Get-Acl -Path '#{value}' | ?{$_.AccessToString -match 'Everyone\sAllow'} | %{($_.PSPath -split '::')[1]}") } - its('stdout') { should eq '' } - end - end - when Array - net_shares.each do |paths| - paths.each do |_key, value| - describe 'Unrestricted file shares' do - subject { command("Get-Acl -Path '#{value}' | ?{$_.AccessToString -match 'Everyone\sAllow'} | %{($_.PSPath -split '::')[1]}") } - its('stdout') { should eq '' } - end - end - end - end - end -end diff --git a/controls/V-93533.rb b/controls/V-93533.rb deleted file mode 100644 index 3c103dc..0000000 --- a/controls/V-93533.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93533" do - title "Windows Server 2019 Remote Desktop Services must prevent drive redirection." - desc "Preventing users from sharing the local drives on their client computers with Remote Session Hosts that they access helps reduce possible exposure of sensitive data." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\ - - Value Name: fDisableCdm - - Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Remote Desktop Services >> Remote Desktop Session Host >> Device and Resource Redirection >> \"Do not allow drive redirection\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000138-GPOS-00069" - tag gid: "V-93533" - tag rid: "SV-103619r1_rule" - tag stig_id: "WN19-CC-000350" - tag fix_id: "F-99777r1_fix" - tag cci: ["CCI-001090"] - tag nist: ["SC-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows NT\\Terminal Services') do - it { should have_property 'fDisableCdm' } - its('fDisableCdm') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93535.rb b/controls/V-93535.rb deleted file mode 100644 index 9e25bad..0000000 --- a/controls/V-93535.rb +++ /dev/null @@ -1,69 +0,0 @@ -# encoding: UTF-8 - -control "V-93535" do - title "Windows Server 2019 data files owned by users must be on a different logical partition from the directory server data files." - desc "When directory service data files, especially for directories used for identification, authentication, or authorization, reside on the same logical partition as user-owned files, the directory service data may be more vulnerable to unauthorized access or other availability compromises. Directory service and user-owned data files sharing a partition may be configured with less restrictive permissions in order to allow access to the user data. - - The directory service may be vulnerable to a denial of service attack when user-owned files on a common partition are expanded to an extent preventing the directory service from acquiring more space for directory or audit data." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - - Run \"Regedit\". - Navigate to \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\". - Note the directory locations in the values for \"DSA Database file\". - - Open \"Command Prompt\". - Enter \"net share\". - Note the logical drive(s) or file system partition for any organization-created data shares. - Ignore system shares (e.g., NETLOGON, SYSVOL, and administrative shares ending in $). User shares that are hidden (ending with $) should not be ignored. - - If user shares are located on the same logical partition as the directory server data files, this is a finding." - desc "fix", "Move shares used to store files owned by users to a different logical partition than the directory server data files." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000138-GPOS-00069" - tag gid: "V-93535" - tag rid: "SV-103621r1_rule" - tag stig_id: "WN19-DC-000120" - tag fix_id: "F-99779r1_fix" - tag cci: ["CCI-001090"] - tag nist: ["SC-4", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - dsa_db_file = command('Get-ItemPropertyValue -Path HKLM:\\System\\CurrentControlSet\\Services\\NTDS\\Parameters -Name "DSA Database file"').stdout.strip - net_shares = json({ command: "Get-SMBShare | Where-Object -Property Name -notin C$,ADMIN$,IPC$,NETLOGON,SYSVOL | Select Path | ConvertTo-Json" }).params - - if net_shares.empty? - impact 0.0 - describe 'No non-default file shares were detected' do - skip 'This control is NA' - end - else - case net_shares - when Hash - net_shares.each do |key, value| - describe "Net Share path: #{value}" do - subject { value } - it { should_not eq dsa_db_file } - end - end - when Array - net_shares.each do |paths| - paths.each do |key, value| - describe "Net Share path: #{value}" do - subject { value } - it { should_not eq dsa_db_file } - end - end - end - end - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' do - skip 'This system is not a domain controller, therefore this control is not applicable as it only applies to domain controllers' - end - end -end \ No newline at end of file diff --git a/controls/V-93537.rb b/controls/V-93537.rb deleted file mode 100644 index f1d3c3b..0000000 --- a/controls/V-93537.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93537" do - title "Windows Server 2019 must not allow anonymous enumeration of shares." - desc "Allowing anonymous logon users (null session connections) to list all account names and enumerate all shared resources can provide a map of potential points to attack the system." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ - - Value Name: RestrictAnonymous - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Do not allow anonymous enumeration of SAM accounts and shares\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000138-GPOS-00069" - tag gid: "V-93537" - tag rid: "SV-103623r1_rule" - tag stig_id: "WN19-SO-000230" - tag fix_id: "F-99781r1_fix" - tag cci: ["CCI-001090"] - tag nist: ["SC-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Lsa') do - it { should have_property 'RestrictAnonymous' } - its('RestrictAnonymous') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93539.rb b/controls/V-93539.rb deleted file mode 100644 index 0cef79a..0000000 --- a/controls/V-93539.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93539" do - title "Windows Server 2019 must restrict anonymous access to Named Pipes and Shares." - desc "Allowing anonymous access to named pipes or shares provides the potential for unauthorized system access. This setting restricts access to those defined in \"Network access: Named Pipes that can be accessed anonymously\" and \"Network access: Shares that can be accessed anonymously\", both of which must be blank under other requirements." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ - - Value Name: RestrictNullSessAccess - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Network access: Restrict anonymous access to Named Pipes and Shares\" to \"Enabled\"." - impact 0.7 - tag severity: nil - tag gtitle: "SRG-OS-000138-GPOS-00069" - tag gid: "V-93539" - tag rid: "SV-103625r1_rule" - tag stig_id: "WN19-SO-000250" - tag fix_id: "F-99783r1_fix" - tag cci: ["CCI-001090"] - tag nist: ["SC-4", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters') do - it { should have_property 'restrictnullsessaccess' } - its('restrictnullsessaccess') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93541.rb b/controls/V-93541.rb deleted file mode 100644 index 9d6bf45..0000000 --- a/controls/V-93541.rb +++ /dev/null @@ -1,32 +0,0 @@ -# encoding: UTF-8 - -control "V-93541" do - title "Windows Server 2019 must be configured to ignore NetBIOS name release requests except from WINS servers." - desc "Configuring the system to ignore name release requests, except from WINS servers, prevents a denial of service (DoS) attack. The DoS consists of sending a NetBIOS name release request to the server for each entry in the server's cache, causing a response delay in the normal operation of the server's WINS resolution capability." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\\ - - Value Name: NoNameReleaseOnDemand - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Administrative Templates >> MSS (Legacy) >> \"MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers\" to \"Enabled\". - This policy setting requires the installation of the MSS-Legacy custom templates included with the STIG package. \"MSS-Legacy.admx\" and \"MSS-Legacy.adml\" must be copied to the \\Windows\\PolicyDefinitions and \\Windows\\PolicyDefinitions\\en-US directories respectively." - impact 0.3 - tag severity: nil - tag gtitle: "SRG-OS-000420-GPOS-00186" - tag gid: "V-93541" - tag rid: "SV-103627r1_rule" - tag stig_id: "WN19-CC-000060" - tag fix_id: "F-99785r1_fix" - tag cci: ["CCI-002385"] - tag nist: ["SC-5", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netbt\\Parameters') do - it { should have_property 'NoNameReleaseOnDemand' } - its('NoNameReleaseOnDemand') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93543.rb b/controls/V-93543.rb deleted file mode 100644 index 93744af..0000000 --- a/controls/V-93543.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93543" do - title "Windows Server 2019 must implement protection methods such as TLS, encrypted VPNs, or IPsec if the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process." - desc "Information can be either unintentionally or maliciously disclosed or modified during preparation for transmission, for example, during aggregation, at protocol transformation points, and during packing/unpacking. These unauthorized disclosures or modifications compromise the confidentiality or integrity of the information. - Ensuring the confidentiality of transmitted information requires the operating system to take measures in preparing information for transmission. - This can be accomplished via access control and encryption. - Use of this requirement will be limited to situations where the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process. When transmitting data, operating systems need to support transmission protection mechanisms such as TLS, encrypted VPNs, or IPsec." - desc "rationale", "" - desc "check", "If the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process, verify protection methods such as TLS, encrypted VPNs, or IPsec have been implemented. - If protection methods have not been implemented, this is a finding." - desc "fix", "Configure protection methods such as TLS, encrypted VPNs, or IPsec when the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000425-GPOS-00189" - tag satisfies: ["SRG-OS-000425-GPOS-00189", "SRG-OS-000426-GPOS-00190"] - tag gid: "V-93543" - tag rid: "SV-103629r1_rule" - tag stig_id: "WN19-00-000260" - tag fix_id: "F-99787r1_fix" - tag cci: ["CCI-002420", "CCI-002422"] - tag nist: ["SC-8 (2)", "SC-8 (2)", "Rev_4"] - - describe "A manual review is required to ensure protection methods such as TLS, encrypted VPNs, or IPSEC are - implemented if the data owner has a strict requirement for ensuring data - integrity and confidentiality is maintained at every step of the data transfer - and handling process." do - skip 'A manual review is required to ensure the operating system employs a deny-all, permit-by-exception - policy to allow the execution of authorized software programs' - end -end \ No newline at end of file diff --git a/controls/V-93545.rb b/controls/V-93545.rb deleted file mode 100644 index da88600..0000000 --- a/controls/V-93545.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 - -control "V-93545" do - title "Windows Server 2019 domain controllers must require LDAP access signing." - desc "Unsigned network traffic is susceptible to man-in-the-middle attacks, where an intruder captures packets between the server and the client and modifies them before forwarding them to the client. In the case of an LDAP server, this means that an attacker could cause a client to make decisions based on false records from the LDAP directory. The risk of an attacker pulling this off can be decreased by implementing strong physical security measures to protect the network infrastructure. Furthermore, implementing Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for Internet Protocol (IP) traffic, can make all types of man-in-the-middle attacks extremely difficult." - desc "rationale", "" - desc "check", "This applies to domain controllers. It is NA for other systems. - If the following registry value does not exist or is not configured as specified, this is a finding: - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters\\ - - Value Name: LDAPServerIntegrity - - Value Type: REG_DWORD - Value: 0x00000002 (2)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain controller: LDAP server signing requirements\" to \"Require signing\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93545" - tag rid: "SV-103631r1_rule" - tag stig_id: "WN19-DC-000320" - tag fix_id: "F-99789r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip - - if domain_role == '4' || domain_role == '5' - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NTDS\\Parameters') do - it { should have_property 'LDAPServerIntegrity' } - its('LDAPServerIntegrity') { should cmp 2 } - end - else - impact 0.0 - describe 'This system is not a domain controller, therefore this control is NA' do - skip 'This system is not a domain controller, therefore this control is NA' - end - end -end \ No newline at end of file diff --git a/controls/V-93547.rb b/controls/V-93547.rb deleted file mode 100644 index e2d6490..0000000 --- a/controls/V-93547.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93547" do - title "Windows Server 2019 setting Domain member: Digitally encrypt or sign secure channel data (always) must be configured to Enabled." - desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but not all information is encrypted. If this policy is enabled, outgoing secure channel traffic will be encrypted and signed." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: RequireSignOrSeal - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally encrypt or sign secure channel data (always)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93547" - tag rid: "SV-103633r1_rule" - tag stig_id: "WN19-SO-000060" - tag fix_id: "F-99791r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'RequireSignOrSeal' } - its('RequireSignOrSeal') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93549.rb b/controls/V-93549.rb deleted file mode 100644 index fb516cc..0000000 --- a/controls/V-93549.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93549" do - title "Windows Server 2019 setting Domain member: Digitally encrypt secure channel data (when possible) must be configured to enabled." - desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but not all information is encrypted. If this policy is enabled, outgoing secure channel traffic will be encrypted." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: SealSecureChannel - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally encrypt secure channel data (when possible)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93549" - tag rid: "SV-103635r1_rule" - tag stig_id: "WN19-SO-000070" - tag fix_id: "F-99793r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'SealSecureChannel' } - its('SealSecureChannel') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93551.rb b/controls/V-93551.rb deleted file mode 100644 index 2b8d0a8..0000000 --- a/controls/V-93551.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93551" do - title "Windows Server 2019 setting Domain member: Digitally sign secure channel data (when possible) must be configured to Enabled." - desc "Requests sent on the secure channel are authenticated, and sensitive information (such as passwords) is encrypted, but the channel is not integrity checked. If this policy is enabled, outgoing secure channel traffic will be signed." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: SignSecureChannel - - Value Type: REG_DWORD - Value: 0x00000001 (1) " - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Digitally sign secure channel data (when possible)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93551" - tag rid: "SV-103637r1_rule" - tag stig_id: "WN19-SO-000080" - tag fix_id: "F-99795r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'SignSecureChannel' } - its('SignSecureChannel') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93553.rb b/controls/V-93553.rb deleted file mode 100644 index 21c317f..0000000 --- a/controls/V-93553.rb +++ /dev/null @@ -1,33 +0,0 @@ -# encoding: UTF-8 - -control "V-93553" do - title "Windows Server 2019 must be configured to require a strong session key." - desc "A computer connecting to a domain controller will establish a secure channel. The secure channel connection may be subject to compromise, such as hijacking or eavesdropping, if strong session keys are not used to establish the connection. Requiring strong session keys enforces 128-bit encryption between systems." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\\ - - Value Name: RequireStrongKey - - Value Type: REG_DWORD - Value: 0x00000001 (1) - - This setting may prevent a system from being joined to a domain if not configured consistently between systems." - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Domain member: Require strong (Windows 2000 or Later) session key\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93553" - tag rid: "SV-103639r1_rule" - tag stig_id: "WN19-SO-000110" - tag fix_id: "F-99797r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Netlogon\\Parameters') do - it { should have_property 'RequireStrongKey' } - its('RequireStrongKey') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93555.rb b/controls/V-93555.rb deleted file mode 100644 index d00e047..0000000 --- a/controls/V-93555.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93555" do - title "Windows Server 2019 setting Microsoft network client: Digitally sign communications (always) must be configured to Enabled." - desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB client will only communicate with an SMB server that performs SMB packet signing." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ - - Value Name: RequireSecuritySignature - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network client: Digitally sign communications (always)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93555" - tag rid: "SV-103641r1_rule" - tag stig_id: "WN19-SO-000160" - tag fix_id: "F-99799r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do - it { should have_property 'RequireSecuritySignature' } - its('RequireSecuritySignature') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93557.rb b/controls/V-93557.rb deleted file mode 100644 index f224d30..0000000 --- a/controls/V-93557.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93557" do - title "Windows Server 2019 setting Microsoft network client: Digitally sign communications (if server agrees) must be configured to Enabled." - desc "The server message block (SMB) protocol provides the basis for many network operations. If this policy is enabled, the SMB client will request packet signing when communicating with an SMB server that is enabled or required to perform SMB packet signing." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\\ - - Value Name: EnableSecuritySignature - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network client: Digitally sign communications (if server agrees)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93557" - tag rid: "SV-103643r1_rule" - tag stig_id: "WN19-SO-000170" - tag fix_id: "F-99801r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters') do - it { should have_property 'EnableSecuritySignature' } - its('EnableSecuritySignature') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93559.rb b/controls/V-93559.rb deleted file mode 100644 index 4da7748..0000000 --- a/controls/V-93559.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93559" do - title "Windows Server 2019 setting Microsoft network server: Digitally sign communications (always) must be configured to Enabled." - desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB server will only communicate with an SMB client that performs SMB packet signing." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ - - Value Name: RequireSecuritySignature - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network server: Digitally sign communications (always)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93559" - tag rid: "SV-103645r1_rule" - tag stig_id: "WN19-SO-000190" - tag fix_id: "F-99803r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do - it { should have_property 'RequireSecuritySignature' } - its('RequireSecuritySignature') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93561.rb b/controls/V-93561.rb deleted file mode 100644 index 3be5e2a..0000000 --- a/controls/V-93561.rb +++ /dev/null @@ -1,31 +0,0 @@ -# encoding: UTF-8 - -control "V-93561" do - title "Windows Server 2019 setting Microsoft network server: Digitally sign communications (if client agrees) must be configured to Enabled." - desc "The server message block (SMB) protocol provides the basis for many network operations. Digitally signed SMB packets aid in preventing man-in-the-middle attacks. If this policy is enabled, the SMB server will negotiate SMB packet signing as requested by the client." - desc "rationale", "" - desc "check", "If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\\ - - Value Name: EnableSecuritySignature - - Value Type: REG_DWORD - Value: 0x00000001 (1)" - desc "fix", "Configure the policy value for Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> Security Options >> \"Microsoft network server: Digitally sign communications (if client agrees)\" to \"Enabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000423-GPOS-00187" - tag satisfies: ["SRG-OS-000423-GPOS-00187", "SRG-OS-000424-GPOS-00188"] - tag gid: "V-93561" - tag rid: "SV-103647r1_rule" - tag stig_id: "WN19-SO-000200" - tag fix_id: "F-99805r1_fix" - tag cci: ["CCI-002418", "CCI-002421"] - tag nist: ["SC-8", "SC-8 (1)", "Rev_4"] - - describe registry_key('HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanmanServer\\Parameters') do - it { should have_property 'EnableSecuritySignature' } - its('EnableSecuritySignature') { should cmp == 1 } - end -end \ No newline at end of file diff --git a/controls/V-93563.rb b/controls/V-93563.rb deleted file mode 100644 index 32b76e3..0000000 --- a/controls/V-93563.rb +++ /dev/null @@ -1,39 +0,0 @@ -# encoding: UTF-8 - -control "V-93563" do - title "Windows Server 2019 Explorer Data Execution Prevention must be enabled." - desc "Data Execution Prevention provides additional protection by performing checks on memory to help prevent malicious code from running. This setting will prevent Data Execution Prevention from being turned off for File Explorer." - desc "rationale", "" - desc "check", "The default behavior is for Data Execution Prevention to be turned on for File Explorer. - If the registry value name below does not exist, this is not a finding. - If it exists and is configured with a value of \"0\", this is not a finding. - If it exists and is configured with a value of \"1\", this is a finding. - - Registry Hive: HKEY_LOCAL_MACHINE - Registry Path: \\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\\ - - Value Name: NoDataExecutionPrevention - - Value Type: REG_DWORD - Value: 0x00000000 (0) (or if the Value Name does not exist)" - desc "fix", "The default behavior is for data execution prevention to be turned on for File Explorer. If this needs to be corrected, configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> File Explorer >> \"Turn off Data Execution Prevention for Explorer\" to \"Not Configured\" or \"Disabled\"." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000433-GPOS-00192" - tag gid: "V-93563" - tag rid: "SV-103649r1_rule" - tag stig_id: "WN19-CC-000310" - tag fix_id: "F-99807r1_fix" - tag cci: ["CCI-002824"] - tag nist: ["SI-16", "Rev_4"] - - if registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer').has_property?('NoDataExecutionPrevention') - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do - its('NoDataExecutionPrevention') { should cmp 0 } - end - else - describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer') do - it { should_not have_property 'NoDataExecutionPrevention' } - end - end -end \ No newline at end of file diff --git a/controls/V-93567.rb b/controls/V-93567.rb deleted file mode 100644 index a6f1eac..0000000 --- a/controls/V-93567.rb +++ /dev/null @@ -1,24 +0,0 @@ -# encoding: UTF-8 - -control "V-93567" do - title "Windows Server 2019 must employ automated mechanisms to determine the state of system components with regard to flaw remediation using the following frequency: continuously, where Host Based Security System (HBSS) is used; 30 days, for any additional internal network scans not covered by HBSS; and annually, for external scans by Computer Network Defense Service Provider (CNDSP)." - desc "Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. The operating system may have an integrated solution incorporating continuous scanning using HBSS and periodic scanning using other tools." - desc "rationale", "" - desc "check", "Verify #{input('org_name')[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." - desc "fix", "Install a #{input('org_name')[:acronym]} approved HBSS software and ensure it is operating continuously." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000191-GPOS-00080" - tag gid: "V-93567" - tag rid: "SV-103653r1_rule" - tag stig_id: "WN19-00-000290" - tag fix_id: "F-99811r1_fix" - tag cci: ["CCI-001233"] - tag nist: ["SI-2 (2)", "Rev_4"] - - org_name = input('org_name') - - describe "A manual review is required to verify #{org_name[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." do - skip "A manual review is required to verify #{org_name[:acronym]} approved HBSS software is installed, configured, and properly operating. Ask the operator to document the HBSS software installation and configuration. If the operator is not able to provide a documented configuration for an installed HBSS or if the HBSS software is not properly configured maintained, or used, this is a finding." - end -end \ No newline at end of file diff --git a/controls/V-93571.rb b/controls/V-93571.rb deleted file mode 100644 index 6c5d02e..0000000 --- a/controls/V-93571.rb +++ /dev/null @@ -1,46 +0,0 @@ -# encoding: UTF-8 - -control "V-93571" do - title "Windows Server 2019 must have a host-based firewall installed and enabled." - desc "A firewall provides a line of defense against attack, allowing or blocking inbound and outbound connections based on a set of rules." - desc "rationale", "" - desc "check", "Determine if a host-based firewall is installed and enabled on the system. If a host-based firewall is not installed and enabled on the system, this is a finding. The configuration requirements will be determined by the applicable firewall STIG." - desc "fix", "Install and enable a host-based firewall on the system." - impact 0.5 - tag severity: nil - tag gtitle: "SRG-OS-000480-GPOS-00231" - tag gid: "V-93571" - tag rid: "SV-103657r1_rule" - tag stig_id: "WN19-00-000280" - tag fix_id: "F-99815r1_fix" - tag cci: ["CCI-000366", "CCI-002080"] - tag nist: ["CM-6 b", "CA-3 (5)", "Rev_4"] - - query_domain = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Domain' } | Select Enabled | ConvertTo-Json" }).params - query_private = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Private' } | Select Enabled | ConvertTo-Json" }).params - query_public = json({ command: "Get-WmiObject -NameSpace 'root\\standardcimv2' -Class MSFT_NetFirewallProfile | Where {$_.Name -Like 'Public' } | Select Enabled | ConvertTo-Json" }).params - - describe.one do - describe 'Windows Firewall should be Enabled' do - subject { query_public["Enabled"] } - it 'The Public host-based firewall' do - failure_message = "is not Enabled" - expect(subject).to eql(1), failure_message - end - end - describe 'Windows Firewall should be Enabled' do - subject { query_private["Enabled"] } - it 'The Private host-based firewall' do - failure_message = "is not enabled" - expect(subject).to eql(1), failure_message - end - end - describe 'Windows Firewall should be Enabled' do - subject { query_domain["Enabled"] } - it 'The Domain host-based firewall' do - failure_message = "is not Enabled" - expect(subject).to eql(1), failure_message - end - end - end -end \ No newline at end of file