MCO-2393: Use /proc/sys/crypto/fips_enabled for FIPS check in tests#6233
MCO-2393: Use /proc/sys/crypto/fips_enabled for FIPS check in tests#6233HarshwardhanPatil07 wants to merge 2 commits into
Conversation
fips-mode-setup does not exist on RHEL 10, causing PolarionID:53668 to fail with "No such file or directory". Use /proc/sys/crypto/fips_enabled instead, consistent with how the MCO daemon checks FIPS in pkg/daemon/update.go.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@HarshwardhanPatil07: This pull request references MCO-2393 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
ChangesFIPS detection path
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed 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. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HarshwardhanPatil07 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/payload-job periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-fips-proxy-longduration-1of3 |
|
@HarshwardhanPatil07: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ec607e20-7074-11f1-81c3-7fd87333d00f-0 |
HarshwardhanPatil07
left a comment
There was a problem hiding this comment.
Verification Steps on Cluster Locally
```
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc get cm cluster-config-v1 -n kube-system -o jsonpath='{.data.install-config}'|grep fips
fips: true
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ cat > /tmp/fips.yaml << 'EOF'
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 50-fips-bz-poc
spec:
config:
ignition:
version: 3.2.0
kernelArguments:
- trigger-sno-fips-issue=1
EOF
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc create -f /tmp/fips.yaml
machineconfig.machineconfiguration.openshift.io/50-fips-bz-poc created
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc get mcp
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
master rendered-master-6ded900152cc64012955c5788254db10 False True False 3 2 2 0 175m
worker rendered-worker-023bec9aece038cf11b074c60087158b True False False 3 3 3 0 175m
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ cat > /tmp/kernel.yaml << 'EOF'
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 50-realtime-kernel
spec:
config:
ignition:
version: 3.2.0
kernelType: "realtime"
EOF
oc create -f /tmp/kernel.yaml
machineconfig.machineconfiguration.openshift.io/50-realtime-kernel created
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc get mcp
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
master rendered-master-35bb86e8f2513414d4375b379f0171ae True False False 3 3 3 0 5h49m
worker rendered-worker-023bec9aece038cf11b074c60087158b True False False 3 3 3 0 5h49m
harshpat@harshpat-thinkpadp1gen4i:/Downloads/repos/openshift-tests-private$ node=$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}')/Downloads/repos/openshift-tests-private$ oc debug node/$node -- chroot /host cat /proc/sys/crypto/fips_enabled 2>&1 | grep -v Warning
echo "Target Node: $node"
Target Node: ip-10-0-21-23.us-east-2.compute.internal
harshpat@harshpat-thinkpadp1gen4i:
Starting pod/ip-10-0-21-23us-east-2computeinternal-debug-5lq5w ...
To use host binaries, run chroot /host. Instead, if you need to access host namespaces, run nsenter -a -t 1.
1
Removing debug pod ...
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc debug node/$node -- chroot /host fips-mode-setup --check 2>&1 | grep -v Warning
Starting pod/ip-10-0-21-23us-east-2computeinternal-debug-mcn4h ...
To use host binaries, run chroot /host. Instead, if you need to access host namespaces, run nsenter -a -t 1.
FIPS mode is enabled.
Removing debug pod ...
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc debug node/$node -- chroot /host cat /proc/cmdline 2>&1 | grep -v Warning
Starting pod/ip-10-0-21-23us-east-2computeinternal-debug-4rtt5 ...
To use host binaries, run chroot /host. Instead, if you need to access host namespaces, run nsenter -a -t 1.
BOOT_IMAGE=(hd0,gpt3)/boot/ostree/rhcos-45e8e6b723ebef5595d8c8f3e2a6cf8079fffd5838d60b9e3d6abce559e01cbe/vmlinuz-5.14.0-687.17.1.el9_8.x86_64+rt rw ostree=/ostree/boot.0/rhcos/45e8e6b723ebef5595d8c8f3e2a6cf8079fffd5838d60b9e3d6abce559e01cbe/0 ignition.platform.id=aws console=tty0 console=ttyS0,115200n8 fips=1 boot=LABEL=boot root=UUID=b56bd452-a78f-4697-885a-a677ef7d9998 rw rootflags=prjquota trigger-sno-fips-issue=1 trigger-fips-issue=1 systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all
Removing debug pod ...
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/openshift-tests-private$ oc debug node/$node -- uname -a 2>&1 | grep -v Warning
Starting pod/ip-10-0-21-23us-east-2computeinternal-debug-zn5lj ...
To use host binaries, run chroot /host. Instead, if you need to access host namespaces, run nsenter -a -t 1.
Linux ip-10-0-21-23 5.14.0-687.17.1.el9_8.x86_64+rt #1 SMP PREEMPT_RT Thu Jun 18 13:38:12 EDT 2026 x86_64 x86_64 x86_64 GNU/Linux
Removing debug pod ...
</pre>
</details>
…t from stderr DebugNodeWithChroot concatenates stdout and stderr, so checking the output of `cat /proc/sys/crypto/fips_enabled` with an exact match `== "1"` fails because stderr contains debug pod lifecycle messages. Use DebugNodeWithChrootStd which returns stdout separately. Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
|
@HarshwardhanPatil07: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
- What I did
- How to verify it
- Description for the changelog
Summary by CodeRabbit