/
V-73221.rb
110 lines (92 loc) · 5.15 KB
/
V-73221.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
control 'V-73221' do
title "Only administrators responsible for the member server or standalone
system must 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.
Systems dedicated to the management of Active Directory (AD admin
platforms, see V-36436 in the Active Directory Domain STIG) are exempt from
this. AD admin platforms may use the Domain Admins group or a domain
administrative group created specifically for AD admin platforms (see V-43711
in the Active Directory Domain STIG).
Standard user accounts must not be members of the built-in Administrators
group.
"
impact 0.7
tag "gtitle": 'SRG-OS-000324-GPOS-00125'
tag "gid": 'V-73221'
tag "rid": 'SV-87873r1_rule'
tag "stig_id": 'WN16-MS-000010'
tag "fix_id": 'F-80263r1_fix'
tag "cci": ['CCI-002235']
tag "nist": ['AC-6 (10)', 'Rev_4']
tag "documentable": false
tag "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.
Systems dedicated to the management of Active Directory (AD admin platforms,
see V-36436 in the Active Directory Domain STIG) are exempt from this. AD admin
platforms may use the Domain Admins group or a domain administrative group
created specifically for AD admin platforms (see V-43711 in the Active
Directory Domain STIG).
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."
tag "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.
Systems dedicated to the management of Active Directory (AD admin platforms,
see V-36436 in the Active Directory Domain STIG) are exempt from this. AD admin
platforms may use the Domain Admins group or a domain administrative group
created specifically for AD admin platforms (see V-43711 in the Active
Directory Domain STIG).
Remove any standard user accounts."
administrators = attribute('administrators')
is_AD_only_system = input('is_AD_only_system')
domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip
administrator_group = command("net localgroup Administrators | Format-List | Findstr /V 'Alias Name Comment Members - command'").stdout.strip.split('\n')
if (domain_role == '2' || domain_role == '3') && !is_AD_only_system
administrator_group.each do |user|
describe user.to_s do
it { should be_in administrators }
end
end
end
if domain_role != '2' && domain_role != '3'
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
if is_AD_only_system
impact 0.0
desc 'This system is dedicated to the management of Active Directory, therefore this control is not applicable'
describe 'This system is dedicated to the management of Active Directory, therefore this control is not applicable' do
skip 'This system is dedicated to the management of Active Directory, therefore this control is not applicable'
end
end
if administrator_group.empty?
impact 0.0
desc 'There are no users with administrative privileges on this system, therefore this control is not applicable'
describe 'There are no users with administrative privileges on this system, therefore this control is not applicable' do
skip 'There are no users with administrative privileges on this system, therefore this control is not applicable'
end
end
end