Skip to content

Added penetration tests important to Telco partners/customers#31283

Open
yogeshahiray wants to merge 11 commits into
openshift:mainfrom
yogeshahiray:penetration-tests
Open

Added penetration tests important to Telco partners/customers#31283
yogeshahiray wants to merge 11 commits into
openshift:mainfrom
yogeshahiray:penetration-tests

Conversation

@yogeshahiray

@yogeshahiray yogeshahiray commented Jun 11, 2026

Copy link
Copy Markdown

Added penetration tests which are very important to Telco partners/customers.

Summary by CodeRabbit

  • New Features
    • Added node e2e coverage validating probe-level terminationGracePeriodSeconds behavior (with pod-level fallback), with MicroShift test skipping.
  • Bug Fixes
    • Improved image mapping output for “new” mirror entries by merging and deduplicating against existing entries.
    • Updated event matching logic to align with newer upstream pod naming.
  • Tests
    • Added an expanded security penetration test suite covering plaintext exposure, SELinux labeling, privileged workload detection, etcd/TLS and permission checks, monitoring posture, and registry/database risk signals.
    • Temporarily disabled the OS version validation test and extended namespace wait timing.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci Bot added ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 11, 2026
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Hi @yogeshahiray. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Walkthrough

Adds a comprehensive security penetration test suite with 13 security checks (credential scanning, CNI/SELinux validation, privilege/permission audits, operator/monitoring health, and risk inventories), introduces probe-level termination grace period testing with event timing validation, and includes utility refactorings for image mirror deduplication and event pattern matching.

Changes

Security Penetration Test Suite

Layer / File(s) Summary
Test Suite Structure and Entrypoints
test/extended/security/penetration.go
Bare-metal gated Ginkgo test suite with conditional platform heuristics (SNO when NonePlatformType), test cases orchestrating each security check, and infrastructure to skip master-node checks on HyperShift/MicroShift.
Plaintext Credential Exposure Scanning
test/extended/security/penetration.go
Collects password values from kubeadmin and openshift-machine-api password Secrets, then runs oc debug + grep across node log paths and selected YAML/config locations; scanning skips when no passwords are collected.
CNI Directory Discovery and SELinux Validation
test/extended/security/penetration.go
Discovers CNI directory under /opt/cni or /usr/libexec/cni via debug shell and verifies SELinux context output contains required bin_t and system_u attributes across nodes.
Secret and Privileged Pod Scanning
test/extended/security/penetration.go
Counts SSH-private-key-like data keys across all Secrets and identifies privileged pods in non-system namespaces by inspecting securityContext.privileged across containers, init containers, and ephemeral containers with namespace filtering.
Per-Node Sudoers and Etcd Hardening Checks
test/extended/security/penetration.go
Lists /etc/sudoers.d/ entries on each node via oc debug, filters benign debug artifacts, verifies APIServer etcd encryption-at-rest is not identity, and finds world-readable critical etcd/backup files on master nodes via find.
Route TLS Enforcement and Etcd Permissions
test/extended/security/penetration.go
Counts Routes without TLS enforcement, validates /var/lib/etcd directory permissions with depth-limited find and known-benign exclusions, and verifies etcds/cluster resource contains TLS indicators in observed config and spec fields.
Security Tooling and Monitoring Validation
test/extended/security/penetration.go
Locates security operators via CSV name substrings, reads and logs audit log profile, ensures monitoring pods are only Running or Succeeded, and requires at least one PrometheusRule in the monitoring API group.
Risk Inventory and Registry Posture Checks
test/extended/security/penetration.go
Counts database-like pods by image substring, cluster-admin ServiceAccount bindings (excluding known-good accounts), and NFS-backed PersistentVolumes; fails if config/v1 image configuration lists insecureRegistries and logs external image-registry Route existence.

Probe-Level Termination Grace Period Testing

Layer / File(s) Summary
Probe Termination Test Cases and Event Helpers
test/extended/node/node_e2e/probe_termination.go, test/extended/node/README.md
Ginkgo test cases validating liveness-probe, startup-probe, and fallback termination grace period behavior with event-selection helpers that isolate "Killing" and "Started" events by reason and timestamp filtering; MicroShift skipping included.
Event-Based Termination Timing Verification
test/extended/node/node_e2e/probe_termination.go, test/extended/node/node_utils.go
verifyProbeTermination polls Kubernetes Events API, collects killing and started events, and asserts the computed time difference matches expected grace period within asymmetric tolerance; CalculateEventTimeDiff utility prefers LastTimestamp and falls back to FirstTimestamp for event time computation.

Utility and Configuration Updates

Layer / File(s) Summary
Image Mirror Injection and Deduplication
pkg/cmd/openshift-tests/images/images_command.go
NewImagesCommand passes existing mirror mappings to injectNewImages, which now deduplicates injected entries against already-present target references and formats output consistently for both mirrored and non-mirrored modes using computed dest (ref.Exact():<mirrorTag>).
ImageVolumeAlreadyPresent Event Pattern Regex
pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go
Widens pod name locator regex from capi-operator-* to `^capi-(operator
Test Skips and Polling Timeout Adjustments
test/extended/ci/job_names.go, test/extended/internalreleaseimage/helper.go
Temporarily disables the "should match os version" test with MCO-2371 TODO; increases namespace annotation polling timeout from 30s to 60s in CreateSimpleNamespace.
Image Allowlist and OWNERS
test/extended/util/image/image.go, test/extended/util/image/OWNERS
Adds Minio image (quay.io/minio/minio:RELEASE.2025-09-07T16-13-09Z) to allowedImages for cluster-image-registry-operator e2e testing; updates reviewers/approvers in image utility OWNERS file.

Sequence Diagram(s)

sequenceDiagram
  participant PenetrationSuite as Penetration Test Suite
  participant OcDebug as oc debug
  participant Node as Node Filesystem
  participant APIServer as Kubernetes API
  participant SecretStore as Secrets API
  
  PenetrationSuite->>SecretStore: Collect passwords from kubeadmin & openshift-machine-api
  SecretStore-->>PenetrationSuite: Password values
  PenetrationSuite->>OcDebug: Start debug pod on node
  OcDebug->>Node: chroot to root, grep logs/configs
  Node-->>OcDebug: Grep results
  OcDebug-->>PenetrationSuite: Plaintext findings
  PenetrationSuite->>APIServer: Query Routes, etcd config, Secrets
  APIServer-->>PenetrationSuite: TLS, privileges, registries
  PenetrationSuite->>OcDebug: Inspect sudoers, etcd permissions
  OcDebug->>Node: find/ls commands
  Node-->>OcDebug: File results
  OcDebug-->>PenetrationSuite: Hardening violations
Loading
sequenceDiagram
  participant ProbeTest as Probe Termination Test
  participant TestPod as Pod with Probe
  participant EventAPI as Events API
  participant KubeletLifecycle as Kubelet Lifecycle
  
  ProbeTest->>TestPod: Create pod with probe-level terminationGracePeriodSeconds
  TestPod->>KubeletLifecycle: Probe fails (liveness/startup)
  KubeletLifecycle->>EventAPI: Record "Killing" event at timestamp T1
  KubeletLifecycle->>EventAPI: Record "Started" event at timestamp T2
  ProbeTest->>EventAPI: Poll for Killing event (reason: "Killing")
  EventAPI-->>ProbeTest: Killing event @ T1
  ProbeTest->>EventAPI: Poll for Started event (after T1)
  EventAPI-->>ProbeTest: Started event @ T2
  ProbeTest->>ProbeTest: Calculate T2 - T1, assert within tolerance
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • openshift/origin#31241: Adds the same Minio image entry to test/extended/util/image/image.go for cluster-image-registry-operator e2e tests.
  • openshift/origin#31275: Increases the namespace SCC uid-range annotation polling timeout from 30s to 60s in test/extended/internalreleaseimage/helper.go.
  • openshift/origin#31279: Updates the same test/extended/util/image/OWNERS file by replacing the same approvers/reviewers (soltysh, tkashemjacobsee, jubittajohn).

Suggested labels

lgtm, verified, e2e-images-update, verified-later

Suggested reviewers

  • sjenning
  • p0lyn0mial
🚥 Pre-merge checks | ✅ 12 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 59.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Tests have multiple quality issues: (1) Missing meaningful assertion messages on lines 135 & 174 in penetration.go; (2) CalculateEventTimeDiff missing EventTime fallback causes zero-duration bugs;... Add messages to assertions at penetration.go:135,174; add EventTime fallback to CalculateEventTimeDiff & event filtering functions; scope job_names.go skip to only RHEL-10 switchover variants.
Microshift Test Compatibility ⚠️ Warning TestMonitoringStackHealthy in penetration.go uses monitoring.coreos.com API and openshift-monitoring namespace (unavailable on MicroShift) but lacks [apigroup:monitoring.coreos.com] tag or MicroShi... Add [apigroup:monitoring.coreos.com] tag to TestMonitoringStackHealthy test name, or add runtime check: if isMicroShift { g.Skip(...) } before using PrometheusRules API.
✅ Passed checks (12 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 primary change: adding penetration tests for Telco partners/customers, which directly matches the main addition of a comprehensive security penetration test suite in test/extended/security/penetration.go alongside supporting changes.
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 All 18 test cases (15 in penetration.go, 3 in probe_termination.go) use stable, deterministic test names as static string literals with no dynamic values, timestamps, pod names, node names, UUIDs,...
Single Node Openshift (Sno) Test Compatibility ✅ Passed Both new test suites are SNO-compatible. penetration.go has explicit SNO baremetal detection logic. probe_termination.go creates single pods without multi-node or topology assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only test code, utilities, and test infrastructure without deployment manifests, operator code, or controllers. No topology-unaware scheduling constraints detected.
Ote Binary Stdout Contract ✅ Passed No OTE Binary Stdout Contract violations found. New test files (penetration.go, probe_termination.go) use only Ginkgo g.By() which writes to GinkgoWriter. images_command.go's fmt.Fprintln only exec...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed New tests (penetration.go, probe_termination.go) use only cluster-internal APIs and oc debug for node inspection. No IPv4 assumptions, external registries, or network connectivity to public service...
No-Weak-Crypto ✅ Passed No weak cryptography detected. PR contains no MD5, SHA1, DES, RC4, 3DES, Blowfish, or ECB usage. No insecure token/secret comparisons or custom crypto implementations found. Only SHA256 used approp...
Container-Privileges ✅ Passed The PR contains no privileged container definitions (privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation: true). The penetration.go test file DETECTS such security...
No-Sensitive-Data-In-Logs ✅ Passed The penetration test code carefully collects passwords only to search for them internally; test output includes only node names, password indices, and file paths—never actual passwords. Other sensi...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot requested review from p0lyn0mial and sjenning June 11, 2026 03:15

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

🧹 Nitpick comments (1)
test/extended/security/penetration.go (1)

282-286: 💤 Low value

Consider making the regex more specific.

The pattern drwxr[A-Za-z0-9\s\.\-]+(/usr/[a-z0-9/]+) is quite permissive in the first part. While the captured path group [a-z0-9/]+ safely prevents injection, the leading pattern could match unintended output. Consider making it more specific to match only expected ls -ld permission strings.

📝 Example of more specific pattern
-	re := regexp.MustCompile(`drwxr[A-Za-z0-9\s\.\-]+(/usr/[a-z0-9/]+)`)
+	// Match: drwxr-xr-x. <number> <user> <group> ... /usr/...
+	re := regexp.MustCompile(`^drwxr-?x?r-?x?[.-]\s+\d+\s+\S+\s+\S+\s+.*?(/usr/libexec/cni|/opt/cni)`)

This more precisely matches the ls -ld output format and explicitly looks for the expected CNI paths.

🤖 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 `@test/extended/security/penetration.go` around lines 282 - 286, The current
regex assigned to re is too permissive; narrow it to match a precise ls -ld
permission line and restrict the captured path to expected CNI locations. Update
the pattern used by re (the string `drwxr[A-Za-z0-9\s\.\-]+(/usr/[a-z0-9/]+)`)
to explicitly match permission bits (e.g., ^d[rwx-]{9}), whitespace-separated
columns (inode/owner/group/size/date), then capture only known /usr subpaths
(for example /usr/bin, /usr/lib, /usr/libexec, etc.) with a conservative
character class for the path; keep the code flow using matches :=
re.FindStringSubmatch(output) and the existing conditional that returns
matches[1] when present.
🤖 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 `@test/extended/security/penetration.go`:
- Around line 234-236: The testPasswords slice is empty so the YAML-password
scanning never runs; populate testPasswords with actual values (either load from
the cluster configuration or supply a sensible default list of common/test
passwords) and reuse it in the YAML check function (the slice named
testPasswords used in the YAML scan) and in checkLogsForPasswords so both checks
operate on the same non-empty password list; update the code that builds
testPasswords and ensure both the YAML scanner and checkLogsForPasswords
reference that populated slice.
- Around line 192-194: The test currently defines an empty slice testPasswords
which prevents the nested verification loops in the penetration test from
running; either populate testPasswords with representative password strings used
in the cluster (e.g., common service/account passwords or test fixtures) so the
loops in the test exercise log-scanning, or explicitly skip the test when it’s
not configured by calling e2eskipper.Skipf (or the existing skip helper) early
in the test; update the code paths around testPasswords and the test function in
test/extended/security/penetration.go (the loops that scan logs) to use the
populated slice or to return after Skipf so the test no longer silently passes.
- Around line 627-643: The current verifyEtcdUsesTLS logic inspects etcd.Object
by converting spec and status maps to strings (fmt.Sprintf("%v", spec/status))
and substring-searching for "cert"/"tls", which is fragile; replace this with
structured checks: retrieve spec and status via unstructured.NestedMap (as you
already do), then explicitly inspect known TLS-related keys (e.g., spec["tls"],
spec["clientTLS"], spec["serverTLS"], spec["peerTLS"], spec["backup"] or the
etcd-operator fields like "tls", "tlsClientConfig", "certFile", "keyFile",
"caFile") and iterate nested maps/slices to detect boolean flags or presence of
certificate file fields; update verifyEtcdUsesTLS to return true only when those
concrete fields exist/are enabled rather than on loose substring matches of
fmt.Sprintf output.
- Line 54: Before calling findCNIPath(oc, nodes.Items[0].Name) add a defensive
check that nodes.Items is non-empty; if len(nodes.Items) == 0, handle the case
(return an error from the surrounding test function or log and fail the test)
instead of indexing [0]. Locate the call to findCNIPath and the variable nodes
in the same test function in test/extended/security/penetration.go and add the
guard so the code never dereferences nodes.Items[0] when the node list is empty.
- Around line 247-253: The code builds a shell command via fmt.Sprintf("grep -nl
'%s' %s") (cmd) and then runs it through "/bin/bash -c", which allows command
injection; change the call in this block so you do not invoke a shell or
interpolate pwd into a single-quoted string. Replace the Sprintf/"/bin/bash -c"
approach by passing grep and its arguments directly to
oc.AsAdmin().Run("debug").Args (e.g., use "/bin/grep", "-nl", pwd, yamlPath) so
pwd and yamlPath are separate Args instead of being concatenated into cmd;
update the code around the cmd variable and the oc.AsAdmin().Run("debug").Args
invocation to use these explicit args.
- Around line 91-92: The shared ctx := context.Background() declared at the
Describe-level is reused across multiple It test cases (the It blocks such as
"TestEtcdBackupEncryptionAndRestriction
[apigroup:config.openshift.io][apigroup:operator.openshift.io]" and the
subsequent It blocks) which breaks test isolation; remove the top-level ctx
declaration and instead add a fresh ctx := context.Background() as the first
statement inside each It block that currently references ctx (all It blocks
between lines 92-181), ensuring each test case obtains its own context.
- Around line 211-217: The grep command is vulnerable to shell injection because
pwd is interpolated into a bash -c string; update the
oc.AsAdmin().Run("debug").Args(...).Output() invocation that builds cmd so it
does not pass an interpolated shell string. Fix by invoking grep without using
"/bin/bash -c" and pass the pattern and logPath as separate arguments (use pwd
and logPath as raw args), or if shell usage is unavoidable, escape/quote pwd
with a robust shell-escaping utility (e.g., use a library that safely quotes
shell arguments) before formatting into the command; ensure the change targets
the code building cmd and the oc.AsAdmin().Run(...).Args call that executes it.

---

Nitpick comments:
In `@test/extended/security/penetration.go`:
- Around line 282-286: The current regex assigned to re is too permissive;
narrow it to match a precise ls -ld permission line and restrict the captured
path to expected CNI locations. Update the pattern used by re (the string
`drwxr[A-Za-z0-9\s\.\-]+(/usr/[a-z0-9/]+)`) to explicitly match permission bits
(e.g., ^d[rwx-]{9}), whitespace-separated columns (inode/owner/group/size/date),
then capture only known /usr subpaths (for example /usr/bin, /usr/lib,
/usr/libexec, etc.) with a conservative character class for the path; keep the
code flow using matches := re.FindStringSubmatch(output) and the existing
conditional that returns matches[1] when present.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7cc44443-f610-468e-a69f-5d3eae92b3dc

📥 Commits

Reviewing files that changed from the base of the PR and between af43b92 and c234f4c.

📒 Files selected for processing (1)
  • test/extended/security/penetration.go

Comment thread test/extended/security/penetration.go
Comment thread test/extended/security/penetration.go Outdated
Comment thread test/extended/security/penetration.go Outdated
Comment thread test/extended/security/penetration.go Outdated
Comment thread test/extended/security/penetration.go Outdated
Comment thread test/extended/security/penetration.go Outdated
Comment thread test/extended/security/penetration.go Outdated
@neisw

neisw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/test e2e-aws-ovn-microshift

@neisw

neisw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@neisw: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/39651d60-6590-11f1-8635-10ef9a19d878-0

Comment thread test/extended/security/penetration.go

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
test/extended/security/penetration.go (5)

124-131: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Sampling only masterNodes.Items[0] leaves master-local etcd permission issues undetected.

Both specs validate a single control-plane node, but backup artifacts and /var/lib/etcd permissions can drift per node. If the first master is clean and another is not, these tests still pass. Iterate over all listed masters before asserting success.

Also applies to: 157-164

🤖 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 `@test/extended/security/penetration.go` around lines 124 - 131, The test only
checks masterNodes.Items[0] which can miss per-node etcd permission issues;
update the code that calls findWorldReadableCriticalEtcdFiles(oc,
masterNodes.Items[0].Name) to iterate over all masterNodes.Items, call
findWorldReadableCriticalEtcdFiles for each node (using
masterNodes.Items[i].Name), collect/merge any returned critical files, and
assert the aggregated result is empty (or assert per-node emptiness) using the
existing o.Expect checks; apply the same iteration/fix to the duplicate check
that uses findWorldReadableCriticalEtcdFiles later in the file.

328-350: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

findCNIPath can skip valid nodes and can never correctly return /opt/cni.

ls -ld /opt/cni /usr/libexec/cni exits non-zero when either path is missing, so a node with only one valid CNI location hits Line 336 and the test skips. Even when parsing succeeds, the regex only matches /usr/..., and the fallback hardcodes /usr/libexec/cni, so /opt/cni is effectively unreachable. Probe each candidate independently and return the one that actually exists.


252-279: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Literal *.log / *.yaml arguments mean most of these grep scans never touch real files.

Passing /var/log/containers/*.log or /etc/kubernetes/manifests/*.yaml as raw args to /bin/grep does not expand the glob, so grep sees a literal filename and returns an error. The current err == nil gate then treats that execution failure as “nothing found”, which is another false-clean result. Enumerate matching files first and search them with literal matching (grep -F --), rather than handing wildcard patterns straight to grep.

Also applies to: 298-319

🤖 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 `@test/extended/security/penetration.go` around lines 252 - 279, The grep calls
loop over logPaths (e.g., "/var/log/containers/*.log") with
oc.AsAdmin().Run("debug") but pass unexpanded globs to /bin/grep, so grep sees
literal filenames and errors are treated as "not found"; fix by enumerating
matching files on the node before grepping (e.g., run a safe listing like ls -1
or find via oc debug for each pattern), then invoke /bin/grep -F -- <pwd>
<eachFoundFile> (literal matching and explicit file args) and append to
foundPasswords only when grep succeeds; apply the same change to the similar
block referenced at 298-319.

466-475: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

A node that cannot be inspected is currently treated as “no unexpected sudoers files”.

continue on the debug-command error drops that node from the result set, so this spec can pass even when one of the nodes was never checked. Surface the error, or at least record the node as an inspection failure instead of silently skipping it. As per coding guidelines, Go code should never ignore error returns.

🤖 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 `@test/extended/security/penetration.go` around lines 466 - 475, The code
currently ignores errors from oc.AsAdmin().Run("debug").Args(...).Output() (the
block using node.Name and cmd) by doing if err != nil { continue }, which
silently skips nodes; fix this by surfacing the error or recording the node as
an inspection failure instead of continuing. Replace the continue with error
handling that logs or returns the error (include node.Name and err in the
message) or append node.Name to a failures slice (e.g., failedNodes) so the spec
can fail or assert on failedNodes after the loop; ensure you handle the Output()
error from oc.AsAdmin().Run("debug").Args(...) rather than ignoring it.

Source: Coding guidelines


447-455: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Privileged init and ephemeral containers bypass this check.

This only inspects pod.Spec.Containers. A privileged initContainer or ephemeralContainer is just as relevant for a penetration test and will currently be missed, so the spec can pass while a namespace still runs privileged workload.

🤖 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 `@test/extended/security/penetration.go` around lines 447 - 455, The current
check only iterates pod.Spec.Containers and misses privileged init or ephemeral
containers; update the logic that builds privilegedPods to also iterate
pod.Spec.InitContainers and pod.Spec.EphemeralContainers and perform the same
nil and *SecurityContext.Privileged checks for each element, appending
fmt.Sprintf("%s/%s", pod.Namespace, pod.Name) to privilegedPods and breaking
once any privileged container (regular, init, or ephemeral) is found; ensure you
reference the same variable names (pod, privilegedPods) and mirror the existing
condition used for pod.Spec.Containers.
♻️ Duplicate comments (1)
test/extended/security/penetration.go (1)

243-249: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

These plaintext-password tests still pass without scanning anything.

Both helpers return an empty result when testPasswords is empty, and the callers assert that emptiness as success. That makes the suite report a clean result even though no password exposure check ran. Either load real inputs or explicitly Skipf/fail the spec until the source of passwords exists.

Also applies to: 289-295

🤖 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 `@test/extended/security/penetration.go` around lines 243 - 249, The
plaintext-password check currently treats an empty testPasswords slice as a
successful pass; update the logic in the penetration test to not silently
succeed when no inputs exist: in the block where testPasswords is declared and
where the helper returns early (the code around the testPasswords variable and
the function that returns foundPasswords), if testPasswords is empty call
t.Skipf (or t.Fatalf if you prefer a hard failure) with an explanatory message
indicating passwords are not configured, or load real test inputs from cluster
config; apply the same change to the similar block around lines 289-295 so the
spec is skipped/failed instead of passing when no passwords are provided,
referencing the testPasswords variable and the helper that returns
foundPasswords.
🤖 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.

Outside diff comments:
In `@test/extended/security/penetration.go`:
- Around line 124-131: The test only checks masterNodes.Items[0] which can miss
per-node etcd permission issues; update the code that calls
findWorldReadableCriticalEtcdFiles(oc, masterNodes.Items[0].Name) to iterate
over all masterNodes.Items, call findWorldReadableCriticalEtcdFiles for each
node (using masterNodes.Items[i].Name), collect/merge any returned critical
files, and assert the aggregated result is empty (or assert per-node emptiness)
using the existing o.Expect checks; apply the same iteration/fix to the
duplicate check that uses findWorldReadableCriticalEtcdFiles later in the file.
- Around line 252-279: The grep calls loop over logPaths (e.g.,
"/var/log/containers/*.log") with oc.AsAdmin().Run("debug") but pass unexpanded
globs to /bin/grep, so grep sees literal filenames and errors are treated as
"not found"; fix by enumerating matching files on the node before grepping
(e.g., run a safe listing like ls -1 or find via oc debug for each pattern),
then invoke /bin/grep -F -- <pwd> <eachFoundFile> (literal matching and explicit
file args) and append to foundPasswords only when grep succeeds; apply the same
change to the similar block referenced at 298-319.
- Around line 466-475: The code currently ignores errors from
oc.AsAdmin().Run("debug").Args(...).Output() (the block using node.Name and cmd)
by doing if err != nil { continue }, which silently skips nodes; fix this by
surfacing the error or recording the node as an inspection failure instead of
continuing. Replace the continue with error handling that logs or returns the
error (include node.Name and err in the message) or append node.Name to a
failures slice (e.g., failedNodes) so the spec can fail or assert on failedNodes
after the loop; ensure you handle the Output() error from
oc.AsAdmin().Run("debug").Args(...) rather than ignoring it.
- Around line 447-455: The current check only iterates pod.Spec.Containers and
misses privileged init or ephemeral containers; update the logic that builds
privilegedPods to also iterate pod.Spec.InitContainers and
pod.Spec.EphemeralContainers and perform the same nil and
*SecurityContext.Privileged checks for each element, appending
fmt.Sprintf("%s/%s", pod.Namespace, pod.Name) to privilegedPods and breaking
once any privileged container (regular, init, or ephemeral) is found; ensure you
reference the same variable names (pod, privilegedPods) and mirror the existing
condition used for pod.Spec.Containers.

---

Duplicate comments:
In `@test/extended/security/penetration.go`:
- Around line 243-249: The plaintext-password check currently treats an empty
testPasswords slice as a successful pass; update the logic in the penetration
test to not silently succeed when no inputs exist: in the block where
testPasswords is declared and where the helper returns early (the code around
the testPasswords variable and the function that returns foundPasswords), if
testPasswords is empty call t.Skipf (or t.Fatalf if you prefer a hard failure)
with an explanatory message indicating passwords are not configured, or load
real test inputs from cluster config; apply the same change to the similar block
around lines 289-295 so the spec is skipped/failed instead of passing when no
passwords are provided, referencing the testPasswords variable and the helper
that returns foundPasswords.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 4881a8d4-aec9-48cc-ab99-4e0c9b6f870b

📥 Commits

Reviewing files that changed from the base of the PR and between 94ae41c and 1d9d9e3.

📒 Files selected for processing (1)
  • test/extended/security/penetration.go

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
test/extended/security/penetration.go (3)

267-272: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore wildcard expansion and literal matching in the password scans.

Passing *.log and *.yaml paths as raw grep arguments means those wildcards are never expanded, so these checks usually return exit code 2 and silently miss the files they are supposed to scan. grep is also treating pwd as a regex, so passwords containing regex metacharacters can produce false positives or misses. Expand the file list separately and search with grep -F -- so the scans stay both safe and functional.

Suggested fix
-				output, err := oc.AsAdmin().Run("debug").Args(
-					fmt.Sprintf("node/%s", node.Name),
-					"--",
-					"/bin/grep", "-nl", pwd, logPath,
-				).Output()
+				output, err := oc.AsAdmin().Run("debug").Args(
+					fmt.Sprintf("node/%s", node.Name),
+					"--",
+					"/bin/sh", "-c",
+					`for f in $1; do [ -e "$f" ] && /bin/grep -F -nl -- "$2" "$f"; done`,
+					"_", logPath, pwd,
+				).Output()

Apply the same pattern to the YAML scan as well.

As per coding guidelines, "Command: no shell=True, os.system, or backtick exec with user input".

Also applies to: 307-312

🤖 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 `@test/extended/security/penetration.go` around lines 267 - 272, The grep
invocation in oc.AsAdmin().Run("debug").Args (where you pass pwd and logPath) is
feeding unexpanded wildcards and a regex pattern to grep; change it to first
expand the target file globs (e.g., expand logPath like "*.log" and the YAML
glob into an explicit list of files) on the node before invoking grep, then call
grep with fixed-string mode and explicit end-of-options (use "-F" and "--") so
the password string (pwd) is treated literally; update the same pattern for the
YAML scan too (the other oc.AsAdmin().Run("debug").Args site mentioned) so both
scans expand globs and use grep -F -- with expanded file lists.

Source: Coding guidelines


725-731: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

countDatabasePods can count the same pod more than once.

The break only exits the dbImages loop. If a pod has two matching containers, count is incremented twice even though the helper comment and log message both describe a pod count. Use a labeled continue or a per-pod boolean so each pod contributes at most once.

Suggested fix
-	for _, pod := range pods.Items {
+podLoop:
+	for _, pod := range pods.Items {
 		for _, container := range pod.Spec.Containers {
 			lowerImage := strings.ToLower(container.Image)
 			for _, dbType := range dbImages {
 				if strings.Contains(lowerImage, dbType) {
 					count++
-					break // Count each pod only once
+					continue podLoop
 				}
 			}
 		}
 	}
🤖 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 `@test/extended/security/penetration.go` around lines 725 - 731, The loop in
countDatabasePods is incrementing count once per matching container because the
break only exits the dbImages loop; change the logic so each pod increments
count at most once by introducing a per-pod boolean (e.g., found) that is set
when any container image matches dbImages and then break out of the container
loop or use a labeled continue to skip to the next pod; update the use of
pods.Items, pod.Spec.Containers, dbImages and count accordingly so the helper
truly counts pods, not containers.

451-456: ⚠️ Potential issue | 🟠 Major

Privileged-pod test misses privileged init/ephemeral containers

countPrivilegedPodsInUserNamespaces only checks pod.Spec.Containers[*].SecurityContext.Privileged (lines 451-458), so pods with privileged initContainers or ephemeralContainers can evade TestNoUnexpectedPrivilegedPods. Update the helper to scan those container types as well, while still counting each pod only once.

🤖 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 `@test/extended/security/penetration.go` around lines 451 - 456, The helper
countPrivilegedPodsInUserNamespaces currently only inspects pod.Spec.Containers
for SecurityContext.Privileged; update it to also iterate
pod.Spec.InitContainers and pod.Spec.EphemeralContainers and check each
container's SecurityContext != nil and SecurityContext.Privileged != nil &&
*SecurityContext.Privileged, incrementing count and breaking out once per pod
(same behavior as for pod.Spec.Containers) so pods with privileged init or
ephemeral containers are counted exactly once; reuse the existing loop/break
pattern and nil checks to avoid panics.
🤖 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 `@test/extended/security/penetration.go`:
- Around line 194-200: The tests named TestNoUnprotectedDatabasePods,
TestNoUnexpectedClusterAdminServiceAccounts, and TestNoNFSVolumesRisk currently
only log via g.By(...) when a non-zero risk is detected, so CI doesn't fail;
replace the informational g.By(...) calls with explicit assertions (e.g., use
g.Expect(dbPodCount).To(BeZero(), "found %d database pod(s) - verify credentials
use Secrets", dbPodCount)) so the test fails when risk is detected; update the
occurrences around TestNoUnprotectedDatabasePods (calling countDatabasePods),
TestNoUnexpectedClusterAdminServiceAccounts (calling countClusterAdminSAs or
similar), and TestNoNFSVolumesRisk (calling countNFSVolumes or similar) to
assert counts are zero (or rename tests to make them discovery-only if you
prefer a non-failing check).

---

Outside diff comments:
In `@test/extended/security/penetration.go`:
- Around line 267-272: The grep invocation in oc.AsAdmin().Run("debug").Args
(where you pass pwd and logPath) is feeding unexpanded wildcards and a regex
pattern to grep; change it to first expand the target file globs (e.g., expand
logPath like "*.log" and the YAML glob into an explicit list of files) on the
node before invoking grep, then call grep with fixed-string mode and explicit
end-of-options (use "-F" and "--") so the password string (pwd) is treated
literally; update the same pattern for the YAML scan too (the other
oc.AsAdmin().Run("debug").Args site mentioned) so both scans expand globs and
use grep -F -- with expanded file lists.
- Around line 725-731: The loop in countDatabasePods is incrementing count once
per matching container because the break only exits the dbImages loop; change
the logic so each pod increments count at most once by introducing a per-pod
boolean (e.g., found) that is set when any container image matches dbImages and
then break out of the container loop or use a labeled continue to skip to the
next pod; update the use of pods.Items, pod.Spec.Containers, dbImages and count
accordingly so the helper truly counts pods, not containers.
- Around line 451-456: The helper countPrivilegedPodsInUserNamespaces currently
only inspects pod.Spec.Containers for SecurityContext.Privileged; update it to
also iterate pod.Spec.InitContainers and pod.Spec.EphemeralContainers and check
each container's SecurityContext != nil and SecurityContext.Privileged != nil &&
*SecurityContext.Privileged, incrementing count and breaking out once per pod
(same behavior as for pod.Spec.Containers) so pods with privileged init or
ephemeral containers are counted exactly once; reuse the existing loop/break
pattern and nil checks to avoid panics.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 275ca5b4-bce4-4c29-86bf-7965200fb8e3

📥 Commits

Reviewing files that changed from the base of the PR and between 1d9d9e3 and 26324d3.

📒 Files selected for processing (1)
  • test/extended/security/penetration.go

Comment thread test/extended/security/penetration.go Outdated
@yogeshahiray yogeshahiray requested a review from neisw June 11, 2026 14:03
@yogeshahiray

Copy link
Copy Markdown
Author

I have addressed all the comments

@sosiouxme sosiouxme changed the title Added penetrstion tests important to Telco partners/customers Added penetration tests important to Telco partners/customers Jun 11, 2026
@sosiouxme

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 12, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-trt

openshift-trt Bot commented Jun 12, 2026

Copy link
Copy Markdown

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: 4549d1c

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-aws-ovn-microshift High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-aws-ovn-microshift High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-aws-ovn-microshift High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
(...showing 20 of 26 rows)

New tests seen in this PR at sha: 4549d1c

  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 2, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestContainerRegistryAuthentication [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 0, Fail: 4, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdDirectoryPermissions [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 4, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNetworkTrafficEncrypted [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 4, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoSSHKeysInUnexpectedSecrets [apigroup:security.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 0, Fail: 4, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 0, Fail: 5, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnprotectedDatabasePods [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 5, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 0, Fail: 5, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 0, Fail: 4, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] TestNoPasswordExposedInLogFiles [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

1 similar comment
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-trt

openshift-trt Bot commented Jun 12, 2026

Copy link
Copy Markdown

Job Failure Risk Analysis for sha: da2b185

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-vsphere-ovn Low
[Feature:NetworkSegmentation][ovn-kubernetes-ote][sig-network] Network Segmentation: services on a user defined primary network should be reachable through their cluster IP, node port and load balancer L2 primary UDN with custom network, cluster-networked pods, NodePort service [Suite:openshift/conformance/parallel]
This test has passed 0.00% of 18 runs on release 5.0 [Architecture:amd64 FeatureSet:default Installer:ipi JobTier:standard Network:ovn NetworkStack:ipv4 OS:rhcos9 Owner:eng Platform:vsphere Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi Low
[Feature:NetworkSegmentation][ovn-kubernetes-ote][sig-network] Network Segmentation: services on a user defined primary network should be reachable through their cluster IP, node port and load balancer L2 primary UDN with custom network, cluster-networked pods, NodePort service [Suite:openshift/conformance/parallel]
This test has passed 0.00% of 11 runs on release 5.0 [Architecture:amd64 FeatureSet:default Installer:upi JobTier:standard Network:ovn NetworkStack:ipv4 OS:rhcos9 Owner:eng Platform:vsphere Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: da2b185

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestContainerRegistryAuthentication [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdDirectoryPermissions [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNetworkTrafficEncrypted [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoSSHKeysInUnexpectedSecrets [apigroup:security.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnprotectedDatabasePods [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 1 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] TestNoPasswordExposedInLogFiles [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.

New tests seen in this PR at sha: da2b185

  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestContainerRegistryAuthentication [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdDirectoryPermissions [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNetworkTrafficEncrypted [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoSSHKeysInUnexpectedSecrets [apigroup:security.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnprotectedDatabasePods [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 0, Fail: 1, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] TestNoPasswordExposedInLogFiles [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 1, Pass: 1, Fail: 0, Flake: 0]

@neisw

neisw commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

/approve
based on the skips for non-metal jobs and informing status of the new tests. @yogeshahiray indicated additional changes are forthcoming to address the failures and remove informing status.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2026
@neisw

neisw commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@neisw: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/d67d8e10-68e8-11f1-8327-82313cf86a27-0

@openshift-ci openshift-ci Bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 17, 2026
@openshift-ci openshift-ci Bot added the e2e-images-update Related to images used by e2e tests label Jun 17, 2026

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

🤖 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/cmd/openshift-tests/images/images_command.go`:
- Line 105: The prefix handling is inconsistent between where repository
prefixes are stored and where they are used for deduplication and output. At
line 318, prefixed targets are stored from existing lines, but when building
dest and printing outputs in lines 324-333, the prefix is not being applied
consistently, causing the dedupe logic at line 325 to fail to match prefixed and
unprefixed targets. Fix this by ensuring that when building dest at lines 324+
and when printing targets at lines 329-333, you apply the same prefix handling
logic that is used when storing targets from existing lines at line 318, so that
deduplication can work correctly and prevent duplicate mappings for file:// and
s3:// repositories.

In `@test/extended/ci/job_names.go`:
- Around line 176-177: The Skipf call on line 177 runs unconditionally, causing
the os-version validation to be skipped for all job variants rather than only
those affected by the RHEL-10 switchover. Add a conditional check before the
Skipf call that evaluates whether the current job is one of the specific
variants impacted by the RHEL-10 switchover, and only execute the Skipf when
that condition is true, allowing the validation to continue for all other
unaffected job variants.

In `@test/extended/node/node_e2e/probe_termination.go`:
- Around line 202-224: The functions findLatestEventByReason and
findEarliestEventAfter use only LastTimestamp.Time for timestamp comparisons,
but the existing CalculateEventTimeDiff function already implements fallback
logic to use FirstTimestamp when LastTimestamp is zero. This inconsistency
causes a bug where zero LastTimestamp values result in epoch time boundaries
being used, allowing findEarliestEventAfter to incorrectly match events. Apply
the same unified timestamp fallback logic from CalculateEventTimeDiff to both
findLatestEventByReason and findEarliestEventAfter so that whenever
LastTimestamp.Time is zero, they fall back to FirstTimestamp.Time for comparison
operations, ensuring consistent and correct timestamp handling across all event
filtering and boundary selection.

In `@test/extended/node/node_utils.go`:
- Around line 773-782: The CalculateEventTimeDiff function does not account for
the EventTime field which is used in newer Kubernetes event objects. Modify the
function to add a fallback mechanism: after checking LastTimestamp and
FirstTimestamp for both startEvent and endEvent, if they are still zero, fall
back to using the EventTime field from the respective event objects. This
ensures the function correctly handles both legacy and newer Kubernetes event
formats and returns a valid duration instead of a zero duration when legacy
timestamp fields are not populated.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 27d79215-2299-4504-921b-3d249a62f905

