Skip to content

[release-5.0] OCPBUGS-122276: fix(hcco): run kas-connection-checker as non-root - #9582

Closed
openshift-cherrypick-robot wants to merge 1 commit into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-9296-to-release-5.0
Closed

openshift-cherrypick-robot wants to merge 1 commit into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-9296-to-release-5.0

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #9296

/assign matlaj

The Deployment set no securityContext, and kube-system is exempt from both SCC and Pod Security
admission, so nothing assigned a UID and the cli image ran as root.

The workload only reads the ServiceAccount token (mode 0644) and curls an endpoint, so it needs
none of those privileges.

The openshift.io/required-scc annotation was inert in kube-system, and once a UID is pinned it
becomes a hazard: if that exemption ever changed, restricted-v2 (MustRunAsRange) would reject
UID 1000 as outside the namespace uid-range and the checker would fail admission.

Pin RunAsUser to 1000 at the pod level and add the restricted container security context (no
privilege escalation, read-only rootfs, RunAsNonRoot, drop ALL capabilities), matching
konnectivity-agent, which solves the same problem in the same namespace.

Clear the required-scc annotation by setting the annotation map to nil rather than dropping the
assignment, so it is also removed from Deployments created by earlier versions.

Extend the unit tests to assert the security context, invert the annotation assertion, and add the
stale annotation to the pre-existing Deployment fixture so the upgrade path is exercised.

Signed-off-by: Máté Lajkó <mate.lajko@ibm.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e6bc037e-01b1-450c-bfcc-81766e001cbc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: Jira Issue OCPBUGS-105875 has been cloned as Jira Issue OCPBUGS-122276. Will retitle bug to link to clone.
/retitle [release-5.0] OCPBUGS-122276: fix(hcco): run kas-connection-checker as non-root

Details

In response to this:

This is an automated cherry-pick of #9296

/assign matlaj

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot changed the title [release-5.0] OCPBUGS-105875: fix(hcco): run kas-connection-checker as non-root [release-5.0] OCPBUGS-122276: fix(hcco): run kas-connection-checker as non-root Sep 11, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-122276, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is an automated cherry-pick of #9296

/assign matlaj

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from Nirshal and devguyio September 11, 2026 07:10
@openshift-ci openshift-ci Bot added the area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release label Sep 11, 2026
@openshift-ci

openshift-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-cherrypick-robot
Once this PR has been reviewed and has the lgtm label, please assign devguyio 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

@matlaj

matlaj commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

/verified by verifyKASCheckerSecurityContext

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@matlaj: This PR has been marked as verified by verifyKASCheckerSecurityContext.

Details

In response to this:

/verified by verifyKASCheckerSecurityContext

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 openshift-eng/jira-lifecycle-plugin repository.

@matlaj

matlaj commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@matlaj: This pull request references Jira Issue OCPBUGS-122276, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-105875 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-105875 targets the "5.1.0" version, which is one of the valid target versions: 5.1.0
  • bug has dependents
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@matlaj

matlaj commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

/auto-cc

@openshift-ci
openshift-ci Bot requested a review from jparrill September 11, 2026 07:24
@openshift-ci

openshift-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@TwoDCube

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2026
@openshift-ci

openshift-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2026
@openshift-ci

openshift-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test 4-23-e2e-aks
/test 4-23-e2e-aws
/test 4-23-e2e-aws-upgrade-hypershift-operator
/test 4-23-e2e-kubevirt-aws-ovn-reduced
/test 4-23-e2e-v2-aws
/test 4-23-e2e-v2-azure-self-managed
/test 4-23-e2e-v2-gke
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-aks-external-oidc
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

matlaj added a commit to matlaj/hypershift that referenced this pull request Sep 18, 2026
This is a manual backport of openshift#9296 to branch `release-5.0` because I don't have the necessary access to resolve the merge conflicts in openshift#9582.

Signed-off-by: Máté Lajkó <mate.lajko@ibm.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@matlaj

matlaj commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

/close

#9694

@openshift-ci openshift-ci Bot closed this Sep 18, 2026
@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@matlaj: Closed this PR.

Details

In response to this:

/close

#9694

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.

@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-122276. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

Details

In response to this:

This is an automated cherry-pick of #9296

/assign matlaj

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 openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants