|
|
07cb6b |
From 742e103392746dac771663247d169cfe498ee658 Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Fri, 21 Jan 2022 14:02:16 +0100
|
|
|
07cb6b |
Subject: [PATCH 1/7] modify vsyscall rules according to rhel9 ospp
|
|
|
07cb6b |
|
|
|
07cb6b |
add references
|
|
|
07cb6b |
make rules scored in th e profile
|
|
|
07cb6b |
---
|
|
|
07cb6b |
.../system/bootloader-grub2/grub2_vsyscall_argument/rule.yml | 1 +
|
|
|
07cb6b |
.../system/bootloader-zipl/zipl_vsyscall_argument/rule.yml | 3 +++
|
|
|
07cb6b |
products/rhel9/profiles/ospp.profile | 4 ----
|
|
|
07cb6b |
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
07cb6b |
index 1dd26fea9b6..9f38a1c13b9 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_vsyscall_argument/rule.yml
|
|
|
07cb6b |
@@ -25,6 +25,7 @@ identifiers:
|
|
|
07cb6b |
references:
|
|
|
07cb6b |
disa: CCI-001084
|
|
|
07cb6b |
nist: CM-7(a)
|
|
|
07cb6b |
+ ospp: FPT_ASLR_EXT.1
|
|
|
07cb6b |
srg: SRG-OS-000480-GPOS-00227,SRG-OS-000134-GPOS-00068
|
|
|
07cb6b |
stigid@ol8: OL08-00-010422
|
|
|
07cb6b |
stigid@rhel8: RHEL-08-010422
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
07cb6b |
index 52b192ffc52..9d645c8876e 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_vsyscall_argument/rule.yml
|
|
|
07cb6b |
@@ -21,6 +21,9 @@ identifiers:
|
|
|
07cb6b |
cce@rhel8: CCE-83381-4
|
|
|
07cb6b |
cce@rhel9: CCE-84100-7
|
|
|
07cb6b |
|
|
|
07cb6b |
+references:
|
|
|
07cb6b |
+ ospp: FPT_ASLR_EXT.1
|
|
|
07cb6b |
+
|
|
|
07cb6b |
ocil_clause: 'vsyscalls are enabled'
|
|
|
07cb6b |
|
|
|
07cb6b |
ocil: |-
|
|
|
07cb6b |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
index 287a28c43c5..f0b850a4ced 100644
|
|
|
07cb6b |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
@@ -128,8 +128,6 @@ selections:
|
|
|
07cb6b |
- grub2_slub_debug_argument
|
|
|
07cb6b |
- grub2_page_poison_argument
|
|
|
07cb6b |
- grub2_vsyscall_argument
|
|
|
07cb6b |
- - grub2_vsyscall_argument.role=unscored
|
|
|
07cb6b |
- - grub2_vsyscall_argument.severity=info
|
|
|
07cb6b |
- grub2_pti_argument
|
|
|
07cb6b |
- grub2_kernel_trust_cpu_rng
|
|
|
07cb6b |
|
|
|
07cb6b |
@@ -421,5 +419,3 @@ selections:
|
|
|
07cb6b |
- zipl_slub_debug_argument
|
|
|
07cb6b |
- zipl_page_poison_argument
|
|
|
07cb6b |
- zipl_vsyscall_argument
|
|
|
07cb6b |
- - zipl_vsyscall_argument.role=unscored
|
|
|
07cb6b |
- - zipl_vsyscall_argument.severity=info
|
|
|
07cb6b |
|
|
|
07cb6b |
From d167658d46accbc75200a5d145a746322f1c2d4a Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Fri, 21 Jan 2022 14:05:24 +0100
|
|
|
07cb6b |
Subject: [PATCH 2/7] add ospp references to fips rules
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
.../software/integrity/fips/enable_dracut_fips_module/rule.yml | 1 +
|
|
|
07cb6b |
.../system/software/integrity/fips/enable_fips_mode/rule.yml | 2 +-
|
|
|
07cb6b |
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
07cb6b |
index f342b9b8d95..3b7c3229b6f 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
|
|
|
07cb6b |
@@ -29,6 +29,7 @@ references:
|
|
|
07cb6b |
ism: "1446"
|
|
|
07cb6b |
nerc-cip: CIP-003-8 R4.2,CIP-007-3 R5.1
|
|
|
07cb6b |
nist: SC-12(2),SC-12(3),IA-7,SC-13,CM-6(a),SC-12
|
|
|
07cb6b |
+ ospp: FCS_RBG_EXT.1
|
|
|
07cb6b |
srg: SRG-OS-000478-GPOS-00223
|
|
|
07cb6b |
stigid@ol8: OL08-00-010020
|
|
|
07cb6b |
stigid@rhel8: RHEL-08-010020
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
07cb6b |
index 7559e61600d..9d89114b07f 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
|
|
|
07cb6b |
@@ -39,7 +39,7 @@ references:
|
|
|
07cb6b |
ism: "1446"
|
|
|
07cb6b |
nerc-cip: CIP-003-8 R4.2,CIP-007-3 R5.1
|
|
|
07cb6b |
nist: SC-12(2),SC-12(3),IA-7,SC-13,CM-6(a),SC-12
|
|
|
07cb6b |
- ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1
|
|
|
07cb6b |
+ ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1,FCS_RBG_EXT.1
|
|
|
07cb6b |
srg: SRG-OS-000478-GPOS-00223,SRG-OS-000396-GPOS-00176
|
|
|
07cb6b |
stigid@ol8: OL08-00-010020
|
|
|
07cb6b |
stigid@rhel8: RHEL-08-010020
|
|
|
07cb6b |
|
|
|
07cb6b |
From f05e895bb96b64a5142e62e3dd0f7208633d5c23 Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Fri, 21 Jan 2022 14:08:36 +0100
|
|
|
07cb6b |
Subject: [PATCH 3/7] drop no longer needed rules from ospp rhel9 profile
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
products/rhel9/profiles/ospp.profile | 6 ------
|
|
|
07cb6b |
1 file changed, 6 deletions(-)
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
index f0b850a4ced..7e30054bc98 100644
|
|
|
07cb6b |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
@@ -125,11 +125,7 @@ selections:
|
|
|
07cb6b |
## Boot prompt
|
|
|
07cb6b |
- grub2_audit_argument
|
|
|
07cb6b |
- grub2_audit_backlog_limit_argument
|
|
|
07cb6b |
- - grub2_slub_debug_argument
|
|
|
07cb6b |
- - grub2_page_poison_argument
|
|
|
07cb6b |
- grub2_vsyscall_argument
|
|
|
07cb6b |
- - grub2_pti_argument
|
|
|
07cb6b |
- - grub2_kernel_trust_cpu_rng
|
|
|
07cb6b |
|
|
|
07cb6b |
## Security Settings
|
|
|
07cb6b |
- sysctl_kernel_kptr_restrict
|
|
|
07cb6b |
@@ -416,6 +412,4 @@ selections:
|
|
|
07cb6b |
- zipl_bootmap_is_up_to_date
|
|
|
07cb6b |
- zipl_audit_argument
|
|
|
07cb6b |
- zipl_audit_backlog_limit_argument
|
|
|
07cb6b |
- - zipl_slub_debug_argument
|
|
|
07cb6b |
- - zipl_page_poison_argument
|
|
|
07cb6b |
- zipl_vsyscall_argument
|
|
|
07cb6b |
|
|
|
07cb6b |
From 972ae269eff95de8a6914056d38e58b7aeafb8c3 Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Fri, 21 Jan 2022 15:12:46 +0100
|
|
|
07cb6b |
Subject: [PATCH 4/7] add grub2_init_on_alloc rule
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
.../grub2_init_on_alloc_argument/rule.yml | 46 +++++++++++++++++++
|
|
|
07cb6b |
shared/references/cce-redhat-avail.txt | 1 -
|
|
|
07cb6b |
2 files changed, 46 insertions(+), 1 deletion(-)
|
|
|
07cb6b |
create mode 100644 linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..592e2fb117d
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
@@ -0,0 +1,46 @@
|
|
|
07cb6b |
+documentation_complete: true
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+prodtype: rhel9
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+title: 'Configure kernel to zero out memory before allocation (through Grub2)'
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+description: |-
|
|
|
07cb6b |
+ To configure the kernel to zero out memory before allocating it, add the
|
|
|
07cb6b |
+ <tt>init_on_alloc=1</tt> argument to the default GRUB 2 command line for
|
|
|
07cb6b |
+ the Linux operating system in <tt>/etc/default/grub</tt>, in the manner
|
|
|
07cb6b |
+ below:
|
|
|
07cb6b |
+ GRUB_CMDLINE_LINUX="crashkernel=auto quiet rd.shell=0 audit=1 audit_backlog_limit=8192 init_on_alloc=1"
|
|
|
07cb6b |
+ Update the boot parameter for existing kernels by running the following command:
|
|
|
07cb6b |
+ # grubby --update-kernel=ALL --args="init_on_alloc=1"
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+rationale: |-
|
|
|
07cb6b |
+ When the kernel configuration option <tt>init_on_alloc</tt> is enabled,
|
|
|
07cb6b |
+ all page allocator and slab allocator memory will be zeroed when allocated,
|
|
|
07cb6b |
+ eliminating many kinds of "uninitialized heap memory" flaws, effectively
|
|
|
07cb6b |
+ preventing data leaks.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+severity: medium
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+identifiers:
|
|
|
07cb6b |
+ cce@rhel9: CCE-85867-0
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ocil_clause: 'the kernel is not configured to zero out memory before allocation'
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ocil: |-
|
|
|
07cb6b |
+ Make sure that the kernel is configured to zero out memory before
|
|
|
07cb6b |
+ allocation. Ensure that the parameter is configured in
|
|
|
07cb6b |
+ <tt>/etc/default/grub</tt>:
|
|
|
07cb6b |
+ grep GRUB_CMDLINE_LINUX /etc/default/grub
|
|
|
07cb6b |
+ The output should contain <tt>init_on_alloc=1</tt>.
|
|
|
07cb6b |
+ Run the following command to display command line parameters of all
|
|
|
07cb6b |
+ installed kernels:
|
|
|
07cb6b |
+ # grubby --info=ALL | grep args
|
|
|
07cb6b |
+ Ensure that each line contains the <tt>init_on_alloc=1</tt> parameter.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+platform: machine
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: grub2_bootloader_argument
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ arg_name: init_on_alloc
|
|
|
07cb6b |
+ arg_value: '1'
|
|
|
07cb6b |
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
index 8aad24b20f7..6835189cd99 100644
|
|
|
07cb6b |
--- a/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
+++ b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
@@ -1,4 +1,3 @@
|
|
|
07cb6b |
-CCE-85867-0
|
|
|
07cb6b |
CCE-85868-8
|
|
|
07cb6b |
CCE-85872-0
|
|
|
07cb6b |
CCE-85873-8
|
|
|
07cb6b |
|
|
|
07cb6b |
From a865514257c85d79aaf7e4286d8723aa1ad8de03 Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Mon, 24 Jan 2022 10:01:23 +0100
|
|
|
07cb6b |
Subject: [PATCH 5/7] add zipl_init_on_alloc_argument rule
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
.../zipl_init_on_alloc_argument/rule.yml | 41 +++++++++++++++++++
|
|
|
07cb6b |
.../tests/correct_option.pass.sh | 15 +++++++
|
|
|
07cb6b |
.../tests/missing_in_cmdline.fail.sh | 13 ++++++
|
|
|
07cb6b |
.../tests/missing_in_entry.fail.sh | 13 ++++++
|
|
|
07cb6b |
shared/references/cce-redhat-avail.txt | 1 -
|
|
|
07cb6b |
5 files changed, 82 insertions(+), 1 deletion(-)
|
|
|
07cb6b |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
07cb6b |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
07cb6b |
create mode 100644 linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..b47a7757327
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
@@ -0,0 +1,41 @@
|
|
|
07cb6b |
+documentation_complete: true
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+prodtype: rhel9
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+title: 'Configure kernel to zero out memory before allocation (through zIPl)'
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+description: |-
|
|
|
07cb6b |
+ To ensure that the kernel is configured to zero out memory before
|
|
|
07cb6b |
+ allocation, check that all boot entries in
|
|
|
07cb6b |
+ <tt>/boot/loader/entries/*.conf</tt> have <tt>init_on_alloc=1</tt>
|
|
|
07cb6b |
+ included in its options.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ To ensure that new kernels and boot entries continue to zero out memory
|
|
|
07cb6b |
+ before allocation, add <tt>init_on_alloc=1</tt> to <tt>/etc/kernel/cmdline</tt>.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+rationale: |-
|
|
|
07cb6b |
+ When the kernel configuration option <tt>init_on_alloc</tt> is enabled,
|
|
|
07cb6b |
+ all page allocator and slab allocator memory will be zeroed when allocated,
|
|
|
07cb6b |
+ eliminating many kinds of "uninitialized heap memory" flaws, effectively
|
|
|
07cb6b |
+ preventing data leaks.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+severity: medium
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+identifiers:
|
|
|
07cb6b |
+ cce@rhel9: CCE-85868-8
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ocil_clause: 'the kernel is not configured to zero out memory before allocation'
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ocil: |-
|
|
|
07cb6b |
+ To check that the kernel is configured to zero out memory before allocation
|
|
|
07cb6b |
+ time, check all boot entries with following command:
|
|
|
07cb6b |
+ sudo grep -L"^options\s+.*\binit_on_alloc=1\b" /boot/loader/entries/*.conf
|
|
|
07cb6b |
+ No line should be returned, each line returned is a boot entry that doesn't enable audit.
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+platform: machine
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: zipl_bls_entries_option
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ arg_name: init_on_alloc
|
|
|
07cb6b |
+ arg_value: '1'
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..50cf1b78f70
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/correct_option.pass.sh
|
|
|
07cb6b |
@@ -0,0 +1,15 @@
|
|
|
07cb6b |
+#!/bin/bash
|
|
|
07cb6b |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Make sure boot loader entries contain init_on_alloc=1
|
|
|
07cb6b |
+for file in /boot/loader/entries/*.conf
|
|
|
07cb6b |
+do
|
|
|
07cb6b |
+ if ! grep -q '^options.*init_on_alloc=1.*$' "$file" ; then
|
|
|
07cb6b |
+ sed -i '/^options / s/$/ init_on_alloc=1/' "$file"
|
|
|
07cb6b |
+ fi
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Make sure /etc/kernel/cmdline contains init_on_alloc=1
|
|
|
07cb6b |
+if ! grep -qs '^(.*\s)?init_on_alloc=1(\s.*)?$' /etc/kernel/cmdline ; then
|
|
|
07cb6b |
+ echo "init_on_alloc=1" >> /etc/kernel/cmdline
|
|
|
07cb6b |
+fi
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..7c0d9154776
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_cmdline.fail.sh
|
|
|
07cb6b |
@@ -0,0 +1,13 @@
|
|
|
07cb6b |
+#!/bin/bash
|
|
|
07cb6b |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Make sure boot loader entries contain init_on_alloc=1
|
|
|
07cb6b |
+for file in /boot/loader/entries/*.conf
|
|
|
07cb6b |
+do
|
|
|
07cb6b |
+ if ! grep -q '^options.*init_on_alloc=1.*$' "$file" ; then
|
|
|
07cb6b |
+ sed -i '/^options / s/$/ init_on_alloc=1/' "$file"
|
|
|
07cb6b |
+ fi
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Make sure /etc/kernel/cmdline doesn't contain init_on_alloc=1
|
|
|
07cb6b |
+sed -Ei 's/(^.*)init_on_alloc=1(.*?)$/\1\2/' /etc/kernel/cmdline || true
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..9d330c9192d
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/tests/missing_in_entry.fail.sh
|
|
|
07cb6b |
@@ -0,0 +1,13 @@
|
|
|
07cb6b |
+#!/bin/bash
|
|
|
07cb6b |
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Remove init_on_alloc=1 from all boot entries
|
|
|
07cb6b |
+sed -Ei 's/(^options.*\s)init_on_alloc=1(.*?)$/\1\2/' /boot/loader/entries/*
|
|
|
07cb6b |
+# But make sure one boot loader entry contains init_on_alloc=1
|
|
|
07cb6b |
+sed -i '/^options / s/$/ init_on_alloc=1/' /boot/loader/entries/*rescue.conf
|
|
|
07cb6b |
+sed -Ei 's/(^options.*\s)\$kernelopts(.*?)$/\1\2/' /boot/loader/entries/*rescue.conf
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+# Make sure /etc/kernel/cmdline contains init_on_alloc=1
|
|
|
07cb6b |
+if ! grep -qs '^(.*\s)?init_on_alloc=1(\s.*)?$' /etc/kernel/cmdline ; then
|
|
|
07cb6b |
+ echo "init_on_alloc=1" >> /etc/kernel/cmdline
|
|
|
07cb6b |
+fi
|
|
|
07cb6b |
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
index 6835189cd99..05a641aeaf0 100644
|
|
|
07cb6b |
--- a/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
+++ b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
@@ -1,4 +1,3 @@
|
|
|
07cb6b |
-CCE-85868-8
|
|
|
07cb6b |
CCE-85872-0
|
|
|
07cb6b |
CCE-85873-8
|
|
|
07cb6b |
CCE-85874-6
|
|
|
07cb6b |
|
|
|
07cb6b |
From 9ca5ec04e734941b1c401369b6da6672b42824b1 Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Mon, 24 Jan 2022 10:07:24 +0100
|
|
|
07cb6b |
Subject: [PATCH 6/7] add new rules to rhel9 ospp
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
products/rhel9/profiles/ospp.profile | 2 ++
|
|
|
07cb6b |
1 file changed, 2 insertions(+)
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/products/rhel9/profiles/ospp.profile b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
index 7e30054bc98..28c7e92d298 100644
|
|
|
07cb6b |
--- a/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
+++ b/products/rhel9/profiles/ospp.profile
|
|
|
07cb6b |
@@ -126,6 +126,7 @@ selections:
|
|
|
07cb6b |
- grub2_audit_argument
|
|
|
07cb6b |
- grub2_audit_backlog_limit_argument
|
|
|
07cb6b |
- grub2_vsyscall_argument
|
|
|
07cb6b |
+ - grub2_init_on_alloc_argument
|
|
|
07cb6b |
|
|
|
07cb6b |
## Security Settings
|
|
|
07cb6b |
- sysctl_kernel_kptr_restrict
|
|
|
07cb6b |
@@ -413,3 +414,4 @@ selections:
|
|
|
07cb6b |
- zipl_audit_argument
|
|
|
07cb6b |
- zipl_audit_backlog_limit_argument
|
|
|
07cb6b |
- zipl_vsyscall_argument
|
|
|
07cb6b |
+ - zipl_init_on_alloc_argument
|
|
|
07cb6b |
|
|
|
07cb6b |
From 42a118bcc615051ae4cd268a5fc758aa5d75108d Mon Sep 17 00:00:00 2001
|
|
|
07cb6b |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
07cb6b |
Date: Thu, 27 Jan 2022 14:08:20 +0100
|
|
|
07cb6b |
Subject: [PATCH 7/7] make rule names consistent
|
|
|
07cb6b |
|
|
|
07cb6b |
---
|
|
|
07cb6b |
.../bootloader-grub2/grub2_init_on_alloc_argument/rule.yml | 2 +-
|
|
|
07cb6b |
.../system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml | 2 +-
|
|
|
07cb6b |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
index 592e2fb117d..a9253c74cc6 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-grub2/grub2_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
@@ -2,7 +2,7 @@ documentation_complete: true
|
|
|
07cb6b |
|
|
|
07cb6b |
prodtype: rhel9
|
|
|
07cb6b |
|
|
|
07cb6b |
-title: 'Configure kernel to zero out memory before allocation (through Grub2)'
|
|
|
07cb6b |
+title: 'Configure kernel to zero out memory before allocation'
|
|
|
07cb6b |
|
|
|
07cb6b |
description: |-
|
|
|
07cb6b |
To configure the kernel to zero out memory before allocating it, add the
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
index b47a7757327..fa272250a28 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/bootloader-zipl/zipl_init_on_alloc_argument/rule.yml
|
|
|
07cb6b |
@@ -2,7 +2,7 @@ documentation_complete: true
|
|
|
07cb6b |
|
|
|
07cb6b |
prodtype: rhel9
|
|
|
07cb6b |
|
|
|
07cb6b |
-title: 'Configure kernel to zero out memory before allocation (through zIPl)'
|
|
|
07cb6b |
+title: 'Configure kernel to zero out memory before allocation in zIPL'
|
|
|
07cb6b |
|
|
|
07cb6b |
description: |-
|
|
|
07cb6b |
To ensure that the kernel is configured to zero out memory before
|