Skip to content

CNTRLPLANE-3423: feat: inject centralized TLS into service-ca operand - #365

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
ingvagabund:tls-injection-to-service-ca
Jul 24, 2026
Merged

CNTRLPLANE-3423: feat: inject centralized TLS into service-ca operand#365
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
ingvagabund:tls-injection-to-service-ca

Conversation

@ingvagabund

@ingvagabund ingvagabund commented Jul 22, 2026

Copy link
Copy Markdown
Member

Operator part implemented in #359.

This covers the operand side as well.

Summary by CodeRabbit

  • New Features

    • Added support for applying operator TLS security settings to the service CA controller.
    • The controller now observes configuration changes and automatically updates its deployment when settings change.
    • Added a managed configuration resource for controller runtime settings.
  • Improvements

    • Controller configuration now includes supported minimum TLS versions and cipher suites from observed operator settings.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 22, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@ingvagabund: This pull request references CNTRLPLANE-3423 which is a valid jira issue.

Details

In response to this:

Operator part implemented in #359.

This covers the operand side as well.

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.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f70333d9-d094-45a5-9a36-132c16b47ae5

📥 Commits

Reviewing files that changed from the base of the PR and between 613dcca and 11a6d83.

📒 Files selected for processing (6)
  • bindata/assets/controller-config.yaml
  • bindata/assets/deployment.yaml
  • pkg/operator/configobservation/configobserver_controller.go
  • pkg/operator/starter.go
  • pkg/operator/sync.go
  • pkg/operator/sync_common.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • bindata/assets/controller-config.yaml
  • pkg/operator/sync.go
  • pkg/operator/configobservation/configobserver_controller.go
  • pkg/operator/starter.go

Walkthrough

Adds TLS configuration observation for the service CA operator, renders observed settings into a controller ConfigMap, mounts that ConfigMap into the controller deployment, and triggers deployment updates when the generated configuration changes.

Changes

Service CA controller configuration

Layer / File(s) Summary
TLS configuration observation
pkg/operator/configobservation/configobserver_controller.go, pkg/operator/starter.go
Adds a config observer controller that observes the service-ca TLS security profile and starts with the operator’s other controllers.
Controller configuration rendering
pkg/operator/sync_common.go, go.mod, bindata/assets/controller-config.yaml
Renders observed TLS settings into a GenericOperatorConfig YAML document stored in the service-ca-controller-config ConfigMap.
Deployment configuration integration
bindata/assets/deployment.yaml, pkg/operator/sync.go
Mounts the ConfigMap into the controller, passes its configuration path and termination file, and includes configuration changes in deployment regeneration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: atiratree, p0lyn0mial

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: injecting centralized TLS into the service-ca operand.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed No *_test.go files changed in the commit, and the added Go files contain no Ginkgo titles.
Test Structure And Quality ✅ Passed No Ginkgo test code was added or changed; pkg/operator tests are standard testing-based, so the review criteria don’t apply.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e/spec tests were added or modified in the PR; the changed files are operator code and manifests only.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added or modified; the diff is operator/config wiring only, so there are no SNO-specific assumptions to flag.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only adds config-mount/controller wiring; the deployment’s topology logic is unchanged and still gates nodeSelector removal on ExternalTopologyMode.
Ote Binary Stdout Contract ✅ Passed Patch adds config-observer and deployment changes, but no new stdout writes in main/init/suite setup were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in the PR; changed files are operator/config manifest code only, so the IPv6/disconnected test check is not applicable.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto code was added; the changes only propagate TLS settings and use library-go CA helpers.
Container-Privileges ✅ Passed Changed manifests add only config wiring; no privileged, hostPID/Network/IPC, SYS_ADMIN, allowPrivilegeEscalation, or root settings are present, and the container is runAsNonRoot.
No-Sensitive-Data-In-Logs ✅ Passed No new logging statements or verbose error messages were added; the touched code only adds generic status/info logs and config wiring.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
bindata/assets/controller-config.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

bindata/assets/deployment.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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

@openshift-ci
openshift-ci Bot requested review from atiratree and p0lyn0mial July 22, 2026 13:03
@ingvagabund
ingvagabund force-pushed the tls-injection-to-service-ca branch from eb1000e to 613dcca Compare July 22, 2026 13:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bindata/assets/deployment.yaml`:
- Around line 48-59: Harden the Kubernetes workload in deployment.yaml by adding
allowPrivilegeEscalation: false, readOnlyRootFilesystem: true,
capabilities.drop: ["ALL"], CPU and memory limits, and liveness/readiness probes
to the container specification. Set automountServiceAccountToken: false unless
the controller explicitly needs in-cluster API credentials, and add or ensure a
restrictive NetworkPolicy exists for the workload’s namespace.

In `@pkg/operator/sync_common.go`:
- Around line 256-260: Update the TLS field extraction in the surrounding sync
function to handle errors from NestedString and NestedStringSlice separately:
return the existing `(bool, error)` failure result immediately when either
lookup reports an error, while only adding fields when found and non-empty.
Follow the established early-return pattern used near the referenced
error-handling blocks, preserving normal behavior for absent valid fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e4579948-7aee-4532-8a36-02e6f711b39d

📥 Commits

Reviewing files that changed from the base of the PR and between 6391e07 and eb1000e.

⛔ Files ignored due to path filters (6)
  • vendor/github.com/openshift/library-go/pkg/operator/configobserver/apiserver/OWNERS is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/configobserver/apiserver/listers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/configobserver/apiserver/observe_audit.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/configobserver/apiserver/observe_cors.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/library-go/pkg/operator/configobserver/apiserver/observe_tlssecurityprofile.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (7)
  • bindata/assets/controller-config.yaml
  • bindata/assets/deployment.yaml
  • go.mod
  • pkg/operator/configobservation/configobserver_controller.go
  • pkg/operator/starter.go
  • pkg/operator/sync.go
  • pkg/operator/sync_common.go

Comment on lines +48 to +59
- mountPath: /var/run/configmaps/config
name: config
volumes:
- name: signing-key
secret:
secretName: signing-key
- name: signing-cabundle
configMap:
name: signing-cabundle
- name: config
configMap:
name: service-ca-controller-config

@coderabbitai coderabbitai Bot Jul 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Apply the required workload hardening controls.

This workload still lacks explicit allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities.drop: ["ALL"], CPU/memory limits, and liveness/readiness probes. Also set automountServiceAccountToken: false unless this controller requires in-cluster API credentials, and ensure its namespace has a restrictive NetworkPolicy.

As per path instructions, Kubernetes workloads require these security controls, limits, probes, and least-privilege defaults.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bindata/assets/deployment.yaml` around lines 48 - 59, Harden the Kubernetes
workload in deployment.yaml by adding allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true, capabilities.drop: ["ALL"], CPU and memory limits,
and liveness/readiness probes to the container specification. Set
automountServiceAccountToken: false unless the controller explicitly needs
in-cluster API credentials, and add or ensure a restrictive NetworkPolicy exists
for the workload’s namespace.

Source: Path instructions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not in the scope of the PR

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ingvagabund Understood—this hardening work is outside the scope of the centralized TLS configuration change. I’ll treat it as a follow-up rather than a blocker for this PR. Would you like me to open a GitHub issue to track it?

Comment thread pkg/operator/sync_common.go
@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

1 similar comment
@ingvagabund

Copy link
Copy Markdown
Member Author

/retest-required

To support cluster wide cryptographic policy aligning with a centralized
TLS configuration.
@ingvagabund
ingvagabund force-pushed the tls-injection-to-service-ca branch from 613dcca to 11a6d83 Compare July 23, 2026 11:24
@ingvagabund

Copy link
Copy Markdown
Member Author

From https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_service-ca-operator/365/pull-ci-openshift-service-ca-operator-main-e2e-aws-operator/2080252674057441280/artifacts/e2e-aws-operator/gather-extra/artifacts/pods.json:

                        "args": [
                            "--config=/var/run/configmaps/config/controller-config.yaml",
                            "--terminate-on-files=/var/run/configmaps/config/controller-config.yaml",
                            "-v=2"
                        ],

From https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_service-ca-operator/365/pull-ci-openshift-service-ca-operator-main-e2e-aws-operator/2080252674057441280/artifacts/e2e-aws-operator/gather-extra/artifacts/configmaps.json:

        {
            "apiVersion": "v1",
            "data": {
                "controller-config.yaml": "apiVersion: operator.openshift.io/v1alpha1\nkind: GenericOperatorConfig\nservingInfo:\n  cipherSuites:\n  - TLS_AES_128_GCM_SHA256\n  - TLS_AES_256_GCM_SHA384\n  - TLS_CHACHA20_POLY1305_SHA256\n  - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\n  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n  - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\n  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n  - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256\n  - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\n  minTLSVersion: VersionTLS12\n"
            },
            "kind": "ConfigMap",
            "metadata": {
                "creationTimestamp": "2026-07-23T11:55:11Z",
                "name": "service-ca-controller-config",
                "namespace": "openshift-service-ca",
                "resourceVersion": "5660",
                "uid": "fd12dfa9-a6af-42a5-a0ff-9705a9c61b15"
            }
        },

/verified by CI

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

Copy link
Copy Markdown
Contributor

@ingvagabund: This PR has been marked as verified by CI.

Details

In response to this:

From https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_service-ca-operator/365/pull-ci-openshift-service-ca-operator-main-e2e-aws-operator/2080252674057441280/artifacts/e2e-aws-operator/gather-extra/artifacts/pods.json:

                       "args": [
                           "--config=/var/run/configmaps/config/controller-config.yaml",
                           "--terminate-on-files=/var/run/configmaps/config/controller-config.yaml",
                           "-v=2"
                       ],

From https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_service-ca-operator/365/pull-ci-openshift-service-ca-operator-main-e2e-aws-operator/2080252674057441280/artifacts/e2e-aws-operator/gather-extra/artifacts/configmaps.json:

       {
           "apiVersion": "v1",
           "data": {
               "controller-config.yaml": "apiVersion: operator.openshift.io/v1alpha1\nkind: GenericOperatorConfig\nservingInfo:\n  cipherSuites:\n  - TLS_AES_128_GCM_SHA256\n  - TLS_AES_256_GCM_SHA384\n  - TLS_CHACHA20_POLY1305_SHA256\n  - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\n  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n  - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\n  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n  - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256\n  - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\n  minTLSVersion: VersionTLS12\n"
           },
           "kind": "ConfigMap",
           "metadata": {
               "creationTimestamp": "2026-07-23T11:55:11Z",
               "name": "service-ca-controller-config",
               "namespace": "openshift-service-ca",
               "resourceVersion": "5660",
               "uid": "fd12dfa9-a6af-42a5-a0ff-9705a9c61b15"
           }
       },

/verified by CI

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 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@ingvagabund: 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.

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ricardomaraschini

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

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2026
@ricardomaraschini

Copy link
Copy Markdown

/approved

@ingvagabund

ingvagabund commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

/hold
To avoid accidental merge before pre-merge testing

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@ricardomaraschini

Copy link
Copy Markdown

/lgtm

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

Copy link
Copy Markdown
Contributor

/verified by @kaleemsiddiqu
Local test execution went successful.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@kaleemsiddiqu: This PR has been marked as verified by @kaleemsiddiqu.

Details

In response to this:

/verified by @kaleemsiddiqu
Local test execution went successful.

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.

@ingvagabund

Copy link
Copy Markdown
Member Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 24, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 41be501 into openshift:main Jul 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. 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