Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Enable FIPS mode for IPA if system is in FIPS mode #535

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

elfosardo
Copy link
Member

If FIPS is enabled in the hosts we should also run IPA in FIPS mode. It is possible to enable FIPS directly at kernel level using the fips option, determining the FIPS status for example from the cryptographic module and specifically the
/proc/sys/crypto/fips_enabled file; if the file contains 1 then the system is in FIPS mode, if it contains 0 the FIPS algorithms are disabled.
Therefore the value of the fips kernel option is 0 (default) if FIPS is disabled, or 1 if enabled.

@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 6, 2024
@elfosardo elfosardo force-pushed the enable-fips-ipa branch 2 times, most recently from c97acfa to c59fef7 Compare August 6, 2024 09:15
@elfosardo
Copy link
Member Author

/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main

@elfosardo
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

1 similar comment
@elfosardo
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

@zaneb
Copy link
Member

zaneb commented Aug 6, 2024

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2024
@@ -86,6 +86,9 @@ mkdir -p /shared/ironic_prometheus_exporter

configure_json_rpc_auth

ENABLE_FIPS_IPA=$(cat /proc/sys/crypto/fips_enabled)
Copy link
Member

Choose a reason for hiding this comment

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

Is this file guaranteed to exist on Centos? It does not exist on my Ubuntu machine, which would result in empty variable, instead of 0 or 1.

Copy link
Member Author

Choose a reason for hiding this comment

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

this should be guarantee existing in FIPS enabled kernels, including ubuntu, since at least 4 years
I don't recall exactly the kernel version, but I'm quite sure the file exists since at least RHEL/CENTOS 7.6 and Ubuntu 16.0.4

Copy link
Member Author

Choose a reason for hiding this comment

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

found it, a bit older than 4 years :)
https://www.kernelconfig.io/config_crypto_fips

Copy link
Member

Choose a reason for hiding this comment

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

It still isn't present on Ubuntu 22.04 by default tho. Obviously my desktop kernel isn't FIPS enabled.

Whats the behavior of the flag if it isn't 0 or 1 but empty? simple_strtol used by fips.c isn't well documented.

Copy link
Member Author

Choose a reason for hiding this comment

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

probably only very latest kernels are all compiled with fips support by default
I guess I can add a test for the file, just to be on the safe side

@elfosardo
Copy link
Member Author

/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main
some issue with CI?

If FIPS is enabled in the hosts we should also run IPA in FIPS mode.
It is possible to enable FIPS directly at kernel level using the
fips option, determining the FIPS status for example from
the cryptographic module and specifically the
/proc/sys/crypto/fips_enabled file; if the file contains 1 then
the system is in FIPS mode, if it contains 0 the FIPS algorithms
are disabled.
Therefore the value of the fips kernel option is 0 (default)
if FIPS is disabled, or 1 if enabled.

Signed-off-by: Riccardo Pittau <elfosardo@gmail.com>
@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2024
@elfosardo
Copy link
Member Author

/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2024
@zaneb
Copy link
Member

zaneb commented Aug 21, 2024

/lgtm

@dtantsur
Copy link
Member

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtantsur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2024
@metal3-io-bot metal3-io-bot merged commit 6b295ae into metal3-io:main Aug 21, 2024
8 checks passed
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants