Skip to content

Conversation

@swastik959
Copy link
Contributor

Description:

Check: 4.2.4 Verify that if defined, the --read-only-port argument is set to 0 (Automated)

The former audit returned too much data, which was subsequently truncated by kube-bench, causing the check to fail consistently. This fix improves the audit for --read-only-port discovery by limiting the returned data, piping the initial command to grep with -o, --only-matching.

Parent issue:
rancher/compliance-operator#123

Fixed versions:

k3s-cis-1.11
k3s-cis-1.10
k3s-cis-1.9

Expected behaviour: By default, K3s sets the --read-only-port to 0 (which disables the read only kubelet API traditionally served on port 10255, preventing unauthenticated access to potentially sensitive cluster information).

@swastik959 swastik959 requested a review from a team as a code owner November 28, 2025 12:24
@swastik959 swastik959 changed the title [k3s][node][4.2.4][release/0.6]] fix audit for --read-only-port discovery [k3s][node][4.2.4][release/0.6] fix audit for --read-only-port discovery Nov 28, 2025
Copy link
Contributor

@andypitcher andypitcher left a comment

Choose a reason for hiding this comment

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

Wrong indentation, could you verify the other PRs as well ? Otherwise let's wait on #568 to get reviewed and merged to rebase your PRs.

…turned data

The former audit returned too much data, which was subsequently truncated by kube-bench, causing the check to fail consistently.

Signed-off-by: Andy Pitcher <[email protected]>
@swastik959 swastik959 merged commit f5a88f9 into rancher:release/v0.6 Dec 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants