Chapter 1. Prepare MicroShift for CIS Level 2 compliance
You can run MicroShift on a Red Hat Enterprise Linux (RHEL) host that is hardened to the Center for Internet Security (CIS) Level 2 benchmark. Use this content when you must meet organizational security compliance requirements for edge deployments while keeping core MicroShift functions such as scheduling, ingress, and persistent storage available.
This documentation covers RPM package-mode installations only. Image-based deployments such as RHEL for Edge and image mode for RHEL are out of scope for the initial CIS Level 2 support.
1.1. Understanding MicroShift on CIS Level 2 hardened systems Copy linkLink copied to clipboard!
MicroShift can run on RHEL hosts that are hardened to the Center for Internet Security (CIS) Level 2 benchmark.
CIS Level 2 hardening applies strict host controls such as firewall lockdown, audit rules, and system configuration policies that can interfere with container orchestration unless you apply documented overrides and postinstall configuration.
This documentation covers RPM package-mode installations only. Image-based deployments such as RHEL for Edge and image mode for RHEL are out of scope for the initial CIS Level 2 support.
1.1.1. Supported platforms and scope Copy linkLink copied to clipboard!
MicroShift CIS Level 2 documentation applies to the following environment:
- RHEL 9 and RHEL 10
-
x86_64andaarch64architectures - RPM package-mode installations of MicroShift
Host compliance is verified with OpenSCAP and the scap-security-guide content by using the xccdf_org.ssgproject.content_profile_cis profile. You cannot use the OpenShift Container Platform Compliance Operator to harden a MicroShift host because that Operator depends on MachineConfig and related OpenShift Container Platform APIs that MicroShift does not provide.
1.1.2. How MicroShift affects CIS scan results Copy linkLink copied to clipboard!
MicroShift introduces host changes that cause a predictable set of CIS rules to fail. These failures are expected on any system that runs Kubernetes containers and cannot be remediated without disabling core networking or container runtime behavior.
The host changes affect the following categories:
- IP forwarding, which OVN-Kubernetes requires for pod networking
-
Container image file ownership under
/var/lib/containers/storage/overlay/ - kubelet volume and termination-log permissions for projected configuration
- Privileged-command audit rules for binaries that MicroShift RPMs add after hardening
Plan for these expected failures when you interpret OpenSCAP results after you install and start MicroShift.
1.2. Security compliance standards in MicroShift Copy linkLink copied to clipboard!
MicroShift supports multiple host-level security postures for regulated edge environments. Use Center for Internet Security (CIS) Level 2 hardening together with, or independently from, Federal Information Processing Standard (FIPS) mode depending on your organizational mandates.
1.2.1. Relationship to FIPS mode Copy linkLink copied to clipboard!
FIPS mode controls cryptographic module behavior on the host and in MicroShift containers. CIS Level 2 hardening controls broader host security configuration such as networking defaults, auditing, and firewall policy.
You can enable both when your environment requires cryptographic validation and CIS host hardening. Configure FIPS when you install RHEL, then apply CIS hardening and the MicroShift-required overrides before or after you install MicroShift RPM packages, according to your deployment process.
1.2.2. Scope boundaries Copy linkLink copied to clipboard!
The following boundaries apply to the current CIS Level 2 support for MicroShift:
- Package mode (RPM) is supported.
- RHEL for Edge and image mode for RHEL deployments are not covered in this documentation.
- Host compliance is assessed with OpenSCAP on the RHEL system, not with the OpenShift Container Platform Compliance Operator.
- Some CIS rule failures remain after a successful MicroShift deployment because of required container platform behavior.
1.3. Hardening RHEL hosts and verifying CIS Level 2 compliance Copy linkLink copied to clipboard!
Harden a RHEL host with the Red Hat Official CIS (Center for Internet Security) Ansible roles, apply the overrides that MicroShift requires for IP forwarding, and verify compliance with OpenSCAP.
Prerequisites
-
You have a RHEL 9 or RHEL 10 host on
x86_64oraarch64. -
You have root or
sudoprivileges on the host. - You can install Ansible and the Red Hat Official CIS role for your RHEL major version.
-
You can install the
openscap-scannerandscap-security-guidepackages.
Procedure
Install Ansible and obtain the CIS hardening role for your RHEL major version by running the following commands:
$ sudo dnf install ansible-core -y $ ansible-galaxy RedHatOfficial.rhel${<MAJOR_VERSION>}_cis $ ansible-galaxy collection install community.general:<10.0.0 ansible.posixReplace <MAJOR_VERSION> with the major version of the target operating system.
Create one of the following playbooks that apply CIS Level 2 hardening and override the IP forwarding variables so that the role does not disable forwarding before MicroShift starts.
Example playbook for RHEL 9
--- - name: Apply CIS Level 2 hardening hosts: localhost connection: local become: true roles: - role: RedHatOfficial.rhel9_cis vars: sysctl_net_ipv4_ip_forward: false sysctl_net_ipv6_conf_all_forwarding: falseExample playbook for RHEL 10
--- - name: Apply CIS Level 2 hardening hosts: localhost connection: local become: true roles: - role: RedHatOfficial.rhel10_cis vars: sysctl_net_ipv4_ip_forward: false sysctl_net_ipv4_conf_all_forwarding: false sysctl_net_ipv4_conf_default_forwarding: false sysctl_net_ipv6_conf_all_forwarding: false sysctl_net_ipv6_conf_default_forwarding: falseSetting each variable to
falsetells the role not to disable forwarding. The setting does not enable forwarding. MicroShift enables IP forwarding at startup.Validate the playbook definition before executing the playbook by entering the following command:
$ ansible-playbook --check <path_to_playbook>.ymlReplace <path_to_playbook> with the playbook file path.
Harden the system by running the playbook that you created for your RHEL major version against the host by entering the following command:
$ ansible-playbook <path_to_playbook>.ymlReplace <path_to_playbook> with the playbook file path.
Install OpenSCAP scanner packages by entering the following command:
$ sudo dnf install -y openscap-scanner scap-security-guideEvaluate the host against the CIS profile by entering one of the following commands for your target operating system.
If your target operating system is RHEL 9, enter the following command:
$ sudo oscap xccdf eval \ --profile xccdf_org.ssgproject.content_profile_cis \ --results /tmp/cis-results.xml \ --report /tmp/cis-report.html \ /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xmlIf your target operating system is RHEL 10, enter the following command:
$ sudo oscap xccdf eval \ --profile xccdf_org.ssgproject.content_profile_cis \ --results /tmp/cis-results.xml \ --report /tmp/cis-report.html \ /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml
-
Review
/tmp/cis-report.htmland remediate unexpected failures before you install MicroShift.
Verification
-
The OpenSCAP report uses the
xccdf_org.ssgproject.content_profile_cisprofile. - Remaining failures match only rules that you expect to address after MicroShift installation, or that are documented as unavoidable for container platforms.
1.4. Install and configure MicroShift on a CIS Level 2 host Copy linkLink copied to clipboard!
Install MicroShift RPM packages on a Center for Internet Security (CIS) Level 2 hardened host, open the required firewall access, regenerate privileged-command audit rules, start MicroShift, and verify that workloads run.
Prerequisites
- You hardened the host and applied the IP forwarding playbook overrides.
- You completed the RPM installation prerequisites for MicroShift, including repository configuration and a pull secret.
-
You have root or
sudoprivileges on the host. -
You installed the
ocCLI.
Procedure
Install MicroShift from RPM packages by following the standard package-mode installation procedure.
CIS hardening enables
firewalldand restricts traffic. Configure the firewall before or immediately after installation so that the API server, router, and pod networking can function.- Configure required firewall trusted sources and any optional ports that your workloads need.
If you installed MicroShift after you applied CIS hardening, regenerate audit rules for privileged binaries so that they cover binaries from MicroShift RPMs by entering the following commands:
$ sudo find / -xdev \( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null | \ awk '{print "-a always,exit -F path=" $1 " -F perm=x -F auid>=1000 -F auid!=unset -k privileged"}' | \ sudo tee /etc/audit/rules.d/99-privileged-post-install.rules > /dev/null $ sudo augenrules --loadStart MicroShift by entering the following command:
$ sudo systemctl enable --now microshiftWait for the node to become ready by entering the following command:
$ oc get node- Deploy a smoke-test application that uses persistent storage and is exposed through an ingress route to validate scheduling, storage, and ingress on the hardened host.
Verification
-
The
microshiftservice is active. -
The node reports
Ready. - The smoke-test application is reachable through its route and can read and write persistent storage.
- A postinstall OpenSCAP scan shows only the documented unavoidable CIS rule failures for IP forwarding, container file ownership, and kubelet volume permissions, plus any site-specific exceptions that you approved.
1.5. CIS Level 2 firewall and configuration reference for MicroShift Copy linkLink copied to clipboard!
Use the configuration information when you prepare a Center for Internet Security (CIS) Level 2 host for MicroShift. The information includes required firewall access, playbook overrides, OpenSCAP profile names, expected CIS rule failures, and common remediation steps.
1.5.1. Required firewall access Copy linkLink copied to clipboard!
CIS hardening enables firewalld and denies traffic by default. Configure the following access for MicroShift:
| Source | Required | Description |
|---|---|---|
|
| Yes | Host-network pod access to other pods |
|
| Yes | Host-network pod access to the MicroShift API server |
| Port | Protocol | Description |
|---|---|---|
|
| TCP | HTTP applications through the router |
|
| TCP | HTTPS applications through the router |
|
| TCP | HTTPS API server access |
|
| TCP or UDP |
|
For complete firewall procedures, see the MicroShift firewall documentation.
1.5.2. Hardening playbook overrides Copy linkLink copied to clipboard!
Set the following Ansible role variables to false so that the CIS role does not disable IP forwarding:
For RHEL 9:
-
sysctl_net_ipv4_ip_forward -
sysctl_net_ipv6_conf_all_forwarding
For RHEL 10:
-
sysctl_net_ipv4_ip_forward -
sysctl_net_ipv4_conf_all_forwarding -
sysctl_net_ipv4_conf_default_forwarding -
sysctl_net_ipv6_conf_all_forwarding -
sysctl_net_ipv6_conf_default_forwarding
1.5.3. OpenSCAP profile and content Copy linkLink copied to clipboard!
| Item | Value |
|---|---|
| Profile ID |
|
| RHEL 9 content |
|
| RHEL 10 content |
|
| Packages |
|
1.5.4. Expected CIS rule failures with MicroShift Copy linkLink copied to clipboard!
| Rule ID | RHEL 9 | RHEL 10 |
|---|---|---|
|
| Yes | Yes |
|
| Yes | Yes |
|
| No | Yes |
|
| No | Yes |
|
| No | Yes |
| Rule ID | RHEL 9 | RHEL 10 |
|---|---|---|
|
| Yes | No |
|
| Yes | No |
|
| No | Yes |
|
| No | Yes |
| Rule ID | RHEL 9 | RHEL 10 |
|---|---|---|
|
| Yes | Yes |
|
| Yes | Yes |
| Rule ID | RHEL 9 | RHEL 10 |
|---|---|---|
|
| Yes (You can remediate this rule by regenerating audit rules after you install MicroShift RPMs.) | Yes (You can remediate this rule by regenerating audit rules after you install MicroShift RPMs.) |
1.5.5. Troubleshooting Copy linkLink copied to clipboard!
- Pods cannot reach other pods or the API server
-
Verify that
firewalldtrusts the cluster network CIDR and169.254.169.1, then reload the firewall. - Ingress routes are unreachable
-
Open router ports such as
80/tcpand443/tcpin the appropriate firewall zone. - OpenSCAP reports IP forwarding failures after MicroShift starts
- These failures are expected. OVN-Kubernetes requires IP forwarding. Ensure your hardening playbook used the documented overrides so that the CIS role does not fight MicroShift at boot.
audit_rules_privileged_commandsfails after RPM install- Regenerate and load privileged-command audit rules after you install MicroShift packages.
- Networking fails immediately after CIS hardening
-
Confirm that the playbook set the IP forwarding role variables to
falseand that MicroShift has started so that it can enable forwarding.