Ensuring Compliance in OpenShift: A Guide for Regulated Industries

When deploying Red Hat OpenShift Container Platform (OCP) in regulated industries (such as banking, healthcare, or government), standard Kubernetes security controls are not enough. You must ensure the entire platform complies with strict regulatory frameworks like PCI-DSS, HIPAA, FedRAMP, and NIST SP 800-53.

OpenShift provides an automated, declarative way to enforce security and compliance from the hardware operating system up to the running workloads. This is driven primarily by the Compliance Operator, File Integrity Operator, and native encryption mechanisms.

1. Automated Compliance Auditing: The Compliance Operator

The Compliance Operator is an automation engine that runs continuous OpenSCAP (Open Security Content Automation Protocol) scans across your OpenShift cluster. It checks the configuration of both the Kubernetes API resources and the underlying Red Hat Enterprise Linux CoreOS (RHCOS) host operating systems against a set of predefined security profiles.

Supported Security Profiles (Out-of-the-Box)
  • CIS (Center for Internet Security): Benchmarks for OCP and RHCOS.
  • NIST-800-53: Moderate and High impact baselines.
  • PCI-DSS: Strict constraints required for processing credit card and payment tokens.
  • STIG (Security Technical Implementation Guides): Required for US Department of Defense (DoD) environments.
The Declarative Compliance Framework

Instead of manually running shell scripts on your servers, you declare a ScanSettingBinding. This tells OpenShift which compliance profiles to scan against, how often to run the scans (e.g., every night at 1:00 AM), and whether it should automatically remediate failures.

YAML

apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:
name: enterprise-compliance-gate
namespace: openshift-compliance
profiles:
# Scan the control plane and worker APIs against CIS benchmarks
- name: ocp4-cis-node
kind: Profile
apiGroup: compliance.openshift.io/v1alpha1
# Scan the underlying host operating systems against PCI-DSS requirements
- name: rhcos4-pci-dss
kind: Profile
apiGroup: compliance.openshift.io/v1alpha1
settingsRef:
name: default-auto-remediate # Uses a pre-configured setting that applies safe fixes automatically
kind: ScanSetting
apiGroup: compliance.openshift.io/v1alpha1
Auto-Remediation Mechanics

If a scan fails because a kernel parameter is insecure or an API setting is too permissive, the Compliance Operator doesn’t just alert you. It generates a ComplianceRemediation object. If you used an auto-remediate profile, it instructs the Machine Config Operator (MCO) to roll out an atomic update to the nodes, fixing the drift and rebooting them safely without human intervention.

2. Host Level Protection: The File Integrity Operator

For high-security compliance (like PCI-DSS Requirement 11.5), you must implement File Integrity Monitoring (FIM). You need to prove to auditors that system binaries, configuration files, and kernel libraries on your host nodes have not been modified or tampered with by an attacker.

OpenShift solves this via the File Integrity Operator, which deploys AIDE (Advanced Intrusion Detection Environment) as a daemon across the cluster.

How File Integrity Operations Work:
  1. The Initialization: When deployed, the operator takes a cryptographic snapshot (hashes) of all critical system files (e.g., /etc, /usr, /boot) on healthy RHCOS nodes and saves this baseline database securely.
  2. The Scan: It continuously monitors the host file systems for changes.
  3. The Event: If an attacker somehow bypasses the cluster API, logs into a worker node via SSH, and alters a file like /etc/pam.d/system-auth, the AIDE scanner detects the hash mismatch.
  4. The Alert: The operator transitions the node status to Failed, fires a Kubernetes event, and surfaces a detailed report showing exactly which file was added, modified, or deleted.

3. Cryptographic Hardening: FIPS Mode and At-Rest Encryption

True platform hardening requires locking down the cryptographic primitives used by the operating system and encrypting data at rest inside the core database.

Federal Information Processing Standards (FIPS 140-3)

If you are building an architecture for government or highly regulated finance sectors, you must enable FIPS Mode.

  • Crucial Architectural Catch: FIPS mode can only be enabled during the initial installation of the OpenShift cluster. It cannot be toggled on a running Day-2 cluster.
  • When fips: true is set in the install-config.yaml, the installer configures the RHCOS kernel to bypass standard cryptographic libraries. It forces the entire platform (from Go binaries to the SSH daemons and the etcd storage layer) to use strictly validated, FIPS-compliant cryptographic modules.
etcd Data-at-Rest Encryption

By default, values written to etcd are stored as cleartext strings. If an attacker gains raw access to the control plane’s physical hard drives or backs up etcd insecurely, they can read cluster secrets.

To meet compliance data protection rules, you can force OpenShift to encrypt the keyspace at rest using standard AES-CBC or AES-GCM algorithms.

You enable this globally by modifying the APIserver custom resource:

YAML

apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
spec:
encryption:
type: aesgcm # Activates high-performance authenticated encryption
What happens behind the scenes?

Once you apply this, the Cluster etcd Operator manages a rolling data migration. It automatically generates encryption keys, distributes them safely to the control plane nodes, reads every single secret, config map, and route out of etcd, encrypts them using the new AES-GCM keys, and writes them back to disk.

The operator then automatically handles key rotation routines periodically to comply with enterprise key-management lifecycle frameworks.

Leave a Reply