📥 Commits

Reviewing files that changed from the base of the PR and between da2b185 and d52b732.

⛔ Files ignored due to path filters (1)
  • test/extended/util/image/zz_generated.txt is excluded by !**/zz_generated*
📒 Files selected for processing (10)
  • pkg/cmd/openshift-tests/images/images_command.go
  • pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go
  • test/extended/ci/job_names.go
  • test/extended/internalreleaseimage/helper.go
  • test/extended/node/README.md
  • test/extended/node/node_e2e/probe_termination.go
  • test/extended/node/node_utils.go
  • test/extended/security/penetration.go
  • test/extended/util/image/OWNERS
  • test/extended/util/image/image.go
✅ Files skipped from review due to trivial changes (2)
  • test/extended/util/image/OWNERS
  • pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/security/penetration.go


// TODO(k8s-1.36): remove this when k8s 1.36 lands
injectedLines := injectNewImages(ref, !o.Upstream)
injectedLines := injectNewImages(ref, !o.Upstream, lines)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prefix handling is inconsistent, breaking dedupe/output for file:// and s3:// repositories.

Line 105 passes only lines, but Line 324+ builds dest without the repository prefix and Lines 329-333 print unprefixed targets. With prefixed repositories, Line 318 stores prefixed targets (from existing lines), so dedupe at Line 325 won’t match and duplicate mappings can be emitted.

