File tree 9 files changed +98
-3
lines changed
java_jre_clean_previous_version
9 files changed +98
-3
lines changed Original file line number Diff line number Diff line change
1
+ # platform = Java Runtime Environment
2
+ # reboot = false
3
+ # strategy = restrict
4
+ # complexity = low
5
+ # disruption = low
6
+ - name : " Ensure YUM Removes Previous Package Versions"
7
+ lineinfile :
8
+ dest : /etc/yum.conf
9
+ regexp : ^#?clean_requirements_on_remove
10
+ line : clean_requirements_on_remove=1
11
+ insertafter : ' \[main\]'
12
+ create : yes
Original file line number Diff line number Diff line change
1
+ # platform = Java Runtime Environment
2
+
3
+ if grep --silent ^clean_requirements_on_remove /etc/yum.conf ; then
4
+ sed -i " s/^clean_requirements_on_remove.*/clean_requirements_on_remove=1/g" /etc/yum.conf
5
+ else
6
+ echo -e " \n# Set clean_requirements_on_remove to 1 per security requirements" >> /etc/yum.conf
7
+ echo " clean_requirements_on_remove=1" >> /etc/yum.conf
8
+ fi
Original file line number Diff line number Diff line change
1
+ <def-group oval_version =" 5.10" >
2
+ <definition class =" compliance" id =" java_jre_clean_previous_version" version =" 1" >
3
+ {{{ oval_metadata("The clean_requirements_on_remove option should be used to ensure that old
4
+ versions of software components are removed after updating.") }}}
5
+ <criteria >
6
+ <criterion comment =" check value of clean_requirements_on_remove in /etc/yum.conf" test_ref =" test_yum_java_jre_clean_previous_version" />
7
+ </criteria >
8
+ </definition >
9
+ <ind : textfilecontent54_test check =" all" check_existence =" all_exist" comment =" check value of clean_requirements_on_remove in /etc/yum.conf" id =" test_yum_java_jre_clean_previous_version" version =" 1" >
10
+ <ind : object object_ref =" object_yum_java_jre_clean_previous_version" />
11
+ </ind : textfilecontent54_test >
12
+ <ind : textfilecontent54_object id =" object_yum_java_jre_clean_previous_version" comment =" clean_requirements_on_remove set in /etc/yum.conf" version =" 1" >
13
+ <ind : filepath >/etc/yum.conf</ind : filepath >
14
+ <ind : pattern operation =" pattern match" >^\s*clean_requirements_on_remove\s*=\s*(1|True|yes)\s*$</ind : pattern >
15
+ <ind : instance datatype =" int" operation =" equals" >1</ind : instance >
16
+ </ind : textfilecontent54_object >
17
+
18
+ </def-group >
Original file line number Diff line number Diff line change
1
+ documentation_complete : true
2
+
3
+ title : ' Ensure {{{ pkg_manager }}} Removes Previous Package Versions'
4
+
5
+ description : |-
6
+ <tt>{{{ pkg_manager }}}</tt> should be configured to remove previous versions of Java after
7
+ new versions have been installed. To configure <tt>{{{ pkg_manager }}}</tt> to remove the
8
+ previous versions of Java after updating, set the <tt>clean_requirements_on_remove</tt>
9
+ to <tt>1</tt> in <tt>{{{ pkg_manager_config_file }}}</tt>.
10
+
11
+ rationale : |-
12
+ Previous versions of software components that are not removed from the information
13
+ system after updates have been installed may be exploited by some adversaries.
14
+
15
+ severity : medium
16
+
17
+ references :
18
+ srg : SRG-APP-000454
19
+ disa : CCI-002617
20
+ stigid : JRE8-UX-000190
21
+ nist : SI-2(6)
22
+
23
+ ocil_clause : ' clean_requirements_on_remove is not enabled or configured correctly'
24
+
25
+ ocil : |-
26
+ To verify that <tt>clean_requirements_on_remove</tt> is configured properly, run the
27
+ following command:
28
+ <pre>$ grep clean_requirements_on_remove {{{ pkg_manager_config_file }}}</pre>
29
+ The output should return something similar to:
30
+ <pre>clean_requirements_on_remove=1</pre>
Original file line number Diff line number Diff line change
1
+ # platform = Java Runtime Environment
2
+ # reboot = true
3
+ # strategy = patch
4
+ # complexity = low
5
+ # disruption = high
6
+ - name : " Security patches are up to date"
7
+ package :
8
+ name : " *"
9
+ state : " latest"
10
+ tags :
11
+ - skip_ansible_lint # [ANSIBLE0010] Skipping lint because ANSIBLE0010 is a bad security practice
12
+
Original file line number Diff line number Diff line change
1
+ # platform = Java Runtime Environment
2
+
3
+ {{% if pkg_manager == " zypper" %}}
4
+ zypper patch -g security -y
5
+ {{% else %}}
6
+ yum -y update
7
+ {{% endif %}}
Original file line number Diff line number Diff line change @@ -8,16 +8,21 @@ description: |-
8
8
<pre>$ sudo yum update</pre>
9
9
If the system is not configured to use one of these sources, updates (in the form of RPM packages)
10
10
can be manually downloaded and installed using <tt>rpm</tt>.
11
+ <br /><br />
12
+ NOTE: U.S. Defense systems are required to be patched within 30 days or sooner as local policy
13
+ dictates.
11
14
12
15
rationale : |-
13
16
Running an older version of the JRE can introduce security
14
17
vulnerabilities to the system.
15
18
16
- severity : medium
19
+ severity : low
17
20
18
21
references :
19
- nist : DCBP-1
20
- stigid : JRE0090-UX
22
+ srg : SRG-APP-000456
23
+ disa : CCI-002605
24
+ stigid : JRE8-UX-000180
25
+ nist : SI-2(c)
21
26
22
27
ocil_clause : ' it is not updated'
23
28
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ type: product
5
5
benchmark_root : " ./guide"
6
6
7
7
profiles_root : " ./profiles"
8
+
9
+ pkg_manager : " yum"
Original file line number Diff line number Diff line change @@ -36,4 +36,5 @@ selections:
36
36
- java_jre_validation_crl_locked
37
37
- java_jre_validation_ocsp
38
38
- java_jre_validation_ocsp_locked
39
+ - java_jre_clean_previous_version
39
40
- java_jre_updated
You can’t perform that action at this time.
0 commit comments