Skip to content

[rhcos-4.17] tests: add fips.enable.tls#4490

Open
openshift-cherrypick-robot wants to merge 1 commit intocoreos:rhcos-4.17from
openshift-cherrypick-robot:cherry-pick-4477-to-rhcos-4.17
Open

[rhcos-4.17] tests: add fips.enable.tls#4490
openshift-cherrypick-robot wants to merge 1 commit intocoreos:rhcos-4.17from
openshift-cherrypick-robot:cherry-pick-4477-to-rhcos-4.17

Conversation

@openshift-cherrypick-robot

This is an automated cherry-pick of #4477

/assign HuijingHei

To verify that using TLS works in FIPS mode by having Ignition
fetch a remote resource over HTTPS with FIPS compatible algorithms.

tests/containers: build the container based on `nginx-126:10.1`.
See Timothee's comment coreos#4477 (comment)

Fixes https://issues.redhat.com/browse/COS-3487
@openshift-ci
Copy link

openshift-ci bot commented Mar 18, 2026

Hi @openshift-cherrypick-robot. Thanks for your PR.

I'm waiting for a coreos 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new test, fips.enable.tls, to verify TLS functionality in FIPS mode. The changes include the test definition in Go, and supporting scripts and a Containerfile to build an nginx container for this test. My primary concern, which I've marked as critical, is the test's reliance on a hardcoded public IP address, making it fragile and dependent on external infrastructure. I've also provided a few medium-severity suggestions to improve the robustness of the container build script and correct a minor documentation inconsistency.

Comment on lines +132 to +136
// Test that using TLS works in FIPS mode by having Ignition fetch
// a remote resource over HTTPS with FIPS compatible algorithms.
// See https://issues.redhat.com/browse/COS-3487
// Note that 34.172.244.189, running RHCOS 9.6 (build 20260312-0) on
// Google Cloud Platform, provides HTTPS services using nginx-126:10.1.
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The test relies on a hardcoded IP address (34.172.244.189), which makes it dependent on an external service that is not managed by the test framework. This is a fragile approach and can lead to test failures if the server at this IP is down, changed, or decommissioned, making the test suite unreliable.

A better approach would be to have the test provision the required HTTPS server as part of its setup, for example by running the fips-nginx container (which is also added in this PR) on a machine within the test cluster or on a temporary VM. This would make the test self-contained and more robust.

@@ -0,0 +1,28 @@
# fips-nginx Container

This is used by the `fips.enable.https` test to verify that using
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a small typo here. The test is named fips.enable.tls, not fips.enable.https. Please update the README to match the test name in mantle/kola/tests/fips/fips.go.

Suggested change
This is used by the `fips.enable.https` test to verify that using
This is used by the `fips.enable.tls` test to verify that using


ip="$1"

tmpdir="$(mktemp -d)"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The script creates a temporary directory but doesn't clean it up on exit. This can lead to an accumulation of temporary directories in /tmp. It's a good practice to use trap to ensure cleanup, even if the script fails. For example, you could add trap 'rm -rf "${tmpdir}"' EXIT after this line.

ip="$1"

tmpdir="$(mktemp -d)"
cp Containerfile ${tmpdir}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This cp command assumes the script is run from the same directory as Containerfile. To make the script more robust and runnable from any location, you should reference Containerfile relative to the script's own location.

Suggested change
cp Containerfile ${tmpdir}
cp "$(dirname "$0")/Containerfile" "${tmpdir}"

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants