[release-5.0] OCPBUGS-122276: fix(hcco): run kas-connection-checker as non-root - #9582
Conversation
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>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-105875 has been cloned as Jira Issue OCPBUGS-122276. Will retitle bug to link to clone. DetailsIn response to this:
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-cherrypick-robot: This pull request references Jira Issue OCPBUGS-122276, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/verified by verifyKASCheckerSecurityContext |
|
@matlaj: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/jira refresh |
|
@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
DetailsIn response to this:
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. |
|
/auto-cc |
|
@openshift-cherrypick-robot: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/lgtm |
|
PR needs rebase. DetailsInstructions 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. |
|
Scheduling tests matching the |
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>
|
/close |
|
@matlaj: Closed this PR. DetailsIn response to this:
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-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. DetailsIn response to this:
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. |
This is an automated cherry-pick of #9296
/assign matlaj