Blame SOURCES/scap-security-guide-0.1.64-stig_ipv4_forwarding-PR_9277.patch

9e17c9
From 82012a2c80e0f0bed75586b7d93570db2121962e Mon Sep 17 00:00:00 2001
9e17c9
From: Watson Sato <wsato@redhat.com>
9e17c9
Date: Mon, 1 Aug 2022 17:50:37 +0200
9e17c9
Subject: [PATCH 1/2] Add rule for sysctl net.ipv4.conf.all.forwarding
f386a0
9e17c9
This is rule is similar to sysctl_net_ipv6_conf_all_forwarding and
9e17c9
sysctl_net_ipv4_forward.
f386a0
---
f386a0
 .../rule.yml                                  | 44 +++++++++++++++++++
f386a0
 ...ctl_net_ipv4_conf_all_forwarding_value.var | 17 +++++++
f386a0
 shared/references/cce-redhat-avail.txt        |  1 -
9e17c9
 3 files changed, 61 insertions(+), 1 deletion(-)
f386a0
 create mode 100644 linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding/rule.yml
f386a0
 create mode 100644 linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding_value.var
f386a0
f386a0
diff --git a/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding/rule.yml b/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding/rule.yml
f386a0
new file mode 100644
9e17c9
index 00000000000..7b0066f7c29
f386a0
--- /dev/null
f386a0
+++ b/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding/rule.yml
f386a0
@@ -0,0 +1,44 @@
f386a0
+documentation_complete: true
f386a0
+
f386a0
+prodtype: rhel8
f386a0
+
f386a0
+title: 'Disable Kernel Parameter for IPv4 Forwarding on all IPv4 Interfaces'
f386a0
+
f386a0
+description: '{{{ describe_sysctl_option_value(sysctl="net.ipv4.conf.all.forwarding", value="0") }}}'
f386a0
+
f386a0
+rationale: |-
f386a0
+    IP forwarding permits the kernel to forward packets from one network
f386a0
+    interface to another. The ability to forward packets between two networks is
f386a0
+    only appropriate for systems acting as routers.
f386a0
+
f386a0
+severity: medium
f386a0
+
f386a0
+identifiers:
f386a0
+    cce@rhel8: CCE-86220-1
f386a0
+
f386a0
+references:
f386a0
+    disa: CCI-000366
f386a0
+    nist: CM-6(b)
f386a0
+    srg: SRG-OS-000480-GPOS-00227
f386a0
+    stigid@rhel8: RHEL-08-040259
f386a0
+
f386a0
+ocil_clause: 'IP forwarding value is "1" and the system is not router'
f386a0
+
f386a0
+ocil: |-
f386a0
+    {{{ ocil_sysctl_option_value(sysctl="net.ipv4.conf.all.forwarding", value="0") }}}
f386a0
+    The ability to forward packets is only appropriate for routers.
f386a0
+
f386a0
+fixtext: |-
f386a0
+    Configure {{{ full_name }}} to not allow packet forwarding unless the system is a router with the following commands:
f386a0
+    {{{ fixtext_sysctl(sysctl="net.ipv4.conf.all.forwarding", value="0") | indent(4) }}}
f386a0
+
f386a0
+srg_requirement: '{{{ full_name }}} must not perform packet forwarding unless the system is a router.'
f386a0
+
f386a0
+platform: machine
f386a0
+
f386a0
+template:
f386a0
+    name: sysctl
f386a0
+    vars:
f386a0
+        sysctlvar: net.ipv4.conf.all.forwarding
f386a0
+        datatype: int
f386a0
+
f386a0
diff --git a/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding_value.var b/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding_value.var
f386a0
new file mode 100644
9e17c9
index 00000000000..2aedd6e6432
f386a0
--- /dev/null
f386a0
+++ b/linux_os/guide/system/network/network-kernel/network_host_and_router_parameters/sysctl_net_ipv4_conf_all_forwarding_value.var
f386a0
@@ -0,0 +1,17 @@
f386a0
+documentation_complete: true
f386a0
+
f386a0
+title: net.ipv4.conf.all.forwarding
f386a0
+
f386a0
+description: 'Toggle IPv4 Forwarding'
f386a0
+
f386a0
+type: number
f386a0
+
f386a0
+operator: equals
f386a0
+
f386a0
+interactive: false
f386a0
+
f386a0
+options:
f386a0
+    default: "0"
f386a0
+    disabled: "0"
f386a0
+    enabled: 1
f386a0
+
9e17c9
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
9e17c9
index 914233f06bf..3e14b73dd71 100644
9e17c9
--- a/shared/references/cce-redhat-avail.txt
9e17c9
+++ b/shared/references/cce-redhat-avail.txt
9e17c9
@@ -168,7 +168,6 @@ CCE-86216-9
9e17c9
 CCE-86217-7
9e17c9
 CCE-86218-5
9e17c9
 CCE-86219-3
9e17c9
-CCE-86220-1
9e17c9
 CCE-86221-9
9e17c9
 CCE-86222-7
9e17c9
 CCE-86223-5
9e17c9
9e17c9
From 0e2be2dfb7c185ac15e69e110c2e7a76f6896df7 Mon Sep 17 00:00:00 2001
9e17c9
From: Watson Sato <wsato@redhat.com>
9e17c9
Date: Mon, 1 Aug 2022 17:53:32 +0200
9e17c9
Subject: [PATCH 2/2] Better align with RHEL-08-040259
9e17c9
9e17c9
The item is about net.ipv4.conf.all.forwarding
9e17c9
The update to V1R7 made brought this misalignment to light.
9e17c9
---
9e17c9
 .../sysctl_net_ipv4_ip_forward/rule.yml                       | 1 -