Proposed fix
-			injectedLines := injectNewImages(ref, !o.Upstream, lines)
+			injectedLines := injectNewImages(ref, !o.Upstream, prefix, lines)
-func injectNewImages(ref reference.DockerImageReference, mirrored bool, existingLines []string) []string {
+func injectNewImages(ref reference.DockerImageReference, mirrored bool, prefix string, existingLines []string) []string {
 	target := ref.Exact()
@@
 	existingTargets := sets.NewString()
 	for _, line := range existingLines {
 		parts := strings.Fields(line)
 		if len(parts) >= 2 {
-			existingTargets.Insert(parts[1])
+			existingTargets.Insert(strings.TrimPrefix(strings.TrimPrefix(parts[1], "file://"), "s3://"))
 		}
 	}
@@
-		if mirrored {
+		if mirrored {
 			lines = append(lines, fmt.Sprintf("%s:%s %s",
-				imagesetup.DefaultTestImageMirrorLocation, mirrorTag, dest))
+				imagesetup.DefaultTestImageMirrorLocation, mirrorTag, prefix+dest))
 		} else {
-			lines = append(lines, fmt.Sprintf("%s %s", originalImage, dest))
+			lines = append(lines, fmt.Sprintf("%s %s", originalImage, prefix+dest))
 		}
 	}

