openscap 0.5.0 → 0.5.1

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