9e17c9
 products/rhel8/profiles/stig.profile                          | 2 +-
9e17c9
 tests/data/profile_stability/rhel8/stig.profile               | 4 ++--
9e17c9
 tests/data/profile_stability/rhel8/stig_gui.profile           | 2 +-
9e17c9
 4 files changed, 4 insertions(+), 5 deletions(-)
9e17c9
f386a0
diff --git a/linux_os/guide/system/network/network-kernel/network_host_parameters/sysctl_net_ipv4_ip_forward/rule.yml b/linux_os/guide/system/network/network-kernel/network_host_parameters/sysctl_net_ipv4_ip_forward/rule.yml
9e17c9
index 5c449db7f3a..7acfc0b05b6 100644
f386a0
--- a/linux_os/guide/system/network/network-kernel/network_host_parameters/sysctl_net_ipv4_ip_forward/rule.yml
f386a0
+++ b/linux_os/guide/system/network/network-kernel/network_host_parameters/sysctl_net_ipv4_ip_forward/rule.yml
f386a0
@@ -45,7 +45,6 @@ references:
f386a0
     stigid@ol7: OL07-00-040740
f386a0
     stigid@ol8: OL08-00-040260
f386a0
     stigid@rhel7: RHEL-07-040740
f386a0
-    stigid@rhel8: RHEL-08-040259
f386a0
     stigid@sle12: SLES-12-030430
f386a0
     stigid@sle15: SLES-15-040380
f386a0
 
f386a0
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
9e17c9
index 4b480bd2c11..6b44436a2b1 100644
f386a0
--- a/products/rhel8/profiles/stig.profile
f386a0
+++ b/products/rhel8/profiles/stig.profile
f386a0
@@ -1127,7 +1127,7 @@ selections:
f386a0
     - sysctl_net_ipv6_conf_default_accept_source_route
f386a0
 
f386a0
     # RHEL-08-040259
f386a0
-    - sysctl_net_ipv4_ip_forward
f386a0
+    - sysctl_net_ipv4_conf_all_forwarding
f386a0
 
f386a0
     # RHEL-08-040260
f386a0
     - sysctl_net_ipv6_conf_all_forwarding
f386a0
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
9e17c9
index 4bee72830d0..47f53a9d023 100644
f386a0
--- a/tests/data/profile_stability/rhel8/stig.profile
f386a0
+++ b/tests/data/profile_stability/rhel8/stig.profile
f386a0
@@ -1,7 +1,7 @@
f386a0
 title: DISA STIG for Red Hat Enterprise Linux 8
f386a0
 description: 'This profile contains configuration checks that align to the
f386a0
 
f386a0
-    DISA STIG for Red Hat Enterprise Linux 8 V1R7
f386a0
+    DISA STIG for Red Hat Enterprise Linux 8 V1R7.
f386a0
 
f386a0
 
f386a0
     In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes
f386a0
@@ -395,13 +395,13 @@ selections:
f386a0
 - sysctl_net_core_bpf_jit_harden
f386a0
 - sysctl_net_ipv4_conf_all_accept_redirects
f386a0
 - sysctl_net_ipv4_conf_all_accept_source_route
f386a0
+- sysctl_net_ipv4_conf_all_forwarding
f386a0
 - sysctl_net_ipv4_conf_all_rp_filter
f386a0
 - sysctl_net_ipv4_conf_all_send_redirects
f386a0
 - sysctl_net_ipv4_conf_default_accept_redirects
f386a0
 - sysctl_net_ipv4_conf_default_accept_source_route
f386a0
 - sysctl_net_ipv4_conf_default_send_redirects
f386a0
 - sysctl_net_ipv4_icmp_echo_ignore_broadcasts
f386a0
-- sysctl_net_ipv4_ip_forward
f386a0
 - sysctl_net_ipv6_conf_all_accept_ra
f386a0
 - sysctl_net_ipv6_conf_all_accept_redirects
f386a0
 - sysctl_net_ipv6_conf_all_accept_source_route
f386a0
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
9e17c9
index ece32d06a6f..c4e60ddcde5 100644
f386a0
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
f386a0
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
f386a0
@@ -405,13 +405,13 @@ selections:
f386a0
 - sysctl_net_core_bpf_jit_harden
f386a0
 - sysctl_net_ipv4_conf_all_accept_redirects
f386a0
 - sysctl_net_ipv4_conf_all_accept_source_route
f386a0
+- sysctl_net_ipv4_conf_all_forwarding
f386a0
 - sysctl_net_ipv4_conf_all_rp_filter
f386a0
 - sysctl_net_ipv4_conf_all_send_redirects
f386a0
 - sysctl_net_ipv4_conf_default_accept_redirects
f386a0
 - sysctl_net_ipv4_conf_default_accept_source_route
f386a0
 - sysctl_net_ipv4_conf_default_send_redirects
f386a0
 - sysctl_net_ipv4_icmp_echo_ignore_broadcasts
f386a0
-- sysctl_net_ipv4_ip_forward
f386a0
 - sysctl_net_ipv6_conf_all_accept_ra
f386a0
 - sysctl_net_ipv6_conf_all_accept_redirects
f386a0
 - sysctl_net_ipv6_conf_all_accept_source_route