openscap 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/openscap/ds/arf.rb +32 -3
- data/lib/openscap/ds/sds.rb +58 -0
- data/lib/openscap/openscap.rb +6 -2
- data/lib/openscap/source.rb +45 -5
- data/lib/openscap/text.rb +55 -0
- data/lib/openscap/version.rb +1 -1
- data/lib/openscap/{helper.rb → xccdf.rb} +6 -6
- data/lib/openscap/xccdf/benchmark.rb +62 -0
- data/lib/openscap/xccdf/profile.rb +43 -0
- data/lib/openscap/xccdf/ruleresult.rb +71 -0
- data/lib/openscap/xccdf/testresult.rb +114 -0
- data/test/common/testcase.rb +11 -0
- data/test/data/invalid.xml +20 -0
- data/test/data/testresult.xml +225 -0
- data/test/data/xccdf.xml +3043 -17
- data/test/ds/arf_test.rb +36 -10
- data/test/ds/sds_test.rb +79 -0
- data/test/integration/arf_waiver_test.rb +99 -0
- data/test/source_test.rb +56 -1
- data/test/text_test.rb +28 -0
- data/test/xccdf/benchmark_test.rb +48 -0
- data/test/xccdf/profile_test.rb +29 -0
- data/test/xccdf/testresult_test.rb +106 -0
- metadata +17 -3
@@ -0,0 +1,114 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2014 Red Hat Inc.
|
3
|
+
#
|
4
|
+
# This software is licensed to you under the GNU General Public License,
|
5
|
+
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
+
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
+
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
+
# along with this software; if not, see
|
9
|
+
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'openscap/source'
|
13
|
+
require 'openscap/exceptions'
|
14
|
+
require 'openscap/xccdf'
|
15
|
+
require 'openscap/xccdf/ruleresult'
|
16
|
+
|
17
|
+
module OpenSCAP
|
18
|
+
module Xccdf
|
19
|
+
class TestResult
|
20
|
+
attr_reader :rr
|
21
|
+
attr_reader :raw
|
22
|
+
|
23
|
+
def initialize(t)
|
24
|
+
case t
|
25
|
+
when OpenSCAP::Source
|
26
|
+
@raw = OpenSCAP.xccdf_result_import_source(t.raw)
|
27
|
+
OpenSCAP.raise! if @raw.null?
|
28
|
+
when FFI::Pointer
|
29
|
+
@raw = OpenSCAP.xccdf_result_import_source(t)
|
30
|
+
OpenSCAP.raise! if @raw.null?
|
31
|
+
else
|
32
|
+
raise OpenSCAP::OpenSCAPError, "Cannot initialize TestResult with #{t}"
|
33
|
+
end
|
34
|
+
init_ruleresults
|
35
|
+
end
|
36
|
+
|
37
|
+
def id
|
38
|
+
return OpenSCAP.xccdf_result_get_id(@raw)
|
39
|
+
end
|
40
|
+
|
41
|
+
def profile
|
42
|
+
return OpenSCAP.xccdf_result_get_profile(@raw)
|
43
|
+
end
|
44
|
+
|
45
|
+
def score
|
46
|
+
@score ||= score_init
|
47
|
+
end
|
48
|
+
|
49
|
+
def score!(benchmark)
|
50
|
+
#recalculate the scores in the scope of given benchmark
|
51
|
+
@score = nil
|
52
|
+
OpenSCAP.raise! unless OpenSCAP.xccdf_result_recalculate_scores(@raw, benchmark.raw) == 0
|
53
|
+
score
|
54
|
+
end
|
55
|
+
|
56
|
+
def source
|
57
|
+
source_p = OpenSCAP.xccdf_result_export_source(raw, nil)
|
58
|
+
OpenSCAP::Source.new source_p
|
59
|
+
end
|
60
|
+
|
61
|
+
def destroy
|
62
|
+
OpenSCAP.xccdf_result_free @raw
|
63
|
+
@raw = nil
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
def init_ruleresults
|
68
|
+
@rr = Hash.new
|
69
|
+
rr_it = OpenSCAP.xccdf_result_get_rule_results(@raw)
|
70
|
+
while OpenSCAP.xccdf_rule_result_iterator_has_more(rr_it) do
|
71
|
+
rr_raw = OpenSCAP.xccdf_rule_result_iterator_next(rr_it)
|
72
|
+
rr = OpenSCAP::Xccdf::RuleResult.new rr_raw
|
73
|
+
@rr[rr.id] = rr
|
74
|
+
end
|
75
|
+
OpenSCAP.xccdf_rule_result_iterator_free(rr_it)
|
76
|
+
end
|
77
|
+
|
78
|
+
def score_init
|
79
|
+
scores = Hash.new
|
80
|
+
scorit = OpenSCAP.xccdf_result_get_scores(@raw)
|
81
|
+
while OpenSCAP.xccdf_score_iterator_has_more(scorit) do
|
82
|
+
s = OpenSCAP.xccdf_score_iterator_next(scorit)
|
83
|
+
scores[OpenSCAP.xccdf_score_get_system(s)] = {
|
84
|
+
:system => OpenSCAP.xccdf_score_get_system(s),
|
85
|
+
:value => OpenSCAP.xccdf_score_get_score(s),
|
86
|
+
:max => OpenSCAP.xccdf_score_get_maximum(s)
|
87
|
+
}
|
88
|
+
end
|
89
|
+
OpenSCAP.xccdf_score_iterator_free(scorit)
|
90
|
+
scores
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
attach_function :xccdf_result_import_source, [:pointer], :pointer
|
96
|
+
attach_function :xccdf_result_free, [:pointer], :void
|
97
|
+
attach_function :xccdf_result_get_id, [:pointer], :string
|
98
|
+
attach_function :xccdf_result_get_profile, [:pointer], :string
|
99
|
+
attach_function :xccdf_result_recalculate_scores, [:pointer, :pointer], :int
|
100
|
+
attach_function :xccdf_result_export_source, [:pointer, :string], :pointer
|
101
|
+
|
102
|
+
attach_function :xccdf_result_get_rule_results, [:pointer] ,:pointer
|
103
|
+
attach_function :xccdf_rule_result_iterator_has_more, [:pointer], :bool
|
104
|
+
attach_function :xccdf_rule_result_iterator_free, [:pointer], :void
|
105
|
+
attach_function :xccdf_rule_result_iterator_next, [:pointer], :pointer
|
106
|
+
|
107
|
+
attach_function :xccdf_result_get_scores, [:pointer], :pointer
|
108
|
+
attach_function :xccdf_score_iterator_has_more, [:pointer], :bool
|
109
|
+
attach_function :xccdf_score_iterator_free, [:pointer], :void
|
110
|
+
attach_function :xccdf_score_iterator_next, [:pointer], :pointer
|
111
|
+
attach_function :xccdf_score_get_system, [:pointer], :string
|
112
|
+
attach_function :xccdf_score_get_score, [:pointer], OpenSCAP::Xccdf::NUMERIC
|
113
|
+
attach_function :xccdf_score_get_maximum, [:pointer], OpenSCAP::Xccdf::NUMERIC
|
114
|
+
end
|
data/test/common/testcase.rb
CHANGED
@@ -34,5 +34,16 @@ module OpenSCAP
|
|
34
34
|
|
35
35
|
def test_x
|
36
36
|
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
def assert_default_score(scores, low, high)
|
40
|
+
assert scores.size == 1
|
41
|
+
s = scores['urn:xccdf:scoring:default']
|
42
|
+
assert !s.nil?
|
43
|
+
assert s[:system] == 'urn:xccdf:scoring:default'
|
44
|
+
assert low < s[:value]
|
45
|
+
assert s[:value] < high
|
46
|
+
assert s[:max] == 100
|
47
|
+
end
|
37
48
|
end
|
38
49
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.2" id="xccdf_moc.elpmaxe.www_benchmark_second">
|
3
|
+
<version>1.0</version>
|
4
|
+
<status>incomplete</status>
|
5
|
+
<Profile id="xccdf_moc.elpmaxe.www_profile_1">
|
6
|
+
<title>is kinda compulsory</title>
|
7
|
+
<select idref="xccdf_moc.elpmaxe.www_rule_second" selected="true"/>
|
8
|
+
</Profile>
|
9
|
+
<Profile id="xccdf_moc.elpmaxe.www_profile_2" extends="xccdf_moc.elpmaxe.www_profile_1">
|
10
|
+
<title>is kinda compulsory</title>
|
11
|
+
<select idref="xccdf_moc.elpmaxe.www_group_one" selected="true"/>
|
12
|
+
</Profile>
|
13
|
+
<Group selected="false" id="xccdf_moc.elpmaxe.www_group_one">
|
14
|
+
<Rule selected="false" id="xccdf_moc.elpmaxe.www_rule_second">
|
15
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
16
|
+
<check-content-ref href="stub-oval.xml"/>
|
17
|
+
</check>
|
18
|
+
</Rule>
|
19
|
+
</Group>
|
20
|
+
</Benchmark>
|
@@ -0,0 +1,225 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<TestResult xmlns="http://checklists.nist.gov/xccdf/1.2" id="xccdf_org.open-scap_testresult_xccdf_org.ssgproject.content_profile_common" start-time="2014-10-17T09:07:43" end-time="2014-10-17T09:07:55">
|
3
|
+
<benchmark href="/usr/share/xml/scap/ssg/fedora/ssg-fedora-ds.xml" id="xccdf_org.ssgproject.content_benchmark_FEDORA"/>
|
4
|
+
<title>OSCAP Scan Result</title>
|
5
|
+
<identity authenticated="false" privileged="false">root</identity>
|
6
|
+
<profile idref="xccdf_org.ssgproject.content_profile_common"/>
|
7
|
+
<target>fedora20.mydomain</target>
|
8
|
+
<target-address>127.0.0.1</target-address>
|
9
|
+
<target-address>0:0:0:0:0:0:0:1</target-address>
|
10
|
+
<target-facts>
|
11
|
+
<fact name="urn:xccdf:fact:scanner:name" type="string">OpenSCAP</fact>
|
12
|
+
<fact name="urn:xccdf:fact:scanner:version" type="string">1.0.9</fact>
|
13
|
+
<fact name="urn:xccdf:fact:ethernet:MAC" type="string">00:00:00:00:00:00</fact>
|
14
|
+
</target-facts><target-id-ref system="http://scap.nist.gov/schema/asset-identification/1.1" name="asset0" href=""/>
|
15
|
+
<platform idref="cpe:/o:fedoraproject:fedora:20"/>
|
16
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_disable_prelink" time="2014-10-17T09:07:43" severity="low" weight="1.000000">
|
17
|
+
<result>fail</result>
|
18
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
19
|
+
<check-content-ref name="oval:ssg:def:151" href="#xccdf1"/>
|
20
|
+
</check>
|
21
|
+
</rule-result>
|
22
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated" time="2014-10-17T09:07:43" severity="high" weight="1.000000">
|
23
|
+
<result>pass</result>
|
24
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
25
|
+
<check-content-ref name="oval:ssg:def:140" href="#xccdf1"/>
|
26
|
+
</check>
|
27
|
+
</rule-result>
|
28
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled" time="2014-10-17T09:07:43" severity="high" weight="1.000000">
|
29
|
+
<result>pass</result>
|
30
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
31
|
+
<check-content-ref name="oval:ssg:def:149" href="#xccdf1"/>
|
32
|
+
</check>
|
33
|
+
</rule-result>
|
34
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_file_permissions_library_dirs" time="2014-10-17T09:07:51" severity="medium" weight="1.000000">
|
35
|
+
<result>fail</result>
|
36
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
37
|
+
<check-content-ref name="oval:ssg:def:137" href="#xccdf1"/>
|
38
|
+
</check>
|
39
|
+
</rule-result>
|
40
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_file_ownership_library_dirs" time="2014-10-17T09:07:53" severity="medium" weight="1.000000">
|
41
|
+
<result>pass</result>
|
42
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
43
|
+
<check-content-ref name="oval:ssg:def:124" href="#xccdf1"/>
|
44
|
+
</check>
|
45
|
+
</rule-result>
|
46
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_file_permissions_binary_dirs" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
47
|
+
<result>pass</result>
|
48
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
49
|
+
<check-content-ref name="oval:ssg:def:161" href="#xccdf1"/>
|
50
|
+
</check>
|
51
|
+
</rule-result>
|
52
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_file_ownership_binary_dirs" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
53
|
+
<result>pass</result>
|
54
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
55
|
+
<check-content-ref name="oval:ssg:def:154" href="#xccdf1"/>
|
56
|
+
</check>
|
57
|
+
</rule-result>
|
58
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_direct_root_logins" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
59
|
+
<result>notchecked</result>
|
60
|
+
<message severity="info">No candidate or applicable check found.</message>
|
61
|
+
<check system="ocil-transitional">
|
62
|
+
<check-export export-name="the /etc/securetty file is not empty" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
63
|
+
<check-content xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
64
|
+
To ensure root may not directly login to the system over physical consoles,
|
65
|
+
run the following command:
|
66
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">cat /etc/securetty</pre>
|
67
|
+
If any output is returned, this is a finding.
|
68
|
+
</check-content>
|
69
|
+
</check>
|
70
|
+
</rule-result>
|
71
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_securetty_root_login_console_only" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
72
|
+
<result>fail</result>
|
73
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
74
|
+
<check-content-ref name="oval:ssg:def:109" href="#xccdf1"/>
|
75
|
+
</check>
|
76
|
+
</rule-result>
|
77
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_restrict_serial_port_logins" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
78
|
+
<result>pass</result>
|
79
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
80
|
+
<check-content-ref name="oval:ssg:def:144" href="#xccdf1"/>
|
81
|
+
</check>
|
82
|
+
</rule-result>
|
83
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_root_webbrowsing" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
84
|
+
<result>notselected</result>
|
85
|
+
<check system="ocil-transitional">
|
86
|
+
<check-export export-name="this is not the case" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
87
|
+
<check-content xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
88
|
+
Check the <xhtml:code>root</xhtml:code> home directory for a <xhtml:code>.mozilla</xhtml:code> directory. If
|
89
|
+
one exists, ensure browsing is limited to local service administration.
|
90
|
+
</check-content>
|
91
|
+
</check>
|
92
|
+
</rule-result>
|
93
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_shelllogin_for_systemaccounts" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
94
|
+
<result>notselected</result>
|
95
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
96
|
+
<check-content-ref name="oval:ssg:def:122" href="#xccdf1"/>
|
97
|
+
</check>
|
98
|
+
<check system="ocil-transitional">
|
99
|
+
<check-export export-name="any system account (other than root) has a login shell" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
100
|
+
<check-content xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
101
|
+
To obtain a listing of all users,
|
102
|
+
their UIDs, and their shells, run the command:
|
103
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ awk -F: '{print $1 ":" $3 ":" $7}' /etc/passwd</pre>
|
104
|
+
Identify the system accounts from this listing. These will
|
105
|
+
primarily be the accounts with UID numbers less than 500, other
|
106
|
+
than root.
|
107
|
+
</check-content>
|
108
|
+
</check>
|
109
|
+
</rule-result>
|
110
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_uidzero_except_root" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
111
|
+
<result>pass</result>
|
112
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
113
|
+
<check-content-ref name="oval:ssg:def:118" href="#xccdf1"/>
|
114
|
+
</check>
|
115
|
+
</rule-result>
|
116
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_root_path_default" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
117
|
+
<result>notselected</result>
|
118
|
+
<check system="ocil-transitional">
|
119
|
+
<check-export export-name="any of these conditions are not met" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
120
|
+
<check-content xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
121
|
+
To view the root user's <xhtml:code>PATH</xhtml:code>, run the following command:
|
122
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># env | grep PATH</pre>
|
123
|
+
If correctly configured, the <xhtml:code>PATH</xhtml:code> must: use vendor default settings,
|
124
|
+
have no empty entries, and have no entries beginning with a character
|
125
|
+
other than a slash (/).
|
126
|
+
</check-content>
|
127
|
+
</check>
|
128
|
+
</rule-result>
|
129
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_empty_passwords" time="2014-10-17T09:07:55" severity="high" weight="1.000000">
|
130
|
+
<result>fail</result>
|
131
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
132
|
+
<check-content-ref name="oval:ssg:def:111" href="#xccdf1"/>
|
133
|
+
</check>
|
134
|
+
</rule-result>
|
135
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_hashes_outside_shadow" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
136
|
+
<result>pass</result>
|
137
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
138
|
+
<check-content-ref name="oval:ssg:def:107" href="#xccdf1"/>
|
139
|
+
</check>
|
140
|
+
</rule-result>
|
141
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_gid_passwd_group_same" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
142
|
+
<result>notselected</result>
|
143
|
+
<check system="ocil-transitional">
|
144
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
145
|
+
<check-content xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
146
|
+
To ensure all GIDs referenced in <xhtml:code>/etc/passwd</xhtml:code> are defined in <xhtml:code>/etc/group</xhtml:code>,
|
147
|
+
run the following command:
|
148
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># pwck -qr</pre>
|
149
|
+
There should be no output.
|
150
|
+
</check-content>
|
151
|
+
</check>
|
152
|
+
</rule-result>
|
153
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_no_netrc_files" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
154
|
+
<result>pass</result>
|
155
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
156
|
+
<check-content-ref name="oval:ssg:def:157" href="#xccdf1"/>
|
157
|
+
</check>
|
158
|
+
</rule-result>
|
159
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_accounts_password_minlen_login_defs" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
160
|
+
<result>fail</result>
|
161
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
162
|
+
<check-export export-name="oval:ssg:var:213" value-id="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs"/>
|
163
|
+
<check-content-ref name="oval:ssg:def:133" href="#xccdf1"/>
|
164
|
+
</check>
|
165
|
+
</rule-result>
|
166
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_accounts_minimum_age_login_defs" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
167
|
+
<result>fail</result>
|
168
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
169
|
+
<check-export export-name="oval:ssg:var:214" value-id="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs"/>
|
170
|
+
<check-content-ref name="oval:ssg:def:159" href="#xccdf1"/>
|
171
|
+
</check>
|
172
|
+
</rule-result>
|
173
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_accounts_maximum_age_login_defs" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
174
|
+
<result>fail</result>
|
175
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
176
|
+
<check-export export-name="oval:ssg:var:211" value-id="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs"/>
|
177
|
+
<check-content-ref name="oval:ssg:def:113" href="#xccdf1"/>
|
178
|
+
</check>
|
179
|
+
</rule-result>
|
180
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
181
|
+
<result>pass</result>
|
182
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
183
|
+
<check-export export-name="oval:ssg:var:215" value-id="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs"/>
|
184
|
+
<check-content-ref name="oval:ssg:def:163" href="#xccdf1"/>
|
185
|
+
</check>
|
186
|
+
</rule-result>
|
187
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_service_ntpd_enabled" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
188
|
+
<result>fail</result>
|
189
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
190
|
+
<check-content-ref name="oval:ssg:def:129" href="#xccdf1"/>
|
191
|
+
</check>
|
192
|
+
</rule-result>
|
193
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_ntpd_specify_remote_server" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
194
|
+
<result>fail</result>
|
195
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
196
|
+
<check-content-ref name="oval:ssg:def:142" href="#xccdf1"/>
|
197
|
+
</check>
|
198
|
+
</rule-result>
|
199
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" time="2014-10-17T09:07:55" severity="medium" weight="1.000000">
|
200
|
+
<result>fail</result>
|
201
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
202
|
+
<check-content-ref name="oval:ssg:def:115" href="#xccdf1"/>
|
203
|
+
</check>
|
204
|
+
</rule-result>
|
205
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords" time="2014-10-17T09:07:55" severity="high" weight="1.000000">
|
206
|
+
<result>pass</result>
|
207
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
208
|
+
<check-content-ref name="oval:ssg:def:146" href="#xccdf1"/>
|
209
|
+
</check>
|
210
|
+
</rule-result>
|
211
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
212
|
+
<result>fail</result>
|
213
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
214
|
+
<check-export export-name="oval:ssg:var:212" value-id="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value"/>
|
215
|
+
<check-content-ref name="oval:ssg:def:120" href="#xccdf1"/>
|
216
|
+
</check>
|
217
|
+
</rule-result>
|
218
|
+
<rule-result idref="xccdf_org.ssgproject.content_rule_sshd_set_keepalive" time="2014-10-17T09:07:55" severity="low" weight="1.000000">
|
219
|
+
<result>fail</result>
|
220
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
221
|
+
<check-content-ref name="oval:ssg:def:135" href="#xccdf1"/>
|
222
|
+
</check>
|
223
|
+
</rule-result>
|
224
|
+
<score system="urn:xccdf:scoring:default" maximum="100.000000">34.722221</score>
|
225
|
+
</TestResult>
|
data/test/data/xccdf.xml
CHANGED
@@ -1,20 +1,3046 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
2
|
-
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.2" id="
|
3
|
-
<status>
|
4
|
-
<
|
5
|
-
<
|
6
|
-
|
7
|
-
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.2" id="xccdf_org.ssgproject.content_benchmark_FEDORA" resolved="1" xml:lang="en-US">
|
3
|
+
<status date="2014-10-02">draft</status>
|
4
|
+
<title xml:lang="en-US">Guide to the Secure Configuration of Fedora</title>
|
5
|
+
<description xml:lang="en-US">This guide presents a catalog of security-relevant configuration
|
6
|
+
settings for Fedora operating system formatted in the eXtensible Configuration
|
7
|
+
Checklist Description Format (XCCDF).
|
8
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
9
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
10
|
+
Providing system administrators with such guidance informs them how to securely
|
11
|
+
configure systems under their control in a variety of network roles. Policy
|
12
|
+
makers and baseline creators can use this catalog of settings, with its
|
13
|
+
associated references to higher-level security control catalogs, in order to
|
14
|
+
assist them in security baseline creation. This guide is a <i xmlns="http://www.w3.org/1999/xhtml">catalog, not a
|
15
|
+
checklist,</i> and satisfaction of every item is not likely to be possible or
|
16
|
+
sensible in many operational scenarios. However, the XCCDF format enables
|
17
|
+
granular selection and adjustment of settings, and their association with OVAL
|
18
|
+
and OCIL content provides an automated checking capability. Transformations of
|
19
|
+
this document, and its associated automated checking content, are capable of
|
20
|
+
providing baselines that meet a diverse set of policy objectives. Some example
|
21
|
+
XCCDF <i xmlns="http://www.w3.org/1999/xhtml">Profiles</i>, which are selections of items that form checklists and
|
22
|
+
can be used as baselines, are available with this guide. They can be
|
23
|
+
processed, in an automated fashion, with tools that support the Security
|
24
|
+
Content Automation Protocol (SCAP).
|
25
|
+
</description>
|
26
|
+
<notice xml:lang="en-US" id="terms_of_use">Do not attempt to implement any of the settings in
|
27
|
+
this guide without first testing them in a non-operational environment. The
|
28
|
+
creators of this guidance assume no responsibility whatsoever for its use by
|
29
|
+
other parties, and makes no guarantees, expressed or implied, about its
|
30
|
+
quality, reliability, or any other characteristic.</notice>
|
31
|
+
<front-matter xml:lang="en-US">
|
32
|
+
<p xmlns="http://www.w3.org/1999/xhtml">
|
33
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" xml:space="preserve" height="140px" viewBox="30 100 330 150" width="350px" version="1.1" y="0px" x="0px" enable-background="new 30 100 330 150">
|
34
|
+
<g fill="#3A3B3B">
|
35
|
+
<path d="m197.1 150.3s-10.1-1.2-14.4-1.2c-7.2 0-11.0 2.6-11.0 8.3 0 6.6 3.5 7.7 12.3 9.6 10.1 2.3 14.5 4.7 14.5 13.6 0 11.2-6.1 15.6-16.1 15.6-6.0 0-16.0-1.6-16.0-1.6l0.6-4.7s9.9 1.3 15.1 1.3c7.2 0 10.8-3.1 10.8-10.2 0-5.7-3.0-7.3-11.2-8.9-10.4-2.3-15.7-4.7-15.7-14.4 0-9.8 6.4-13.6 16.3-13.6 6.0 0 15.3 1.5 15.3 1.5l-0.5 4.8z"/>
|
36
|
+
<path d="m238.7 194.6c-3.6 0.7-9.1 1.5-13.9 1.5-15.1 0-18.5-9.2-18.5-25.9 0-17.1 3.3-26.1 18.5-26.1 5.2 0 10.7 1.0 13.9 1.6l-0.2 4.7c-3.3-0.6-9.2-1.3-13.1-1.3-11.2 0-13.2 6.7-13.2 21.1 0 14.1 1.8 20.8 13.4 20.8 4.1 0 9.5-0.7 13.0-1.3l0.2 4.8z"/>
|
37
|
+
<path d="m257.5 144.9h12.3l13.9 50.5h-5.6l-3.7-13.0h-21.6l-3.7 13.0h-5.5l13.9-50.5zm-3.4 32.5h19.1l-7.7-27.7h-3.8l-7.7 27.7z"/>
|
38
|
+
<path d="m297.2 178.4v17.0h-5.6v-50.5h18.5c11.0 0 16.1 5.3 16.1 16.3 0 11.0-5.1 17.2-16.1 17.2h-12.9zm12.8-5.0c7.4 0 10.4-4.5 10.4-12.3 0-7.7-3.1-11.3-10.4-11.3h-12.8v23.6h12.8z"/>
|
39
|
+
</g>
|
40
|
+
<g fill="#676767">
|
41
|
+
<path d="m176.8 211.2s-2.8-0.3-4.0-0.3c-1.5 0-2.2 0.5-2.2 1.4 0 0.9 0.5 1.2 2.8 1.9 2.9 0.9 3.8 1.8 3.8 4.0 0 3.0-2.0 4.3-4.7 4.3-1.9 0-4.5-0.6-4.5-0.6l0.3-2.1s2.7 0.4 4.1 0.4c1.5 0 2.1-0.7 2.1-1.8 0-0.8-0.5-1.2-2.4-1.8-3.1-0.9-4.2-1.9-4.2-4.1 0-2.8 1.9-4.0 4.6-4.0 1.8 0 4.5 0.5 4.5 0.5l-0.2 2.2z"/>
|
42
|
+
<path d="m180.6 208.7h8.8v2.4h-6.0v3.2h4.8v2.4h-4.9v3.3h6.0v2.4h-8.8v-13.6z"/>
|
43
|
+
<path d="m201.2 222.1c-0.9 0.2-2.7 0.5-4.0 0.5-4.2 0-5.2-2.3-5.2-7.0 0-5.2 1.2-7.0 5.2-7.0 1.4 0 3.1 0.3 4.0 0.5l-0.1 2.2c-0.9-0.1-2.6-0.3-3.5-0.3-2.1 0-2.8 0.7-2.8 4.6 0 3.7 0.5 4.6 2.8 4.6 0.9 0 2.6-0.2 3.4-0.3l0.1 2.3z"/>
|
44
|
+
<path d="m209.5 220.2c1.6 0 2.4-0.8 2.4-2.4v-9.1h2.8v9.0c0 3.4-1.8 4.8-5.2 4.8-3.4 0-5.2-1.4-5.2-4.8v-9.0h2.8v9.1c0 1.6 0.8 2.4 2.4 2.4z"/>
|
45
|
+
<path d="m221.3 217.8v4.6h-2.8v-13.6h5.3c3.1 0 4.8 1.4 4.8 4.5 0 1.9-0.8 3.1-2.0 3.9l1.9 5.2h-3.0l-1.6-4.6h-2.7zm2.5-6.7h-2.5v4.3h2.6c1.4 0 1.9-1.0 1.9-2.2 0-1.3-0.7-2.2-2.0-2.2z"/>
|
46
|
+
<path d="m231.9 208.7h2.8v13.6h-2.8v-13.6z"/>
|
47
|
+
<path d="m237.4 208.7h10.0v2.4h-3.6v11.2h-2.8v-11.2h-3.6v-2.4z"/>
|
48
|
+
<path d="m255.7 222.3h-2.8v-5.5l-4.2-8.1h3.1l2.5 5.4 2.5-5.4h3.1l-4.2 8.1v5.5z"/>
|
49
|
+
<path d="m273.4 215.1h4.0v7.1s-2.9 0.5-4.6 0.5c-4.4 0-5.6-2.5-5.6-7.0 0-5.0 1.4-7.0 5.5-7.0 2.1 0 4.7 0.6 4.7 0.6l-0.1 2.1s-2.4-0.3-4.2-0.3c-2.4 0-3.1 0.8-3.1 4.6 0 3.6 0.5 4.6 3.0 4.6 0.8 0 1.7-0.1 1.7-0.1v-2.6h-1.2v-2.4z"/>
|
50
|
+
<path d="m286 220.2c1.6 0 2.4-0.8 2.4-2.4v-9.1h2.8v9.0c0 3.4-1.8 4.8-5.2 4.8s-5.2-1.4-5.2-4.8v-9.0h2.8v9.1c0 1.6 0.8 2.4 2.4 2.4z"/>
|
51
|
+
<path d="m295.0 208.7h2.8v13.6h-2.8v-13.6z"/>
|
52
|
+
<path d="m301.8 222.3v-13.6h4.6c4.7 0 5.8 2.0 5.6 6.5 0 4.6-0.9 7.1-5.8 7.1h-4.6zm4.6-11.2h-1.8v8.8h1.8c2.7 0 2.9-1.6 2.9-4.7 0-3.0-0.3-4.1-3.0-4.1z"/>
|
53
|
+
<path d="m315.5 208.7h8.8v2.4h-6.0v3.2h4.8v2.4h-4.8v3.3h6.0v2.4h-8.8v-13.6z"/>
|
54
|
+
</g>
|
55
|
+
<path d="m116.0 204.9h-2.8c-1.5 0-2.8 1.2-2.8 2.7v19.2c0 1.5 1.3 2.7 2.8 2.7h27.9c1.5 0 2.8-1.2 2.8-2.7v-19.2c0-1.5-1.3-2.7-2.8-2.7h-2.8v-8.2c0-6.1-5.0-11.0-11.2-11.0-6.2 0-11.2 4.9-11.2 11.0v8.2zm5.6-8.2c0-3.0 2.5-5.5 5.6-5.4 3.1 0 5.6 2.4 5.6 5.5v8.2h-11.2v-8.2z" fill="#6D0B2B"/>
|
56
|
+
<g fill="#AD1D3F">
|
57
|
+
<path d="m106.4 214.7c-16.4 11.4-37.5 7.8-50.0-3.4l11.9-11.7c2.3-1.9 3.4-5.4 1.2-8.8-0.1-0.1-6.7-11.0 2.3-19.8 7.3-7.2 17.8-5.8 23.3-0.3 3.2 3.1 4.9 7.1 4.9 11.4v0.1c0 4.3-1.8 8.5-5.1 11.7-4.0 3.9-9.6 5.4-15.4 4.1-2.1-0.5-4.3 0.8-4.8 2.9-0.5 2.1 0.8 4.2 2.9 4.7 8.4 2.0 16.9-0.3 22.8-6.1 4.9-4.8 7.5-10.9 7.4-17.4-0.0-6.3-2.6-12.3-7.3-16.8-8.2-8.1-23.8-10.3-34.5 0.3-10.7 10.5-6.6 23.8-3.7 28.8l-12.8 12.6c-2.9 2.9-2.3 6.6-0.2 8.7 15.4 15.2 38.7 17.9 56.9 8.2l-0.0-9.1z"/>
|
58
|
+
<path d="m43.9 188.4c-1.1-7.5-1.1-21.8 11.2-33.9 8.0-7.9 18.5-12.0 29.5-11.7 10.2 0.3 20.1 4.5 27.1 11.4 7.6 7.4 11.8 17.3 11.9 27.8v0.1c1.16-0.3 2.4-0.4 3.6-0.4 1.5 0 2.9 0.2 4.3 0.6 0-0.1 0.0-0.2 0.0-0.3-0.1-12.5-5.2-24.3-14.2-33.2-8.4-8.3-20.2-13.3-32.4-13.7-13.2-0.5-25.8 4.5-35.4 14.0-9.1 8.9-14.0 20.8-14.0 33.3 0 2.4 0.2 4.8 0.5 7.2 0.6 4.0 1.8 8.1 3.7 12.2 0.9 2.0 3.2 2.8 5.2 1.9 2.0-0.9 2.9-3.1 2.0-5.1-1.5-3.3-2.6-6.8-3.1-10.1z"/>
|
59
|
+
</g>
|
60
|
+
<circle cy="218.49" cx="127.26" r="3.233" fill="#fff"/>
|
61
|
+
</svg>
|
62
|
+
</p>
|
63
|
+
</front-matter>
|
64
|
+
<rear-matter xml:lang="en-US">Red Hat and Fedora are either registered
|
65
|
+
trademarks or trademarks of Red Hat, Inc. in the United States and other
|
66
|
+
countries. All other names are registered trademarks or trademarks of their
|
67
|
+
respective companies.</rear-matter>
|
68
|
+
<platform idref="cpe:/o:fedoraproject:fedora:21"/>
|
69
|
+
<platform idref="cpe:/o:fedoraproject:fedora:20"/>
|
70
|
+
<platform idref="cpe:/o:fedoraproject:fedora:19"/>
|
71
|
+
<version>0.0.4</version>
|
72
|
+
<model system="urn:xccdf:scoring:default"/>
|
73
|
+
<Profile id="xccdf_org.ssgproject.content_profile_common">
|
74
|
+
<title xml:lang="en-US">Common Profile for General-Purpose Fedora Systems</title>
|
75
|
+
<description xml:lang="en-US">This profile contains items common to general-purpose Fedora installations.</description>
|
76
|
+
<select idref="xccdf_org.ssgproject.content_rule_disable_prelink" selected="true"/>
|
77
|
+
<select idref="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated" selected="true"/>
|
78
|
+
<select idref="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled" selected="true"/>
|
79
|
+
<select idref="xccdf_org.ssgproject.content_rule_file_permissions_library_dirs" selected="true"/>
|
80
|
+
<select idref="xccdf_org.ssgproject.content_rule_file_ownership_library_dirs" selected="true"/>
|
81
|
+
<select idref="xccdf_org.ssgproject.content_rule_file_permissions_binary_dirs" selected="true"/>
|
82
|
+
<select idref="xccdf_org.ssgproject.content_rule_file_ownership_binary_dirs" selected="true"/>
|
83
|
+
<select idref="xccdf_org.ssgproject.content_rule_no_direct_root_logins" selected="true"/>
|
84
|
+
<select idref="xccdf_org.ssgproject.content_rule_securetty_root_login_console_only" selected="true"/>
|
85
|
+
<select idref="xccdf_org.ssgproject.content_rule_restrict_serial_port_logins" selected="true"/>
|
86
|
+
<select idref="xccdf_org.ssgproject.content_rule_no_uidzero_except_root" selected="true"/>
|
87
|
+
<select idref="xccdf_org.ssgproject.content_rule_no_empty_passwords" selected="true"/>
|
88
|
+
<select idref="xccdf_org.ssgproject.content_rule_no_hashes_outside_shadow" selected="true"/>
|
89
|
+
<select idref="xccdf_org.ssgproject.content_rule_no_netrc_files" selected="true"/>
|
90
|
+
<select idref="xccdf_org.ssgproject.content_rule_accounts_password_minlen_login_defs" selected="true"/>
|
91
|
+
<select idref="xccdf_org.ssgproject.content_rule_accounts_minimum_age_login_defs" selected="true"/>
|
92
|
+
<select idref="xccdf_org.ssgproject.content_rule_accounts_maximum_age_login_defs" selected="true"/>
|
93
|
+
<select idref="xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs" selected="true"/>
|
94
|
+
<select idref="xccdf_org.ssgproject.content_rule_service_ntpd_enabled" selected="true"/>
|
95
|
+
<select idref="xccdf_org.ssgproject.content_rule_ntpd_specify_remote_server" selected="true"/>
|
96
|
+
<select idref="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="true"/>
|
97
|
+
<select idref="xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords" selected="true"/>
|
98
|
+
<select idref="xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout" selected="true"/>
|
99
|
+
<select idref="xccdf_org.ssgproject.content_rule_sshd_set_keepalive" selected="true"/>
|
100
|
+
<refine-value idref="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs" selector="12"/>
|
101
|
+
<refine-value idref="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs" selector="7"/>
|
102
|
+
<refine-value idref="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs" selector="90"/>
|
103
|
+
<refine-value idref="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs" selector="7"/>
|
104
|
+
<refine-value idref="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value" selector="5_minutes"/>
|
8
105
|
</Profile>
|
9
|
-
<
|
10
|
-
<title>
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
106
|
+
<Value id="xccdf_org.ssgproject.content_value_conditional_clause" operator="equals" type="string">
|
107
|
+
<title xml:lang="en-US">A conditional clause for check statements.</title>
|
108
|
+
<description xml:lang="en-US">A conditional clause for check statements.</description>
|
109
|
+
<value>This is a placeholder.</value>
|
110
|
+
</Value>
|
111
|
+
<Group id="xccdf_org.ssgproject.content_group_intro">
|
112
|
+
<title xml:lang="en-US">Introduction</title>
|
113
|
+
<description xml:lang="en-US"><!-- purpose and scope of guidance -->
|
114
|
+
The purpose of this guidance is to provide security configuration
|
115
|
+
recommendations and baselines for the Fedora operating system.
|
116
|
+
Recommended settings for the basic operating system are provided,
|
117
|
+
as well as for many network services that the system can provide
|
118
|
+
to other systems.
|
119
|
+
<!-- audience -->The guide is intended for system administrators. Readers are assumed to
|
120
|
+
possess basic system administration skills for Unix-like systems, as well
|
121
|
+
as some familiarity with Fedora's documentation and administration
|
122
|
+
conventions. Some instructions within this guide are complex.
|
123
|
+
All directions should be followed completely and with understanding of
|
124
|
+
their effects in order to avoid serious adverse effects on the system
|
125
|
+
and its security.
|
126
|
+
</description>
|
127
|
+
<Group id="xccdf_org.ssgproject.content_group_general-principles">
|
128
|
+
<title xml:lang="en-US">General Principles</title>
|
129
|
+
<description xml:lang="en-US">
|
130
|
+
The following general principles motivate much of the advice in this
|
131
|
+
guide and should also influence any configuration decisions that are
|
132
|
+
not explicitly covered.
|
133
|
+
</description>
|
134
|
+
<Group id="xccdf_org.ssgproject.content_group_principle-encrypt-transmitted-data">
|
135
|
+
<title xml:lang="en-US">Encrypt Transmitted Data Whenever Possible</title>
|
136
|
+
<description xml:lang="en-US">
|
137
|
+
Data transmitted over a network, whether wired or wireless, is susceptible
|
138
|
+
to passive monitoring. Whenever practical solutions for encrypting
|
139
|
+
such data exist, they should be applied. Even if data is expected to
|
140
|
+
be transmitted only over a local network, it should still be encrypted.
|
141
|
+
Encrypting authentication data, such as passwords, is particularly
|
142
|
+
important. Networks of Fedora machines can and should be configured
|
143
|
+
so that no unencrypted authentication data is ever transmitted between
|
144
|
+
machines.
|
145
|
+
</description>
|
146
|
+
</Group>
|
147
|
+
<Group id="xccdf_org.ssgproject.content_group_principle-minimize-software">
|
148
|
+
<title xml:lang="en-US">Minimize Software to Minimize Vulnerability</title>
|
149
|
+
<description xml:lang="en-US">
|
150
|
+
The simplest way to avoid vulnerabilities in software is to avoid
|
151
|
+
installing that software. On Fedora, the RPM Package Manager (originally
|
152
|
+
Red Hat Package Manager, abbreviated RPM) allows for careful management of
|
153
|
+
the set of software packages installed on a system. Installed software
|
154
|
+
contributes to system vulnerability in several ways. Packages that
|
155
|
+
include setuid programs may provide local attackers a potential path to
|
156
|
+
privilege escalation. Packages that include network services may give
|
157
|
+
this opportunity to network-based attackers. Packages that include
|
158
|
+
programs which are predictably executed by local users (e.g. after
|
159
|
+
graphical login) may provide opportunities for trojan horses or other
|
160
|
+
attack code to be run undetected. The number of software packages
|
161
|
+
installed on a system can almost always be significantly pruned to include
|
162
|
+
only the software for which there is an environmental or operational need.
|
163
|
+
</description>
|
164
|
+
</Group>
|
165
|
+
<Group id="xccdf_org.ssgproject.content_group_principle-separate-servers">
|
166
|
+
<title xml:lang="en-US">Run Different Network Services on Separate Systems</title>
|
167
|
+
<description xml:lang="en-US">
|
168
|
+
Whenever possible, a server should be dedicated to serving exactly one
|
169
|
+
network service. This limits the number of other services that can
|
170
|
+
be compromised in the event that an attacker is able to successfully
|
171
|
+
exploit a software flaw in one network service.
|
172
|
+
</description>
|
173
|
+
</Group>
|
174
|
+
<Group id="xccdf_org.ssgproject.content_group_principle-use-security-tools">
|
175
|
+
<title xml:lang="en-US">Configure Security Tools to Improve System Robustness</title>
|
176
|
+
<description xml:lang="en-US">
|
177
|
+
Several tools exist which can be effectively used to improve a system's
|
178
|
+
resistance to and detection of unknown attacks. These tools can improve
|
179
|
+
robustness against attack at the cost of relatively little configuration
|
180
|
+
effort. In particular, this guide recommends and discusses the use of
|
181
|
+
Iptables for host-based firewalling, SELinux for protection against
|
182
|
+
vulnerable services, and a logging and auditing infrastructure for
|
183
|
+
detection of problems.
|
184
|
+
</description>
|
185
|
+
</Group>
|
186
|
+
<Group id="xccdf_org.ssgproject.content_group_principle-least-privilege">
|
187
|
+
<title xml:lang="en-US">Least Privilege</title>
|
188
|
+
<description xml:lang="en-US">
|
189
|
+
Grant the least privilege necessary for user accounts and software to perform tasks.
|
190
|
+
For example, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sudo</xhtml:code> can be implemented to limit authorization to super user
|
191
|
+
accounts on the system only to designated personnel. Another example is to limit
|
192
|
+
logins on server systems to only those administrators who need to log into them in
|
193
|
+
order to perform administration tasks. Using SELinux also follows the principle of
|
194
|
+
least privilege: SELinux policy can confine software to perform only actions on the
|
195
|
+
system that are specifically allowed. This can be far more restrictive than the
|
196
|
+
actions permissible by the traditional Unix permissions model.
|
197
|
+
</description>
|
198
|
+
</Group>
|
199
|
+
</Group>
|
200
|
+
<Group id="xccdf_org.ssgproject.content_group_how-to-use">
|
201
|
+
<title xml:lang="en-US">How to Use This Guide</title>
|
202
|
+
<description xml:lang="en-US">
|
203
|
+
Readers should heed the following points when using the guide.
|
204
|
+
</description>
|
205
|
+
<Group id="xccdf_org.ssgproject.content_group_intro-read-sections-completely">
|
206
|
+
<title xml:lang="en-US">Read Sections Completely and in Order</title>
|
207
|
+
<description xml:lang="en-US">
|
208
|
+
Each section may build on information and recommendations discussed in
|
209
|
+
prior sections. Each section should be read and understood completely;
|
210
|
+
instructions should never be blindly applied. Relevant discussion may
|
211
|
+
occur after instructions for an action.
|
212
|
+
</description>
|
213
|
+
</Group>
|
214
|
+
<Group id="xccdf_org.ssgproject.content_group_intro-test-non-production">
|
215
|
+
<title xml:lang="en-US">Test in Non-Production Environment</title>
|
216
|
+
<description xml:lang="en-US">
|
217
|
+
This guidance should always be tested in a non-production environment
|
218
|
+
before deployment. This test environment should simulate the setup in
|
219
|
+
which the system will be deployed as closely as possible.
|
220
|
+
</description>
|
221
|
+
</Group>
|
222
|
+
<Group id="xccdf_org.ssgproject.content_group_intro-root-shell-assumed">
|
223
|
+
<title xml:lang="en-US">Root Shell Environment Assumed</title>
|
224
|
+
<description xml:lang="en-US">
|
225
|
+
Most of the actions listed in this document are written with the
|
226
|
+
assumption that they will be executed by the root user running the
|
227
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/bin/bash</xhtml:code> shell. Commands preceded with a hash mark (#)
|
228
|
+
assume that the administrator will execute the commands as root, i.e.
|
229
|
+
apply the command via <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sudo</xhtml:code> whenever possible, or use
|
230
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">su</xhtml:code> to gain root privileges if <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sudo</xhtml:code> cannot be
|
231
|
+
used. Commands which can be executed as a non-root user are are preceded
|
232
|
+
by a dollar sign ($) prompt.
|
233
|
+
</description>
|
234
|
+
</Group>
|
235
|
+
<Group id="xccdf_org.ssgproject.content_group_intro-formatting-conventions">
|
236
|
+
<title xml:lang="en-US">Formatting Conventions</title>
|
237
|
+
<description xml:lang="en-US">
|
238
|
+
Commands intended for shell execution, as well as configuration file text,
|
239
|
+
are featured in a <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">monospace font</xhtml:code>. <i xmlns="http://www.w3.org/1999/xhtml">Italics</i> are used
|
240
|
+
to indicate instances where the system administrator must substitute
|
241
|
+
the appropriate information into a command or configuration file.
|
242
|
+
</description>
|
243
|
+
</Group>
|
244
|
+
<Group id="xccdf_org.ssgproject.content_group_intro-reboot-required">
|
245
|
+
<title xml:lang="en-US">Reboot Required</title>
|
246
|
+
<description xml:lang="en-US">
|
247
|
+
A system reboot is implicitly required after some actions in order to
|
248
|
+
complete the reconfiguration of the system. In many cases, the changes
|
249
|
+
will not take effect until a reboot is performed. In order to ensure
|
250
|
+
that changes are applied properly and to test functionality, always
|
251
|
+
reboot the system after applying a set of recommendations from this guide.
|
252
|
+
</description>
|
253
|
+
</Group>
|
254
|
+
</Group>
|
255
|
+
</Group>
|
256
|
+
<Group id="xccdf_org.ssgproject.content_group_system">
|
257
|
+
<title xml:lang="en-US">System Settings</title>
|
258
|
+
<Group id="xccdf_org.ssgproject.content_group_settings">
|
259
|
+
<title xml:lang="en-US">General System Wide Configuration Settings</title>
|
260
|
+
<description xml:lang="en-US">The following sections contain information on
|
261
|
+
various security-relevant configuration settings that in
|
262
|
+
particular way modify the behaviour of the system as a whole.
|
263
|
+
</description>
|
264
|
+
<Rule id="xccdf_org.ssgproject.content_rule_disable_prelink" selected="false" severity="low">
|
265
|
+
<title xml:lang="en-US">Prelinking Disabled</title>
|
266
|
+
<description xml:lang="en-US">
|
267
|
+
The prelinking feature changes binaries in an attempt to decrease their startup
|
268
|
+
time. In order to disable it, change or add the following line inside the file
|
269
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/prelink</xhtml:code>:
|
270
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PRELINKING=no</pre>
|
271
|
+
Next, run the following command to return binaries to a normal, non-prelinked
|
272
|
+
state:
|
273
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># /sbin/prelink -ua</pre>
|
274
|
+
</description>
|
275
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
276
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
277
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-28</reference>
|
278
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
279
|
+
<rationale xml:lang="en-US">
|
280
|
+
The prelinking feature can interfere with the operation of checksum integrity
|
281
|
+
tools (e.g. AIDE), because it modifies binaries to speed up their startup time.
|
282
|
+
Also it makes the location of shared libraries very predictable, mitigating
|
283
|
+
the efficiency of address space layout randomization (ASLR) protection mechanism.
|
284
|
+
In addition, each upgrade of an application or a library requires prelink to be
|
285
|
+
run again.
|
286
|
+
</rationale>
|
287
|
+
<fix system="urn:xccdf:fix:script:sh">#
|
288
|
+
# Disable prelinking altogether
|
289
|
+
#
|
290
|
+
if grep -q ^PRELINKING /etc/sysconfig/prelink
|
291
|
+
then
|
292
|
+
sed -i 's/PRELINKING.*/PRELINKING=no/g' /etc/sysconfig/prelink
|
293
|
+
else
|
294
|
+
echo -e "\n# Set PRELINKING=no per security requirements" >> /etc/sysconfig/prelink
|
295
|
+
echo "PRELINKING=no" >> /etc/sysconfig/prelink
|
296
|
+
fi
|
297
|
+
|
298
|
+
#
|
299
|
+
# Undo previous prelink changes to binaries
|
300
|
+
#
|
301
|
+
/usr/sbin/prelink -ua
|
302
|
+
</fix>
|
303
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
304
|
+
<check-content-ref name="oval:ssg:def:198" href="ssg-fedora-oval.xml"/>
|
305
|
+
</check>
|
306
|
+
</Rule>
|
307
|
+
</Group>
|
308
|
+
<Group id="xccdf_org.ssgproject.content_group_software">
|
309
|
+
<title xml:lang="en-US">Installing and Maintaining Software</title>
|
310
|
+
<description xml:lang="en-US">The following sections contain information on
|
311
|
+
security-relevant choices during the initial operating system
|
312
|
+
installation process and the setup of software
|
313
|
+
updates.</description>
|
314
|
+
<Group id="xccdf_org.ssgproject.content_group_updating">
|
315
|
+
<title xml:lang="en-US">Updating Software</title>
|
316
|
+
<description xml:lang="en-US">The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">yum</xhtml:code> command line tool is used to install and
|
317
|
+
update software packages. The system also provides a graphical
|
318
|
+
software update tool in the <b xmlns="http://www.w3.org/1999/xhtml">System</b> menu, in the <b xmlns="http://www.w3.org/1999/xhtml">Administration</b> submenu,
|
319
|
+
called <b xmlns="http://www.w3.org/1999/xhtml">Software Update</b>.
|
320
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
321
|
+
Fedora systems contain an installed software catalog called
|
322
|
+
the RPM database, which records metadata of installed packages. Tools such as
|
323
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">yum</xhtml:code> or the graphical <b xmlns="http://www.w3.org/1999/xhtml">Software Update</b> ensure usage of RPM
|
324
|
+
packages for software installation. This allows for insight into the current
|
325
|
+
inventory of installed software on the system, and is highly recommended.
|
326
|
+
</description>
|
327
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated" selected="false" severity="high">
|
328
|
+
<title xml:lang="en-US">gpgcheck Enabled In Main Yum Configuration</title>
|
329
|
+
<description xml:lang="en-US">The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code> option should be used to ensure
|
330
|
+
checking of an RPM package's signature always occurs prior to its
|
331
|
+
installation. To configure yum to check package signatures before installing
|
332
|
+
them, ensure the following line appears in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/yum.conf</xhtml:code> in
|
333
|
+
the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">[main]</xhtml:code> section:
|
334
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">gpgcheck=1</pre>
|
335
|
+
</description>
|
336
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
337
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">MA-1(b)</reference>
|
338
|
+
<reference href="http://iase.disa.mil/cci/index.html">352</reference>
|
339
|
+
<reference href="http://iase.disa.mil/cci/index.html">663</reference>
|
340
|
+
<rationale xml:lang="en-US">
|
341
|
+
Ensuring the validity of packages' cryptographic signatures prior to
|
342
|
+
installation ensures the provenance of the software and
|
343
|
+
protects against malicious tampering.
|
344
|
+
</rationale>
|
345
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
346
|
+
<check-content-ref name="oval:ssg:def:148" href="ssg-fedora-oval.xml"/>
|
347
|
+
</check>
|
348
|
+
<check system="ocil-transitional">
|
349
|
+
<check-export export-name="GPG checking is not enabled" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
350
|
+
<check-content>
|
351
|
+
To determine whether <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">yum</xhtml:code> is configured to use <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code>,
|
352
|
+
inspect <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/yum.conf</xhtml:code> and ensure the following appears in the
|
353
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">[main]</xhtml:code> section:
|
354
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">gpgcheck=1</pre>
|
355
|
+
A value of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">1</xhtml:code> indicates that <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code> is enabled. Absence of a
|
356
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code> line or a setting of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">0</xhtml:code> indicates that it is
|
357
|
+
disabled.
|
358
|
+
</check-content>
|
359
|
+
</check>
|
360
|
+
</Rule>
|
361
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled" selected="false" severity="high">
|
362
|
+
<title xml:lang="en-US">gpgcheck Enabled For All Yum Package Repositories</title>
|
363
|
+
<description xml:lang="en-US">To ensure signature checking is not disabled for
|
364
|
+
any repos, remove any lines from files in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/yum.repos.d</xhtml:code> of the form:
|
365
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">gpgcheck=0</pre>
|
366
|
+
</description>
|
367
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
368
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">MA-1(b)</reference>
|
369
|
+
<reference href="http://iase.disa.mil/cci/index.html">352</reference>
|
370
|
+
<reference href="http://iase.disa.mil/cci/index.html">663</reference>
|
371
|
+
<rationale xml:lang="en-US">
|
372
|
+
Ensuring all packages' cryptographic signatures are valid prior to
|
373
|
+
installation ensures the provenance of the software and
|
374
|
+
protects against malicious tampering.
|
375
|
+
</rationale>
|
376
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
377
|
+
<check-content-ref name="oval:ssg:def:124" href="ssg-fedora-oval.xml"/>
|
378
|
+
</check>
|
379
|
+
<check system="ocil-transitional">
|
380
|
+
<check-export export-name="GPG checking is disabled" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
381
|
+
<check-content>
|
382
|
+
To determine whether <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">yum</xhtml:code> has been configured to disable
|
383
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code> for any repos, inspect all files in
|
384
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/yum.repos.d</xhtml:code> and ensure the following does not appear in any
|
385
|
+
sections:
|
386
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">gpgcheck=0</pre>
|
387
|
+
A value of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">0</xhtml:code> indicates that <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gpgcheck</xhtml:code> has been disabled for that repo.
|
388
|
+
</check-content>
|
389
|
+
</check>
|
390
|
+
</Rule>
|
391
|
+
</Group>
|
392
|
+
<Group id="xccdf_org.ssgproject.content_group_integrity">
|
393
|
+
<title xml:lang="en-US">Software Integrity Checking</title>
|
394
|
+
<description xml:lang="en-US">
|
395
|
+
Both the AIDE (Advanced Intrusion Detection Environment)
|
396
|
+
software and the RPM package management system provide
|
397
|
+
mechanisms for verifying the integrity of installed software.
|
398
|
+
AIDE uses snapshots of file metadata (such as hashes) and compares these
|
399
|
+
to current system files in order to detect changes.
|
400
|
+
The RPM package management system can conduct integrity
|
401
|
+
checks by comparing information in its metadata database with
|
402
|
+
files installed on the system.
|
403
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
404
|
+
Integrity checking cannot <i xmlns="http://www.w3.org/1999/xhtml">prevent</i> intrusions,
|
405
|
+
but can detect that they have occurred. Requirements
|
406
|
+
for software integrity checking may be highly dependent on
|
407
|
+
the environment in which the system will be used. Snapshot-based
|
408
|
+
approaches such as AIDE may induce considerable overhead
|
409
|
+
in the presence of frequent software updates.
|
410
|
+
</description>
|
411
|
+
<Group id="xccdf_org.ssgproject.content_group_aide">
|
412
|
+
<title xml:lang="en-US">Verify Integrity with AIDE</title>
|
413
|
+
<description xml:lang="en-US">AIDE conducts integrity checks by comparing information about
|
414
|
+
files with previously-gathered information. Ideally, the AIDE database is
|
415
|
+
created immediately after initial system configuration, and then again after any
|
416
|
+
software update. AIDE is highly configurable, with further configuration
|
417
|
+
information located in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/usr/share/doc/aide-<i xmlns="http://www.w3.org/1999/xhtml">VERSION</i></xhtml:code>.
|
418
|
+
</description>
|
419
|
+
<Rule id="xccdf_org.ssgproject.content_rule_package_aide_installed" selected="false" severity="medium">
|
420
|
+
<title xml:lang="en-US">Install AIDE</title>
|
421
|
+
<description xml:lang="en-US">
|
422
|
+
Install the AIDE package with the command:
|
423
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># yum install aide</pre>
|
424
|
+
</description>
|
425
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(d)</reference>
|
426
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(e)</reference>
|
427
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
428
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
429
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-28</reference>
|
430
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
431
|
+
<reference href="http://iase.disa.mil/cci/index.html">1069</reference>
|
432
|
+
<rationale xml:lang="en-US">
|
433
|
+
The AIDE package must be installed if it is to be available for integrity checking.
|
434
|
+
</rationale>
|
435
|
+
<check system="ocil-transitional">
|
436
|
+
<check-export export-name="the package is not installed" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
437
|
+
<check-content>
|
438
|
+
|
439
|
+
Run the following command to determine if the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">aide</xhtml:code> package is installed:
|
440
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># rpm -q aide</xhtml:pre>
|
441
|
+
</check-content>
|
442
|
+
</check>
|
443
|
+
</Rule>
|
444
|
+
<Rule id="xccdf_org.ssgproject.content_rule_aide_build_database" selected="false" severity="low">
|
445
|
+
<title xml:lang="en-US">Build and Test AIDE Database</title>
|
446
|
+
<description xml:lang="en-US">Run the following command to generate a new database:
|
447
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># /usr/sbin/aide --init</pre>
|
448
|
+
By default, the database will be written to the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/var/lib/aide/aide.db.new.gz</xhtml:code>.
|
449
|
+
Storing the database, the configuration file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/aide.conf</xhtml:code>, and the binary
|
450
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/usr/sbin/aide</xhtml:code> (or hashes of these files), in a secure location (such as on read-only media) provides additional assurance about their integrity.
|
451
|
+
The newly-generated database can be installed as follows:
|
452
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz</pre>
|
453
|
+
To initiate a manual check, run the following command:
|
454
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># /usr/sbin/aide --check</pre>
|
455
|
+
If this check produces any unexpected output, investigate.
|
456
|
+
</description>
|
457
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(d)</reference>
|
458
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(e)</reference>
|
459
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
460
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
461
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-28</reference>
|
462
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
463
|
+
<rationale xml:lang="en-US">
|
464
|
+
For AIDE to be effective, an initial database of "known-good" information about files
|
465
|
+
must be captured and it should be able to be verified against the installed files.
|
466
|
+
</rationale>
|
467
|
+
</Rule>
|
468
|
+
<Rule id="xccdf_org.ssgproject.content_rule_aide_periodic_cron_checking" selected="false" severity="medium">
|
469
|
+
<title xml:lang="en-US">Configure Periodic Execution of AIDE</title>
|
470
|
+
<description xml:lang="en-US">
|
471
|
+
To implement a daily execution of AIDE at 4:05am using cron, add the following line to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/crontab</xhtml:code>:
|
472
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">05 4 * * * root /usr/sbin/aide --check</pre>
|
473
|
+
AIDE can be executed periodically through other means; this is merely one example.
|
474
|
+
</description>
|
475
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(d)</reference>
|
476
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-3(e)</reference>
|
477
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
478
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
479
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-28</reference>
|
480
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
481
|
+
<reference href="http://iase.disa.mil/cci/index.html">374</reference>
|
482
|
+
<reference href="http://iase.disa.mil/cci/index.html">416</reference>
|
483
|
+
<reference href="http://iase.disa.mil/cci/index.html">1069</reference>
|
484
|
+
<reference href="http://iase.disa.mil/cci/index.html">1263</reference>
|
485
|
+
<reference href="http://iase.disa.mil/cci/index.html">1297</reference>
|
486
|
+
<reference href="http://iase.disa.mil/cci/index.html">1589</reference>
|
487
|
+
<rationale xml:lang="en-US">
|
488
|
+
By default, AIDE does not install itself for periodic execution. Periodically
|
489
|
+
running AIDE is necessary to reveal unexpected changes in installed files.
|
490
|
+
</rationale>
|
491
|
+
<check system="ocil-transitional">
|
492
|
+
<check-export export-name="there is no output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
493
|
+
<check-content>
|
494
|
+
To determine that periodic AIDE execution has been scheduled, run the following command:
|
495
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep aide /etc/crontab</pre>
|
496
|
+
</check-content>
|
497
|
+
</check>
|
498
|
+
</Rule>
|
499
|
+
</Group>
|
500
|
+
<Group id="xccdf_org.ssgproject.content_group_rpm_verification">
|
501
|
+
<title xml:lang="en-US">Verify Integrity with RPM</title>
|
502
|
+
<description xml:lang="en-US">The RPM package management system includes the ability
|
503
|
+
to verify the integrity of installed packages by comparing the
|
504
|
+
installed files with information about the files taken from the
|
505
|
+
package metadata stored in the RPM database. Although an attacker
|
506
|
+
could corrupt the RPM database (analogous to attacking the AIDE
|
507
|
+
database as described above), this check can still reveal
|
508
|
+
modification of important files. To list which files on the system differ from what is expected by the RPM database:
|
509
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -qVa</pre>
|
510
|
+
See the man page for <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpm</xhtml:code> to see a complete explanation of each column.
|
511
|
+
</description>
|
512
|
+
<Rule id="xccdf_org.ssgproject.content_rule_rpm_verify_permissions" selected="false" severity="low">
|
513
|
+
<title xml:lang="en-US">Verify and Correct File Permissions with RPM</title>
|
514
|
+
<description xml:lang="en-US">
|
515
|
+
The RPM package management system can check file access
|
516
|
+
permissions of installed software packages, including many that are
|
517
|
+
important to system security.
|
518
|
+
After locating a file with incorrect permissions, run the following command to determine which package owns it:
|
519
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -qf <i>FILENAME</i></pre>
|
520
|
+
Next, run the following command to reset its permissions to
|
521
|
+
the correct values:
|
522
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm --setperms <i>PACKAGENAME</i></pre>
|
523
|
+
</description>
|
524
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
525
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
526
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
527
|
+
<reference href="http://iase.disa.mil/cci/index.html">1493</reference>
|
528
|
+
<reference href="http://iase.disa.mil/cci/index.html">1494</reference>
|
529
|
+
<reference href="http://iase.disa.mil/cci/index.html">1495</reference>
|
530
|
+
<rationale xml:lang="en-US">
|
531
|
+
Permissions on system binaries and configuration files that are too generous
|
532
|
+
could allow an unauthorized user to gain privileges that they should not have.
|
533
|
+
The permissions set by the vendor should be maintained. Any deviations from
|
534
|
+
this baseline should be investigated.</rationale>
|
535
|
+
<check system="ocil-transitional">
|
536
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
537
|
+
<check-content>
|
538
|
+
The following command will list which files on the system have permissions different from what
|
539
|
+
is expected by the RPM database:
|
540
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -Va | grep '^.M'</pre>
|
541
|
+
</check-content>
|
542
|
+
</check>
|
543
|
+
</Rule>
|
544
|
+
<Rule id="xccdf_org.ssgproject.content_rule_rpm_verify_hashes" selected="false" severity="low">
|
545
|
+
<title xml:lang="en-US">Verify File Hashes with RPM</title>
|
546
|
+
<description xml:lang="en-US">The RPM package management system can check the hashes of
|
547
|
+
installed software packages, including many that are important to system
|
548
|
+
security. Run the following command to list which files on the system
|
549
|
+
have hashes that differ from what is expected by the RPM database:
|
550
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -Va | grep '^..5'</pre>
|
551
|
+
A "c" in the second column indicates that a file is a configuration file, which
|
552
|
+
may appropriately be expected to change. If the file was not expected to
|
553
|
+
change, investigate the cause of the change using audit logs or other means.
|
554
|
+
The package can then be reinstalled to restore the file.
|
555
|
+
Run the following command to determine which package owns the file:
|
556
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -qf <i>FILENAME</i></pre>
|
557
|
+
The package can be reinstalled from a yum repository using the command:
|
558
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">yum reinstall <i>PACKAGENAME</i></pre>
|
559
|
+
Alternatively, the package can be reinstalled from trusted media using the command:
|
560
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">rpm -Uvh <i>PACKAGENAME</i></pre>
|
561
|
+
</description>
|
562
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(d)</reference>
|
563
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-6(3)</reference>
|
564
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-7</reference>
|
565
|
+
<reference href="http://iase.disa.mil/cci/index.html">1496</reference>
|
566
|
+
<rationale xml:lang="en-US">
|
567
|
+
The hashes of important files like system executables should match the
|
568
|
+
information given by the RPM database. Executables with erroneous hashes could
|
569
|
+
be a sign of nefarious activity on the system.</rationale>
|
570
|
+
<check system="ocil-transitional">
|
571
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
572
|
+
<check-content> The following command will list which files on the system
|
573
|
+
have file hashes different from what is expected by the RPM database.
|
574
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># rpm -Va | awk '$1 ~ /..5/ && $2 != "c"'</pre>
|
575
|
+
</check-content>
|
576
|
+
</check>
|
577
|
+
</Rule>
|
578
|
+
</Group>
|
579
|
+
<Group id="xccdf_org.ssgproject.content_group_additional_security_software">
|
580
|
+
<title xml:lang="en-US">Additional Security Software</title>
|
581
|
+
<description xml:lang="en-US">
|
582
|
+
Additional security software that is not provided or supported
|
583
|
+
by Red Hat can be installed to provide complementary or duplicative
|
584
|
+
security capabilities to those provided by the base platform. Add-on
|
585
|
+
software may not be appropriate for some specialized systems.
|
586
|
+
</description>
|
587
|
+
<Rule id="xccdf_org.ssgproject.content_rule_install_hids" selected="false" severity="high">
|
588
|
+
<title xml:lang="en-US">Install Intrusion Detection Software</title>
|
589
|
+
<description xml:lang="en-US">
|
590
|
+
The Red Hat platform includes a sophisticated auditing system
|
591
|
+
and SELinux, which provide host-based intrusion detection capabilities.
|
592
|
+
</description>
|
593
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-7</reference>
|
594
|
+
<reference href="http://iase.disa.mil/cci/index.html">1263</reference>
|
595
|
+
<rationale xml:lang="en-US">
|
596
|
+
Host-based intrusion detection tools provide a system-level defense when an
|
597
|
+
intruder gains access to a system or network.
|
598
|
+
</rationale>
|
599
|
+
<check system="ocil-transitional">
|
600
|
+
<check-export export-name="no host-based intrusion detection tools are installed" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
601
|
+
<check-content>
|
602
|
+
Inspect the system to determine if intrusion detection software has been installed.
|
603
|
+
Verify this intrusion detection software is active.
|
604
|
+
</check-content>
|
605
|
+
</check>
|
606
|
+
</Rule>
|
607
|
+
<Rule id="xccdf_org.ssgproject.content_rule_install_antivirus" selected="false" severity="low">
|
608
|
+
<title xml:lang="en-US">Install Virus Scanning Software</title>
|
609
|
+
<description xml:lang="en-US">
|
610
|
+
Install virus scanning software, which uses signatures to search for the
|
611
|
+
presence of viruses on the filesystem.
|
612
|
+
The McAfee VirusScan Enterprise for Linux virus scanning tool is provided for DoD systems.
|
613
|
+
Ensure virus definition files are no older than 7 days, or their last release.
|
614
|
+
<!-- need info here on where DoD admins can go to get this -->
|
615
|
+
Configure the virus scanning software to perform scans dynamically on all
|
616
|
+
accessed files. If this is not possible, configure the
|
617
|
+
system to scan all altered files on the system on a daily
|
618
|
+
basis. If the system processes inbound SMTP mail, configure the virus scanner
|
619
|
+
to scan all received mail.
|
620
|
+
<!-- what's the basis for the IAO language? would not failure of a check
|
621
|
+
imply a discussion, for every check in this document,
|
622
|
+
with the IAO (or SSO or ISSO or ISSM or whatever is the right acronym in your
|
623
|
+
particular neighborhood) should occur? -->
|
624
|
+
</description>
|
625
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-28</reference>
|
626
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SI-3</reference>
|
627
|
+
<reference href="http://iase.disa.mil/cci/index.html">1239</reference>
|
628
|
+
<reference href="http://iase.disa.mil/cci/index.html">1668</reference>
|
629
|
+
<rationale xml:lang="en-US">
|
630
|
+
Virus scanning software can be used to detect if a system has been compromised by
|
631
|
+
computer viruses, as well as to limit their spread to other systems.
|
632
|
+
</rationale>
|
633
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
634
|
+
<check-content-ref name="oval:ssg:def:164" href="ssg-fedora-oval.xml"/>
|
635
|
+
</check>
|
636
|
+
<check system="ocil-transitional">
|
637
|
+
<check-export export-name="virus scanning software does not run continuously, or at least daily, or has signatures that are out of date" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
638
|
+
<check-content>
|
639
|
+
Inspect the system for a cron job or system service which executes
|
640
|
+
a virus scanning tool regularly.
|
641
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
642
|
+
<!-- this should be handled as DoD-specific text in a future revision -->
|
643
|
+
To verify the McAfee VSEL system service is operational,
|
644
|
+
run the following command:
|
645
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># /etc/init.d/nails status</pre>
|
646
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
647
|
+
To check on the age of uvscan virus definition files, run the following command:
|
648
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># cd /opt/NAI/LinuxShield/engine/dat
|
649
|
+
# ls -la avvscan.dat avvnames.dat avvclean.dat</pre>
|
650
|
+
</check-content>
|
651
|
+
</check>
|
652
|
+
</Rule>
|
653
|
+
</Group>
|
654
|
+
</Group>
|
655
|
+
</Group>
|
656
|
+
<Group id="xccdf_org.ssgproject.content_group_permissions">
|
657
|
+
<title xml:lang="en-US">File Permissions and Masks</title>
|
658
|
+
<description xml:lang="en-US">Traditional Unix security relies heavily on file and
|
659
|
+
directory permissions to prevent unauthorized users from reading or
|
660
|
+
modifying files to which they should not have access.
|
661
|
+
</description>
|
662
|
+
<Group id="xccdf_org.ssgproject.content_group_permissions_within_important_dirs">
|
663
|
+
<title xml:lang="en-US">Verify File Permissions Within Some Important Directories</title>
|
664
|
+
<description xml:lang="en-US">Some directories contain files whose confidentiality or integrity
|
665
|
+
is notably important and may also be susceptible to misconfiguration over time,
|
666
|
+
particularly if unpackaged software is installed. As such, an argument exists
|
667
|
+
to verify that files' permissions within these directories remain configured
|
668
|
+
correctly and restrictively.
|
669
|
+
</description>
|
670
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_permissions_library_dirs" selected="false" severity="medium">
|
671
|
+
<title xml:lang="en-US">Shared Library Files Have Restrictive Permissions</title>
|
672
|
+
<description xml:lang="en-US">System-wide shared library files, which are linked to executables
|
673
|
+
during process load time or run time, are stored in the following directories
|
674
|
+
by default:
|
675
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">/lib
|
676
|
+
/lib64
|
677
|
+
/usr/lib
|
678
|
+
/usr/lib64
|
679
|
+
</pre>
|
680
|
+
Kernel modules, which can be added to the kernel during runtime, are stored in
|
681
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/lib/modules</xhtml:code>. All files in these directories should not be
|
682
|
+
group-writable or world-writable. If any file in these directories is found to
|
683
|
+
be group-writable or world-writable, correct its permission with the following
|
684
|
+
command:
|
685
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># chmod go-w <i>FILE</i></pre>
|
686
|
+
</description>
|
687
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
688
|
+
<reference href="http://iase.disa.mil/cci/index.html">1499</reference>
|
689
|
+
<rationale xml:lang="en-US">Files from shared library directories are loaded into the address
|
690
|
+
space of processes (including privileged ones) or of the kernel itself at
|
691
|
+
runtime. Restrictive permissions are necessary to protect the integrity of the
|
692
|
+
system.
|
693
|
+
</rationale>
|
694
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
695
|
+
<check-content-ref name="oval:ssg:def:190" href="ssg-fedora-oval.xml"/>
|
696
|
+
</check>
|
697
|
+
</Rule>
|
698
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_ownership_library_dirs" selected="false" severity="medium">
|
699
|
+
<title xml:lang="en-US">Shared Library Files Have Root Ownership</title>
|
700
|
+
<description xml:lang="en-US">System-wide shared library files, which are linked to executables
|
701
|
+
during process load time or run time, are stored in the following directories
|
702
|
+
by default:
|
703
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">/lib
|
704
|
+
/lib64
|
705
|
+
/usr/lib
|
706
|
+
/usr/lib64
|
707
|
+
</pre>
|
708
|
+
Kernel modules, which can be added to the kernel during runtime, are also
|
709
|
+
stored in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/lib/modules</xhtml:code>. All files in these directories should be owned
|
710
|
+
by the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> user. If the directory, or any file in these directories,
|
711
|
+
is found to be owned by a user other than root correct its ownership with the
|
712
|
+
following command:
|
713
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># chown root <i>FILE</i></pre>
|
714
|
+
</description>
|
715
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
716
|
+
<reference href="http://iase.disa.mil/cci/index.html">1499</reference>
|
717
|
+
<rationale xml:lang="en-US">Files from shared library directories are loaded into the address
|
718
|
+
space of processes (including privileged ones) or of the kernel itself at
|
719
|
+
runtime. Proper ownership is necessary to protect the integrity of the system.
|
720
|
+
</rationale>
|
721
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
722
|
+
<check-content-ref name="oval:ssg:def:207" href="ssg-fedora-oval.xml"/>
|
723
|
+
</check>
|
724
|
+
</Rule>
|
725
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_permissions_binary_dirs" selected="false" severity="medium">
|
726
|
+
<title xml:lang="en-US">System Executables Have Restrictive Permissions</title>
|
727
|
+
<description xml:lang="en-US">
|
728
|
+
System executables are stored in the following directories by default:
|
729
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">/bin
|
730
|
+
/usr/bin
|
731
|
+
/usr/local/bin
|
732
|
+
/sbin
|
733
|
+
/usr/sbin
|
734
|
+
/usr/local/sbin</pre>
|
735
|
+
All files in these directories should not be group-writable or world-writable.
|
736
|
+
If any file <i xmlns="http://www.w3.org/1999/xhtml">FILE</i> in these directories is found to be group-writable or
|
737
|
+
world-writable, correct its permission with the following command:
|
738
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># chmod go-w <i>FILE</i></pre>
|
739
|
+
</description>
|
740
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
741
|
+
<reference href="http://iase.disa.mil/cci/index.html">1499</reference>
|
742
|
+
<rationale xml:lang="en-US">System binaries are executed by privileged users, as well as system
|
743
|
+
services, and restrictive permissions are necessary to ensure execution of
|
744
|
+
these programs cannot be co-opted.
|
745
|
+
</rationale>
|
746
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
747
|
+
<check-content-ref name="oval:ssg:def:137" href="ssg-fedora-oval.xml"/>
|
748
|
+
</check>
|
749
|
+
</Rule>
|
750
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_ownership_binary_dirs" selected="false" severity="medium">
|
751
|
+
<title xml:lang="en-US">System Executables Have Root Ownership</title>
|
752
|
+
<description xml:lang="en-US">
|
753
|
+
System executables are stored in the following directories by default:
|
754
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">/bin
|
755
|
+
/usr/bin
|
756
|
+
/usr/local/bin
|
757
|
+
/sbin
|
758
|
+
/usr/sbin
|
759
|
+
/usr/local/sbin</pre>
|
760
|
+
All files in these directories should be owned by the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> user. If
|
761
|
+
any file <i xmlns="http://www.w3.org/1999/xhtml">FILE</i> in these directories is found to be owned by a user other
|
762
|
+
than root, correct its ownership with the following command:
|
763
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># chown root <i>FILE</i></pre>
|
764
|
+
</description>
|
765
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
766
|
+
<reference href="http://iase.disa.mil/cci/index.html">1499</reference>
|
767
|
+
<rationale xml:lang="en-US">System binaries are executed by privileged users as well as system
|
768
|
+
services, and restrictive permissions are necessary to ensure that their
|
769
|
+
execution of these programs cannot be co-opted.
|
770
|
+
</rationale>
|
771
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
772
|
+
<check-content-ref name="oval:ssg:def:161" href="ssg-fedora-oval.xml"/>
|
773
|
+
</check>
|
774
|
+
</Rule>
|
775
|
+
</Group>
|
776
|
+
</Group>
|
777
|
+
<Group id="xccdf_org.ssgproject.content_group_accounts">
|
778
|
+
<title xml:lang="en-US">Account and Access Control</title>
|
779
|
+
<description xml:lang="en-US">In traditional Unix security, if an attacker gains
|
780
|
+
shell access to a certain login account, they can perform any action
|
781
|
+
or access any file to which that account has access. Therefore,
|
782
|
+
making it more difficult for unauthorized people to gain shell
|
783
|
+
access to accounts, particularly to privileged accounts, is a
|
784
|
+
necessary part of securing a system. This section introduces
|
785
|
+
mechanisms for restricting access to accounts under Fedora.
|
786
|
+
</description>
|
787
|
+
<Group id="xccdf_org.ssgproject.content_group_accounts-restrictions">
|
788
|
+
<title xml:lang="en-US">Protect Accounts by Restricting Password-Based Login</title>
|
789
|
+
<description xml:lang="en-US">Conventionally, Unix shell accounts are accessed by
|
790
|
+
providing a username and password to a login program, which tests
|
791
|
+
these values for correctness using the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code> and
|
792
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/shadow</xhtml:code> files. Password-based login is vulnerable to
|
793
|
+
guessing of weak passwords, and to sniffing and man-in-the-middle
|
794
|
+
attacks against passwords entered over a network or at an insecure
|
795
|
+
console. Therefore, mechanisms for accessing accounts by entering
|
796
|
+
usernames and passwords should be restricted to those which are
|
797
|
+
operationally necessary.</description>
|
798
|
+
<Group id="xccdf_org.ssgproject.content_group_root_logins">
|
799
|
+
<title xml:lang="en-US">Restrict Root Logins</title>
|
800
|
+
<description xml:lang="en-US">
|
801
|
+
Direct root logins should be allowed only for emergency use.
|
802
|
+
In normal situations, the administrator should access the system
|
803
|
+
via a unique unprivileged account, and then use <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">su</xhtml:code> or <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sudo</xhtml:code> to execute
|
804
|
+
privileged commands. Discouraging administrators from accessing the
|
805
|
+
root account directly ensures an audit trail in organizations with
|
806
|
+
multiple administrators. Locking down the channels through which
|
807
|
+
root can connect directly also reduces opportunities for
|
808
|
+
password-guessing against the root account. The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">login</xhtml:code> program
|
809
|
+
uses the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/securetty</xhtml:code> to determine which interfaces
|
810
|
+
should allow root logins.
|
811
|
+
|
812
|
+
The virtual devices <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/console</xhtml:code>
|
813
|
+
and <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/tty*</xhtml:code> represent the system consoles (accessible via
|
814
|
+
the Ctrl-Alt-F1 through Ctrl-Alt-F6 keyboard sequences on a default
|
815
|
+
installation). The default securetty file also contains <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/vc/*</xhtml:code>.
|
816
|
+
These are likely to be deprecated in most environments, but may be retained
|
817
|
+
for compatibility. Furthermore, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/hvc*</xhtml:code> represent virtio-serial
|
818
|
+
consoles, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/hvsi*</xhtml:code> IBM pSeries serial consoles, and finally
|
819
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/dev/xvc0</xhtml:code> Xen virtual console. Root should also be prohibited
|
820
|
+
from connecting via network protocols. Other sections of this document
|
821
|
+
include guidance describing how to prevent root from logging in via SSH.
|
822
|
+
</description>
|
823
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_direct_root_logins" selected="false" severity="medium">
|
824
|
+
<title xml:lang="en-US">Direct root Logins Not Allowed</title>
|
825
|
+
<description xml:lang="en-US">To further limit access to the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> account, administrators
|
826
|
+
can disable root logins at the console by editing the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/securetty</xhtml:code> file.
|
827
|
+
This file lists all devices the root user is allowed to login to. If the file does
|
828
|
+
not exist at all, the root user can login through any communication device on the
|
829
|
+
system, whether via the console or via a raw network interface. This is dangerous
|
830
|
+
as user can login to his machine as root via Telnet, which sends the password in
|
831
|
+
plain text over the network. By default, Fedora's <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/securetty</xhtml:code> file
|
832
|
+
only allows the root user to login at the console physically attached to the
|
833
|
+
machine. To prevent root from logging in, remove the contents of this file.
|
834
|
+
To prevent direct root logins, remove the contents of this file by typing the
|
835
|
+
following command:
|
836
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">
|
837
|
+
echo > /etc/securetty
|
838
|
+
</pre>
|
839
|
+
</description>
|
840
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-2(1)</reference>
|
841
|
+
<rationale xml:lang="en-US">
|
842
|
+
Disabling direct root logins ensures proper accountability and multifactor
|
843
|
+
authentication to privileged accounts. Users will first login, then escalate
|
844
|
+
to privileged (root) access via su / sudo. This scenario is nowadays required
|
845
|
+
by security standards.
|
846
|
+
</rationale>
|
847
|
+
<check system="ocil-transitional">
|
848
|
+
<check-export export-name="the /etc/securetty file is not empty" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
849
|
+
<check-content>
|
850
|
+
To ensure root may not directly login to the system over physical consoles,
|
851
|
+
run the following command:
|
852
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">cat /etc/securetty</pre>
|
853
|
+
If any output is returned, this is a finding.
|
854
|
+
</check-content>
|
855
|
+
</check>
|
856
|
+
</Rule>
|
857
|
+
<Rule id="xccdf_org.ssgproject.content_rule_securetty_root_login_console_only" selected="false" severity="medium">
|
858
|
+
<title xml:lang="en-US">Virtual Console Root Logins Restricted</title>
|
859
|
+
<description xml:lang="en-US">
|
860
|
+
To restrict root logins through the (deprecated) virtual console devices,
|
861
|
+
ensure lines of this form do not appear in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/securetty</xhtml:code>:
|
862
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">vc/1
|
863
|
+
vc/2
|
864
|
+
vc/3
|
865
|
+
vc/4</pre>
|
866
|
+
</description>
|
867
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6(2)</reference>
|
868
|
+
<reference href="http://iase.disa.mil/cci/index.html">770</reference>
|
869
|
+
<rationale xml:lang="en-US">
|
870
|
+
Preventing direct root login to virtual console devices
|
871
|
+
helps ensure accountability for actions taken on the system
|
872
|
+
using the root account.
|
873
|
+
</rationale>
|
874
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
875
|
+
<check-content-ref name="oval:ssg:def:144" href="ssg-fedora-oval.xml"/>
|
876
|
+
</check>
|
877
|
+
<check system="ocil-transitional">
|
878
|
+
<check-export export-name="root login over virtual console devices is permitted" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
879
|
+
<check-content>
|
880
|
+
To check for virtual console entries which permit root login, run the
|
881
|
+
following command:
|
882
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep ^vc/[0-9] /etc/securetty</pre>
|
883
|
+
If any output is returned, then root logins over virtual console devices is permitted.
|
884
|
+
</check-content>
|
885
|
+
</check>
|
886
|
+
</Rule>
|
887
|
+
<Rule id="xccdf_org.ssgproject.content_rule_restrict_serial_port_logins" selected="false" severity="low">
|
888
|
+
<title xml:lang="en-US">Serial Port Root Logins Restricted</title>
|
889
|
+
<description xml:lang="en-US">To restrict root logins on serial ports,
|
890
|
+
ensure lines of this form do not appear in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/securetty</xhtml:code>:
|
891
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">ttyS0
|
892
|
+
ttyS1</pre>
|
893
|
+
<!-- TODO: discussion/description of serial port -->
|
894
|
+
</description>
|
895
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6(2)</reference>
|
896
|
+
<reference href="http://iase.disa.mil/cci/index.html">770</reference>
|
897
|
+
<rationale xml:lang="en-US">
|
898
|
+
Preventing direct root login to serial port interfaces
|
899
|
+
helps ensure accountability for actions taken on the systems
|
900
|
+
using the root account.
|
901
|
+
</rationale>
|
902
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
903
|
+
<check-content-ref name="oval:ssg:def:159" href="ssg-fedora-oval.xml"/>
|
904
|
+
</check>
|
905
|
+
<check system="ocil-transitional">
|
906
|
+
<check-export export-name="root login over serial ports is permitted" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
907
|
+
<check-content>
|
908
|
+
To check for serial port entries which permit root login,
|
909
|
+
run the following command:
|
910
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep ^ttyS/[0-9] /etc/securetty</pre>
|
911
|
+
If any output is returned, then root login over serial ports is permitted.
|
912
|
+
</check-content>
|
913
|
+
</check>
|
914
|
+
</Rule>
|
915
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_root_webbrowsing" selected="false" severity="low">
|
916
|
+
<title xml:lang="en-US">Web Browser Use for Administrative Accounts Restricted</title>
|
917
|
+
<description xml:lang="en-US">
|
918
|
+
Enforce policy requiring administrative accounts use web browsers only for
|
919
|
+
local service administration.
|
920
|
+
</description>
|
921
|
+
<rationale xml:lang="en-US">
|
922
|
+
If a browser vulnerability is exploited while running with administrative privileges,
|
923
|
+
the entire system could be compromised. Specific exceptions for local service
|
924
|
+
administration should be documented in site-defined policy.
|
925
|
+
</rationale>
|
926
|
+
<check system="ocil-transitional">
|
927
|
+
<check-export export-name="this is not the case" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
928
|
+
<check-content>
|
929
|
+
Check the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> home directory for a <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">.mozilla</xhtml:code> directory. If
|
930
|
+
one exists, ensure browsing is limited to local service administration.
|
931
|
+
</check-content>
|
932
|
+
</check>
|
933
|
+
</Rule>
|
934
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_shelllogin_for_systemaccounts" selected="false" severity="medium">
|
935
|
+
<title xml:lang="en-US">System Accounts Do Not Run a Shell Upon Login</title>
|
936
|
+
<description xml:lang="en-US">
|
937
|
+
Some accounts are not associated with a human
|
938
|
+
user of the system, and exist to perform some administrative
|
939
|
+
function. Should an attacker be able to log into these accounts,
|
940
|
+
they should not be granted access to a shell.
|
941
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
942
|
+
The login shell for each local account is stored in the last field of each line
|
943
|
+
in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code>. System accounts are those user accounts with a user ID less than
|
944
|
+
500. The user ID is stored in the third field.
|
945
|
+
If any system account <i xmlns="http://www.w3.org/1999/xhtml">SYSACCT</i> (other than root) has a login shell,
|
946
|
+
disable it with the command:
|
947
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># usermod -s /sbin/nologin <i>SYSACCT</i></pre>
|
948
|
+
</description>
|
949
|
+
<warning xml:lang="en-US" override="false" category="functionality">
|
950
|
+
Do not perform the steps in this
|
951
|
+
section on the root account. Doing so might cause the system to
|
952
|
+
become inaccessible.
|
953
|
+
</warning>
|
954
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf"/>
|
955
|
+
<reference href="http://iase.disa.mil/cci/index.html">178</reference>
|
956
|
+
<rationale xml:lang="en-US">
|
957
|
+
Ensuring shells are not given to system accounts upon login
|
958
|
+
makes it more difficult for attackers to make use of
|
959
|
+
system accounts.
|
960
|
+
</rationale>
|
961
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
962
|
+
<check-content-ref name="oval:ssg:def:210" href="ssg-fedora-oval.xml"/>
|
963
|
+
</check>
|
964
|
+
<check system="ocil-transitional">
|
965
|
+
<check-export export-name="any system account (other than root) has a login shell" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
966
|
+
<check-content>
|
967
|
+
To obtain a listing of all users,
|
968
|
+
their UIDs, and their shells, run the command:
|
969
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ awk -F: '{print $1 ":" $3 ":" $7}' /etc/passwd</pre>
|
970
|
+
Identify the system accounts from this listing. These will
|
971
|
+
primarily be the accounts with UID numbers less than 500, other
|
972
|
+
than root.
|
973
|
+
</check-content>
|
974
|
+
</check>
|
975
|
+
</Rule>
|
976
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_uidzero_except_root" selected="false" severity="medium">
|
977
|
+
<title xml:lang="en-US">Only Root Has UID 0</title>
|
978
|
+
<description xml:lang="en-US">
|
979
|
+
If any account other than root has a UID of 0,
|
980
|
+
this misconfiguration should be investigated and the
|
981
|
+
accounts other than root should be removed or have their UID changed.
|
982
|
+
</description>
|
983
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6</reference>
|
984
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-2(1)</reference>
|
985
|
+
<reference href="http://iase.disa.mil/cci/index.html">366</reference>
|
986
|
+
<rationale xml:lang="en-US">
|
987
|
+
An account has root authority if it has a UID of 0. Multiple accounts
|
988
|
+
with a UID of 0 afford more opportunity for potential intruders to
|
989
|
+
guess a password for a privileged account. Proper configuration of
|
990
|
+
sudo is recommended to afford multiple system administrators
|
991
|
+
access to root privileges in an accountable manner.
|
992
|
+
</rationale>
|
993
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
994
|
+
<check-content-ref name="oval:ssg:def:181" href="ssg-fedora-oval.xml"/>
|
995
|
+
</check>
|
996
|
+
<check system="ocil-transitional">
|
997
|
+
<check-export export-name="any account other than root has a UID of 0" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
998
|
+
<check-content>
|
999
|
+
To list all password file entries for accounts with UID 0, run the following command:
|
1000
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># awk -F: '($3 == "0") {print}' /etc/passwd</pre>
|
1001
|
+
This should print only one line, for the user root.
|
1002
|
+
</check-content>
|
1003
|
+
</check>
|
1004
|
+
</Rule>
|
1005
|
+
<Rule id="xccdf_org.ssgproject.content_rule_root_path_default" selected="false" severity="low">
|
1006
|
+
<title xml:lang="en-US">Root Path Is Vendor Default</title>
|
1007
|
+
<description xml:lang="en-US">
|
1008
|
+
Assuming root shell is bash, edit the following files:
|
1009
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">~/.profile</pre>
|
1010
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">~/.bashrc</pre>
|
1011
|
+
Change any <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PATH</xhtml:code> variables to the vendor default for root and remove any
|
1012
|
+
empty <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PATH</xhtml:code> entries or references to relative paths.
|
1013
|
+
</description>
|
1014
|
+
<rationale xml:lang="en-US">
|
1015
|
+
The root account's executable search path must be the vendor default, and must
|
1016
|
+
contain only absolute paths.
|
1017
|
+
</rationale>
|
1018
|
+
<check system="ocil-transitional">
|
1019
|
+
<check-export export-name="any of these conditions are not met" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1020
|
+
<check-content>
|
1021
|
+
To view the root user's <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PATH</xhtml:code>, run the following command:
|
1022
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># env | grep PATH</pre>
|
1023
|
+
If correctly configured, the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PATH</xhtml:code> must: use vendor default settings,
|
1024
|
+
have no empty entries, and have no entries beginning with a character
|
1025
|
+
other than a slash (/).
|
1026
|
+
</check-content>
|
1027
|
+
</check>
|
1028
|
+
</Rule>
|
1029
|
+
</Group>
|
1030
|
+
<Group id="xccdf_org.ssgproject.content_group_password_storage">
|
1031
|
+
<title xml:lang="en-US">Proper Storage and Existence of Password Hashes</title>
|
1032
|
+
<description xml:lang="en-US">
|
1033
|
+
By default, password hashes for local accounts are stored
|
1034
|
+
in the second field (colon-separated) in
|
1035
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/shadow</xhtml:code>. This file should be readable only by
|
1036
|
+
processes running with root credentials, preventing users from
|
1037
|
+
casually accessing others' password hashes and attempting
|
1038
|
+
to crack them.
|
1039
|
+
However, it remains possible to misconfigure the system
|
1040
|
+
and store password hashes
|
1041
|
+
in world-readable files such as <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code>, or
|
1042
|
+
to even store passwords themselves in plaintext on the system.
|
1043
|
+
Using system-provided tools for password change/creation
|
1044
|
+
should allow administrators to avoid such misconfiguration.
|
1045
|
+
</description>
|
1046
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_empty_passwords" selected="false" severity="high">
|
1047
|
+
<title xml:lang="en-US">Log In to Accounts With Empty Password Impossible</title>
|
1048
|
+
<description xml:lang="en-US">If an account is configured for password authentication
|
1049
|
+
but does not have an assigned password, it may be possible to log
|
1050
|
+
into the account without authentication. Remove any instances of the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nullok</xhtml:code>
|
1051
|
+
option in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/pam.d/system-auth</xhtml:code> to
|
1052
|
+
prevent logins with empty passwords.
|
1053
|
+
</description>
|
1054
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(b)</reference>
|
1055
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(c)</reference>
|
1056
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(1)(a)</reference>
|
1057
|
+
<rationale xml:lang="en-US">
|
1058
|
+
If an account has an empty password, anyone could log in and
|
1059
|
+
run commands with the privileges of that account. Accounts with
|
1060
|
+
empty passwords should never be used in operational
|
1061
|
+
environments.
|
1062
|
+
</rationale>
|
1063
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1064
|
+
<check-content-ref name="oval:ssg:def:200" href="ssg-fedora-oval.xml"/>
|
1065
|
+
</check>
|
1066
|
+
<check system="ocil-transitional">
|
1067
|
+
<check-export export-name="NULL passwords can be used" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1068
|
+
<check-content>
|
1069
|
+
To verify that null passwords cannot be used, run the following command:
|
1070
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep nullok /etc/pam.d/system-auth</pre>
|
1071
|
+
If this produces any output, it may be possible to log into accounts
|
1072
|
+
with empty passwords.
|
1073
|
+
</check-content>
|
1074
|
+
</check>
|
1075
|
+
</Rule>
|
1076
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_hashes_outside_shadow" selected="false" severity="medium">
|
1077
|
+
<title xml:lang="en-US">Password Hashes For Each Account Shadowed</title>
|
1078
|
+
<description xml:lang="en-US">
|
1079
|
+
If any password hashes are stored in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code> (in the second field,
|
1080
|
+
instead of an <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">x</xhtml:code>), the cause of this misconfiguration should be
|
1081
|
+
investigated. The account should have its password reset and the hash should be
|
1082
|
+
properly stored, or the account should be deleted entirely.
|
1083
|
+
</description>
|
1084
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(h)</reference>
|
1085
|
+
<reference href="http://iase.disa.mil/cci/index.html">201</reference>
|
1086
|
+
<rationale xml:lang="en-US">
|
1087
|
+
The hashes for all user account passwords should be stored in
|
1088
|
+
the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/shadow</xhtml:code> and never in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code>,
|
1089
|
+
which is readable by all users.
|
1090
|
+
</rationale>
|
1091
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1092
|
+
<check-content-ref name="oval:ssg:def:175" href="ssg-fedora-oval.xml"/>
|
1093
|
+
</check>
|
1094
|
+
<check system="ocil-transitional">
|
1095
|
+
<check-export export-name="any stored hashes are found in /etc/passwd" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1096
|
+
<check-content>
|
1097
|
+
To check that no password hashes are stored in
|
1098
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code>, run the following command:
|
1099
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># awk -F: '($2 != "x") {print}' /etc/passwd</pre>
|
1100
|
+
If it produces any output, then a password hash is
|
1101
|
+
stored in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code>.
|
1102
|
+
</check-content>
|
1103
|
+
</check>
|
1104
|
+
</Rule>
|
1105
|
+
<Rule id="xccdf_org.ssgproject.content_rule_gid_passwd_group_same" selected="false" severity="low">
|
1106
|
+
<title xml:lang="en-US">All GIDs referenced in /etc/passwd Defined in /etc/group</title>
|
1107
|
+
<description xml:lang="en-US">
|
1108
|
+
Add a group to the system for each GID referenced without a corresponding group.
|
1109
|
+
</description>
|
1110
|
+
<reference href="http://iase.disa.mil/cci/index.html">366</reference>
|
1111
|
+
<rationale xml:lang="en-US">
|
1112
|
+
Inconsistency in GIDs between <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code> and <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/group</xhtml:code> could lead to a user having unintended rights.
|
1113
|
+
</rationale>
|
1114
|
+
<check system="ocil-transitional">
|
1115
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1116
|
+
<check-content>
|
1117
|
+
To ensure all GIDs referenced in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/passwd</xhtml:code> are defined in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/group</xhtml:code>,
|
1118
|
+
run the following command:
|
1119
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># pwck -qr</pre>
|
1120
|
+
There should be no output.
|
1121
|
+
</check-content>
|
1122
|
+
</check>
|
1123
|
+
</Rule>
|
1124
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_netrc_files" selected="false" severity="medium">
|
1125
|
+
<title xml:lang="en-US">netrc Files Do Not Exist</title>
|
1126
|
+
<description xml:lang="en-US">The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">.netrc</xhtml:code> files contain login information
|
1127
|
+
used to auto-login into FTP servers and reside in the user's home
|
1128
|
+
directory. These files may contain unencrypted passwords to
|
1129
|
+
remote FTP servers making them susceptible to access by unauthorized
|
1130
|
+
users and should not be used. Any <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">.netrc</xhtml:code> files should be removed.
|
1131
|
+
</description>
|
1132
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(h)</reference>
|
1133
|
+
<reference href="http://iase.disa.mil/cci/index.html">196</reference>
|
1134
|
+
<rationale xml:lang="en-US">
|
1135
|
+
Unencrypted passwords for remote FTP servers may be stored in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">.netrc</xhtml:code>
|
1136
|
+
files. DoD policy requires passwords be encrypted in storage and not used
|
1137
|
+
in access scripts.
|
1138
|
+
</rationale>
|
1139
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1140
|
+
<check-content-ref name="oval:ssg:def:129" href="ssg-fedora-oval.xml"/>
|
1141
|
+
</check>
|
1142
|
+
<check system="ocil-transitional">
|
1143
|
+
<check-export export-name="any .netrc files exist" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1144
|
+
<check-content>
|
1145
|
+
To check the system for the existence of any <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">.netrc</xhtml:code> files,
|
1146
|
+
run the following command:
|
1147
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># find /home -xdev -name .netrc</pre>
|
1148
|
+
<!-- needs fixup to limit search to home dirs -->
|
1149
|
+
</check-content>
|
1150
|
+
</check>
|
1151
|
+
</Rule>
|
1152
|
+
</Group>
|
1153
|
+
<Group id="xccdf_org.ssgproject.content_group_password_expiration">
|
1154
|
+
<title xml:lang="en-US">Set Password Expiration Parameters</title>
|
1155
|
+
<description xml:lang="en-US">The file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code> controls several
|
1156
|
+
password-related settings. Programs such as <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">passwd</xhtml:code>,
|
1157
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">su</xhtml:code>, and <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">login</xhtml:code> consult <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code> to determine
|
1158
|
+
behavior with regard to password aging, expiration warnings,
|
1159
|
+
and length. See the man page <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">login.defs(5)</xhtml:code> for more information.
|
1160
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1161
|
+
Users should be forced to change their passwords, in order to
|
1162
|
+
decrease the utility of compromised passwords. However, the need to
|
1163
|
+
change passwords often should be balanced against the risk that
|
1164
|
+
users will reuse or write down passwords if forced to change them
|
1165
|
+
too often. Forcing password changes every 90-360 days, depending on
|
1166
|
+
the environment, is recommended. Set the appropriate value as
|
1167
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PASS_MAX_DAYS</xhtml:code> and apply it to existing accounts with the
|
1168
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">-M</xhtml:code> flag.
|
1169
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1170
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PASS_MIN_DAYS</xhtml:code> (<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">-m</xhtml:code>) setting prevents password
|
1171
|
+
changes for 7 days after the first change, to discourage password
|
1172
|
+
cycling. If you use this setting, train users to contact an administrator
|
1173
|
+
for an emergency password change in case a new password becomes
|
1174
|
+
compromised. The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PASS_WARN_AGE</xhtml:code> (<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">-W</xhtml:code>) setting gives
|
1175
|
+
users 7 days of warnings at login time that their passwords are about to expire.
|
1176
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1177
|
+
For example, for each existing human user <i xmlns="http://www.w3.org/1999/xhtml">USER</i>, expiration parameters
|
1178
|
+
could be adjusted to a 180 day maximum password age, 7 day minimum password
|
1179
|
+
age, and 7 day warning period with the following command:
|
1180
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># chage -M 180 -m 7 -W 7 USER</pre>
|
1181
|
+
</description>
|
1182
|
+
<Value id="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs" type="number">
|
1183
|
+
<title xml:lang="en-US">minimum password length</title>
|
1184
|
+
<description xml:lang="en-US">Minimum number of characters in password</description>
|
1185
|
+
<warning xml:lang="en-US" override="false" category="general">This will only check new passwords</warning>
|
1186
|
+
<value>12</value>
|
1187
|
+
<value selector="6">6</value>
|
1188
|
+
<value selector="8">8</value>
|
1189
|
+
<value selector="10">10</value>
|
1190
|
+
<value selector="12">12</value>
|
1191
|
+
<value selector="14">14</value>
|
1192
|
+
</Value>
|
1193
|
+
<Value id="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs" type="number">
|
1194
|
+
<title xml:lang="en-US">maximum password age</title>
|
1195
|
+
<description xml:lang="en-US">Maximum age of password in days</description>
|
1196
|
+
<warning xml:lang="en-US" override="false" category="general">This will only apply to newly created accounts</warning>
|
1197
|
+
<value>60</value>
|
1198
|
+
<value selector="60">60</value>
|
1199
|
+
<value selector="90">90</value>
|
1200
|
+
<value selector="120">120</value>
|
1201
|
+
<value selector="180">180</value>
|
1202
|
+
</Value>
|
1203
|
+
<Value id="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs" type="number">
|
1204
|
+
<title xml:lang="en-US">minimum password age</title>
|
1205
|
+
<description xml:lang="en-US">Minimum age of password in days</description>
|
1206
|
+
<warning xml:lang="en-US" override="false" category="general">This will only apply to newly created accounts</warning>
|
1207
|
+
<value>7</value>
|
1208
|
+
<value selector="7">7</value>
|
1209
|
+
<value selector="5">5</value>
|
1210
|
+
<value selector="1">1</value>
|
1211
|
+
<value selector="2">2</value>
|
1212
|
+
<value selector="0">0</value>
|
1213
|
+
</Value>
|
1214
|
+
<Value id="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs" type="number">
|
1215
|
+
<title xml:lang="en-US">warning days before password expires</title>
|
1216
|
+
<description xml:lang="en-US">The number of days' warning given before a password expires.</description>
|
1217
|
+
<warning xml:lang="en-US" override="false" category="general">This will only apply to newly created accounts</warning>
|
1218
|
+
<value>7</value>
|
1219
|
+
<value selector="0">0</value>
|
1220
|
+
<value selector="7">7</value>
|
1221
|
+
<value selector="14">14</value>
|
1222
|
+
</Value>
|
1223
|
+
<Rule id="xccdf_org.ssgproject.content_rule_accounts_password_minlen_login_defs" selected="false" severity="medium">
|
1224
|
+
<title xml:lang="en-US">Password Minimum Length</title>
|
1225
|
+
<description xml:lang="en-US">To specify password length requirements for new accounts,
|
1226
|
+
edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code>, locate the following line:
|
1227
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MIN_LEN <b>LENGTH</b></pre>
|
1228
|
+
and correct it to have the form of:
|
1229
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MIN_LEN <b><sub xmlns="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs" use="legacy"/></b></pre>
|
1230
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1231
|
+
Nowadays recommended values, considered as secure by various organizations
|
1232
|
+
focused on topic of computer security, range from <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">12 (FISMA)</xhtml:code> up to
|
1233
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">14 (DoD)</xhtml:code> characters for password length requirements.
|
1234
|
+
If a program consults <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code> and also another PAM module
|
1235
|
+
(such as <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">pam_cracklib</xhtml:code>) during a password change operation,
|
1236
|
+
then the most restrictive must be satisfied. See PAM section
|
1237
|
+
for more information about enforcing password quality requirements.
|
1238
|
+
</description>
|
1239
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(f)</reference>
|
1240
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(1)(a)</reference>
|
1241
|
+
<reference href="http://iase.disa.mil/cci/index.html">205</reference>
|
1242
|
+
<rationale xml:lang="en-US">
|
1243
|
+
Requiring a minimum password length makes password
|
1244
|
+
cracking attacks more difficult by ensuring a larger
|
1245
|
+
search space. However, any security benefit from an onerous requirement
|
1246
|
+
must be carefully weighed against usability problems, support costs, or
|
1247
|
+
counterproductive behavior that may result.
|
1248
|
+
</rationale>
|
1249
|
+
<fix system="urn:xccdf:fix:script:sh">var_accounts_password_minlen_login_defs="<sub idref="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs" use="legacy"/>"
|
1250
|
+
grep -q ^PASS_MIN_LEN /etc/login.defs && \
|
1251
|
+
sed -i "s/PASS_MIN_LEN.*/PASS_MIN_LEN\t$var_accounts_password_minlen_login_defs/g" /etc/login.defs
|
1252
|
+
if ! [ $? -eq 0 ]
|
1253
|
+
then
|
1254
|
+
echo -e "PASS_MIN_LEN\t$var_accounts_password_minlen_login_defs" >> /etc/login.defs
|
1255
|
+
fi
|
1256
|
+
</fix>
|
1257
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1258
|
+
<check-export export-name="oval:ssg:var:281" value-id="xccdf_org.ssgproject.content_value_var_accounts_password_minlen_login_defs"/>
|
1259
|
+
<check-content-ref name="oval:ssg:def:155" href="ssg-fedora-oval.xml"/>
|
1260
|
+
</check>
|
1261
|
+
<check system="ocil-transitional">
|
1262
|
+
<check-export export-name="it is not set to the required value" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1263
|
+
<check-content>
|
1264
|
+
To check the minimum password length, run the command:
|
1265
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep PASS_MIN_LEN /etc/login.defs</pre>
|
1266
|
+
Passwords of length <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">12</xhtml:code> characters and more are nowadays
|
1267
|
+
considered to be a standard requirement.
|
1268
|
+
</check-content>
|
1269
|
+
</check>
|
1270
|
+
</Rule>
|
1271
|
+
<Rule id="xccdf_org.ssgproject.content_rule_accounts_minimum_age_login_defs" selected="false" severity="medium">
|
1272
|
+
<title xml:lang="en-US">Password Minimum Age</title>
|
1273
|
+
<description xml:lang="en-US">To specify password minimum age for new accounts,
|
1274
|
+
edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code>, locate the following line:
|
1275
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MIN_DAYS <b>DAYS</b></pre>
|
1276
|
+
and correct it to have the form of:
|
1277
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MIN_DAYS <b><sub xmlns="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs" use="legacy"/></b></pre>
|
1278
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1279
|
+
A value greater than 1 day is considered to be sufficient for many environments.
|
1280
|
+
</description>
|
1281
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(f)</reference>
|
1282
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(1)(d)</reference>
|
1283
|
+
<reference href="http://iase.disa.mil/cci/index.html">198</reference>
|
1284
|
+
<rationale xml:lang="en-US">
|
1285
|
+
Setting the minimum password age protects against users cycling
|
1286
|
+
back to a favorite password after satisfying the password reuse
|
1287
|
+
requirement.
|
1288
|
+
</rationale>
|
1289
|
+
<fix system="urn:xccdf:fix:script:sh">var_accounts_minimum_age_login_defs="<sub idref="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs" use="legacy"/>"
|
1290
|
+
grep -q ^PASS_MIN_DAYS /etc/login.defs && \
|
1291
|
+
sed -i "s/PASS_MIN_DAYS.*/PASS_MIN_DAYS\t$var_accounts_minimum_age_login_defs/g" /etc/login.defs
|
1292
|
+
if ! [ $? -eq 0 ]
|
1293
|
+
then
|
1294
|
+
echo -e "PASS_MIN_DAYS\t$var_accounts_minimum_age_login_defs" >> /etc/login.defs
|
1295
|
+
fi
|
1296
|
+
</fix>
|
1297
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1298
|
+
<check-export export-name="oval:ssg:var:279" value-id="xccdf_org.ssgproject.content_value_var_accounts_minimum_age_login_defs"/>
|
1299
|
+
<check-content-ref name="oval:ssg:def:135" href="ssg-fedora-oval.xml"/>
|
1300
|
+
</check>
|
1301
|
+
<check system="ocil-transitional">
|
1302
|
+
<check-export export-name="it is not set to the required value" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1303
|
+
<check-content>
|
1304
|
+
To check the minimum password age, run the command:
|
1305
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep PASS_MIN_DAYS /etc/login.defs</pre>
|
1306
|
+
A value greater than 1 day is considered to be sufficient for many environments.
|
1307
|
+
</check-content>
|
1308
|
+
</check>
|
1309
|
+
</Rule>
|
1310
|
+
<Rule id="xccdf_org.ssgproject.content_rule_accounts_maximum_age_login_defs" selected="false" severity="medium">
|
1311
|
+
<title xml:lang="en-US">Password Maximum Age</title>
|
1312
|
+
<description xml:lang="en-US">To specify password maximum age for new accounts,
|
1313
|
+
edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code>, locate the following line:
|
1314
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MAX_DAYS <b>DAYS</b></pre>
|
1315
|
+
and correct it to have the form of:
|
1316
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_MAX_DAYS <b><sub xmlns="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs" use="legacy"/></b></pre>
|
1317
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1318
|
+
A value less than 180 days is sufficient for many environments.
|
1319
|
+
</description>
|
1320
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(f)</reference>
|
1321
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(g)</reference>
|
1322
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(1)(d)</reference>
|
1323
|
+
<reference href="http://iase.disa.mil/cci/index.html">180</reference>
|
1324
|
+
<reference href="http://iase.disa.mil/cci/index.html">199</reference>
|
1325
|
+
<rationale xml:lang="en-US">
|
1326
|
+
Setting the password maximum age ensures users are required to
|
1327
|
+
periodically change their passwords. This could possibly decrease
|
1328
|
+
the utility of a stolen password. Requiring shorter password lifetimes
|
1329
|
+
increases the risk of users writing down the password in a convenient
|
1330
|
+
location subject to physical compromise.</rationale>
|
1331
|
+
<fix system="urn:xccdf:fix:script:sh">var_accounts_maximum_age_login_defs="<sub idref="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs" use="legacy"/>"
|
1332
|
+
grep -q ^PASS_MAX_DAYS /etc/login.defs && \
|
1333
|
+
sed -i "s/PASS_MAX_DAYS.*/PASS_MAX_DAYS\t$var_accounts_maximum_age_login_defs/g" /etc/login.defs
|
1334
|
+
if ! [ $? -eq 0 ]
|
1335
|
+
then
|
1336
|
+
echo -e "PASS_MAX_DAYS\t$var_accounts_maximum_age_login_defs" >> /etc/login.defs
|
1337
|
+
fi
|
1338
|
+
</fix>
|
1339
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1340
|
+
<check-export export-name="oval:ssg:var:282" value-id="xccdf_org.ssgproject.content_value_var_accounts_maximum_age_login_defs"/>
|
1341
|
+
<check-content-ref name="oval:ssg:def:157" href="ssg-fedora-oval.xml"/>
|
1342
|
+
</check>
|
1343
|
+
<check system="ocil-transitional">
|
1344
|
+
<check-export export-name="it is not set to the required value" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1345
|
+
<check-content>
|
1346
|
+
To check the maximum password age, run the command:
|
1347
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep PASS_MAX_DAYS /etc/login.defs</pre>
|
1348
|
+
A value less than 180 days is sufficient for many environments.
|
1349
|
+
</check-content>
|
1350
|
+
</check>
|
1351
|
+
</Rule>
|
1352
|
+
<Rule id="xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs" selected="false" severity="low">
|
1353
|
+
<title xml:lang="en-US">Password Warning Age</title>
|
1354
|
+
<description xml:lang="en-US">To specify how many days prior to password
|
1355
|
+
expiration that a warning will be issued to users,
|
1356
|
+
edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/login.defs</xhtml:code>, locate the following line:
|
1357
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_WARN_AGE <b>DAYS</b></pre>
|
1358
|
+
and correct it to have the form of:
|
1359
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PASS_WARN_AGE <b><sub xmlns="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs" use="legacy"/></b></pre>
|
1360
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1361
|
+
A value of 7 days would be nowadays considered to be a standard.
|
1362
|
+
</description>
|
1363
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(f)</reference>
|
1364
|
+
<rationale xml:lang="en-US">
|
1365
|
+
Setting the password warning age enables users to make the change
|
1366
|
+
at a practical time.
|
1367
|
+
</rationale>
|
1368
|
+
<fix system="urn:xccdf:fix:script:sh">var_accounts_password_warn_age_login_defs="<sub idref="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs" use="legacy"/>"
|
1369
|
+
grep -q ^PASS_WARN_AGE /etc/login.defs && \
|
1370
|
+
sed -i "s/PASS_WARN_AGE.*/PASS_WARN_AGE\t$var_accounts_password_warn_age_login_defs/g" /etc/login.defs
|
1371
|
+
if ! [ $? -eq 0 ]
|
1372
|
+
then
|
1373
|
+
echo -e "PASS_WARN_AGE\t$var_accounts_password_warn_age_login_defs" >> /etc/login.defs
|
1374
|
+
fi
|
1375
|
+
</fix>
|
1376
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1377
|
+
<check-export export-name="oval:ssg:var:280" value-id="xccdf_org.ssgproject.content_value_var_accounts_password_warn_age_login_defs"/>
|
1378
|
+
<check-content-ref name="oval:ssg:def:142" href="ssg-fedora-oval.xml"/>
|
1379
|
+
</check>
|
1380
|
+
<check system="ocil-transitional">
|
1381
|
+
<check-export export-name="it is not set to the required value" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1382
|
+
<check-content>
|
1383
|
+
To check the password warning age, run the command:
|
1384
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep PASS_WARN_AGE /etc/login.defs</pre>
|
1385
|
+
A value of 7 days would be nowadays considered to be a standard.
|
1386
|
+
</check-content>
|
1387
|
+
</check>
|
1388
|
+
</Rule>
|
1389
|
+
</Group>
|
1390
|
+
</Group>
|
1391
|
+
<Group id="xccdf_org.ssgproject.content_group_accounts-physical">
|
1392
|
+
<title xml:lang="en-US">Protect Physical Console Access</title>
|
1393
|
+
<description xml:lang="en-US">It is impossible to fully protect a system from an
|
1394
|
+
attacker with physical access, so securing the space in which the
|
1395
|
+
system is located should be considered a necessary step. However,
|
1396
|
+
there are some steps which, if taken, make it more difficult for an
|
1397
|
+
attacker to quickly or undetectably modify a system from its
|
1398
|
+
console.</description>
|
1399
|
+
<Group id="xccdf_org.ssgproject.content_group_bootloader">
|
1400
|
+
<title xml:lang="en-US">Set Boot Loader Password</title>
|
1401
|
+
<description xml:lang="en-US">During the boot process, the boot loader is
|
1402
|
+
responsible for starting the execution of the kernel and passing
|
1403
|
+
options to it. The boot loader allows for the selection of
|
1404
|
+
different kernels - possibly on different partitions or media.
|
1405
|
+
The default Fedora boot loader for x86 systems is called GRUB2.
|
1406
|
+
Options it can pass to the kernel include <i xmlns="http://www.w3.org/1999/xhtml">single-user mode</i>, which
|
1407
|
+
provides root access without any authentication, and the ability to
|
1408
|
+
disable SELinux. To prevent local users from modifying the boot
|
1409
|
+
parameters and endangering security, protect the boot loader configuration
|
1410
|
+
with a password and ensure its configuration file's permissions
|
1411
|
+
are set properly.
|
1412
|
+
</description>
|
1413
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_user_owner_grub2_cfg" selected="false" severity="medium">
|
1414
|
+
<title xml:lang="en-US">Verify /boot/grub2/grub.cfg User Ownership</title>
|
1415
|
+
<description xml:lang="en-US">The file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code> should
|
1416
|
+
be owned by the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> user to prevent destruction
|
1417
|
+
or modification of the file.
|
1418
|
+
|
1419
|
+
To properly set the owner of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code>, run the command:
|
1420
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:space="preserve"># chown root/boot/grub2/grub.cfg</xhtml:pre>
|
1421
|
+
</description>
|
1422
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf"/>
|
1423
|
+
<reference href="http://iase.disa.mil/cci/index.html">225</reference>
|
1424
|
+
<rationale xml:lang="en-US">
|
1425
|
+
Only root should be able to modify important boot parameters.
|
1426
|
+
</rationale>
|
1427
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1428
|
+
<check-content-ref name="oval:ssg:def:139" href="ssg-fedora-oval.xml"/>
|
1429
|
+
</check>
|
1430
|
+
<check system="ocil-transitional">
|
1431
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1432
|
+
<check-content>
|
1433
|
+
|
1434
|
+
To check the ownership of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code>, run the command:
|
1435
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml">$ ls -lL /boot/grub2/grub.cfg</xhtml:pre>
|
1436
|
+
If properly configured, the output should indicate the following owner:
|
1437
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code>
|
1438
|
+
</check-content>
|
1439
|
+
</check>
|
1440
|
+
</Rule>
|
1441
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_group_owner_grub2_cfg" selected="false" severity="medium">
|
1442
|
+
<title xml:lang="en-US">Verify /boot/grub2/grub.cfg Group Ownership</title>
|
1443
|
+
<description xml:lang="en-US">The file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code> should
|
1444
|
+
be group-owned by the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> group to prevent
|
1445
|
+
destruction or modification of the file.
|
1446
|
+
|
1447
|
+
To properly set the group owner of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code>, run the command:
|
1448
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:space="preserve"># chgrp root/boot/grub2/grub.cfg</xhtml:pre>
|
1449
|
+
</description>
|
1450
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf"/>
|
1451
|
+
<reference href="http://iase.disa.mil/cci/index.html">225</reference>
|
1452
|
+
<rationale xml:lang="en-US">
|
1453
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code> group is a highly-privileged group. Furthermore, the group-owner of this
|
1454
|
+
file should not have any access privileges anyway.
|
1455
|
+
</rationale>
|
1456
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1457
|
+
<check-content-ref name="oval:ssg:def:126" href="ssg-fedora-oval.xml"/>
|
1458
|
+
</check>
|
1459
|
+
<check system="ocil-transitional">
|
1460
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1461
|
+
<check-content>
|
1462
|
+
|
1463
|
+
To check the group ownership of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code>, run the command:
|
1464
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml">$ ls -lL /boot/grub2/grub.cfg</xhtml:pre>
|
1465
|
+
If properly configured, the output should indicate the following group-owner.
|
1466
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">root</xhtml:code>
|
1467
|
+
</check-content>
|
1468
|
+
</check>
|
1469
|
+
</Rule>
|
1470
|
+
<Rule id="xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg" selected="false" severity="medium">
|
1471
|
+
<title xml:lang="en-US">Verify /boot/grub2/grub.cfg Permissions</title>
|
1472
|
+
<description xml:lang="en-US">File permissions for <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code> should be set to 600, which
|
1473
|
+
is the default.
|
1474
|
+
|
1475
|
+
To properly set the permissions of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/boot/grub2/grub.cfg</xhtml:code>, run the command:
|
1476
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:space="preserve"># chmod 600/boot/grub2/grub.cfg</xhtml:pre>
|
1477
|
+
</description>
|
1478
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf"/>
|
1479
|
+
<reference href="http://iase.disa.mil/cci/index.html">225</reference>
|
1480
|
+
<rationale xml:lang="en-US">
|
1481
|
+
Proper permissions ensure that only the root user can modify important boot
|
1482
|
+
parameters.
|
1483
|
+
</rationale>
|
1484
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1485
|
+
<check-content-ref name="oval:ssg:def:152" href="ssg-fedora-oval.xml"/>
|
1486
|
+
</check>
|
1487
|
+
<check system="ocil-transitional">
|
1488
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1489
|
+
<check-content>
|
1490
|
+
To check the permissions of /boot/grub2/grub.cfg, run the command:
|
1491
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ sudo ls -lL /boot/grub2/grub.cfg</pre>
|
1492
|
+
If properly configured, the output should indicate the following
|
1493
|
+
permissions: <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">-rw-------</xhtml:code>
|
1494
|
+
</check-content>
|
1495
|
+
</check>
|
1496
|
+
</Rule>
|
1497
|
+
<Rule id="xccdf_org.ssgproject.content_rule_bootloader_password" selected="false" severity="medium">
|
1498
|
+
<title xml:lang="en-US">Set Boot Loader Password</title>
|
1499
|
+
<description xml:lang="en-US">The grub2 boot loader should have a superuser account and password
|
1500
|
+
protection enabled to protect boot-time settings.
|
1501
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1502
|
+
To do so, select a superuser account and password and add them into the
|
1503
|
+
appropriate grub2 configuration file(s) under <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/grub.d</xhtml:code>.
|
1504
|
+
Since plaintext passwords are a security risk, generate a hash for the pasword
|
1505
|
+
by running the following command:
|
1506
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grub2-mkpasswd-pbkdf2</pre>
|
1507
|
+
When prompted, enter the password that was selected and insert the returned
|
1508
|
+
password hash into the appropriate grub2 configuration file(s) under
|
1509
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/grub.d</xhtml:code> immediately after the superuser account.
|
1510
|
+
(Use the output from <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">grub2-mkpasswd-pbkdf2</xhtml:code> as the value of
|
1511
|
+
<b xmlns="http://www.w3.org/1999/xhtml">password-hash</b>):
|
1512
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">password_pbkdf2 <b>superusers-account</b> <b>password-hash</b></pre>
|
1513
|
+
NOTE: It is recommended not to use common administrator account names like root,
|
1514
|
+
admin, or administrator for the grub2 superuser account.
|
1515
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1516
|
+
To meet FISMA Moderate, the bootloader superuser account and password MUST
|
1517
|
+
differ from the root account and password.
|
1518
|
+
Once the superuser account and password have been added, update the
|
1519
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">grub.cfg</xhtml:code> file by running:
|
1520
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">grub2-mkconfig -o /boot/grub2/grub.cfg</pre>
|
1521
|
+
NOTE: Do NOT manually add the superuser account and password to the
|
1522
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">grub.cfg</xhtml:code> file as the grub2-mkconfig command overwrites this file.
|
1523
|
+
</description>
|
1524
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-2(1)</reference>
|
1525
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-5(e)</reference>
|
1526
|
+
<reference href="http://iase.disa.mil/cci/index.html">213</reference>
|
1527
|
+
<rationale xml:lang="en-US">
|
1528
|
+
Password protection on the boot loader configuration ensures
|
1529
|
+
users with physical access cannot trivially alter
|
1530
|
+
important bootloader settings. These include which kernel to use,
|
1531
|
+
and whether to enter single-user mode. For more information on how to configure
|
1532
|
+
the grub2 superuser account and password, please refer to
|
1533
|
+
<ul xmlns="http://www.w3.org/1999/xhtml"><li>https://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-GRUB_2_Password_Protection.html</li>.
|
1534
|
+
</ul>
|
1535
|
+
</rationale>
|
1536
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1537
|
+
<check-content-ref name="oval:ssg:def:193" href="ssg-fedora-oval.xml"/>
|
1538
|
+
</check>
|
1539
|
+
<check system="ocil-transitional">
|
1540
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1541
|
+
<check-content>
|
1542
|
+
To verify the boot loader superuser account and superuser account password have
|
1543
|
+
been set, and the password encrypted, run the following command:
|
1544
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">sudo grep -A1 "superusers\|password" /etc/grub2.cfg</pre>
|
1545
|
+
The output should show the following:
|
1546
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">set superusers="<b>superusers-account</b>"
|
1547
|
+
password_pbkdf2 <b>superusers-account</b> <b>password-hash</b></pre>
|
1548
|
+
</check-content>
|
1549
|
+
</check>
|
1550
|
+
</Rule>
|
1551
|
+
</Group>
|
1552
|
+
<Rule id="xccdf_org.ssgproject.content_rule_require_singleuser_auth" selected="false" severity="medium">
|
1553
|
+
<title xml:lang="en-US">Require Authentication for Single User Mode</title>
|
1554
|
+
<description xml:lang="en-US">Single-user mode is intended as a system recovery
|
1555
|
+
method, providing a single user root access to the system by
|
1556
|
+
providing a boot option at startup. By default, no authentication
|
1557
|
+
is performed if single-user mode is selected.
|
1558
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1559
|
+
To require entry of the root password even if the system is
|
1560
|
+
started in single-user mode, add or correct the following line in the
|
1561
|
+
file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/init</xhtml:code>:
|
1562
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">SINGLE=/sbin/sulogin</pre>
|
1563
|
+
</description>
|
1564
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-2(1)</reference>
|
1565
|
+
<reference href="http://iase.disa.mil/cci/index.html">213</reference>
|
1566
|
+
<rationale xml:lang="en-US">
|
1567
|
+
This prevents attackers with physical access from trivially bypassing security
|
1568
|
+
on the machine and gaining root access. Such accesses are further prevented
|
1569
|
+
by configuring the bootloader password.
|
1570
|
+
</rationale>
|
1571
|
+
<check system="ocil-transitional">
|
1572
|
+
<check-export export-name="the output is different" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1573
|
+
<check-content>
|
1574
|
+
To check if authentication is required for single-user mode, run the following command:
|
1575
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep SINGLE /etc/sysconfig/init</pre>
|
1576
|
+
The output should be the following:
|
1577
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">SINGLE=/sbin/sulogin</pre>
|
1578
|
+
</check-content>
|
1579
|
+
</check>
|
1580
|
+
</Rule>
|
1581
|
+
<Rule id="xccdf_org.ssgproject.content_rule_disable_ctrlaltdel_reboot" selected="false" severity="high">
|
1582
|
+
<title xml:lang="en-US">Disable Ctrl-Alt-Del Reboot Activation</title>
|
1583
|
+
<description xml:lang="en-US">
|
1584
|
+
By default, the system includes the following line in
|
1585
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/init/control-alt-delete.conf</xhtml:code>
|
1586
|
+
to reboot the system when the Ctrl-Alt-Del key sequence is pressed:
|
1587
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">exec /sbin/shutdown -r now "Control-Alt-Delete pressed"</pre>
|
1588
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/>
|
1589
|
+
To configure the system to log a message instead of
|
1590
|
+
rebooting the system, alter that line to read as follows:
|
1591
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">exec /usr/bin/logger -p security.info "Control-Alt-Delete pressed"</pre>
|
1592
|
+
</description>
|
1593
|
+
<rationale xml:lang="en-US">
|
1594
|
+
A locally logged-in user who presses Ctrl-Alt-Del, when at the console,
|
1595
|
+
can reboot the system. If accidentally pressed, as could happen in
|
1596
|
+
the case of mixed OS environment, this can create the risk of short-term
|
1597
|
+
loss of availability of systems due to unintentional reboot.
|
1598
|
+
In the GNOME graphical environment, risk of unintentional reboot from the
|
1599
|
+
Ctrl-Alt-Del sequence is reduced because the user will be
|
1600
|
+
prompted before any action is taken.
|
1601
|
+
</rationale>
|
1602
|
+
<check system="ocil-transitional">
|
1603
|
+
<check-export export-name="the system is configured to run the shutdown command" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1604
|
+
<check-content>
|
1605
|
+
To ensure the system is configured to log a message instead of rebooting the system when
|
1606
|
+
Ctrl-Alt-Del is pressed, ensure the following line is in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/init/control-alt-delete.conf</xhtml:code>:
|
1607
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">exec /usr/bin/logger -p security.info "Control-Alt-Delete pressed"</pre>
|
1608
|
+
</check-content>
|
1609
|
+
</check>
|
1610
|
+
</Rule>
|
1611
|
+
<Rule id="xccdf_org.ssgproject.content_rule_disable_interactive_boot" selected="false" severity="medium">
|
1612
|
+
<title xml:lang="en-US">Disable Interactive Boot</title>
|
1613
|
+
<description xml:lang="en-US">
|
1614
|
+
To disable the ability for users to perform interactive startups,
|
1615
|
+
edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/init</xhtml:code>.
|
1616
|
+
Add or correct the line:
|
1617
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PROMPT=no</pre>
|
1618
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">PROMPT</xhtml:code> option allows the console user to perform an
|
1619
|
+
interactive system startup, in which it is possible to select the
|
1620
|
+
set of services which are started on boot.
|
1621
|
+
</description>
|
1622
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">SC-2</reference>
|
1623
|
+
<reference href="http://iase.disa.mil/cci/index.html">213</reference>
|
1624
|
+
<rationale xml:lang="en-US">
|
1625
|
+
Using interactive boot,
|
1626
|
+
the console user could disable auditing, firewalls, or other
|
1627
|
+
services, weakening system security.
|
1628
|
+
</rationale>
|
1629
|
+
<check system="ocil-transitional">
|
1630
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1631
|
+
<check-content>
|
1632
|
+
To check whether interactive boot is disabled, run the following command:
|
1633
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ grep PROMPT /etc/sysconfig/init</pre>
|
1634
|
+
If interactive boot is disabled, the output will show:
|
1635
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PROMPT=no</pre>
|
1636
|
+
</check-content>
|
1637
|
+
</check>
|
1638
|
+
</Rule>
|
1639
|
+
<Group id="xccdf_org.ssgproject.content_group_screen_locking">
|
1640
|
+
<title xml:lang="en-US">Configure Screen Locking</title>
|
1641
|
+
<description xml:lang="en-US">When a user must temporarily leave an account
|
1642
|
+
logged-in, screen locking should be employed to prevent passersby
|
1643
|
+
from abusing the account. User education and training is
|
1644
|
+
particularly important for screen locking to be effective, and policies
|
1645
|
+
can be implemented to reinforce this.
|
1646
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1647
|
+
Automatic screen locking is only meant as a safeguard for
|
1648
|
+
those cases where a user forgot to lock the screen.</description>
|
1649
|
+
<Group id="xccdf_org.ssgproject.content_group_gui_screen_locking">
|
1650
|
+
<title xml:lang="en-US">Configure GUI Screen Locking</title>
|
1651
|
+
<description xml:lang="en-US">In the default GNOME desktop, the screen can be locked
|
1652
|
+
by choosing <b xmlns="http://www.w3.org/1999/xhtml">Lock Screen</b> from the <b xmlns="http://www.w3.org/1999/xhtml">System</b> menu.
|
1653
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1654
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gconftool-2</xhtml:code> program can be used to enforce mandatory
|
1655
|
+
screen locking settings for the default GNOME environment.
|
1656
|
+
The
|
1657
|
+
following sections detail commands to enforce idle activation of the screen saver,
|
1658
|
+
screen locking, a blank-screen screensaver, and an idle
|
1659
|
+
activation time.
|
1660
|
+
|
1661
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1662
|
+
Because users should be trained to lock the screen when they
|
1663
|
+
step away from the computer, the automatic locking feature is only
|
1664
|
+
meant as a backup. The Lock Screen icon from the System menu can
|
1665
|
+
also be dragged to the taskbar in order to facilitate even more
|
1666
|
+
convenient screen-locking.
|
1667
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1668
|
+
The root account cannot be screen-locked, but this should
|
1669
|
+
<!-- TODO: is this still true? -->have no practical effect as the root account should <i xmlns="http://www.w3.org/1999/xhtml">never</i> be used
|
1670
|
+
to log into an X Windows environment, and should only be used to
|
1671
|
+
for direct login via console in emergency circumstances.
|
1672
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1673
|
+
For more information about configuring GNOME screensaver, see
|
1674
|
+
http://live.gnome.org/GnomeScreensaver. For more information about
|
1675
|
+
enforcing preferences in the GNOME environment using the GConf
|
1676
|
+
configuration system, see http://projects.gnome.org/gconf and
|
1677
|
+
the man page <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">gconftool-2(1)</xhtml:code>.</description>
|
1678
|
+
<Value id="xccdf_org.ssgproject.content_value_inactivity_timeout_value" operator="equals" type="number">
|
1679
|
+
<title xml:lang="en-US">Inactivity timeout</title>
|
1680
|
+
<description xml:lang="en-US">Choose allowed duration of inactive SSH connections, shells, and X sessions</description>
|
1681
|
+
<value>15</value>
|
1682
|
+
<value selector="5_minutes">5</value>
|
1683
|
+
<value selector="10_minutes">10</value>
|
1684
|
+
<value selector="15_minutes">15</value>
|
1685
|
+
</Value>
|
1686
|
+
<Rule id="xccdf_org.ssgproject.content_rule_set_screensaver_inactivity_timeout" selected="false" severity="medium">
|
1687
|
+
<title xml:lang="en-US">Set GNOME Login Inactivity Timeout</title>
|
1688
|
+
<description xml:lang="en-US">
|
1689
|
+
Run the following command to set the idle time-out value for
|
1690
|
+
inactivity in the GNOME desktop to 15 minutes:
|
1691
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># gconftool-2 \
|
1692
|
+
--direct \
|
1693
|
+
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
|
1694
|
+
--type int \
|
1695
|
+
--set /apps/gnome-screensaver/idle_delay 15</pre>
|
1696
|
+
</description>
|
1697
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-11(a)</reference>
|
1698
|
+
<reference href="http://iase.disa.mil/cci/index.html">57</reference>
|
1699
|
+
<rationale xml:lang="en-US">
|
1700
|
+
Setting the idle delay controls when the
|
1701
|
+
screensaver will start, and can be combined with
|
1702
|
+
screen locking to prevent access from passersby.
|
1703
|
+
</rationale>
|
1704
|
+
<check system="ocil-transitional">
|
1705
|
+
<check-export export-name="it is not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1706
|
+
<check-content>
|
1707
|
+
To check the current idle time-out value, run the following command:
|
1708
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ gconftool-2 -g /apps/gnome-screensaver/idle_delay</pre>
|
1709
|
+
If properly configured, the output should be <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">15</xhtml:code>.
|
1710
|
+
</check-content>
|
1711
|
+
</check>
|
1712
|
+
</Rule>
|
1713
|
+
<Rule id="xccdf_org.ssgproject.content_rule_enable_screensaver_after_idle" selected="false" severity="medium">
|
1714
|
+
<title xml:lang="en-US">GNOME Desktop Screensaver Mandatory Use</title>
|
1715
|
+
<description xml:lang="en-US">
|
1716
|
+
Run the following command to activate the screensaver
|
1717
|
+
in the GNOME desktop after a period of inactivity:
|
1718
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># gconftool-2 --direct \
|
1719
|
+
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
|
1720
|
+
--type bool \
|
1721
|
+
--set /apps/gnome-screensaver/idle_activation_enabled true</pre>
|
1722
|
+
</description>
|
1723
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-11(a)</reference>
|
1724
|
+
<reference href="http://iase.disa.mil/cci/index.html">57</reference>
|
1725
|
+
<rationale xml:lang="en-US">
|
1726
|
+
Enabling idle activation of the screen saver ensures the screensaver will
|
1727
|
+
be activated after the idle delay. Applications requiring continuous,
|
1728
|
+
real-time screen display (such as network management products) require the
|
1729
|
+
login session does not have administrator rights and the display station is located in a
|
1730
|
+
controlled-access area.
|
1731
|
+
</rationale>
|
1732
|
+
<check system="ocil-transitional">
|
1733
|
+
<check-export export-name="it is not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1734
|
+
<check-content>To check the screensaver mandatory use status, run the following command:
|
1735
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ gconftool-2 -g /apps/gnome-screensaver/idle_activation_enabled</pre>
|
1736
|
+
If properly configured, the output should be <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">true</xhtml:code>.
|
1737
|
+
</check-content>
|
1738
|
+
</check>
|
1739
|
+
</Rule>
|
1740
|
+
<Rule id="xccdf_org.ssgproject.content_rule_enable_screensaver_password_lock" selected="false" severity="medium">
|
1741
|
+
<title xml:lang="en-US">Enable Screen Lock Activation After Idle Period</title>
|
1742
|
+
<description xml:lang="en-US">
|
1743
|
+
Run the following command to activate locking of the screensaver
|
1744
|
+
in the GNOME desktop when it is activated:
|
1745
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># gconftool-2 --direct \
|
1746
|
+
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
|
1747
|
+
--type bool \
|
1748
|
+
--set /apps/gnome-screensaver/lock_enabled true</pre>
|
1749
|
+
</description>
|
1750
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-11(a)</reference>
|
1751
|
+
<reference href="http://iase.disa.mil/cci/index.html">57</reference>
|
1752
|
+
<rationale xml:lang="en-US">
|
1753
|
+
Enabling the activation of the screen lock after an idle period
|
1754
|
+
ensures password entry will be required in order to
|
1755
|
+
access the system, preventing access by passersby.
|
1756
|
+
</rationale>
|
1757
|
+
<check system="ocil-transitional">
|
1758
|
+
<check-export export-name="it is not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1759
|
+
<check-content>
|
1760
|
+
To check the status of the idle screen lock activation, run the following command:
|
1761
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ gconftool-2 -g /apps/gnome-screensaver/lock_enabled</pre>
|
1762
|
+
If properly configured, the output should be <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">true</xhtml:code>.
|
1763
|
+
</check-content>
|
1764
|
+
</check>
|
1765
|
+
</Rule>
|
1766
|
+
<Rule id="xccdf_org.ssgproject.content_rule_set_blank_screensaver" selected="false" severity="low">
|
1767
|
+
<title xml:lang="en-US">Implement Blank Screen Saver</title>
|
1768
|
+
<description xml:lang="en-US">
|
1769
|
+
Run the following command to set the screensaver mode
|
1770
|
+
in the GNOME desktop to a blank screen:
|
1771
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># gconftool-2 --direct \
|
1772
|
+
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
|
1773
|
+
--type string \
|
1774
|
+
--set /apps/gnome-screensaver/mode blank-only</pre>
|
1775
|
+
</description>
|
1776
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-11(b)</reference>
|
1777
|
+
<reference href="http://iase.disa.mil/cci/index.html">60</reference>
|
1778
|
+
<rationale xml:lang="en-US">
|
1779
|
+
Setting the screensaver mode to blank-only conceals the
|
1780
|
+
contents of the display from passersby.
|
1781
|
+
</rationale>
|
1782
|
+
<check system="ocil-transitional">
|
1783
|
+
<check-export export-name="it is not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1784
|
+
<check-content>
|
1785
|
+
To ensure the screensaver is configured to be blank, run the following command:
|
1786
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ gconftool-2 -g /apps/gnome-screensaver/mode</pre>
|
1787
|
+
If properly configured, the output should be <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">blank-only</xhtml:code>
|
1788
|
+
</check-content>
|
1789
|
+
</check>
|
1790
|
+
</Rule>
|
1791
|
+
</Group>
|
1792
|
+
<Group id="xccdf_org.ssgproject.content_group_console_screen_locking">
|
1793
|
+
<title xml:lang="en-US">Configure Console Screen Locking</title>
|
1794
|
+
<description xml:lang="en-US">
|
1795
|
+
A console screen locking mechanism is provided in the
|
1796
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">screen</xhtml:code> package, which is not installed by default.
|
1797
|
+
</description>
|
1798
|
+
<Rule id="xccdf_org.ssgproject.content_rule_package_screen_installed" selected="false" severity="low">
|
1799
|
+
<title xml:lang="en-US">Install the screen Package</title>
|
1800
|
+
<description xml:lang="en-US">
|
1801
|
+
To enable console screen locking, install the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">screen</xhtml:code> package:
|
1802
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># yum install screen</pre>
|
1803
|
+
Instruct users to begin new terminal sessions with the following command:
|
1804
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ screen</pre>
|
1805
|
+
The console can now be locked with the following key combination:
|
1806
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">ctrl+a x</pre>
|
1807
|
+
</description>
|
1808
|
+
<reference href="http://iase.disa.mil/cci/index.html">58</reference>
|
1809
|
+
<rationale xml:lang="en-US">
|
1810
|
+
Installing <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">screen</xhtml:code> ensures a console locking capability is available
|
1811
|
+
for users who may need to suspend console logins.
|
1812
|
+
</rationale>
|
1813
|
+
<check system="ocil-transitional">
|
1814
|
+
<check-export export-name="the package is not installed" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1815
|
+
<check-content>
|
1816
|
+
|
1817
|
+
Run the following command to determine if the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">screen</xhtml:code> package is installed:
|
1818
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># rpm -q screen</xhtml:pre>
|
1819
|
+
</check-content>
|
1820
|
+
</check>
|
1821
|
+
</Rule>
|
1822
|
+
</Group>
|
1823
|
+
<Group id="xccdf_org.ssgproject.content_group_smart_card_login">
|
1824
|
+
<title xml:lang="en-US">Hardware Tokens for Authentication</title>
|
1825
|
+
<description xml:lang="en-US">
|
1826
|
+
The use of hardware tokens such as smart cards for system login
|
1827
|
+
provides stronger, two-factor authentication than using a username/password.
|
1828
|
+
In Fedora servers and workstations, hardware token login
|
1829
|
+
is not enabled by default and must be enabled in the system settings.
|
1830
|
+
</description>
|
1831
|
+
<Rule id="xccdf_org.ssgproject.content_rule_smartcard_auth" selected="false" severity="medium">
|
1832
|
+
<title xml:lang="en-US">Enable Smart Card Login</title>
|
1833
|
+
<description xml:lang="en-US">
|
1834
|
+
To enable smart card authentication, consult the documentation at:
|
1835
|
+
<ul xmlns="http://www.w3.org/1999/xhtml"><li>https://docs.fedoraproject.org/docs/en-US/Fedora/18/html/Security_Guide/sect-Security_Guide-Single_Sign_on_SSO-Getting_Started_with_your_new_Smart_Card.html</li></ul>
|
1836
|
+
</description>
|
1837
|
+
<reference href="http://iase.disa.mil/cci/index.html">765</reference>
|
1838
|
+
<reference href="http://iase.disa.mil/cci/index.html">766</reference>
|
1839
|
+
<reference href="http://iase.disa.mil/cci/index.html">767</reference>
|
1840
|
+
<reference href="http://iase.disa.mil/cci/index.html">768</reference>
|
1841
|
+
<reference href="http://iase.disa.mil/cci/index.html">771</reference>
|
1842
|
+
<reference href="http://iase.disa.mil/cci/index.html">772</reference>
|
1843
|
+
<reference href="http://iase.disa.mil/cci/index.html">884</reference>
|
1844
|
+
<rationale xml:lang="en-US">Smart card login provides two-factor authentication stronger than
|
1845
|
+
that provided by a username/password combination. Smart cards leverage a PKI
|
1846
|
+
(public key infrastructure) in order to provide and verify credentials.
|
1847
|
+
</rationale>
|
1848
|
+
<check system="ocil-transitional">
|
1849
|
+
<check-export export-name="non-exempt accounts are not using CAC authentication" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
1850
|
+
<check-content>
|
1851
|
+
Interview the SA to determine if all accounts not exempted by policy are
|
1852
|
+
using CAC authentication.
|
1853
|
+
</check-content>
|
1854
|
+
</check>
|
1855
|
+
</Rule>
|
1856
|
+
</Group>
|
1857
|
+
</Group>
|
1858
|
+
</Group>
|
1859
|
+
</Group>
|
1860
|
+
</Group>
|
1861
|
+
<Group id="xccdf_org.ssgproject.content_group_services">
|
1862
|
+
<title xml:lang="en-US">Services</title>
|
1863
|
+
<description xml:lang="en-US">
|
1864
|
+
The best protection against vulnerable software is running less software. This
|
1865
|
+
section describes how to review the software which Fedora installs on a system
|
1866
|
+
and disable software which is not needed. It then enumerates the software
|
1867
|
+
packages installed on a default Fedora system and provides guidance about which
|
1868
|
+
ones can be safely disabled.
|
1869
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1870
|
+
Fedora provides a convenient minimal install option that essentially installs
|
1871
|
+
the bare necessities for a functional system. When building Fedora servers, it
|
1872
|
+
is highly recommended to select the minimal packages and then build up the
|
1873
|
+
system from there.
|
1874
|
+
</description>
|
1875
|
+
<Group id="xccdf_org.ssgproject.content_group_ntp">
|
1876
|
+
<title xml:lang="en-US">Network Time Protocol</title>
|
1877
|
+
<description xml:lang="en-US">The Network Time Protocol is used to manage the system clock over
|
1878
|
+
a network. Computer clocks are not very accurate, so time will drift
|
1879
|
+
unpredictably on unmanaged systems. Central time protocols can be used both to
|
1880
|
+
ensure that time is consistent among a network of machines, and that their time
|
1881
|
+
is consistent with the outside world.
|
1882
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1883
|
+
If every system on a network reliably reports the same time, then it is much
|
1884
|
+
easier to correlate log messages in case of an attack. In addition, a number of
|
1885
|
+
cryptographic protocols (such as Kerberos) use timestamps to prevent certain
|
1886
|
+
types of attacks. If your network does not have synchronized time, these
|
1887
|
+
protocols may be unreliable or even unusable.
|
1888
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1889
|
+
Depending on the specifics of the network, global time accuracy may be just as
|
1890
|
+
important as local synchronization, or not very important at all. If your
|
1891
|
+
network is connected to the Internet, using a public timeserver (or one
|
1892
|
+
provided by your enterprise) provides globally accurate timestamps which may be
|
1893
|
+
essential in investigating or responding to an attack which originated outside
|
1894
|
+
of your network.
|
1895
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1896
|
+
A typical network setup involves a small number of internal systems operating
|
1897
|
+
as NTP servers, and the remainder obtaining time information from those
|
1898
|
+
internal servers.
|
1899
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1900
|
+
More information on how to configure the NTP server software, including
|
1901
|
+
configuration of cryptographic authentication for time data, is available at
|
1902
|
+
http://www.ntp.org.
|
1903
|
+
</description>
|
1904
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_ntpd_enabled" selected="false" severity="medium">
|
1905
|
+
<title xml:lang="en-US">NTP Daemon Enabled</title>
|
1906
|
+
<description xml:lang="en-US">
|
1907
|
+
|
1908
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ntpd</xhtml:code> service can be enabled with the following command:
|
1909
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl enable ntpd.service</xhtml:pre>
|
1910
|
+
</description>
|
1911
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AU-8(1)</reference>
|
1912
|
+
<reference href="http://iase.disa.mil/cci/index.html">160</reference>
|
1913
|
+
<rationale xml:lang="en-US">Enabling the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ntpd</xhtml:code> service ensures that the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ntpd</xhtml:code>
|
1914
|
+
service will be running and that the system will synchronize its time to any
|
1915
|
+
servers specified. This is important whether the system is configured to be a
|
1916
|
+
client (and synchronize only its own clock) or it is also acting as an NTP
|
1917
|
+
server to other systems. Synchronizing time is essential for authentication
|
1918
|
+
services such as Kerberos, but it is also important for maintaining accurate
|
1919
|
+
logs and auditing possible security breaches.
|
1920
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
1921
|
+
The NTP daemon offers all of the functionality of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ntpdate</xhtml:code>, which is
|
1922
|
+
now deprecated. Additional information on this is available at
|
1923
|
+
http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate</rationale>
|
1924
|
+
<fix system="urn:xccdf:fix:script:sh">#
|
1925
|
+
# Install ntp package if necessary
|
1926
|
+
#
|
1927
|
+
|
1928
|
+
yum -y install ntp
|
1929
|
+
|
1930
|
+
#
|
1931
|
+
# Enable ntpd service (for current systemd target)
|
1932
|
+
#
|
1933
|
+
|
1934
|
+
systemctl enable ntpd.service
|
1935
|
+
|
1936
|
+
#
|
1937
|
+
# Start ntpd if not currently running
|
1938
|
+
#
|
1939
|
+
|
1940
|
+
systemctl start ntpd.service
|
1941
|
+
</fix>
|
1942
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1943
|
+
<check-content-ref name="oval:ssg:def:169" href="ssg-fedora-oval.xml"/>
|
1944
|
+
</check>
|
1945
|
+
</Rule>
|
1946
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ntpd_specify_remote_server" selected="false" severity="medium">
|
1947
|
+
<title xml:lang="en-US">Remote NTP Server Specified</title>
|
1948
|
+
<description xml:lang="en-US">To specify a remote NTP server for time synchronization, edit
|
1949
|
+
the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ntp.conf</xhtml:code>. Add or correct the following lines,
|
1950
|
+
substituting the IP or hostname of a remote NTP server for <em xmlns="http://www.w3.org/1999/xhtml">ntpserver</em>:
|
1951
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">server <i>ntpserver</i></pre>
|
1952
|
+
This instructs the NTP software to contact that remote server to obtain time
|
1953
|
+
data.
|
1954
|
+
</description>
|
1955
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AU-8(1)</reference>
|
1956
|
+
<reference href="http://iase.disa.mil/cci/index.html">160</reference>
|
1957
|
+
<rationale xml:lang="en-US">Synchronizing with an NTP server makes it possible to collate system
|
1958
|
+
logs from multiple sources or correlate computer events with real time events.
|
1959
|
+
</rationale>
|
1960
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
1961
|
+
<check-content-ref name="oval:ssg:def:146" href="ssg-fedora-oval.xml"/>
|
1962
|
+
</check>
|
1963
|
+
</Rule>
|
1964
|
+
</Group>
|
1965
|
+
<Group id="xccdf_org.ssgproject.content_group_ssh">
|
1966
|
+
<title xml:lang="en-US">SSH Server</title>
|
1967
|
+
<description xml:lang="en-US">The SSH protocol is recommended for remote login and remote file
|
1968
|
+
transfer. SSH provides confidentiality and integrity for data exchanged between
|
1969
|
+
two systems, as well as server authentication, through the use of public key
|
1970
|
+
cryptography. The implementation included with the system is called OpenSSH,
|
1971
|
+
and more detailed documentation is available from its website,
|
1972
|
+
http://www.openssh.org. Its server program is called <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sshd</xhtml:code> and
|
1973
|
+
provided by the RPM package <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">openssh-server</xhtml:code>.</description>
|
1974
|
+
<Value id="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value" operator="equals" type="number">
|
1975
|
+
<title xml:lang="en-US">SSH session Idle time</title>
|
1976
|
+
<description xml:lang="en-US">Specify duration of allowed idle time.</description>
|
1977
|
+
<value>300</value>
|
1978
|
+
<value selector="5_minutes">300</value>
|
1979
|
+
<value selector="10_minutes">600</value>
|
1980
|
+
<value selector="15_minutes">900</value>
|
1981
|
+
</Value>
|
1982
|
+
<Group id="xccdf_org.ssgproject.content_group_ssh_server">
|
1983
|
+
<title xml:lang="en-US">Configure OpenSSH Server if Necessary</title>
|
1984
|
+
<description xml:lang="en-US">If the system needs to act as an SSH server, then certain changes
|
1985
|
+
should be made to the OpenSSH daemon configuration file
|
1986
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</xhtml:code>. The following recommendations can be applied
|
1987
|
+
to this file. See the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">sshd_config(5)</xhtml:code> man page for more detailed
|
1988
|
+
information.</description>
|
1989
|
+
<Rule id="xccdf_org.ssgproject.content_rule_sshd_disable_root_login" selected="false" severity="medium">
|
1990
|
+
<title xml:lang="en-US">SSH Root Login Disabled</title>
|
1991
|
+
<description xml:lang="en-US">The root user should never be allowed to login to a system
|
1992
|
+
directly over a network. To disable root login via SSH, add or correct the
|
1993
|
+
following line in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</xhtml:code>:
|
1994
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PermitRootLogin no</pre>
|
1995
|
+
</description>
|
1996
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">AC-6(2)</reference>
|
1997
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">IA-2(1)</reference>
|
1998
|
+
<reference href="http://iase.disa.mil/cci/index.html">770</reference>
|
1999
|
+
<rationale xml:lang="en-US">
|
2000
|
+
Permitting direct root login reduces auditable information about who ran
|
2001
|
+
privileged commands on the system and also allows direct attack attempts on
|
2002
|
+
root's password.
|
2003
|
+
</rationale>
|
2004
|
+
<fix system="urn:xccdf:fix:script:sh">
|
2005
|
+
SSHD_CONFIG='/etc/ssh/sshd_config'
|
2006
|
+
|
2007
|
+
# Obtain line number of first uncommented case-insensitive occurrence of Match
|
2008
|
+
# block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG
|
2009
|
+
FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2010
|
+
|
2011
|
+
# Obtain line number of first uncommented case-insensitive occurence of
|
2012
|
+
# PermitRootLogin directive (possibly prefixed with whitespace) present in
|
2013
|
+
# $SSHD_CONFIG
|
2014
|
+
FIRST_PERMIT_ROOT_LOGIN=$(sed -n '/^[[:space:]]*PermitRootLogin[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2015
|
+
|
2016
|
+
# Case: Match block directive not present in $SSHD_CONFIG
|
2017
|
+
if [ -z "$FIRST_MATCH_BLOCK" ]
|
2018
|
+
then
|
2019
|
+
|
2020
|
+
# Case: PermitRootLogin directive not present in $SSHD_CONFIG yet
|
2021
|
+
if [ -z "$FIRST_PERMIT_ROOT_LOGIN" ]
|
2022
|
+
then
|
2023
|
+
# Append 'PermitRootLogin no' at the end of $SSHD_CONFIG
|
2024
|
+
echo -e "\nPermitRootLogin no" >> $SSHD_CONFIG
|
2025
|
+
|
2026
|
+
# Case: PermitRootLogin directive present in $SSHD_CONFIG already
|
2027
|
+
else
|
2028
|
+
# Replace first uncommented case-insensitive occurrence
|
2029
|
+
# of PermitRootLogin directive
|
2030
|
+
sed -i "$FIRST_PERMIT_ROOT_LOGIN s/^[[:space:]]*PermitRootLogin.*$/PermitRootLogin no/I" $SSHD_CONFIG
|
2031
|
+
fi
|
2032
|
+
|
2033
|
+
# Case: Match block directive present in $SSHD_CONFIG
|
2034
|
+
else
|
2035
|
+
|
2036
|
+
# Case: PermitRootLogin directive not present in $SSHD_CONFIG yet
|
2037
|
+
if [ -z "$FIRST_PERMIT_ROOT_LOGIN" ]
|
2038
|
+
then
|
2039
|
+
# Prepend 'PermitRootLogin no' before first uncommented
|
2040
|
+
# case-insensitive occurrence of Match block directive
|
2041
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitRootLogin no\n\1/I" $SSHD_CONFIG
|
2042
|
+
|
2043
|
+
# Case: PermitRootLogin directive present in $SSHD_CONFIG and placed
|
2044
|
+
# before first Match block directive
|
2045
|
+
elif [ "$FIRST_PERMIT_ROOT_LOGIN" -lt "$FIRST_MATCH_BLOCK" ]
|
2046
|
+
then
|
2047
|
+
# Replace first uncommented case-insensitive occurrence
|
2048
|
+
# of PermitRootLogin directive
|
2049
|
+
sed -i "$FIRST_PERMIT_ROOT_LOGIN s/^[[:space:]]*PermitRootLogin.*$/PermitRootLogin no/I" $SSHD_CONFIG
|
2050
|
+
|
2051
|
+
# Case: PermitRootLogin directive present in $SSHD_CONFIG and placed
|
2052
|
+
# after first Match block directive
|
2053
|
+
else
|
2054
|
+
# Prepend 'PermitRootLogin no' before first uncommented
|
2055
|
+
# case-insensitive occurrence of Match block directive
|
2056
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitRootLogin no\n\1/I" $SSHD_CONFIG
|
2057
|
+
fi
|
2058
|
+
fi
|
2059
|
+
</fix>
|
2060
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2061
|
+
<check-content-ref name="oval:ssg:def:188" href="ssg-fedora-oval.xml"/>
|
2062
|
+
</check>
|
2063
|
+
</Rule>
|
2064
|
+
<Rule id="xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords" selected="false" severity="high">
|
2065
|
+
<title xml:lang="en-US">SSH Access via Empty Passwords Disabled</title>
|
2066
|
+
<description xml:lang="en-US">To explicitly disallow remote login from accounts with empty
|
2067
|
+
passwords, add or correct the following line in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</xhtml:code>:
|
2068
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">PermitEmptyPasswords no</pre>
|
2069
|
+
Any accounts with empty passwords should be disabled immediately, and PAM
|
2070
|
+
configuration should prevent users from being able to assign themselves empty
|
2071
|
+
passwords.
|
2072
|
+
</description>
|
2073
|
+
<reference href="http://iase.disa.mil/cci/index.html">765</reference>
|
2074
|
+
<reference href="http://iase.disa.mil/cci/index.html">766</reference>
|
2075
|
+
<rationale xml:lang="en-US">
|
2076
|
+
Configuring this setting for the SSH daemon provides additional assurance that
|
2077
|
+
remote login via SSH will require a password, even in the event of
|
2078
|
+
misconfiguration elsewhere.
|
2079
|
+
</rationale>
|
2080
|
+
<fix system="urn:xccdf:fix:script:sh">
|
2081
|
+
SSHD_CONFIG='/etc/ssh/sshd_config'
|
2082
|
+
|
2083
|
+
# Obtain line number of first uncommented case-insensitive occurrence of Match
|
2084
|
+
# block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG
|
2085
|
+
FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2086
|
+
|
2087
|
+
# Obtain line number of first uncommented case-insensitive occurence of
|
2088
|
+
# PermitEmptyPasswords directive (possibly prefixed with whitespace) present in
|
2089
|
+
# $SSHD_CONFIG
|
2090
|
+
FIRST_PERMIT_EMPTY_PASSWORDS=$(sed -n '/^[[:space:]]*PermitEmptyPasswords[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2091
|
+
|
2092
|
+
# Case: Match block directive not present in $SSHD_CONFIG
|
2093
|
+
if [ -z "$FIRST_MATCH_BLOCK" ]
|
2094
|
+
then
|
2095
|
+
|
2096
|
+
# Case: PermitEmptyPasswords directive not present in $SSHD_CONFIG yet
|
2097
|
+
if [ -z "$FIRST_PERMIT_EMPTY_PASSWORDS" ]
|
2098
|
+
then
|
2099
|
+
# Append 'PermitEmptyPasswords no' at the end of $SSHD_CONFIG
|
2100
|
+
echo -e "\nPermitEmptyPasswords no" >> $SSHD_CONFIG
|
2101
|
+
|
2102
|
+
# Case: PermitEmptyPasswords directive present in $SSHD_CONFIG already
|
2103
|
+
else
|
2104
|
+
# Replace first uncommented case-insensitive occurrence
|
2105
|
+
# of PermitEmptyPasswords directive
|
2106
|
+
sed -i "$FIRST_PERMIT_EMPTY_PASSWORDS s/^[[:space:]]*PermitEmptyPasswords.*$/PermitEmptyPasswords no/I" $SSHD_CONFIG
|
2107
|
+
fi
|
2108
|
+
|
2109
|
+
# Case: Match block directive present in $SSHD_CONFIG
|
2110
|
+
else
|
2111
|
+
|
2112
|
+
# Case: PermitEmptyPasswords directive not present in $SSHD_CONFIG yet
|
2113
|
+
if [ -z "$FIRST_PERMIT_EMPTY_PASSWORDS" ]
|
2114
|
+
then
|
2115
|
+
# Prepend 'PermitEmptyPasswords no' before first uncommented
|
2116
|
+
# case-insensitive occurrence of Match block directive
|
2117
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitEmptyPasswords no\n\1/I" $SSHD_CONFIG
|
2118
|
+
|
2119
|
+
# Case: PermitEmptyPasswords directive present in $SSHD_CONFIG and placed
|
2120
|
+
# before first Match block directive
|
2121
|
+
elif [ "$FIRST_PERMIT_EMPTY_PASSWORDS" -lt "$FIRST_MATCH_BLOCK" ]
|
2122
|
+
then
|
2123
|
+
# Replace first uncommented case-insensitive occurrence
|
2124
|
+
# of PermitEmptyPasswords directive
|
2125
|
+
sed -i "$FIRST_PERMIT_EMPTY_PASSWORDS s/^[[:space:]]*PermitEmptyPasswords.*$/PermitEmptyPasswords no/I" $SSHD_CONFIG
|
2126
|
+
|
2127
|
+
# Case: PermitEmptyPasswords directive present in $SSHD_CONFIG and placed
|
2128
|
+
# after first Match block directive
|
2129
|
+
else
|
2130
|
+
# Prepend 'PermitEmptyPasswords no' before first uncommented
|
2131
|
+
# case-insensitive occurrence of Match block directive
|
2132
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitEmptyPasswords no\n\1/I" $SSHD_CONFIG
|
2133
|
+
fi
|
2134
|
+
fi
|
2135
|
+
</fix>
|
2136
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2137
|
+
<check-content-ref name="oval:ssg:def:204" href="ssg-fedora-oval.xml"/>
|
2138
|
+
</check>
|
2139
|
+
</Rule>
|
2140
|
+
<Rule id="xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout" selected="false" severity="low">
|
2141
|
+
<title xml:lang="en-US">SSH Idle Timeout Interval Used</title>
|
2142
|
+
<description xml:lang="en-US">SSH allows administrators to set an idle timeout interval.
|
2143
|
+
After this interval has passed, the idle user will be automatically logged out.
|
2144
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2145
|
+
To set an idle timeout interval, edit the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</xhtml:code> file,
|
2146
|
+
locate the following line:
|
2147
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">ClientAliveInterval <b>INTERVAL</b></pre>
|
2148
|
+
and correct it to have the form of:
|
2149
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">ClientAliveInterval <b><sub xmlns="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value" use="legacy"/></b></pre>
|
2150
|
+
The timeout <b xmlns="http://www.w3.org/1999/xhtml">INTERVAL</b> is given in seconds. To have a timeout of 15
|
2151
|
+
minutes, set <b xmlns="http://www.w3.org/1999/xhtml">INTERVAL</b> to 900.
|
2152
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2153
|
+
If a shorter timeout has already been set for the login shell, that value will
|
2154
|
+
preempt any SSH setting made here. Keep in mind that some processes may stop
|
2155
|
+
SSH from correctly detecting that the user is idle.
|
2156
|
+
</description>
|
2157
|
+
<reference href="http://iase.disa.mil/cci/index.html">879</reference>
|
2158
|
+
<reference href="http://iase.disa.mil/cci/index.html">1133</reference>
|
2159
|
+
<rationale xml:lang="en-US">
|
2160
|
+
Causing idle users to be automatically logged out guards against compromises
|
2161
|
+
one system leading trivially to compromises on another.
|
2162
|
+
</rationale>
|
2163
|
+
<fix system="urn:xccdf:fix:script:sh">sshd_idle_timeout_value="<sub idref="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value" use="legacy"/>"
|
2164
|
+
SSHD_CONFIG='/etc/ssh/sshd_config'
|
2165
|
+
|
2166
|
+
# Obtain line number of first uncommented case-insensitive occurrence of Match
|
2167
|
+
# block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG
|
2168
|
+
FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2169
|
+
|
2170
|
+
# Obtain line number of first uncommented case-insensitive occurence of
|
2171
|
+
# ClientAliveInterval directive (possibly prefixed with whitespace) present in
|
2172
|
+
# $SSHD_CONFIG
|
2173
|
+
FIRST_CLIENT_ALIVE_INTERVAL=$(sed -n '/^[[:space:]]*ClientAliveInterval[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2174
|
+
|
2175
|
+
# Case: Match block directive not present in $SSHD_CONFIG
|
2176
|
+
if [ -z "$FIRST_MATCH_BLOCK" ]
|
2177
|
+
then
|
2178
|
+
|
2179
|
+
# Case: ClientAliveInterval directive not present in $SSHD_CONFIG yet
|
2180
|
+
if [ -z "$FIRST_CLIENT_ALIVE_INTERVAL" ]
|
2181
|
+
then
|
2182
|
+
# Append 'ClientAliveInterval $sshd_idle_timeout_value' at the end of $SSHD_CONFIG
|
2183
|
+
echo -e "\nClientAliveInterval $sshd_idle_timeout_value" >> $SSHD_CONFIG
|
2184
|
+
|
2185
|
+
# Case: ClientAliveInterval directive present in $SSHD_CONFIG already
|
2186
|
+
else
|
2187
|
+
# Replace first uncommented case-insensitive occurrence
|
2188
|
+
# of ClientAliveInterval directive
|
2189
|
+
sed -i "$FIRST_CLIENT_ALIVE_INTERVAL s/^[[:space:]]*ClientAliveInterval.*$/ClientAliveInterval $sshd_idle_timeout_value/I" $SSHD_CONFIG
|
2190
|
+
fi
|
2191
|
+
|
2192
|
+
# Case: Match block directive present in $SSHD_CONFIG
|
2193
|
+
else
|
2194
|
+
|
2195
|
+
# Case: ClientAliveInterval directive not present in $SSHD_CONFIG yet
|
2196
|
+
if [ -z "$FIRST_CLIENT_ALIVE_INTERVAL" ]
|
2197
|
+
then
|
2198
|
+
# Prepend 'ClientAliveInterval $sshd_idle_timeout_value' before first uncommented
|
2199
|
+
# case-insensitive occurrence of Match block directive
|
2200
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveInterval $sshd_idle_timeout_value\n\1/I" $SSHD_CONFIG
|
2201
|
+
|
2202
|
+
# Case: ClientAliveInterval directive present in $SSHD_CONFIG and placed
|
2203
|
+
# before first Match block directive
|
2204
|
+
elif [ "$FIRST_CLIENT_ALIVE_INTERVAL" -lt "$FIRST_MATCH_BLOCK" ]
|
2205
|
+
then
|
2206
|
+
# Replace first uncommented case-insensitive occurrence
|
2207
|
+
# of ClientAliveInterval directive
|
2208
|
+
sed -i "$FIRST_CLIENT_ALIVE_INTERVAL s/^[[:space:]]*ClientAliveInterval.*$/ClientAliveInterval $sshd_idle_timeout_value/I" $SSHD_CONFIG
|
2209
|
+
|
2210
|
+
# Case: ClientAliveInterval directive present in $SSHD_CONFIG and placed
|
2211
|
+
# after first Match block directive
|
2212
|
+
else
|
2213
|
+
# Prepend 'ClientAliveInterval $sshd_idle_timeout_value' before first uncommented
|
2214
|
+
# case-insensitive occurrence of Match block directive
|
2215
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveInterval $sshd_idle_timeout_value\n\1/I" $SSHD_CONFIG
|
2216
|
+
fi
|
2217
|
+
fi
|
2218
|
+
</fix>
|
2219
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2220
|
+
<check-export export-name="oval:ssg:var:283" value-id="xccdf_org.ssgproject.content_value_sshd_idle_timeout_value"/>
|
2221
|
+
<check-content-ref name="oval:ssg:def:179" href="ssg-fedora-oval.xml"/>
|
2222
|
+
</check>
|
2223
|
+
</Rule>
|
2224
|
+
<Rule id="xccdf_org.ssgproject.content_rule_sshd_set_keepalive" selected="false" severity="low">
|
2225
|
+
<title xml:lang="en-US">SSH Client Alive Count Used</title>
|
2226
|
+
<description xml:lang="en-US">To ensure the SSH idle timeout occurs precisely when the
|
2227
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ClientAliveCountMax</xhtml:code> is set, edit <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</xhtml:code> as
|
2228
|
+
follows:
|
2229
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">ClientAliveCountMax 0</pre>
|
2230
|
+
</description>
|
2231
|
+
<reference href="http://iase.disa.mil/cci/index.html">879</reference>
|
2232
|
+
<reference href="http://iase.disa.mil/cci/index.html">1133</reference>
|
2233
|
+
<rationale xml:lang="en-US">
|
2234
|
+
This ensures a user login will be terminated as soon as the
|
2235
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ClientAliveCountMax</xhtml:code> is reached.
|
2236
|
+
</rationale>
|
2237
|
+
<fix system="urn:xccdf:fix:script:sh">
|
2238
|
+
SSHD_CONFIG='/etc/ssh/sshd_config'
|
2239
|
+
|
2240
|
+
# Obtain line number of first uncommented case-insensitive occurrence of Match
|
2241
|
+
# block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG
|
2242
|
+
FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2243
|
+
|
2244
|
+
# Obtain line number of first uncommented case-insensitive occurence of
|
2245
|
+
# ClientAliveCountMax directive (possibly prefixed with whitespace) present in
|
2246
|
+
# $SSHD_CONFIG
|
2247
|
+
FIRST_CLIENT_ALIVE_COUNT_MAX=$(sed -n '/^[[:space:]]*ClientAliveCountMax[^\n]*/I{=;q}' $SSHD_CONFIG)
|
2248
|
+
|
2249
|
+
# Case: Match block directive not present in $SSHD_CONFIG
|
2250
|
+
if [ -z "$FIRST_MATCH_BLOCK" ]
|
2251
|
+
then
|
2252
|
+
|
2253
|
+
# Case: ClientAliveCountMax directive not present in $SSHD_CONFIG yet
|
2254
|
+
if [ -z "$FIRST_CLIENT_ALIVE_COUNT_MAX" ]
|
2255
|
+
then
|
2256
|
+
# Append 'ClientAliveCountMax 0' at the end of $SSHD_CONFIG
|
2257
|
+
echo -e "\nClientAliveCountMax 0" >> $SSHD_CONFIG
|
2258
|
+
|
2259
|
+
# Case: ClientAliveCountMax directive present in $SSHD_CONFIG already
|
2260
|
+
else
|
2261
|
+
# Replace first uncommented case-insensitive occurrence
|
2262
|
+
# of ClientAliveCountMax directive
|
2263
|
+
sed -i "$FIRST_CLIENT_ALIVE_COUNT_MAX s/^[[:space:]]*ClientAliveCountMax.*$/ClientAliveCountMax 0/I" $SSHD_CONFIG
|
2264
|
+
fi
|
2265
|
+
|
2266
|
+
# Case: Match block directive present in $SSHD_CONFIG
|
2267
|
+
else
|
2268
|
+
|
2269
|
+
# Case: ClientAliveCountMax directive not present in $SSHD_CONFIG yet
|
2270
|
+
if [ -z "$FIRST_CLIENT_ALIVE_COUNT_MAX" ]
|
2271
|
+
then
|
2272
|
+
# Prepend 'ClientAliveCountMax 0' before first uncommented
|
2273
|
+
# case-insensitive occurrence of Match block directive
|
2274
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveCountMax 0\n\1/I" $SSHD_CONFIG
|
2275
|
+
|
2276
|
+
# Case: ClientAliveCountMax directive present in $SSHD_CONFIG and placed
|
2277
|
+
# before first Match block directive
|
2278
|
+
elif [ "$FIRST_CLIENT_ALIVE_COUNT_MAX" -lt "$FIRST_MATCH_BLOCK" ]
|
2279
|
+
then
|
2280
|
+
# Replace first uncommented case-insensitive occurrence
|
2281
|
+
# of ClientAliveCountMax directive
|
2282
|
+
sed -i "$FIRST_CLIENT_ALIVE_COUNT_MAX s/^[[:space:]]*ClientAliveCountMax.*$/ClientAliveCountMax 0/I" $SSHD_CONFIG
|
2283
|
+
|
2284
|
+
# Case: ClientAliveCountMax directive present in $SSHD_CONFIG and placed
|
2285
|
+
# after first Match block directive
|
2286
|
+
else
|
2287
|
+
# Prepend 'ClientAliveCountMax 0' before first uncommented
|
2288
|
+
# case-insensitive occurrence of Match block directive
|
2289
|
+
sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveCountMax 0\n\1/I" $SSHD_CONFIG
|
2290
|
+
fi
|
2291
|
+
fi
|
2292
|
+
</fix>
|
2293
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2294
|
+
<check-content-ref name="oval:ssg:def:166" href="ssg-fedora-oval.xml"/>
|
2295
|
+
</check>
|
2296
|
+
</Rule>
|
2297
|
+
</Group>
|
2298
|
+
</Group>
|
2299
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp">
|
2300
|
+
<title xml:lang="en-US">FTP Server</title>
|
2301
|
+
<description xml:lang="en-US">FTP is a common method for allowing remote access to
|
2302
|
+
files. Like telnet, the FTP protocol is unencrypted, which means
|
2303
|
+
that passwords and other data transmitted during the session can be
|
2304
|
+
captured and that the session is vulnerable to hijacking.
|
2305
|
+
Therefore, running the FTP server software is not recommended.
|
2306
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2307
|
+
However, there are some FTP server configurations which may
|
2308
|
+
be appropriate for some environments, particularly those which
|
2309
|
+
allow only read-only anonymous access as a means of downloading
|
2310
|
+
data available to the public.</description>
|
2311
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_vsftpd">
|
2312
|
+
<title xml:lang="en-US">Disable vsftpd if Possible</title>
|
2313
|
+
<Rule id="xccdf_org.ssgproject.content_rule_disable_vsftpd" selected="false" severity="low">
|
2314
|
+
<title xml:lang="en-US">Disable vsftpd Service</title>
|
2315
|
+
<description xml:lang="en-US">
|
2316
|
+
|
2317
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> service can be disabled with the following command:
|
2318
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable vsftpd.service</xhtml:pre>
|
2319
|
+
</description>
|
2320
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-7</reference>
|
2321
|
+
<reference href="http://iase.disa.mil/cci/index.html">1436</reference>
|
2322
|
+
<rationale xml:lang="en-US">
|
2323
|
+
Running FTP server software provides a network-based avenue
|
2324
|
+
of attack, and should be disabled if not needed.
|
2325
|
+
Furthermore, the FTP protocol is unencrypted and creates
|
2326
|
+
a risk of compromising sensitive information.
|
2327
|
+
</rationale>
|
2328
|
+
<check system="ocil-transitional">
|
2329
|
+
<check-export export-name="the service is running" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2330
|
+
<check-content>
|
2331
|
+
|
2332
|
+
To check that the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> service is disabled in system boot configuration, run the following command:
|
2333
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>vsftpd</xhtml:code> --list</xhtml:pre>
|
2334
|
+
Output should indicate the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> service has either not been installed,
|
2335
|
+
or has been disabled at all runlevels, as shown in the example below:
|
2336
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>vsftpd</xhtml:code> --list
|
2337
|
+
<xhtml:code>vsftpd</xhtml:code> 0:off 1:off 2:off 3:off 4:off 5:off 6:off</xhtml:pre>
|
2338
|
+
|
2339
|
+
Run the following command to verify <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> is disabled through current runtime configuration:
|
2340
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># service vsftpd status</xhtml:pre>
|
2341
|
+
|
2342
|
+
If the service is disabled the command will return the following output:
|
2343
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd is stopped</xhtml:pre>
|
2344
|
+
</check-content>
|
2345
|
+
</check>
|
2346
|
+
</Rule>
|
2347
|
+
<Rule id="xccdf_org.ssgproject.content_rule_uninstall_vsftpd" selected="false" severity="low">
|
2348
|
+
<title xml:lang="en-US">Uninstall vsftpd Package</title>
|
2349
|
+
<description xml:lang="en-US">
|
2350
|
+
|
2351
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> package can be removed with the following command:
|
2352
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># yum erase vsftpd</xhtml:pre>
|
2353
|
+
</description>
|
2354
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-7</reference>
|
2355
|
+
<reference href="http://iase.disa.mil/cci/index.html">1436</reference>
|
2356
|
+
<rationale xml:lang="en-US">
|
2357
|
+
Removing the vsftpd package decreases the risk of its
|
2358
|
+
accidental activation.
|
2359
|
+
</rationale>
|
2360
|
+
<check system="ocil-transitional">
|
2361
|
+
<check-export export-name="the package is installed" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2362
|
+
<check-content>
|
2363
|
+
|
2364
|
+
Run the following command to determine if the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> package is installed:
|
2365
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># rpm -q vsftpd</xhtml:pre>
|
2366
|
+
</check-content>
|
2367
|
+
</check>
|
2368
|
+
</Rule>
|
2369
|
+
</Group>
|
2370
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp_use_vsftpd">
|
2371
|
+
<title xml:lang="en-US">Use vsftpd to Provide FTP Service if Necessary</title>
|
2372
|
+
<Rule id="xccdf_org.ssgproject.content_rule_package_vsftpd_installed" selected="false" severity="low">
|
2373
|
+
<title xml:lang="en-US">Install vsftpd Package</title>
|
2374
|
+
<description xml:lang="en-US">If this machine must operate as an FTP server, install the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code> package via the standard channels.
|
2375
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># yum install vsftpd</pre>
|
2376
|
+
</description>
|
2377
|
+
<reference href="http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf">CM-7</reference>
|
2378
|
+
<rationale xml:lang="en-US">After RHEL 2.1, Red Hat switched from distributing wu-ftpd with RHEL to distributing vsftpd. For security
|
2379
|
+
and for consistency with future Red Hat releases, the use of vsftpd is recommended.</rationale>
|
2380
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2381
|
+
<check-content-ref name="oval:ssg:def:150" href="ssg-fedora-oval.xml"/>
|
2382
|
+
</check>
|
2383
|
+
</Rule>
|
2384
|
+
</Group>
|
2385
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp_configure_vsftpd">
|
2386
|
+
<title xml:lang="en-US">Use vsftpd to Provide FTP Service if Necessary</title>
|
2387
|
+
<description xml:lang="en-US">The primary vsftpd configuration file is
|
2388
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftpd.conf</xhtml:code>, if that file exists, or
|
2389
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftpd/vsftpd.conf</xhtml:code> if it does not.
|
2390
|
+
</description>
|
2391
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ftp_log_transactions" selected="false" severity="low">
|
2392
|
+
<title xml:lang="en-US">Enable Logging of All FTP Transactions</title>
|
2393
|
+
<description xml:lang="en-US">Add or correct the following configuration options within the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd</xhtml:code>
|
2394
|
+
configuration file, located at <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftpd/vsftpd.conf</xhtml:code>:
|
2395
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">xferlog_enable=YES
|
2396
|
+
xferlog_std_format=NO
|
2397
|
+
log_ftp_protocol=YES</pre>
|
2398
|
+
</description>
|
2399
|
+
<warning xml:lang="en-US" override="false" category="general">If verbose logging to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd.log</xhtml:code> is done, sparse logging of downloads to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/var/log/xferlog</xhtml:code> will not also occur. However, the information about what files were downloaded is included in the information logged to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">vsftpd.log</xhtml:code></warning>
|
2400
|
+
<rationale xml:lang="en-US">To trace malicious activity facilitated by the FTP service, it must be configured to ensure that all commands sent to
|
2401
|
+
the FTP server are logged using the verbose vsftpd log
|
2402
|
+
format. The default vsftpd log file is <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/var/log/vsftpd.log</xhtml:code>.</rationale>
|
2403
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2404
|
+
<check-content-ref name="oval:ssg:def:183" href="ssg-fedora-oval.xml"/>
|
2405
|
+
</check>
|
2406
|
+
<check system="ocil-transitional">
|
2407
|
+
<check-export export-name="xferlog_enable is missing, or is not set to yes" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2408
|
+
<check-content>
|
2409
|
+
Find if logging is applied to the FTP daemon.
|
2410
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2411
|
+
Procedures:
|
2412
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2413
|
+
If vsftpd is started by xinetd the following command will indicate the xinetd.d startup file:
|
2414
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep vsftpd /etc/xinetd.d/*</pre>
|
2415
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep server_args <i>vsftpd xinetd.d startup file</i></pre>
|
2416
|
+
This will indicate the vsftpd config file used when starting through xinetd.
|
2417
|
+
If the <i xmlns="http://www.w3.org/1999/xhtml">server_args</i> line is missing or does not include the vsftpd configuration file, then the default config file (/etc/vsftpd/vsftpd.conf) is used.
|
2418
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep xferlog_enable <i>vsftpd config file</i></pre>
|
2419
|
+
</check-content>
|
2420
|
+
</check>
|
2421
|
+
</Rule>
|
2422
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ftp_present_banner" selected="false" severity="medium">
|
2423
|
+
<title xml:lang="en-US">Create Warning Banners for All FTP Users</title>
|
2424
|
+
<description xml:lang="en-US">Edit the vsftpd configuration file, which resides at <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftpd/vsftpd.conf</xhtml:code>
|
2425
|
+
by default. Add or correct the following configuration options:
|
2426
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">banner_file=/etc/issue</pre>
|
2427
|
+
</description>
|
2428
|
+
<reference href="http://iase.disa.mil/cci/index.html">48</reference>
|
2429
|
+
<rationale xml:lang="en-US">This setting will cause the system greeting banner to be used for FTP connections as well.</rationale>
|
2430
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2431
|
+
<check-content-ref name="oval:ssg:def:202" href="ssg-fedora-oval.xml"/>
|
2432
|
+
</check>
|
2433
|
+
<check system="ocil-transitional">
|
2434
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2435
|
+
<check-content>
|
2436
|
+
If FTP services are not installed, this is not applicable.
|
2437
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2438
|
+
To verify this configuration, run the following command:
|
2439
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">grep "banner_file" /etc/vsftpd/vsftpd.conf</pre>
|
2440
|
+
|
2441
|
+
The output should show the value of <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">banner_file</xhtml:code> is set to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/issue</xhtml:code>, an example of which is shown below:
|
2442
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep "banner_file" /etc/vsftpd/vsftpd.conf
|
2443
|
+
banner_file=/etc/issue</pre>
|
2444
|
+
</check-content>
|
2445
|
+
</check>
|
2446
|
+
</Rule>
|
2447
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp_restrict_users">
|
2448
|
+
<title xml:lang="en-US">Restrict the Set of Users Allowed to Access FTP</title>
|
2449
|
+
<description xml:lang="en-US">This section describes how to disable non-anonymous (password-based) FTP logins, or, if it is not possible to
|
2450
|
+
do this entirely due to legacy applications, how to restrict insecure FTP login to only those users who have an
|
2451
|
+
identified need for this access.</description>
|
2452
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ftp_restrict_to_anon" selected="false" severity="low">
|
2453
|
+
<title xml:lang="en-US">Restrict Access to Anonymous Users if Possible</title>
|
2454
|
+
<description xml:lang="en-US">Is there a mission-critical reason for users to transfer files to/from their own accounts using FTP, rather than
|
2455
|
+
using a secure protocol like SCP/SFTP? If not, edit the vsftpd configuration file. Add or correct the following configuration option:
|
2456
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">local_enable=NO</pre>
|
2457
|
+
If non-anonymous FTP logins are necessary, follow the guidance in the remainder of this section to secure
|
2458
|
+
these logins as much as possible.</description>
|
2459
|
+
<rationale xml:lang="en-US">The use of non-anonymous FTP logins is strongly discouraged. Since SSH clients and servers are widely available, and since SSH provides support for a transfer mode which resembles FTP in user interface, there is no good reason to allow password-based FTP access. </rationale>
|
2460
|
+
</Rule>
|
2461
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp_limit_users">
|
2462
|
+
<title xml:lang="en-US">Limit Users Allowed FTP Access if Necessary</title>
|
2463
|
+
<description xml:lang="en-US">If there is a mission-critical reason for users to access their accounts via the insecure FTP protocol, limit the set of users who are allowed this access. Edit the vsftpd configuration file. Add or correct the following configuration options:
|
2464
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">userlist_enable=YES
|
2465
|
+
userlist_file=/etc/vsftp.ftpusers
|
2466
|
+
userlist_deny=NO</pre>
|
2467
|
+
Edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftp.ftpusers</xhtml:code>. For each user USERNAME who should be allowed to access the system via FTP, add a line containing that user's name:
|
2468
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">USERNAME</pre>
|
2469
|
+
If anonymous access is also required, add the anonymous usernames to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/vsftp.ftpusers</xhtml:code> as well.
|
2470
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">anonymous
|
2471
|
+
ftp</pre>
|
2472
|
+
</description>
|
2473
|
+
<rationale xml:lang="en-US">Historically, the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/ftpusers</xhtml:code> contained a list of users who were not allowed to access the system via FTP. It was used to prevent system users such as the root user from logging in via the insecure FTP protocol. However, when the configuration option <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">userlist deny=NO</xhtml:code> is set, vsftpd interprets ftpusers as the set of users who are allowed to login via FTP. Since it should be possible for most users to access their accounts via secure protocols, it is recommended that this setting be used, so that non-anonymous FTP access can be limited to legacy users who have been explicitly identified.</rationale>
|
2474
|
+
</Group>
|
2475
|
+
</Group>
|
2476
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ftp_disable_uploads" selected="false" severity="low">
|
2477
|
+
<title xml:lang="en-US">Disable FTP Uploads if Possible</title>
|
2478
|
+
<description xml:lang="en-US">Is there a mission-critical reason for users to upload files via FTP? If not,
|
2479
|
+
edit the vsftpd configuration file to add or correct the following configuration options:
|
2480
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">write_enable=NO</pre>
|
2481
|
+
If FTP uploads are necessary, follow the guidance in the remainder of this section to secure these transactions
|
2482
|
+
as much as possible.</description>
|
2483
|
+
<rationale xml:lang="en-US">Anonymous FTP can be a convenient way to make files available for universal download. However, it is less
|
2484
|
+
common to have a need to allow unauthenticated users to place files on the FTP server. If this must be done, it
|
2485
|
+
is necessary to ensure that files cannot be uploaded and downloaded from the same directory.
|
2486
|
+
</rationale>
|
2487
|
+
</Rule>
|
2488
|
+
<Rule id="xccdf_org.ssgproject.content_rule_ftp_home_partition" selected="false" severity="low">
|
2489
|
+
<title xml:lang="en-US">Place the FTP Home Directory on its Own Partition</title>
|
2490
|
+
<description xml:lang="en-US">By default, the anonymous FTP root is the home directory of the FTP user account. The df command can
|
2491
|
+
be used to verify that this directory is on its own partition.</description>
|
2492
|
+
<rationale xml:lang="en-US">If there is a mission-critical reason for anonymous users to upload files, precautions must be taken to prevent
|
2493
|
+
these users from filling a disk used by other services.</rationale>
|
2494
|
+
</Rule>
|
2495
|
+
<Group id="xccdf_org.ssgproject.content_group_ftp_configure_firewall">
|
2496
|
+
<title xml:lang="en-US">Configure Firewalls to Protect the FTP Server</title>
|
2497
|
+
<description xml:lang="en-US">By default, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">iptables</xhtml:code>
|
2498
|
+
blocks access to the ports used by the web server.
|
2499
|
+
|
2500
|
+
To configure <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">iptables</xhtml:code> to allow port
|
2501
|
+
21 traffic one must edit
|
2502
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/iptables</xhtml:code> and
|
2503
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/ip6tables</xhtml:code> (if IPv6 is in use).
|
2504
|
+
Add the following line, ensuring that it appears before the final LOG
|
2505
|
+
and DROP lines for the INPUT chain:
|
2506
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:space="preserve">-A INPUT -m state --state NEW -p tcp --dport 21 -j ACCEPT</xhtml:pre>
|
2507
|
+
Edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/iptables-config</xhtml:code>. Ensure that the space-separated list of modules contains
|
2508
|
+
the FTP connection tracking module:
|
2509
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">IPTABLES_MODULES="ip_conntrack_ftp"</pre></description>
|
2510
|
+
<rationale xml:lang="en-US">These settings configure iptables to allow connections to an FTP server. The first line allows initial connections
|
2511
|
+
to the FTP server port.
|
2512
|
+
FTP is an older protocol which is not very compatible with firewalls. During the initial FTP dialogue, the client
|
2513
|
+
and server negotiate an arbitrary port to be used for data transfer. The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ip_conntrack_ftp</xhtml:code> module is used by
|
2514
|
+
iptables to listen to that dialogue and allow connections to the data ports which FTP negotiates. This allows an
|
2515
|
+
FTP server to operate on a machine which is running a firewall.</rationale>
|
2516
|
+
</Group>
|
2517
|
+
</Group>
|
2518
|
+
</Group>
|
2519
|
+
<Group id="xccdf_org.ssgproject.content_group_snmp">
|
2520
|
+
<title xml:lang="en-US">SNMP Server</title>
|
2521
|
+
<description xml:lang="en-US">The Simple Network Management Protocol allows
|
2522
|
+
administrators to monitor the state of network devices, including
|
2523
|
+
computers. Older versions of SNMP were well-known for weak
|
2524
|
+
security, such as plaintext transmission of the community string
|
2525
|
+
(used for authentication) and usage of easily-guessable
|
2526
|
+
choices for the community string.</description>
|
2527
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_snmp_service">
|
2528
|
+
<title xml:lang="en-US">Disable SNMP Server if Possible</title>
|
2529
|
+
<description xml:lang="en-US">The system includes an SNMP daemon that allows for its remote
|
2530
|
+
monitoring, though it not installed by default. If it was installed and
|
2531
|
+
activated but is not needed, the software should be disabled and removed.
|
2532
|
+
</description>
|
2533
|
+
<Rule id="xccdf_org.ssgproject.content_rule_disable_snmpd" selected="false" severity="low">
|
2534
|
+
<title xml:lang="en-US">Disable snmpd Service</title>
|
2535
|
+
<description xml:lang="en-US">
|
2536
|
+
|
2537
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd</xhtml:code> service can be disabled with the following command:
|
2538
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable snmpd.service</xhtml:pre>
|
2539
|
+
</description>
|
2540
|
+
<rationale xml:lang="en-US">
|
2541
|
+
Running SNMP software provides a network-based avenue of attack, and
|
2542
|
+
should be disabled if not needed.
|
2543
|
+
</rationale>
|
2544
|
+
<check system="ocil-transitional">
|
2545
|
+
<check-export export-name="the service is running" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2546
|
+
<check-content>
|
2547
|
+
|
2548
|
+
To check that the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd</xhtml:code> service is disabled in system boot configuration, run the following command:
|
2549
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>snmpd</xhtml:code> --list</xhtml:pre>
|
2550
|
+
Output should indicate the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd</xhtml:code> service has either not been installed,
|
2551
|
+
or has been disabled at all runlevels, as shown in the example below:
|
2552
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>snmpd</xhtml:code> --list
|
2553
|
+
<xhtml:code>snmpd</xhtml:code> 0:off 1:off 2:off 3:off 4:off 5:off 6:off</xhtml:pre>
|
2554
|
+
|
2555
|
+
Run the following command to verify <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd</xhtml:code> is disabled through current runtime configuration:
|
2556
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># service snmpd status</xhtml:pre>
|
2557
|
+
|
2558
|
+
If the service is disabled the command will return the following output:
|
2559
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd is stopped</xhtml:pre>
|
2560
|
+
</check-content>
|
2561
|
+
</check>
|
2562
|
+
</Rule>
|
2563
|
+
<Rule id="xccdf_org.ssgproject.content_rule_uninstall_net-snmp" selected="false" severity="low">
|
2564
|
+
<title xml:lang="en-US">Uninstall net-snmp Package</title>
|
2565
|
+
<description xml:lang="en-US">The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">net-snmp</xhtml:code> package provides the snmpd service.
|
2566
|
+
|
2567
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">net-snmpd</xhtml:code> package can be removed with the following command:
|
2568
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># yum erase net-snmpd</xhtml:pre>
|
2569
|
+
</description>
|
2570
|
+
<rationale xml:lang="en-US">
|
2571
|
+
If there is no need to run SNMP server software,
|
2572
|
+
removing the package provides a safeguard against its
|
2573
|
+
activation.
|
2574
|
+
</rationale>
|
2575
|
+
<check system="ocil-transitional">
|
2576
|
+
<check-export export-name="the package is installed" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2577
|
+
<check-content>
|
2578
|
+
|
2579
|
+
Run the following command to determine if the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">net-snmpd</xhtml:code> package is installed:
|
2580
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># rpm -q net-snmpd</xhtml:pre>
|
2581
|
+
</check-content>
|
2582
|
+
</check>
|
2583
|
+
</Rule>
|
2584
|
+
</Group>
|
2585
|
+
<Group id="xccdf_org.ssgproject.content_group_snmp_configure_server">
|
2586
|
+
<title xml:lang="en-US">Configure SNMP Server if Necessary</title>
|
2587
|
+
<description xml:lang="en-US">If it is necessary to run the snmpd agent on the system, some best
|
2588
|
+
practices should be followed to minimize the security risk from the
|
2589
|
+
installation. The multiple security models implemented by SNMP cannot be fully
|
2590
|
+
covered here so only the following general configuration advice can be offered:
|
2591
|
+
<ul xmlns="http://www.w3.org/1999/xhtml"><li>use only SNMP version 3 security models and enable the use of authentication and encryption</li><li>write access to the MIB (Management Information Base) should be allowed only if necessary</li><li>all access to the MIB should be restricted following a principle of least privilege</li><li>network access should be limited to the maximum extent possible including restricting to expected network
|
2592
|
+
addresses both in the configuration files and in the system firewall rules</li><li>ensure SNMP agents send traps only to, and accept SNMP queries only from, authorized management
|
2593
|
+
stations</li><li>ensure that permissions on the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">snmpd.conf</xhtml:code> configuration file (by default, in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/snmp</xhtml:code>) are 640 or more restrictive</li><li>ensure that any MIB files' permissions are also 640 or more restrictive</li></ul>
|
2594
|
+
</description>
|
2595
|
+
<Rule id="xccdf_org.ssgproject.content_rule_snmpd_use_newer_protocol" selected="false" severity="medium">
|
2596
|
+
<title xml:lang="en-US">Configure SNMP Service to Use Only SNMPv3 or Newer </title>
|
2597
|
+
<description xml:lang="en-US">
|
2598
|
+
Edit <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/snmp/snmpd.conf</xhtml:code>, removing any references to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rocommunity</xhtml:code>, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rwcommunity</xhtml:code>, or <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">com2sec</xhtml:code>.
|
2599
|
+
Upon doing that, restart the SNMP service:
|
2600
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># service snmpd restart</pre>
|
2601
|
+
</description>
|
2602
|
+
<rationale xml:lang="en-US">
|
2603
|
+
Earlier versions of SNMP are considered insecure, as they potentially allow
|
2604
|
+
unauthorized access to detailed system management information.
|
2605
|
+
</rationale>
|
2606
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2607
|
+
<check-content-ref name="oval:ssg:def:177" href="ssg-fedora-oval.xml"/>
|
2608
|
+
</check>
|
2609
|
+
<check system="ocil-transitional">
|
2610
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2611
|
+
<check-content>
|
2612
|
+
To ensure only SNMPv3 or newer is used, run the following command:
|
2613
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep 'rocommunity\|rwcommunity\|com2sec' /etc/snmp/snmpd.conf | grep -v "^#"</pre>
|
2614
|
+
There should be no output.
|
2615
|
+
</check-content>
|
2616
|
+
</check>
|
2617
|
+
</Rule>
|
2618
|
+
<Rule id="xccdf_org.ssgproject.content_rule_snmpd_not_default_password" selected="false" severity="medium">
|
2619
|
+
<title xml:lang="en-US">Ensure Default Password Is Not Used</title>
|
2620
|
+
<description xml:lang="en-US">
|
2621
|
+
Edit <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/snmp/snmpd.conf</xhtml:code>, remove default community string <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">public</xhtml:code>.
|
2622
|
+
Upon doing that, restart the SNMP service:
|
2623
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># service snmpd restart</pre>
|
2624
|
+
</description>
|
2625
|
+
<rationale xml:lang="en-US">
|
2626
|
+
Presence of the default SNMP password enables querying of different system
|
2627
|
+
aspects and could result in unauthorized knowledge of the system.
|
2628
|
+
</rationale>
|
2629
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
2630
|
+
<check-content-ref name="oval:ssg:def:171" href="ssg-fedora-oval.xml"/>
|
2631
|
+
</check>
|
2632
|
+
<check system="ocil-transitional">
|
2633
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2634
|
+
<check-content>
|
2635
|
+
To ensure the default password is not set, run the following command:
|
2636
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep -v "^#" /etc/snmp/snmpd.conf| grep public</pre>
|
2637
|
+
There should be no output.
|
2638
|
+
</check-content>
|
2639
|
+
</check>
|
2640
|
+
</Rule>
|
2641
|
+
</Group>
|
2642
|
+
</Group>
|
2643
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_and_rpc">
|
2644
|
+
<title xml:lang="en-US">NFS and RPC</title>
|
2645
|
+
<description xml:lang="en-US">The Network File System is a popular distributed filesystem for
|
2646
|
+
the Unix environment, and is very widely deployed. This section discusses the
|
2647
|
+
circumstances under which it is possible to disable NFS and its dependencies,
|
2648
|
+
and then details steps which should be taken to secure
|
2649
|
+
NFS's configuration. This section is relevant to machines operating as NFS
|
2650
|
+
clients, as well as to those operating as NFS servers.
|
2651
|
+
</description>
|
2652
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_nfs">
|
2653
|
+
<title xml:lang="en-US">Disable All NFS Services if Possible</title>
|
2654
|
+
<description xml:lang="en-US">If there is not a reason for the system to operate as either an
|
2655
|
+
NFS client or an NFS server, follow all instructions in this section to disable
|
2656
|
+
subsystems required by NFS.
|
2657
|
+
</description>
|
2658
|
+
<warning xml:lang="en-US" override="false" category="general">The steps in this section will prevent a machine
|
2659
|
+
from operating as either an NFS client or an NFS server. Only perform these
|
2660
|
+
steps on machines which do not need NFS at all.</warning>
|
2661
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_nfs_services">
|
2662
|
+
<title xml:lang="en-US">Disable Services Used Only by NFS</title>
|
2663
|
+
<description xml:lang="en-US">If NFS is not needed, disable the NFS client daemons nfslock, rpcgssd, and rpcidmapd.
|
2664
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2665
|
+
All of these daemons run with elevated privileges, and many listen for network
|
2666
|
+
connections. If they are not needed, they should be disabled to improve system
|
2667
|
+
security posture.</description>
|
2668
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_nfslock_disabled" selected="false" severity="low">
|
2669
|
+
<title xml:lang="en-US">Disable Network File System Lock Service (nfslock)</title>
|
2670
|
+
<description xml:lang="en-US">The Network File System Lock (nfslock) service starts the required
|
2671
|
+
remote procedure call (RPC) processes which allow clients to lock files on the
|
2672
|
+
server. If the local machine is not configured to mount NFS filesystems then
|
2673
|
+
this service should be disabled.
|
2674
|
+
|
2675
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfslock</xhtml:code> service can be disabled with the following command:
|
2676
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable nfslock.service</xhtml:pre>
|
2677
|
+
</description>
|
2678
|
+
</Rule>
|
2679
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_rpcgssd_disabled" selected="false" severity="low">
|
2680
|
+
<title xml:lang="en-US">Disable Secure RPC Client Service (rpcgssd)</title>
|
2681
|
+
<description xml:lang="en-US">
|
2682
|
+
The rpcgssd service manages RPCSEC GSS contexts required to secure protocols
|
2683
|
+
that use RPC (most often Kerberos and NFS). The rpcgssd service is the
|
2684
|
+
client-side of RPCSEC GSS. If the system does not require secure RPC then this
|
2685
|
+
service should be disabled.
|
2686
|
+
|
2687
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcgssd</xhtml:code> service can be disabled with the following command:
|
2688
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable rpcgssd.service</xhtml:pre>
|
2689
|
+
</description>
|
2690
|
+
</Rule>
|
2691
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_rpcidmapd_disabled" selected="false" severity="low">
|
2692
|
+
<title xml:lang="en-US">Disable RPC ID Mapping Service (rpcidmapd)</title>
|
2693
|
+
<description xml:lang="en-US">The rpcidmapd service is used to map user names and groups to UID
|
2694
|
+
and GID numbers on NFSv4 mounts. If NFS is not in use on the local system then
|
2695
|
+
this service should be disabled.
|
2696
|
+
|
2697
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcidmapd</xhtml:code> service can be disabled with the following command:
|
2698
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable rpcidmapd.service</xhtml:pre>
|
2699
|
+
</description>
|
2700
|
+
</Rule>
|
2701
|
+
</Group>
|
2702
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_netfs">
|
2703
|
+
<title xml:lang="en-US">Disable netfs if Possible</title>
|
2704
|
+
<description xml:lang="en-US">To determine if any network filesystems handled by netfs are
|
2705
|
+
currently mounted on the system execute the following command:
|
2706
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># mount -t nfs,nfs4,smbfs,cifs,ncpfs</pre>
|
2707
|
+
If the command did not return any output then disable netfs.
|
2708
|
+
</description>
|
2709
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_netfs_disabled" selected="false" severity="low">
|
2710
|
+
<title xml:lang="en-US">Disable Network File Systems (netfs)</title>
|
2711
|
+
<description xml:lang="en-US">The netfs script manages the boot-time mounting of several types
|
2712
|
+
of networked filesystems, of which NFS and Samba are the most common. If these
|
2713
|
+
filesystem types are not in use, the script can be disabled, protecting the
|
2714
|
+
system somewhat against accidental or malicious changes to <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/fstab</xhtml:code>
|
2715
|
+
and against flaws in the netfs script itself.
|
2716
|
+
|
2717
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">netfs</xhtml:code> service can be disabled with the following command:
|
2718
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable netfs.service</xhtml:pre>
|
2719
|
+
</description>
|
2720
|
+
</Rule>
|
2721
|
+
</Group>
|
2722
|
+
</Group>
|
2723
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_configuring_all_machines">
|
2724
|
+
<title xml:lang="en-US">Configure All Machines which Use NFS</title>
|
2725
|
+
<description xml:lang="en-US">The steps in this section are appropriate for all machines which
|
2726
|
+
run NFS, whether they operate as clients or as servers.</description>
|
2727
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_client_or_server_not_both">
|
2728
|
+
<title xml:lang="en-US">Make Each Machine a Client or a Server, not Both</title>
|
2729
|
+
<description xml:lang="en-US">If NFS must be used, it should be deployed in the simplest
|
2730
|
+
configuration possible to avoid maintainability problems which may lead to
|
2731
|
+
unnecessary security exposure. Due to the reliability and security problems
|
2732
|
+
caused by NFS (specially NFSv3 and NFSv2), it is not a good idea for machines
|
2733
|
+
which act as NFS servers to also mount filesystems via NFS. At the least,
|
2734
|
+
crossed mounts (the situation in which each of two servers mounts a filesystem
|
2735
|
+
from the other) should never be used.
|
2736
|
+
</description>
|
2737
|
+
</Group>
|
2738
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_configure_fixed_ports">
|
2739
|
+
<title xml:lang="en-US">Configure NFS Services to Use Fixed Ports (NFSv3 and NFSv2)</title>
|
2740
|
+
<description xml:lang="en-US">Firewalling should be done at each host and at the border
|
2741
|
+
firewalls to protect the NFS daemons from remote access, since NFS servers
|
2742
|
+
should never be accessible from outside the organization. However, by default
|
2743
|
+
for NFSv3 and NFSv2, the RPC Bind service assigns each NFS service to a port
|
2744
|
+
dynamically at service startup time. Dynamic ports cannot be protected by port
|
2745
|
+
filtering firewalls such as iptables.
|
2746
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2747
|
+
Therefore, restrict each service to always use a given port, so that
|
2748
|
+
firewalling can be done effectively. Note that, because of the way RPC is
|
2749
|
+
implemented, it is not possible to disable the RPC Bind service even if ports
|
2750
|
+
are assigned statically to all RPC services.
|
2751
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2752
|
+
In NFSv4, the mounting and locking protocols have been incorporated into the
|
2753
|
+
protocol, and the server listens on the the well-known TCP port 2049. As such,
|
2754
|
+
NFSv4 does not need to interact with the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcbind, lockd, and rpc.statd</xhtml:code>
|
2755
|
+
daemons, which can and should be disabled in a pure NFSv4 environment. The
|
2756
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpc.mountd</xhtml:code> daemon is still required on the NFS server to setup
|
2757
|
+
exports, but is not involved in any over-the-wire operations.
|
2758
|
+
</description>
|
2759
|
+
<Rule id="xccdf_org.ssgproject.content_rule_nfs_fixed_lockd_tcp_port" selected="false" severity="low">
|
2760
|
+
<title xml:lang="en-US">Configure lockd to use static TCP port</title>
|
2761
|
+
<description xml:lang="en-US">Configure the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">lockd</xhtml:code> daemon to use a static TCP port as
|
2762
|
+
opposed to letting the RPC Bind service dynamically assign a port. Edit the
|
2763
|
+
file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/nfs</xhtml:code>. Add or correct the following line:
|
2764
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">LOCKD_TCPPORT=lockd-port</pre>
|
2765
|
+
Where <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">lockd-port</xhtml:code> is a port which is not used by any other service on
|
2766
|
+
your network.
|
2767
|
+
</description>
|
2768
|
+
<rationale xml:lang="en-US">
|
2769
|
+
Restrict service to always use a given port, so that firewalling can be done
|
2770
|
+
effectively.
|
2771
|
+
</rationale>
|
2772
|
+
</Rule>
|
2773
|
+
<Rule id="xccdf_org.ssgproject.content_rule_nfs_fixed_lockd_udp_port" selected="false" severity="low">
|
2774
|
+
<title xml:lang="en-US">Configure lockd to use static UDP port</title>
|
2775
|
+
<description xml:lang="en-US">Configure the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">lockd</xhtml:code> daemon to use a static UDP port as
|
2776
|
+
opposed to letting the RPC Bind service dynamically assign a port. Edit the
|
2777
|
+
file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/nfs</xhtml:code>. Add or correct the following line:
|
2778
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">LOCKD_UDPPORT=lockd-port</pre>
|
2779
|
+
Where <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">lockd-port</xhtml:code> is a port which is not used by any other service on
|
2780
|
+
your network.
|
2781
|
+
</description>
|
2782
|
+
<rationale xml:lang="en-US"> Restricting services to always use a given port enables firewalling
|
2783
|
+
to be done more effectively.
|
2784
|
+
</rationale>
|
2785
|
+
</Rule>
|
2786
|
+
<Rule id="xccdf_org.ssgproject.content_rule_nfs_fixed_statd_port" selected="false" severity="low">
|
2787
|
+
<title xml:lang="en-US">Configure statd to use static port</title>
|
2788
|
+
<description xml:lang="en-US">Configure the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">statd</xhtml:code> daemon to use a static port as
|
2789
|
+
opposed to letting the RPC Bind service dynamically assign a port. Edit the
|
2790
|
+
file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/nfs</xhtml:code>. Add or correct the following line:
|
2791
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">STATD_PORT=statd-port</pre>
|
2792
|
+
Where <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">statd-port</xhtml:code> is a port which is not used by any other service on your network.
|
2793
|
+
</description>
|
2794
|
+
<rationale xml:lang="en-US"> Restricting services to always use a given port enables firewalling
|
2795
|
+
to be done more effectively.
|
2796
|
+
</rationale>
|
2797
|
+
</Rule>
|
2798
|
+
<Rule id="xccdf_org.ssgproject.content_rule_nfs_fixed_mountd_port" selected="false" severity="low">
|
2799
|
+
<title xml:lang="en-US">Configure mountd to use static port</title>
|
2800
|
+
<description xml:lang="en-US">Configure the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">mountd</xhtml:code> daemon to use a static port as
|
2801
|
+
opposed to letting the RPC Bind service dynamically assign a port. Edit the
|
2802
|
+
file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/sysconfig/nfs</xhtml:code>. Add or correct the following line:
|
2803
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">MOUNTD_PORT=statd-port</pre>
|
2804
|
+
Where <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">mountd-port</xhtml:code> is a port which is not used by any other service on your network.
|
2805
|
+
</description>
|
2806
|
+
<rationale xml:lang="en-US"> Restricting services to always use a given port enables firewalling
|
2807
|
+
to be done more effectively.
|
2808
|
+
</rationale>
|
2809
|
+
</Rule>
|
2810
|
+
</Group>
|
2811
|
+
</Group>
|
2812
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_configuring_clients">
|
2813
|
+
<title xml:lang="en-US">Configure NFS Clients</title>
|
2814
|
+
<description xml:lang="en-US">The steps in this section are appropriate for machines which operate as NFS clients.</description>
|
2815
|
+
<Group id="xccdf_org.ssgproject.content_group_disabling_nfsd">
|
2816
|
+
<title xml:lang="en-US">Disable NFS Server Daemons</title>
|
2817
|
+
<description xml:lang="en-US">
|
2818
|
+
There is no need to run the NFS server daemons <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs</xhtml:code> and
|
2819
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd</xhtml:code> except on a small number of properly secured machines
|
2820
|
+
designated as NFS servers. Ensure that these daemons are turned off on
|
2821
|
+
clients.</description>
|
2822
|
+
<Rule id="xccdf_org.ssgproject.content_rule_nfs_no_anonymous" selected="false" severity="low">
|
2823
|
+
<title xml:lang="en-US">Specify UID and GID for Anonymous NFS Connections</title>
|
2824
|
+
<description xml:lang="en-US">To specify the UID and GID for remote root users, edit the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> file and add the following for each export:
|
2825
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">
|
2826
|
+
anonuid=-1
|
2827
|
+
anongid=-1
|
2828
|
+
</pre>
|
2829
|
+
</description>
|
2830
|
+
<rationale xml:lang="en-US">Specifying the anonymous UID and GID as -1 ensures that the remote root user is mapped to a local account which has no permissions on the system.</rationale>
|
2831
|
+
</Rule>
|
2832
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_nfs_disabled" selected="false" severity="low">
|
2833
|
+
<title xml:lang="en-US">Disable Network File System (nfs)</title>
|
2834
|
+
<description xml:lang="en-US">The Network File System (NFS) service allows remote hosts to mount
|
2835
|
+
and interact with shared filesystems on the local machine. If the local machine
|
2836
|
+
is not designated as a NFS server then this service should be disabled.
|
2837
|
+
|
2838
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs</xhtml:code> service can be disabled with the following command:
|
2839
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable nfs.service</xhtml:pre>
|
2840
|
+
</description>
|
2841
|
+
<rationale xml:lang="en-US">Unnecessary services should be disabled to decrease the attack surface of the system.</rationale>
|
2842
|
+
<check system="ocil-transitional">
|
2843
|
+
<check-export export-name="it does not" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2844
|
+
<check-content>
|
2845
|
+
It is prudent to ensure the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs</xhtml:code> service is disabled in system boot, as well as
|
2846
|
+
not currently running. First, run the following to verify the service is stopped:
|
2847
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ service nfs status</pre>
|
2848
|
+
If the service is stopped or disabled, it will return the following:
|
2849
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">rpc.svcgssd is stopped
|
2850
|
+
rpc.mountd is stopped
|
2851
|
+
nfsd is stopped
|
2852
|
+
rpc.rquotad is stopped</pre>
|
2853
|
+
To verify that the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs</xhtml:code> service is disabled, run the following command:
|
2854
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ chkconfig --list nfs</pre>
|
2855
|
+
If properly configured, the output should look like:
|
2856
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off</pre>
|
2857
|
+
</check-content>
|
2858
|
+
</check>
|
2859
|
+
</Rule>
|
2860
|
+
<Rule id="xccdf_org.ssgproject.content_rule_service_rpcsvcgssd_disabled" selected="false" severity="low">
|
2861
|
+
<title xml:lang="en-US">Disable Secure RPC Server Service (rpcsvcgssd)</title>
|
2862
|
+
<description xml:lang="en-US">The rpcsvcgssd service manages RPCSEC GSS contexts required to
|
2863
|
+
secure protocols that use RPC (most often Kerberos and NFS). The rpcsvcgssd
|
2864
|
+
service is the server-side of RPCSEC GSS. If the system does not require secure
|
2865
|
+
RPC then this service should be disabled.
|
2866
|
+
|
2867
|
+
The <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd</xhtml:code> service can be disabled with the following command:
|
2868
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># systemctl disable rpcsvcgssd.service</xhtml:pre>
|
2869
|
+
</description>
|
2870
|
+
<rationale xml:lang="en-US">Unnecessary services should be disabled to decrease the attack surface of the system.</rationale>
|
2871
|
+
<check system="ocil-transitional">
|
2872
|
+
<check-export export-name="the service is running" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2873
|
+
<check-content>
|
2874
|
+
|
2875
|
+
To check that the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd</xhtml:code> service is disabled in system boot configuration, run the following command:
|
2876
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>rpcsvcgssd</xhtml:code> --list</xhtml:pre>
|
2877
|
+
Output should indicate the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd</xhtml:code> service has either not been installed,
|
2878
|
+
or has been disabled at all runlevels, as shown in the example below:
|
2879
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># chkconfig <xhtml:code>rpcsvcgssd</xhtml:code> --list
|
2880
|
+
<xhtml:code>rpcsvcgssd</xhtml:code> 0:off 1:off 2:off 3:off 4:off 5:off 6:off</xhtml:pre>
|
2881
|
+
|
2882
|
+
Run the following command to verify <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd</xhtml:code> is disabled through current runtime configuration:
|
2883
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml"># service rpcsvcgssd status</xhtml:pre>
|
2884
|
+
|
2885
|
+
If the service is disabled the command will return the following output:
|
2886
|
+
<xhtml:pre xmlns:xhtml="http://www.w3.org/1999/xhtml">rpcsvcgssd is stopped</xhtml:pre>
|
2887
|
+
</check-content>
|
2888
|
+
</check>
|
2889
|
+
</Rule>
|
2890
|
+
</Group>
|
2891
|
+
<Group id="xccdf_org.ssgproject.content_group_mounting_remote_filesystems">
|
2892
|
+
<title xml:lang="en-US">Mount Remote Filesystems with Restrictive Options</title>
|
2893
|
+
<description xml:lang="en-US">Edit the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/fstab</xhtml:code>. For each filesystem whose type
|
2894
|
+
(column 3) is <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs</xhtml:code> or <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nfs4</xhtml:code>, add the text
|
2895
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">,nodev,nosuid</xhtml:code> to the list of mount options in column 4. If
|
2896
|
+
appropriate, also add <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">,noexec</xhtml:code>.
|
2897
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2898
|
+
See the section titled "Restrict Partition Mount Options" for a description of
|
2899
|
+
the effects of these options. In general, execution of files mounted via NFS
|
2900
|
+
should be considered risky because of the possibility that an adversary could
|
2901
|
+
intercept the request and substitute a malicious file. Allowing setuid files to
|
2902
|
+
be executed from remote servers is particularly risky, both for this reason and
|
2903
|
+
because it requires the clients to extend root-level trust to the NFS
|
2904
|
+
server.</description>
|
2905
|
+
<Rule id="xccdf_org.ssgproject.content_rule_use_nodev_option_on_nfs_mounts" selected="false" severity="medium">
|
2906
|
+
<title xml:lang="en-US">Mount Remote Filesystems with nodev</title>
|
2907
|
+
<description xml:lang="en-US">
|
2908
|
+
|
2909
|
+
Add the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nodev</xhtml:code> option to the fourth column of
|
2910
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/fstab</xhtml:code> for the line which controls mounting of
|
2911
|
+
any NFS mounts.
|
2912
|
+
|
2913
|
+
</description>
|
2914
|
+
<rationale xml:lang="en-US">Legitimate device files should only exist in the /dev directory. NFS mounts
|
2915
|
+
should not present device files to users.</rationale>
|
2916
|
+
<check system="ocil-transitional">
|
2917
|
+
<check-export export-name="the setting does not show" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2918
|
+
<check-content>
|
2919
|
+
To verify the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nodev</xhtml:code> option is configured for all NFS mounts, run the following command:
|
2920
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ mount | grep nfs</pre>
|
2921
|
+
All NFS mounts should show the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nodev</xhtml:code> setting in parentheses. This is not applicable if NFS is
|
2922
|
+
not implemented.
|
2923
|
+
</check-content>
|
2924
|
+
</check>
|
2925
|
+
</Rule>
|
2926
|
+
<Rule id="xccdf_org.ssgproject.content_rule_use_nosuid_option_on_nfs_mounts" selected="false" severity="medium">
|
2927
|
+
<title xml:lang="en-US">Mount Remote Filesystems with nosuid</title>
|
2928
|
+
<description xml:lang="en-US">
|
2929
|
+
|
2930
|
+
Add the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nosuid</xhtml:code> option to the fourth column of
|
2931
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/fstab</xhtml:code> for the line which controls mounting of
|
2932
|
+
any NFS mounts.
|
2933
|
+
|
2934
|
+
</description>
|
2935
|
+
<rationale xml:lang="en-US">NFS mounts should not present suid binaries to users. Only vendor-supplied suid executables
|
2936
|
+
should be installed to their default location on the local filesystem.</rationale>
|
2937
|
+
<check system="ocil-transitional">
|
2938
|
+
<check-export export-name="the setting does not show" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
2939
|
+
<check-content>
|
2940
|
+
To verify the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nosuid</xhtml:code> option is configured for all NFS mounts, run the following command:
|
2941
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">$ mount | grep nfs</pre>
|
2942
|
+
All NFS mounts should show the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">nosuid</xhtml:code> setting in parentheses. This is not applicable if NFS is
|
2943
|
+
not implemented.
|
2944
|
+
</check-content>
|
2945
|
+
</check>
|
2946
|
+
</Rule>
|
2947
|
+
</Group>
|
2948
|
+
</Group>
|
2949
|
+
<Group id="xccdf_org.ssgproject.content_group_nfs_configuring_servers">
|
2950
|
+
<title xml:lang="en-US">Configure NFS Servers</title>
|
2951
|
+
<description xml:lang="en-US">The steps in this section are appropriate for machines which operate as NFS servers.</description>
|
2952
|
+
<Group id="xccdf_org.ssgproject.content_group_configure_exports_restrictively">
|
2953
|
+
<title xml:lang="en-US">Configure the Exports File Restrictively</title>
|
2954
|
+
<description xml:lang="en-US">Linux's NFS implementation uses the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> to control what filesystems
|
2955
|
+
and directories may be accessed via NFS. (See the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">exports(5)</xhtml:code> manpage for more information about the
|
2956
|
+
format of this file.)
|
2957
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2958
|
+
The syntax of the <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">exports</xhtml:code> file is not necessarily checked fully on reload, and syntax errors
|
2959
|
+
can leave your NFS configuration more open than intended. Therefore, exercise caution when modifying
|
2960
|
+
the file.
|
2961
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2962
|
+
The syntax of each line in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> is:
|
2963
|
+
<pre xmlns="http://www.w3.org/1999/xhtml">/DIR host1(opt1,opt2) host2(opt3)</pre>
|
2964
|
+
where <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/DIR</xhtml:code> is a directory or filesystem to export, <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">hostN</xhtml:code> is an IP address, netblock,
|
2965
|
+
hostname, domain, or netgroup to which to export, and <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">optN</xhtml:code> is an option.
|
2966
|
+
</description>
|
2967
|
+
</Group>
|
2968
|
+
<Group id="xccdf_org.ssgproject.content_group_use_acl_enforce_auth_restrictions">
|
2969
|
+
<title xml:lang="en-US">Use Access Lists to Enforce Authorization Restrictions</title>
|
2970
|
+
<description xml:lang="en-US">When configuring NFS exports, ensure that each export line in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> contains
|
2971
|
+
a list of hosts which are allowed to access that export. If no hosts are specified on an export line,
|
2972
|
+
then that export is available to any remote host which requests it. All lines of the exports file should
|
2973
|
+
specify the hosts (or subnets, if needed) which are allowed to access the exported directory, so that
|
2974
|
+
unknown or remote hosts will be denied.
|
2975
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2976
|
+
Authorized hosts can be specified in several different formats:
|
2977
|
+
<ul xmlns="http://www.w3.org/1999/xhtml"><li>Name or alias that is recognized by the resolver</li><li>Fully qualified domain name</li><li>IP address</li><li>IP subnets in the format <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">address/netmask</xhtml:code> or <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">address/CIDR</xhtml:code></li></ul>
|
2978
|
+
</description>
|
2979
|
+
</Group>
|
2980
|
+
<Group id="xccdf_org.ssgproject.content_group_export_filesystems_read_only">
|
2981
|
+
<title xml:lang="en-US">Export Filesystems Read-Only if Possible</title>
|
2982
|
+
<description xml:lang="en-US">If a filesystem is being exported so that users can view the files in a convenient
|
2983
|
+
fashion, but there is no need for users to edit those files, exporting the filesystem read-only
|
2984
|
+
removes an attack vector against the server. The default filesystem export mode is <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">ro</xhtml:code>,
|
2985
|
+
so do not specify <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">rw</xhtml:code> without a good reason.
|
2986
|
+
</description>
|
2987
|
+
</Group>
|
2988
|
+
<Rule id="xccdf_org.ssgproject.content_rule_use_root_squashing_all_exports" selected="false" severity="low">
|
2989
|
+
<title xml:lang="en-US">Use Root-Squashing on All Exports</title>
|
2990
|
+
<description xml:lang="en-US">If a filesystem is exported using root squashing, requests from root on the client
|
2991
|
+
are considered to be unprivileged (mapped to a user such as nobody). This provides some mild
|
2992
|
+
protection against remote abuse of an NFS server. Root squashing is enabled by default, and
|
2993
|
+
should not be disabled.
|
2994
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
2995
|
+
Ensure that no line in <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> contains the option <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">no_root_squash</xhtml:code>.
|
2996
|
+
</description>
|
2997
|
+
<rationale xml:lang="en-US">If the NFS server allows root access to local file systems from remote hosts, this
|
2998
|
+
access could be used to compromise the system.
|
2999
|
+
</rationale>
|
3000
|
+
</Rule>
|
3001
|
+
<Rule id="xccdf_org.ssgproject.content_rule_restrict_nfs_clients_to_privileged_ports" selected="false" severity="low">
|
3002
|
+
<title xml:lang="en-US">Restrict NFS Clients to Privileged Ports</title>
|
3003
|
+
<description xml:lang="en-US">By default, the server NFS implementation requires that all client requests be made
|
3004
|
+
from ports less than 1024. If your organization has control over machines connected to its
|
3005
|
+
network, and if NFS requests are prohibited at the border firewall, this offers some protection
|
3006
|
+
against malicious requests from unprivileged users. Therefore, the default should not be changed.
|
3007
|
+
<br xmlns="http://www.w3.org/1999/xhtml"/><br xmlns="http://www.w3.org/1999/xhtml"/>
|
3008
|
+
To ensure that the default has not been changed, ensure no line in
|
3009
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code> contains the option <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">insecure</xhtml:code>.
|
3010
|
+
</description>
|
3011
|
+
<rationale xml:lang="en-US">Allowing client requests to be made from ports higher than 1024 could allow a unprivileged
|
3012
|
+
user to initiate an NFS connection. If the unprivileged user account has been compromised, an
|
3013
|
+
attacker could gain access to data on the NFS server.</rationale>
|
3014
|
+
</Rule>
|
3015
|
+
<Rule id="xccdf_org.ssgproject.content_rule_no_insecure_locks_exports" selected="false" severity="medium">
|
3016
|
+
<title xml:lang="en-US">Ensure Insecure File Locking is Not Allowed</title>
|
3017
|
+
<description xml:lang="en-US">By default the NFS server requires secure file-lock requests,
|
3018
|
+
which require credentials from the client in order to lock a file. Most NFS
|
3019
|
+
clients send credentials with file lock requests, however, there are a few
|
3020
|
+
clients that do not send credentials when requesting a file-lock, allowing the
|
3021
|
+
client to only be able to lock world-readable files. To get around this, the
|
3022
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">insecure_locks</xhtml:code> option can be used so these clients can access the
|
3023
|
+
desired export. This poses a security risk by potentially allowing the client
|
3024
|
+
access to data for which it does not have authorization.
|
3025
|
+
Remove any instances of the
|
3026
|
+
<xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">insecure_locks</xhtml:code> option from the file <xhtml:code xmlns:xhtml="http://www.w3.org/1999/xhtml">/etc/exports</xhtml:code>.
|
3027
|
+
</description>
|
3028
|
+
<reference href="http://iase.disa.mil/cci/index.html">764</reference>
|
3029
|
+
<rationale xml:lang="en-US">Allowing insecure file locking could allow for sensitive data to be
|
3030
|
+
viewed or edited by an unauthorized user.
|
3031
|
+
</rationale>
|
3032
|
+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
|
3033
|
+
<check-content-ref name="oval:ssg:def:196" href="ssg-fedora-oval.xml"/>
|
3034
|
+
</check>
|
3035
|
+
<check system="ocil-transitional">
|
3036
|
+
<check-export export-name="there is output" value-id="xccdf_org.ssgproject.content_value_conditional_clause"/>
|
3037
|
+
<check-content>
|
3038
|
+
To verify insecure file locking has been disabled, run the following command:
|
3039
|
+
<pre xmlns="http://www.w3.org/1999/xhtml"># grep insecure_locks /etc/exports</pre>
|
3040
|
+
</check-content>
|
3041
|
+
</check>
|
3042
|
+
</Rule>
|
3043
|
+
</Group>
|
3044
|
+
</Group>
|
19
3045
|
</Group>
|
20
3046
|
</Benchmark>
|