Skip to content

Conversation

@jackorp
Copy link
Contributor

@jackorp jackorp commented Aug 28, 2025

Worked on mimicking the nodejs approach: sclorg/s2i-nodejs-container#498

The check is simply executing OpenSSL.fips_mode which returns bool.
Based on exit status we can then know whether it failed/succeeded against our expectation.

The app has 4 GET endpoints that executes some OpenSSL capability.
2 of those test symmetric ciphers:

  • '/symmetric/aes-256-cbc' -- succeeds under FIPS
  • '/symmetric/des-ede-cbc' -- fails under FIPS
    2 of those test digests:
  • '/hash/sha256' -- succeeds under FIPS
  • '/hash/md5' -- fails under FIPS

The app is prepared so that it tests assumptions of when should what
fail, under both FIPS and non-fips environment.

These endpoints either return 200 if the case for them succeeded
or 5xx for FIPS related failures and 4xx for general failures not
accounted for. When a failure happens when it shouldn't, the app also
returns backtrace in the response body.

A few examples:
MD5 succeeds and FIPS is enabled, that's unexpected, returns 500
SHA256 fails in any case, 409 is returned because that shouldn't happen
with both FIPS disabled and enabled, something else went wrong.
MD5 fails with FIPS enabled, that's desired and expected, returns 200.

Since more information is passed within body on response,
curl --fail-with-body is recommended.

409 is chosen to differentiate 500 returned in cases we
might expect. It was chosen firstly as it is "user error", either the code is
wrong, or the setup is wrong.

For the purpose of building and running the app,
and adjustment was made to run_test_application to be able to run a custom
named container.

Otherwise there is only testapp to be ran and we can have better names.

@github-actions
Copy link

github-actions bot commented Aug 28, 2025

Pull Request validation

Failed

🔴 Failed or pending statuses:

  • Testing Farm - CentOS Stream 10 - 3.3[pending]
  • Testing Farm - RHEL8 - 3.3[pending]
  • Testing Farm - RHEL9 - 3.0[pending]
  • Testing Farm - RHEL9 - FIPS Enabled - 3.3[pending]
  • Testing Farm - Fedora - 3.3[pending]
  • Testing Farm - RHEL9 - FIPS Enabled - 3.0[pending]
  • Testing Farm - RHEL9 - 3.3[pending]
  • Testing Farm - RHEL10 - FIPS Enabled - 3.3[pending]
  • Testing Farm - RHEL8 - 2.5[pending]
  • Testing Farm - RHEL10 - 3.3[pending]

🔴 Review - Missing review from a member (1 required)

@phracek
Copy link
Member

phracek commented Sep 3, 2025

[test]

@phracek
Copy link
Member

phracek commented Sep 3, 2025

[test]

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - 3.3Fedora-latestx86_64❌ error16.09.2025 12:47:0912min 53stest pipeline
CentOS Stream 10 - 3.3CentOS-Stream-10x86_64❌ error16.09.2025 16:35:053h 12min 59stest pipeline
RHEL10 - 3.3RHEL-10-Nightlyx86_64❌ error16.09.2025 11:32:1521min 11stest pipeline
RHEL10 - FIPS Enabled - 3.3RHEL-10-Nightlyx86_64❌ error16.09.2025 14:22:0423min 1stest pipeline
RHEL8 - 3.3RHEL-8.10.0-Nightlyx86_64✅ passed16.09.2025 18:35:1017min 60stest pipeline
RHEL9 - 3.3RHEL-9.6.0-Nightlyx86_64❌ error16.09.2025 14:21:5525min 59stest pipeline
RHEL8 - 2.5RHEL-8.10.0-Nightlyx86_64✅ passed16.09.2025 16:35:0622min 52stest pipeline
RHEL9 - FIPS Enabled - 3.3RHEL-9.6.0-Nightlyx86_64❌ error16.09.2025 14:22:2333min 59stest pipeline
RHEL9 - 3.0RHEL-9.6.0-Nightlyx86_64❌ error16.09.2025 12:35:0235min 60stest pipeline
RHEL9 - FIPS Enabled - 3.0RHEL-9.6.0-Nightlyx86_64❌ error16.09.2025 16:35:1818min 49stest pipeline

@jackorp
Copy link
Contributor Author

jackorp commented Sep 3, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 4, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 4, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 4, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 15, 2025

[test]

3 similar comments
@jackorp
Copy link
Contributor Author

jackorp commented Sep 16, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 16, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 16, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 16, 2025

[test]

1 similar comment
@jackorp
Copy link
Contributor Author

jackorp commented Sep 17, 2025

[test]

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
RHEL8 - 3.3RHEL-8.10.0-Nightlyx86_64✅ passed08.10.2025 10:11:4116min 56stest pipeline
RHEL8 - 2.5RHEL-8.10.0-Nightlyx86_64✅ passed08.10.2025 10:11:3921min 40stest pipeline
CentOS Stream 10 - 3.3CentOS-Stream-10x86_64✅ passed08.10.2025 10:11:4110min 23stest pipeline
Fedora - 3.3Fedora-latestx86_64✅ passed08.10.2025 10:11:4010min 28stest pipeline
RHEL10 - 3.3RHEL-10-Nightlyx86_64✅ passed08.10.2025 10:11:3815min 51stest pipeline
RHEL9 - 3.3RHEL-9.6.0-Nightlyx86_64✅ passed08.10.2025 10:11:4220min 49stest pipeline
RHEL10 - FIPS Enabled - 3.3RHEL-10-Nightlyx86_64✅ passed08.10.2025 10:11:3919min 39stest pipeline
RHEL9 - 3.0RHEL-9.6.0-Nightlyx86_64✅ passed08.10.2025 10:11:4129min 49stest pipeline
RHEL9 - FIPS Enabled - 3.3RHEL-9.6.0-Nightlyx86_64✅ passed08.10.2025 10:11:3930min 16stest pipeline
RHEL9 - FIPS Enabled - 3.0RHEL-9.6.0-Nightlyx86_64✅ passed08.10.2025 10:11:3936min 52stest pipeline

@jackorp
Copy link
Contributor Author

jackorp commented Sep 19, 2025

[test]

@github-actions
Copy link

github-actions bot commented Sep 19, 2025

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

@jackorp
Copy link
Contributor Author

jackorp commented Sep 23, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 23, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 24, 2025

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Sep 24, 2025

[test]

Add FIPS test and example application with HTTP.

The check is simply executing OpenSSL.fips_mode which returns bool.
Based on exit status we can then know whether it failed/succeeded as we
expect it to.

The app has 4 GET endpoints that executes some OpenSSL capability.
2 of those test symmetric ciphers:
* '/symmetric/aes-256-cbc' -- succeeds under FIPS
* '/symmetric/des-ede-cbc' -- fails under FIPS
2 of those test digests:
* '/hash/sha256' -- succeeds under FIPS
* '/hash/md5' -- fails under FIPS

The app is prepared so that it tests assumptions of when should what
fail, under both FIPS and non-fips environment.

These endpoints either return 200 if the case for them succeeded
or 5xx for FIPS related failures and 4xx for general failures not
accounted for. When a failure happens when it shouldn't, the app also
returns backtrace in the response body.

A few examples:
MD5 succeeds and FIPS is enabled, that's unexpected, returns 500
SHA256 fails in any case, 409 is returned because that shouldn't happen
with both FIPS disabled and enabled, something else went wrong.
MD5 fails with FIPS enabled, that's desired and expected, returns 200.

Since more information is passed within body on response,
`curl --fail-with-body` is recommended.

409 is chosen to differentiate 500 returned in cases we
might expect. It was chosen firstly as it is "user error", either the code is
wrong, or the setup is wrong.

For the purpose of building and running the app,
an adjustment was made to run_test_application to be able to run a custom
named container.

Otherwise there is only testapp to be ran and we can have better names.
@jackorp jackorp changed the title Draft: Test fips for Ruby Test fips for Ruby Sep 25, 2025
@jackorp jackorp requested a review from phracek September 25, 2025 08:29
@jackorp
Copy link
Contributor Author

jackorp commented Sep 25, 2025

@phracek finally got through to something I'd call functioning tests... Ready for review.

@jackorp
Copy link
Contributor Author

jackorp commented Oct 8, 2025

[test]

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

I don't understand test_ruby_fips_s2i_app function.

ct_wait_for_cid "${cid_file}"
ct_test_response "http://$(container_ip):8080/symmetric/aes-256-cbc" 200 ""
ct_check_testcase_result $?
ct_test_response "http://$(container_ip):8080/symmetric/des-ede-cbc" 200 ""
Copy link
Member

Choose a reason for hiding this comment

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

Based on your description in pull request:

  • '/symmetric/aes-256-cbc' -- succeeds under FIPS
  • '/symmetric/des-ede-cbc' -- fails under FIPS - This should fail.
    2 of those test digests:
  • '/hash/sha256' -- succeeds under FIPS
  • '/hash/md5' -- fails under FIPS

test_ruby_fips_s2i_app where is enabled FIPS mode This works the same as for FIPs mode and for None FIPs mode? Like this https://github.com/sclorg/s2i-nodejs-container/blob/master/test/test-lib-nodejs.sh#L587

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is checked in code that it fails under FIPS, an exception is rescued. If an exception does NOT occur under FIPS, then the test fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noted it down with those comments that there are ciphers/hashes which are expected to fail and which are expected to pass. If those that should pass raise an exception, that is not expected and the test will fail.

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for adding FIPS enabled Ruby container. It brings to customers, that we have a container FIPS compliance.

@jackorp jackorp merged commit dad69ac into sclorg:master Oct 16, 2025
11 checks passed
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