Skip to content

Add TLS scanner for External Secrets Operator - #82876

Open
siddhibhor-56 wants to merge 2 commits into
openshift:mainfrom
siddhibhor-56:tls-scanner
Open

Add TLS scanner for External Secrets Operator#82876
siddhibhor-56 wants to merge 2 commits into
openshift:mainfrom
siddhibhor-56:tls-scanner

Conversation

@siddhibhor-56

@siddhibhor-56 siddhibhor-56 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  • Adds an optional, manually triggered tls-scanner presubmit for openshift/external-secrets-operator on master.
  • The job provisions an AWS cluster, installs the external-secrets-operator bundle, deploys the ExternalSecretsConfig operand (controller, webhook, cert-controller), enables TLS 1.3 strict adherence (StrictAllComponents), exercises the webhook admission path via a dummy SecretStore/ExternalSecret, generates self-signed TLS certificates and enables the Bitwarden SDK server plugin, and runs tls-scanner-run against the external-secrets-operator and external-secrets namespaces.
  • Pattern follows STOR-3001: Add TLS scanner job to csi-operator for SMB #82657.

Summary by CodeRabbit

Adds an optional, manually triggered AWS TLS scanner presubmit for openshift/external-secrets-operator on master.

The workflow installs the operator, deploys operands, verifies webhook services, creates test resources, configures TLS materials and the Bitwarden plugin, and runs tls-scanner-run against relevant namespaces.

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: d3d85297-f23b-4543-ac66-b2aa9e5e87ea

📥 Commits

Reviewing files that changed from the base of the PR and between f85f4e1 and 561d99f.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift/external-secrets-operator/openshift-external-secrets-operator-main-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml

Walkthrough

The configuration adds base images and an optional AWS workflow. The workflow deploys the External Secrets operator, validates resource reconciliation, creates TLS materials, enables the Bitwarden plugin, and runs TLS 1.3 checks.

Changes

External Secrets TLS validation

Layer / File(s) Summary
Scanner workflow foundation
ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml
The configuration adds cli-operator-sdk and tls-scanner-tool base images. It defines AWS workflow settings, operator bundle dependencies, scanner limits, and TLS 1.3 configuration.
Operand deployment and reconciliation
ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml
The workflow deploys the operator and operands, checks readiness, discovers the webhook service, creates SecretStore and ExternalSecret resources, and waits for successful reconciliation.
TLS material, plugin, and scanner execution
ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml
The workflow generates certificates, creates the TLS secret, enables the Bitwarden plugin, verifies readiness, lists TLS-relevant services, and runs the TLS scanner.

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

Possibly related PRs

Suggested reviewers: swghosh, trilokgeer

Sequence Diagram(s)

sequenceDiagram
  participant AWSWorkflow
  participant OperatorSDK
  participant ExternalSecretsOperator
  participant SecretStore
  participant ExternalSecret
  participant BitwardenPlugin
  participant TLSScannerTool
  AWSWorkflow->>OperatorSDK: Install operator and deploy operands
  OperatorSDK->>ExternalSecretsOperator: Start operator components
  AWSWorkflow->>SecretStore: Create test SecretStore
  AWSWorkflow->>ExternalSecret: Create test ExternalSecret
  ExternalSecret->>ExternalSecretsOperator: Reconcile test resource
  ExternalSecretsOperator-->>AWSWorkflow: Report successful reconciliation
  AWSWorkflow->>ExternalSecretsOperator: Create TLS secret and enable Bitwarden plugin
  ExternalSecretsOperator->>BitwardenPlugin: Roll out Bitwarden SDK server
  AWSWorkflow->>TLSScannerTool: Scan TLS-relevant services with TLS 1.3
Loading

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Container-Privileges ❌ Error The new job invokes tls-scanner-run without TLS_SCANNER_CLUSTER_LABEL=management; its default path generates a Pod with privileged: true, hostNetwork: true, hostPID: true, and runAsUser: 0. Use a restricted scanner mode that sets privileged, hostNetwork, and hostPID to false and runs non-root, or document and isolate the required host privileges.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a TLS scanner for the External Secrets Operator.
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 The patch changes only CI YAML. Its test and step names, including tls-scanner and deploy-operand, are static; no Ginkgo title declarations or dynamic test titles were added.
Test Structure And Quality ✅ Passed The PR changes only one CI YAML file with shell commands; it adds no Ginkgo test code, It blocks, or Eventually/Consistently calls for this check to assess.
Microshift Test Compatibility ✅ Passed The pull request changes only CI YAML and shell commands; it adds no Ginkgo e2e tests using It, Describe, Context, or When.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit changes only CI YAML and adds shell commands; it adds no Ginkgo It/Describe/Context/When tests, so the SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The change adds only an optional CI workflow and CR/test commands; the YAML contains no affinity, topology spread, replica, node selector, toleration, or PDB scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only CI YAML and shell commands; no OTE binary entry points or process-level Go stdout writes are added. The scanner runs as a separate tls-scanner pod.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo tests were added. The workflow uses cluster-local service names and internal image streams; its TLS SAN includes both 127.0.0.1 and ::1, with no public URLs or external hosts.
No-Weak-Crypto ✅ Passed The changed workflow uses EC prime256v1 and SHA-256 only; the diff contains no MD5/SHA-1, DES/3DES, RC4, Blowfish, ECB, custom crypto, or secret/token comparisons.
No-Sensitive-Data-In-Logs ✅ Passed The job creates test TLS keys locally, passes only file paths and a secret name to oc, suppresses OpenSSL errors, and logs statuses and service metadata without credentials or secret contents.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from TrilokGeer and swghosh August 4, 2026 10:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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
`@ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml`:
- Around line 314-325: Update the webhook verification block around WEBHOOK_SVC
and WEBHOOK_NS to fail with a nonzero status when the
ValidatingWebhookConfiguration, service, or endpoints cannot be discovered or
verified, instead of suppressing errors with true. Also update the
reconciliation readiness check around the Ready condition to fail when Ready
never becomes True, ensuring tls-scanner-run cannot succeed without exercising
both webhook and controller TLS paths.
🪄 Autofix

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e068a18f-62ee-4e95-ab29-70cb421ae1e9

📥 Commits

Reviewing files that changed from the base of the PR and between db82109 and 2f6ca1f.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift/external-secrets-operator/openshift-external-secrets-operator-main-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml

Comment on lines +314 to +325
echo "Verifying webhook TLS endpoint is live..."
WEBHOOK_SVC=$(oc get validatingwebhookconfigurations -l app=external-secrets -o jsonpath='{.items[0].webhooks[0].clientConfig.service.name}' 2>/dev/null || true)
WEBHOOK_NS=$(oc get validatingwebhookconfigurations -l app=external-secrets -o jsonpath='{.items[0].webhooks[0].clientConfig.service.namespace}' 2>/dev/null || true)
if [[ -n "${WEBHOOK_SVC}" && -n "${WEBHOOK_NS}" ]]; then
WEBHOOK_PORT=$(oc get validatingwebhookconfigurations -l app=external-secrets -o jsonpath='{.items[0].webhooks[0].clientConfig.service.port}' 2>/dev/null || echo "443")
echo "Found webhook service: ${WEBHOOK_NS}/${WEBHOOK_SVC}:${WEBHOOK_PORT}"
oc get svc -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}" || true
oc get endpoints -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}" || true
else
echo "Warning: could not discover ValidatingWebhookConfiguration with label app=external-secrets"
oc get validatingwebhookconfigurations -o name || true
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fail when the TLS paths are not exercised.

The webhook checks ignore missing configuration, services, and endpoints. The reconciliation loop also exits successfully when Ready never becomes True.

The workflow can therefore run tls-scanner-run and pass without proving that the webhook and controller TLS paths were exercised. Return a nonzero status when either verification fails.

Proposed failure checks
         if [[ -n "${WEBHOOK_SVC}" && -n "${WEBHOOK_NS}" ]]; then
           WEBHOOK_PORT=$(oc get validatingwebhookconfigurations -l app=external-secrets -o jsonpath='{.items[0].webhooks[0].clientConfig.service.port}' 2>/dev/null || echo "443")
           echo "Found webhook service: ${WEBHOOK_NS}/${WEBHOOK_SVC}:${WEBHOOK_PORT}"
