Skip to content

[release-6.6]feat(security): protect collector ServiceAccounts via ValidatingAdmissionPolicy - #3523

Open
vparfonov wants to merge 1 commit into
openshift:release-6.6from
vparfonov:log9441-6.6
Open

vparfonov wants to merge 1 commit into
openshift:release-6.6from
vparfonov:log9441-6.6

Conversation

@vparfonov

Copy link
Copy Markdown
Contributor

Description

Backport CVE-2026-10609 fix from master PR #3405 to release-6.6.

Implement Kubernetes ValidatingAdmissionPolicy to prevent unauthorized use of collector ServiceAccounts. A user who can create a ClusterLogForwarder can name any existing ServiceAccount; without protection, that user could create a Pod/Deployment referencing the collector SA and inherit its privileges (logging-scc, host mounts, token access).

Two ValidatingAdmissionPolicies enforce that collector ServiceAccounts can only be used by:

  • CLO-managed workloads (created by the operator ServiceAccount)
  • Built-in kube-system controllers propagating from those workloads (daemon-set-controller, replicaset-controller, deployment-controller, etc.)

The trust anchor is request.userInfo (authenticated creator), not Pod metadata, so copying collector labels/annotations/names does not bypass the check.

Changes for release-6.6:

  • ValidatingAdmissionPolicy manifests with CEL expressions
  • ConfigMap parameter tracking protected SAs and allowed creator identities
  • Controller reconciling policies/bindings and syncing ConfigMap on CLF events
  • ConfigMap self-healing via Watches predicate
  • API availability check at manager startup (gracefully disabled if unavailable)
  • Unit tests for policy logic and ConfigMap sync/self-healing
  • envtest for CEL validation against real kube-apiserver
  • E2E tests verifying policy enforcement
  • Manual test script (hack/test-protected-sa.sh)
  • Documentation on protected ServiceAccounts and ValidatingAdmissionPolicy

/cc
/assign @jcantrill

Links

…sionPolicy

Backport CVE-2026-10609 fix from master PR openshift#3405 to release-6.6.

Implement Kubernetes ValidatingAdmissionPolicy to prevent unauthorized use of
collector ServiceAccounts. A user who can create a ClusterLogForwarder can name
any existing ServiceAccount; without protection, that user could create a
Pod/Deployment referencing the collector SA and inherit its privileges
(logging-scc, host mounts, token access).

Two ValidatingAdmissionPolicies enforce that collector ServiceAccounts can only
be used by:
- CLO-managed workloads (created by the operator ServiceAccount)
- Built-in kube-system controllers propagating from those workloads
  (daemon-set-controller, replicaset-controller, deployment-controller, etc.)

The trust anchor is request.userInfo (authenticated creator), not Pod metadata,
so copying collector labels/annotations/names does not bypass the check.

Changes for release-6.6:
- ValidatingAdmissionPolicy manifests with CEL expressions
- ConfigMap parameter tracking protected SAs and allowed creator identities
- Controller reconciling policies/bindings and syncing ConfigMap on CLF events
- ConfigMap self-healing via Watches predicate
- API availability check at manager startup (gracefully disabled if unavailable)
- Unit tests for policy logic and ConfigMap sync/self-healing
- envtest for CEL validation against real kube-apiserver
- E2E tests verifying policy enforcement
- Manual test script (hack/test-protected-sa.sh)
- Documentation on protected ServiceAccounts and ValidatingAdmissionPolicy

Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
@coderabbitai

coderabbitai Bot commented Oct 1, 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: openshift/cluster-logging-operator/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ec9e3872-e817-4f2b-8d33-e455186cc76e

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
openshift-ci Bot requested review from cahartma and jcantrill October 1, 2026 10:38
@openshift-ci

openshift-ci Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

openshift-ci Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@vparfonov: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-target 42b264d link true /test e2e-target
ci/prow/functional-target 42b264d link true /test functional-target

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.

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.

1 participant