Also applies to: 304-333

🤖 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/cmd/openshift-tests/images/images_command.go` at line 105, The prefix
handling is inconsistent between where repository prefixes are stored and where
they are used for deduplication and output. At line 318, prefixed targets are
stored from existing lines, but when building dest and printing outputs in lines
324-333, the prefix is not being applied consistently, causing the dedupe logic
at line 325 to fail to match prefixed and unprefixed targets. Fix this by
ensuring that when building dest at lines 324+ and when printing targets at
lines 329-333, you apply the same prefix handling logic that is used when
storing targets from existing lines at line 318, so that deduplication can work
correctly and prevent duplicate mappings for file:// and s3:// repositories.

Comment on lines +176 to +177
// TODO: @pablintino https://redhat.atlassian.net/browse/MCO-2371
e2eskipper.Skipf("Temporarily disabled until RHEL-10 switchover, see MCO-2371")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Unconditional skip removes this CI guardrail for all jobs.

On Line 177, Skipf(...) runs unconditionally, so the os-version validation never executes (including cases unrelated to RHEL-10 switchover). Please scope the skip to only the affected job variants so existing coverage remains active.

Suggested adjustment
 g.It("should match os version", func() {
-	// TODO: `@pablintino` https://redhat.atlassian.net/browse/MCO-2371
-	e2eskipper.Skipf("Temporarily disabled until RHEL-10 switchover, see MCO-2371")
 	if jobName == "" {
 		e2eskipper.Skipf("JOB_NAME env var not set, skipping")
 	}
+	// TODO: `@pablintino` https://redhat.atlassian.net/browse/MCO-2371
+	if strings.Contains(jobName, "rhcos10") || strings.Contains(jobName, "rhcos9-10") {
+		e2eskipper.Skipf("Temporarily disabled for RHEL-10 switchover paths, see MCO-2371")
+	}
🤖 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 `@test/extended/ci/job_names.go` around lines 176 - 177, The Skipf call on line
177 runs unconditionally, causing the os-version validation to be skipped for
all job variants rather than only those affected by the RHEL-10 switchover. Add
a conditional check before the Skipf call that evaluates whether the current job
is one of the specific variants impacted by the RHEL-10 switchover, and only
execute the Skipf when that condition is true, allowing the validation to
continue for all other unaffected job variants.

Comment thread test/extended/node/node_e2e/probe_termination.go
Comment on lines +773 to +782
func CalculateEventTimeDiff(startEvent, endEvent *corev1.Event) time.Duration {
startTime := startEvent.LastTimestamp.Time
if startTime.IsZero() {
startTime = startEvent.FirstTimestamp.Time
}
endTime := endEvent.LastTimestamp.Time
if endTime.IsZero() {
endTime = endEvent.FirstTimestamp.Time
}
return endTime.Sub(startTime)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find the file and check its current state
find . -name "node_utils.go" -type f | head -20

Repository: openshift/origin

Length of output: 95


🏁 Script executed:

# Search for the CalculateEventTimeDiff function to understand the implementation
rg "CalculateEventTimeDiff" -A 15 --type go

Repository: openshift/origin

Length of output: 2089


🏁 Script executed:

# Check what corev1.Event looks like and if it has EventTime field
rg "type Event struct" --type go -A 30

Repository: openshift/origin

Length of output: 50372


🏁 Script executed:

# Search for EventTime field specifically in the corev1.Event definition
rg "EventTime" vendor/k8s.io/api/core/v1/types.go

Repository: openshift/origin

Length of output: 156


🏁 Script executed:

# Get the full corev1.Event definition more carefully
sed -n '/^type Event struct/,/^}/p' vendor/k8s.io/api/core/v1/types.go | head -60

Repository: openshift/origin

Length of output: 2703


🏁 Script executed:

# Check the actual implementation at the specified line range
sed -n '765,790p' test/extended/node/node_utils.go

Repository: openshift/origin

Length of output: 841


Include EventTime fallback in CalculateEventTimeDiff to handle newer Kubernetes event objects.

The helper currently ignores EventTime, which is present in corev1.Event (as metav1.MicroTime). When both LastTimestamp and FirstTimestamp are zero, the function returns an invalid zero duration, breaking event-timing assertions that rely on this helper.

Suggested fix
 func CalculateEventTimeDiff(startEvent, endEvent *corev1.Event) time.Duration {
 	startTime := startEvent.LastTimestamp.Time
 	if startTime.IsZero() {
 		startTime = startEvent.FirstTimestamp.Time
 	}
+	if startTime.IsZero() {
+		startTime = startEvent.EventTime.Time
+	}
 	endTime := endEvent.LastTimestamp.Time
 	if endTime.IsZero() {
 		endTime = endEvent.FirstTimestamp.Time
 	}
+	if endTime.IsZero() {
+		endTime = endEvent.EventTime.Time
+	}
 	return endTime.Sub(startTime)
 }
🤖 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 `@test/extended/node/node_utils.go` around lines 773 - 782, The
CalculateEventTimeDiff function does not account for the EventTime field which
is used in newer Kubernetes event objects. Modify the function to add a fallback
mechanism: after checking LastTimestamp and FirstTimestamp for both startEvent
and endEvent, if they are still zero, fall back to using the EventTime field
from the respective event objects. This ensures the function correctly handles
both legacy and newer Kubernetes event formats and returns a valid duration
instead of a zero duration when legacy timestamp fields are not populated.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2026
@openshift-ci openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 17, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@laurayang842

Copy link
Copy Markdown

/lgtm

@openshift-ci

openshift-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@laurayang842: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@neisw

neisw commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/retest-required

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

openshift-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: laurayang842, neisw, yogeshahiray

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

Copy link
Copy Markdown
Contributor

@yogeshahiray: 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/verify-image-manifest-lists 4761694 link true /test verify-image-manifest-lists
ci/prow/e2e-gcp-ovn ae2362a link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-fips ae2362a link true /test e2e-aws-ovn-fips

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

openshift-trt Bot commented Jun 17, 2026

Copy link
Copy Markdown

Job Failure Risk Analysis for sha: ae2362a

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-vsphere-ovn Low
[Feature:NetworkSegmentation][ovn-kubernetes-ote][sig-network] Network Segmentation: services on a user defined primary network should be reachable through their cluster IP, node port and load balancer L2 primary UDN with custom network, cluster-networked pods, NodePort service [Suite:openshift/conformance/parallel]
This test has passed 0.00% of 1 runs on release 5.0 [Architecture:amd64 FeatureSet:default Installer:ipi JobTier:standard Network:ovn NetworkStack:ipv4 OS:rhcos9 Owner:eng Platform:vsphere Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi Low
[Feature:NetworkSegmentation][ovn-kubernetes-ote][sig-network] Network Segmentation: services on a user defined primary network should be reachable through their cluster IP, node port and load balancer L2 primary UDN with custom network, cluster-networked pods, NodePort service [Suite:openshift/conformance/parallel]
This test has passed 0.00% of 1 runs on release 5.0 [Architecture:amd64 FeatureSet:default Installer:upi JobTier:standard Network:ovn NetworkStack:ipv4 OS:rhcos9 Owner:eng Platform:vsphere Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: ae2362a

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestContainerRegistryAuthentication [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdDirectoryPermissions [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNetworkTrafficEncrypted [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoSSHKeysInUnexpectedSecrets [apigroup:security.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnprotectedDatabasePods [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" is a new test, was only seen in one job, and failed 2 time(s) against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 Medium - "[sig-auth][Feature:SecurityPenetration] TestNoPasswordExposedInLogFiles [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" is a new test, and was only seen in one job.

New tests seen in this PR at sha: ae2362a

  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestAllRoutesUseTLS [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestContainerRegistryAuthentication [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdBackupEncryptionAndRestriction [apigroup:config.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestEtcdDirectoryPermissions [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestMonitoringStackHealthy [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNetworkTrafficEncrypted [apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoNFSVolumesRisk [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoSSHKeysInUnexpectedSecrets [apigroup:security.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedClusterAdminServiceAccounts [apigroup:rbac.authorization.k8s.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnexpectedPrivilegedPods [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestNoUnprotectedDatabasePods [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestProperNodeSudoConfiguration [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] Security Penetration Tests TestSecurityToolingInstalled [apigroup:operators.coreos.com] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-auth][Feature:SecurityPenetration] TestNoPasswordExposedInLogFiles [apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]

@yogeshahiray

Copy link
Copy Markdown
Author

/retest-required

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. e2e-images-update Related to images used by e2e tests lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants