Skip to content

add azure linux-specific fips tests #3688

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

Merged
merged 21 commits into from
Apr 8, 2025

Conversation

tobiasb-ms
Copy link
Contributor

Add Azure Linux-specific tests around FIPS compliance. Specifically, this change adds:

verify_fips_is_enabled_azl: Verifies that an AZL system is in FIPS mode.
verify_fips_is_disabled_azl: Verifies that an AZL system is not in FIPS mode.
verify_fips_enable_azl: Verifies that an AZL system can be put into FIPS mode.
verify_fips_disable_azl: Verifies that an AZL system can be taken out of FIPS mode.

It also removes the AZL code from verify_fips_enable.

Due to the nature of these tests, they only make sense to run if we believe a machine is already in the correct mode. For example, verify_fips_is_enabled_azl would make sense on the marketplace image MicrosoftCBLMariner:azure-linux-3:azure-linux-3-fips:latest but not on MicrosoftCBLMariner:azure-linux-3:azure-linux-3:latest.

To accomplish this, we look at two things (see function ensure_fips_expectations).
First, we see if a variable testing_fips_image was provided to the test case. If so, and if it is yes or no, we respect that.
Second, we try to hit the azure metadata endpoint to get the image sku name. If that is a FIPS sku, we consider it to be a FIPS machine.
If neither exist, we skip the test.

@squirrelsc
Copy link
Member

@tobiasb-ms please continue to fix errors in the PR checks.
@LiliDeng LGTM

@tobiasb-ms
Copy link
Contributor Author

@tobiasb-ms please continue to fix errors in the PR checks.
All checks now pass.

@tobiasb-ms tobiasb-ms marked this pull request as ready for review April 7, 2025 19:22
@LiliDeng LiliDeng merged commit b0e91fe into microsoft:main Apr 8, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants