Skip to content

PROJQUAY-10703: feat(tls): propagate PQC groups for Modern profiles - #1303

Open
Marcusk19 wants to merge 2 commits into
quay:masterfrom
Marcusk19:feat/projquay-10703-modern-pqc-curves
Open

PROJQUAY-10703: feat(tls): propagate PQC groups for Modern profiles#1303
Marcusk19 wants to merge 2 commits into
quay:masterfrom
Marcusk19:feat/projquay-10703-modern-pqc-curves

Conversation

@Marcusk19

@Marcusk19 Marcusk19 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Propagate the post-quantum TLS supported groups required by Quay when the OpenShift cluster TLS security profile is Modern.

Root Cause / Rationale

The operator already propagated TLS versions and ciphers/ciphersuites, but it did not configure Quay nginx's supported groups. Consequently, a Quay image with ML-KEM-capable OpenSSL could still fail an X25519MLKEM768 handshake unless SSL_ECDH_CURVES was manually supplied.

Changes

  • Add SSLECDHCurves to QuayRegistryContext.
  • Map the Modern profile to X25519MLKEM768:X25519:prime256v1.
  • Inject SSL_ECDH_CURVES into generated Quay configuration when not user-specified.
  • Preserve existing user TLS configuration precedence.
  • Extend controller unit coverage for Modern, Intermediate, and user override behavior.
  • Extend the TLS security profile Chainsaw assertion to verify X25519MLKEM768 for Modern.

Test Plan

  • KUBEBUILDER_ASSETS=$PWD/bin/k8s/1.28.0-darwin-arm64 go test ./controllers/quay ./pkg/kustomize ./pkg/context
  • go vet ./controllers/quay ./pkg/kustomize ./pkg/context
  • Existing CRC validation with a Quay image configured for ML-KEM negotiated X25519MLKEM768 and completed authenticated registry push/pull.

JIRA Link

https://issues.redhat.com/browse/PROJQUAY-10703

Backport

Not required; this targets the current development line and depends on the existing TLS security profile integration.

Summary by CodeRabbit

  • New Features

    • Derives OpenShift API server ECDH curve settings and injects SSL_ECDH_CURVES into the generated Quay TLS config.
    • For the Modern TLS profile, injects PQC-capable groups (including X25519MLKEM768).
  • Bug Fixes

    • Respects user-provided SSL_ECDH_CURVES in config.yaml without overriding.
    • Avoids populating SSL_ECDH_CURVES for non-Modern/default profiles.
  • Tests

    • Updated unit tests and end-to-end TLS security profile verification for SSL_ECDH_CURVES injection and precedence.

@openshift-ci-robot

openshift-ci-robot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@Marcusk19: This pull request references [Jira Issue PROJQUAY-10703](https://redhat.atlassian.net/browse/PROJQUAY-10703), which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Release Pending (Done) instead

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.

Details

In response to this:

Summary

Propagate the post-quantum TLS supported groups required by Quay when the OpenShift cluster TLS security profile is Modern.

Root Cause / Rationale

The operator already propagated TLS versions and ciphers/ciphersuites, but it did not configure Quay nginx's supported groups. Consequently, a Quay image with ML-KEM-capable OpenSSL could still fail an X25519MLKEM768 handshake unless SSL_ECDH_CURVES was manually supplied.

Changes

  • Add SSLECDHCurves to QuayRegistryContext.
  • Map the Modern profile to X25519MLKEM768:X25519:prime256v1.
  • Inject SSL_ECDH_CURVES into generated Quay configuration when not user-specified.
  • Preserve existing user TLS configuration precedence.
  • Extend controller unit coverage for Modern, Intermediate, and user override behavior.
  • Extend the TLS security profile Chainsaw assertion to verify X25519MLKEM768 for Modern.

Test Plan

  • KUBEBUILDER_ASSETS=$PWD/bin/k8s/1.28.0-darwin-arm64 go test ./controllers/quay ./pkg/kustomize ./pkg/context
  • go vet ./controllers/quay ./pkg/kustomize ./pkg/context
  • Existing CRC validation with a Quay image configured for ML-KEM negotiated X25519MLKEM768 and completed authenticated registry push/pull.

JIRA Link

https://issues.redhat.com/browse/PROJQUAY-10703

Backport

Not required; this targets the current development line and depends on the existing TLS security profile integration.

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 17, 2026

Copy link
Copy Markdown

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "tools"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Changes

TLS ECDH curve configuration

Layer / File(s) Summary
TLS profile derivation and override handling
pkg/context/context.go, controllers/quay/tls.go, controllers/quay/tls_test.go
Modern API server TLS profiles derive X25519MLKEM768:X25519:prime256v1; user overrides and non-Modern profiles leave SSLECDHCurves empty.
Generated configuration injection
pkg/kustomize/kustomize.go, pkg/kustomize/kustomize_test.go
SSL_ECDH_CURVES is conditionally rendered in generated config.yaml from the derived curve list.
Modern profile integration validation
test/chainsaw/tls_security_profile/chainsaw-test.yaml
The integration test verifies Modern profiles include SSL_ECDH_CURVES and X25519MLKEM768.

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

Possibly related issues

Possibly related PRs

Suggested reviewers: jbpratt

🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title starts with the required Jira key and accurately summarizes the Modern TLS PQC groups change.
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.
Crd Backward Compatibility ✅ Passed No files under apis/quay/v1 were modified; the PR only changes controller, context, kustomize, and tests.
No Weak Cryptographic Algorithms ✅ Passed Modified code only adds modern TLS supported groups and existing AES-GCM/ChaCha20 suites; no weak algorithms or InsecureSkipVerify found.
No Privileged Containers ✅ Passed No touched manifest or workload template sets privileged, hostPID, hostNetwork, hostIPC, or SYS_ADMIN; only restricted securityContexts are present.
No Sensitive Data In Logs ✅ Passed No new log/print paths expose secret values; the touched TLS code adds no logging, and existing kustomize logs only mention key names or operational status.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci-robot

openshift-ci-robot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@Marcusk19: This pull request references [Jira Issue PROJQUAY-10703](https://redhat.atlassian.net/browse/PROJQUAY-10703), which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Release Pending (Done) instead

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.

Details

In response to this:

Summary

Propagate the post-quantum TLS supported groups required by Quay when the OpenShift cluster TLS security profile is Modern.

Root Cause / Rationale

The operator already propagated TLS versions and ciphers/ciphersuites, but it did not configure Quay nginx's supported groups. Consequently, a Quay image with ML-KEM-capable OpenSSL could still fail an X25519MLKEM768 handshake unless SSL_ECDH_CURVES was manually supplied.

Changes

  • Add SSLECDHCurves to QuayRegistryContext.
  • Map the Modern profile to X25519MLKEM768:X25519:prime256v1.
  • Inject SSL_ECDH_CURVES into generated Quay configuration when not user-specified.
  • Preserve existing user TLS configuration precedence.
  • Extend controller unit coverage for Modern, Intermediate, and user override behavior.
  • Extend the TLS security profile Chainsaw assertion to verify X25519MLKEM768 for Modern.

Test Plan

  • KUBEBUILDER_ASSETS=$PWD/bin/k8s/1.28.0-darwin-arm64 go test ./controllers/quay ./pkg/kustomize ./pkg/context
  • go vet ./controllers/quay ./pkg/kustomize ./pkg/context
  • Existing CRC validation with a Quay image configured for ML-KEM negotiated X25519MLKEM768 and completed authenticated registry push/pull.

JIRA Link

https://issues.redhat.com/browse/PROJQUAY-10703

Backport

Not required; this targets the current development line and depends on the existing TLS security profile integration.

Summary by CodeRabbit

  • New Features
  • Added automatic TLS ECDH curve configuration for Quay based on the OpenShift API server’s TLS security profile.
  • Modern TLS profiles now enable post-quantum-capable curve settings, including X25519MLKEM768.
  • Bug Fixes
  • User-provided SSL_ECDH_CURVES settings are preserved and are not overwritten.
  • Default and non-Modern profiles no longer receive unintended curve configuration.
  • Tests
  • Added coverage validating profile-based TLS settings and user override behavior.

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 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 `@controllers/quay/tls.go`:
- Around line 67-69: Update the user-override guard in the TLS configuration
flow to return early when config["SSL_ECDH_CURVES"] is present, alongside the
existing TLS key checks. Ensure qctx.SSLECDHCurves is not populated from the
APIServer profile when this user override is supplied.

In `@test/chainsaw/tls_security_profile/chainsaw-test.yaml`:
- Around line 89-100: Update the PROFILE_TYPE lookup in the Modern-profile
validation block to fail the test when kubectl cannot read apiserver/cluster,
instead of falling back to an empty value and skipping validation. Preserve the
existing checks for SSL_ECDH_CURVES and X25519MLKEM768 once the profile type is
retrieved.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ada2d4c5-6073-487d-ab8d-695e7d6ee66c

📥 Commits

Reviewing files that changed from the base of the PR and between 855b10b and 5a7dae3.

📒 Files selected for processing (5)
  • controllers/quay/tls.go
  • controllers/quay/tls_test.go
  • pkg/context/context.go
  • pkg/kustomize/kustomize.go
  • test/chainsaw/tls_security_profile/chainsaw-test.yaml

Comment thread controllers/quay/tls.go
Comment thread test/chainsaw/tls_security_profile/chainsaw-test.yaml Outdated
@Marcusk19
Marcusk19 force-pushed the feat/projquay-10703-modern-pqc-curves branch from 5a7dae3 to 67fdae8 Compare July 17, 2026 16:02
@openshift-ci-robot

openshift-ci-robot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@Marcusk19: This pull request references [Jira Issue PROJQUAY-10703](https://redhat.atlassian.net/browse/PROJQUAY-10703), which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Release Pending (Done) instead

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.

Details

In response to this:

Summary

Propagate the post-quantum TLS supported groups required by Quay when the OpenShift cluster TLS security profile is Modern.

Root Cause / Rationale

The operator already propagated TLS versions and ciphers/ciphersuites, but it did not configure Quay nginx's supported groups. Consequently, a Quay image with ML-KEM-capable OpenSSL could still fail an X25519MLKEM768 handshake unless SSL_ECDH_CURVES was manually supplied.

Changes

  • Add SSLECDHCurves to QuayRegistryContext.
  • Map the Modern profile to X25519MLKEM768:X25519:prime256v1.
  • Inject SSL_ECDH_CURVES into generated Quay configuration when not user-specified.
  • Preserve existing user TLS configuration precedence.
  • Extend controller unit coverage for Modern, Intermediate, and user override behavior.
  • Extend the TLS security profile Chainsaw assertion to verify X25519MLKEM768 for Modern.

Test Plan

  • KUBEBUILDER_ASSETS=$PWD/bin/k8s/1.28.0-darwin-arm64 go test ./controllers/quay ./pkg/kustomize ./pkg/context
  • go vet ./controllers/quay ./pkg/kustomize ./pkg/context
  • Existing CRC validation with a Quay image configured for ML-KEM negotiated X25519MLKEM768 and completed authenticated registry push/pull.

JIRA Link

https://issues.redhat.com/browse/PROJQUAY-10703

Backport

Not required; this targets the current development line and depends on the existing TLS security profile integration.

Summary by CodeRabbit

  • New Features

  • Automatically injects SSL_ECDH_CURVES into generated Quay TLS configuration based on the OpenShift API server TLS security profile.

  • For the Modern profile, injects PQC-capable curve settings (including X25519MLKEM768).

  • Bug Fixes

  • Preserves user-provided SSL_ECDH_CURVES (no overriding when already set).

  • Prevents unintended ECDH curve configuration for non-Modern/default profiles.

  • Tests

  • Expanded unit and end-to-end coverage for SSL_ECDH_CURVES injection and user override precedence.

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 17, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@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: 1

🤖 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 `@pkg/kustomize/kustomize_test.go`:
- Around line 961-962: Update the test around Inflate to use require.NoError or
t.Fatalf instead of assert.NoError, so execution stops immediately when Inflate
fails before iterating pieces. Keep the existing successful-path assertions
unchanged.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ca1e8fcc-f902-4a4a-a1b9-102bc8b1ac02

📥 Commits

Reviewing files that changed from the base of the PR and between 5a7dae3 and 67fdae8.

📒 Files selected for processing (6)
  • controllers/quay/tls.go
  • controllers/quay/tls_test.go
  • pkg/context/context.go
  • pkg/kustomize/kustomize.go
  • pkg/kustomize/kustomize_test.go
  • test/chainsaw/tls_security_profile/chainsaw-test.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/chainsaw/tls_security_profile/chainsaw-test.yaml
  • controllers/quay/tls_test.go
  • pkg/kustomize/kustomize.go
  • controllers/quay/tls.go

Comment thread pkg/kustomize/kustomize_test.go Outdated
@openshift-ci-robot

openshift-ci-robot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@Marcusk19: This pull request references [Jira Issue PROJQUAY-10703](https://redhat.atlassian.net/browse/PROJQUAY-10703), which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Release Pending (Done) instead

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.

Details

In response to this:

Summary

Propagate the post-quantum TLS supported groups required by Quay when the OpenShift cluster TLS security profile is Modern.

Root Cause / Rationale

The operator already propagated TLS versions and ciphers/ciphersuites, but it did not configure Quay nginx's supported groups. Consequently, a Quay image with ML-KEM-capable OpenSSL could still fail an X25519MLKEM768 handshake unless SSL_ECDH_CURVES was manually supplied.

Changes

  • Add SSLECDHCurves to QuayRegistryContext.
  • Map the Modern profile to X25519MLKEM768:X25519:prime256v1.
  • Inject SSL_ECDH_CURVES into generated Quay configuration when not user-specified.
  • Preserve existing user TLS configuration precedence.
  • Extend controller unit coverage for Modern, Intermediate, and user override behavior.
  • Extend the TLS security profile Chainsaw assertion to verify X25519MLKEM768 for Modern.

Test Plan

  • KUBEBUILDER_ASSETS=$PWD/bin/k8s/1.28.0-darwin-arm64 go test ./controllers/quay ./pkg/kustomize ./pkg/context
  • go vet ./controllers/quay ./pkg/kustomize ./pkg/context
  • Existing CRC validation with a Quay image configured for ML-KEM negotiated X25519MLKEM768 and completed authenticated registry push/pull.

JIRA Link

https://issues.redhat.com/browse/PROJQUAY-10703

Backport

Not required; this targets the current development line and depends on the existing TLS security profile integration.

Summary by CodeRabbit

  • New Features

  • Derives OpenShift API server ECDH curve settings and injects SSL_ECDH_CURVES into the generated Quay TLS config.

  • For the Modern TLS profile, injects PQC-capable groups (including X25519MLKEM768).

  • Bug Fixes

  • Respects user-provided SSL_ECDH_CURVES in config.yaml without overriding.

  • Avoids populating SSL_ECDH_CURVES for non-Modern/default profiles.

  • Tests

  • Updated unit tests and end-to-end TLS security profile verification for SSL_ECDH_CURVES injection and precedence.

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 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.

🧹 Nitpick comments (1)
pkg/kustomize/kustomize_test.go (1)

956-975: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover renderer-level override precedence.

This test verifies injection only. Add a case where config.yaml already contains SSL_ECDH_CURVES and assert Inflate preserves that value; the controller override test cannot catch a regression in pkg/kustomize/kustomize.go’s independent rendering guard.

🤖 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 `@pkg/kustomize/kustomize_test.go` around lines 956 - 975, The
TestInflateInjectsSSLECDHCurves test only verifies injection and must also cover
renderer-level precedence. Add a case with SSL_ECDH_CURVES already present in
config.yaml, run Inflate, and assert the existing value is preserved rather than
replaced by the context override, targeting the independent rendering guard in
Inflate.
🤖 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.

Nitpick comments:
In `@pkg/kustomize/kustomize_test.go`:
- Around line 956-975: The TestInflateInjectsSSLECDHCurves test only verifies
injection and must also cover renderer-level precedence. Add a case with
SSL_ECDH_CURVES already present in config.yaml, run Inflate, and assert the
existing value is preserved rather than replaced by the context override,
targeting the independent rendering guard in Inflate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3f967879-60c0-4ab7-91e2-bdca86c18487

📥 Commits

Reviewing files that changed from the base of the PR and between 5a7dae3 and ba2e978.

📒 Files selected for processing (6)
  • controllers/quay/tls.go
  • controllers/quay/tls_test.go
  • pkg/context/context.go
  • pkg/kustomize/kustomize.go
  • pkg/kustomize/kustomize_test.go
  • test/chainsaw/tls_security_profile/chainsaw-test.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/kustomize/kustomize.go
  • test/chainsaw/tls_security_profile/chainsaw-test.yaml
  • controllers/quay/tls_test.go
  • pkg/context/context.go

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

Development

Successfully merging this pull request may close these issues.

2 participants