-          oc get svc -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}" || true
-          oc get endpoints -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}" || true
+          oc get svc -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}"
+          ENDPOINT_IPS=$(oc get endpoints -n "${WEBHOOK_NS}" "${WEBHOOK_SVC}" -o jsonpath='{.subsets[*].addresses[*].ip}')
+          [[ -n "${ENDPOINT_IPS}" ]] || {
+            echo "Webhook service has no ready endpoints" >&2
+            exit 1
+          }
         else
-          echo "Warning: could not discover ValidatingWebhookConfiguration with label app=external-secrets"
+          echo "Could not discover ValidatingWebhookConfiguration with label app=external-secrets" >&2
           oc get validatingwebhookconfigurations -o name || true
+          exit 1
         fi
...
         done
+        if [[ "${STATUS}" != "True" ]]; then
+          oc describe externalsecret tls-scan-dummy -n tls-scanner-exercise || true
+          exit 1
+        fi

Also applies to: 363-372

🤖 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
`@ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml`
around lines 314 - 325, Update the webhook verification block around WEBHOOK_SVC
and WEBHOOK_NS to fail with a nonzero status when the
ValidatingWebhookConfiguration, service, or endpoints cannot be discovered or
verified, instead of suppressing errors with true. Also update the
reconciliation readiness check around the Ready condition to fail when Ready
never becomes True, ensuring tls-scanner-run cannot succeed without exercising
both webhook and controller TLS paths.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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
`@ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml`:
- Around line 258-260: The tls-scanner job has been added to the configuration
in the openshift-external-secrets-operator-main.yaml file (with as:
tls-scanner), but the corresponding generated Prow job artifacts and metadata
have not been created. Run make update in the repository root to generate the
Prow job configurations for the tls-scanner job, then commit all generated files
and configuration changes together. Without these generated artifacts, Prow
cannot properly register the optional job after merge.
🪄 Autofix

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: fbb3f5c2-2dfc-4e7e-b204-a2f43f400365

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6ca1f and 8874ee8.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift/external-secrets-operator/openshift-external-secrets-operator-main-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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
`@ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml`:
- Around line 415-425: Update the oc patch payload in the Bitwarden plugin
configuration so TLS_SECRET_NAME is expanded by the shell before the request is
sent, while preserving valid JSON quoting and the existing secretRef structure.
Ensure ExternalSecretsConfig receives the actual secret name, such as
bitwarden-tls-cert, rather than the literal placeholder.
🪄 Autofix

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 6276b220-9133-4e5e-ae65-59c64c117da9

📥 Commits

Reviewing files that changed from the base of the PR and between bfc1292 and ce7436c.

📒 Files selected for processing (1)
  • ci-operator/config/openshift/external-secrets-operator/openshift-external-secrets-operator-main.yaml

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/retest

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse pull-ci-openshift-external-secrets-operator-main-e2e-operator-coverage
/pj-rehearse pull-ci-openshift-external-secrets-operator-main-tls-scanner
/pj-rehearse pull-ci-openshift-external-secrets-operator-main-e2e-operator

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: requesting more than one rehearsal in one comment is not supported. If you would like to rehearse multiple specific jobs, please separate the job names by a space in a single command.

1 similar comment
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: requesting more than one rehearsal in one comment is not supported. If you would like to rehearse multiple specific jobs, please separate the job names by a space in a single command.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@siddhibhor-56: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-external-secrets-operator-main-tls-scanner openshift/external-secrets-operator presubmit Presubmit changed
pull-ci-openshift-external-secrets-operator-main-ci-bundle-external-secrets-operator-bundle openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-e2e-operator openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-e2e-operator-coverage openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-fips-image-scan-external-secrets openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-fips-image-scan-operator openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-images openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-unit openshift/external-secrets-operator presubmit Ci-operator config changed
pull-ci-openshift-external-secrets-operator-main-verify openshift/external-secrets-operator presubmit Ci-operator config changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@siddhibhor-56: The following test 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/rehearse/openshift/external-secrets-operator/main/tls-scanner 561d99f link unknown /pj-rehearse pull-ci-openshift-external-secrets-operator-main-tls-scanner

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.

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/pj-rehearse pull-ci-openshift-external-secrets-operator-main-tls-scanner

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@siddhibhor-56: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

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