Skip to content

common: Disable empty password authentication via authselect without-nullok#255

Open
sebrandon1 wants to merge 1 commit into
coreos:mainfrom
sebrandon1:hardening/pam-no-empty-passwords
Open

common: Disable empty password authentication via authselect without-nullok#255
sebrandon1 wants to merge 1 commit into
coreos:mainfrom
sebrandon1:hardening/pam-no-empty-passwords

Conversation

@sebrandon1
Copy link
Copy Markdown

RHCOS inherits nullok in PAM from the RHEL defaults, which permits authentication with empty passwords. While RHCOS nodes don't set a root password by default, nullok still allows authentication with empty passwords for any account where one is explicitly set. Removing it is a defense-in-depth measure consistent with all major compliance profiles.

This adds without-nullok to the existing authselect test sssd calls in the postprocess block, plus a verification step. The change is minimal — adding one authselect feature flag to the existing PAM configuration step.

Why this change

This is flagged as a HIGH severity finding across every compliance profile that applies to RHCOS: Essential 8, CIS, NIST Moderate, and PCI-DSS. Unlike many hardening recommendations where benchmarks disagree, removing nullok is consistent across all of them.

Today, the compliance-operator remediation for this finding is broken on RHCOS 9 — it generates RHEL 8 era PAM templates that don't apply cleanly. Fixing it at the image level eliminates the issue for all clusters without requiring per-node MachineConfig remediation.

Why the maintenance burden is low

  • Uses authselect's without-nullok feature flag — the supported RHEL mechanism purpose-built for this (authselect/authselect#94, landed in 2018)
  • Adds one parameter to the existing authselect test sssd calls — no new postprocess block, no custom PAM files
  • Includes a verification step that fails the build if nullok persists

Scope

This is intentionally narrow. We understand the concern about carrying hardening overrides that diverge from RHEL defaults. This is not a campaign to upstream every compliance checklist item.

Moved from openshift/os#1934 per maintainer feedback.

References

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign travier for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

Hi @sebrandon1. Thanks for your PR.

I'm waiting for a coreos member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances security by incorporating the without-nullok feature into the authselect configuration, which disables empty password authentication. It also introduces a verification step to ensure the nullok option is successfully removed from PAM files. The review feedback suggests extending this verification to include smartcard-auth and fingerprint-auth to ensure consistent security policy enforcement across all relevant authentication methods.

Comment thread common.yaml Outdated
…nullok

Add the without-nullok feature flag to the existing authselect test sssd
calls, removing the nullok parameter from PAM pam_unix.so in all auth
files. This prevents authentication with empty passwords on RHCOS nodes.

This is a HIGH severity finding across every compliance profile that
applies to RHCOS (Essential 8, CIS, NIST Moderate, and PCI-DSS).
@sebrandon1 sebrandon1 force-pushed the hardening/pam-no-empty-passwords branch from 40cde78 to ce795bc Compare May 12, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant