Skip to content

[AI Generated] BugFix: Add Debian/Ubuntu FIPS enablement support in verify_fips_enablement#4530

Open
johnsongeorge-w wants to merge 1 commit into
mainfrom
bugfix/fips-ubuntu-skip_110626_160630
Open

[AI Generated] BugFix: Add Debian/Ubuntu FIPS enablement support in verify_fips_enablement#4530
johnsongeorge-w wants to merge 1 commit into
mainfrom
bugfix/fips-ubuntu-skip_110626_160630

Conversation

@johnsongeorge-w

@johnsongeorge-w johnsongeorge-w commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add Debian/Ubuntu support to verify_fips_enablement test, which previously only handled CBL-Mariner. Ubuntu FIPS images were incorrectly skipped.

Changes

  • Add _verify_fips_enablement_debian() method that:
    • Detects FIPS kernel by checking uname -r for 'fips' in name
    • If FIPS already enabled: verifies /proc/sys/crypto/fips_enabled is 1
    • If FIPS kernel present but not enabled: enables via GrubConfig.set_kernel_cmdline_arg(), reboots, and verifies
    • Skips on non-FIPS Debian/Ubuntu images
  • Add supported_os=[CBLMariner, Ubuntu] requirement to verify_fips_enablement
  • Remove unsupported fips-mode-setup path — other distros now skip cleanly

Testing

Image Type Scenario Result
Canonical pro-fips-22_04 (marketplace, x64) FIPS already enabled Verify enabled PASSED
jammy_linux-image-azure-fips (shared gallery, ARM64) FIPS kernel, not enabled Enable + verify PASSED

Copilot AI review requested due to automatic review settings June 12, 2026 22:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the FipsTests.verify_fips_enablement security test to handle Debian-based distros (Ubuntu/Debian) by detecting FIPS kernels and enabling FIPS via GRUB boot parameters when needed, instead of relying on fips-mode-setup paths intended for other distros.

Changes:

  • Adds a Debian-based verification path (_verify_fips_enablement_debian) that checks /proc/sys/crypto/fips_enabled, detects FIPS kernels via uname -r, and enables fips=1 via GRUB when required.
  • Narrows/clarifies non-supported distro behavior by skipping cleanly with a targeted message instead of probing for fips-mode-setup.
  • Updates the verify_fips_enablement OS requirement to include Debian/Ubuntu alongside CBL-Mariner.

Comment thread lisa/microsoft/testsuites/security/fips.py
Comment thread lisa/microsoft/testsuites/security/fips.py Outdated
Comment thread lisa/microsoft/testsuites/security/fips.py
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

3 test case(s) selected (view run)

Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 0
Total 3
Test case details
Test Case Status Time (s) Message
verify_openssl_basic (lisa_0_0) ✅ PASSED 15.528
verify_golang_sys_crypto (lisa_0_1) ✅ PASSED 143.400
verify_openssl_speed_test (lisa_0_2) ✅ PASSED 331.839

@johnsongeorge-w johnsongeorge-w force-pushed the bugfix/fips-ubuntu-skip_110626_160630 branch from dc91769 to 072f0bd Compare June 12, 2026 23:09
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

3 test case(s) selected (view run)

Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 0
Total 3
Test case details
Test Case Status Time (s) Message
verify_openssl_basic (lisa_0_0) ✅ PASSED 14.891
verify_golang_sys_crypto (lisa_0_1) ✅ PASSED 142.864
verify_openssl_speed_test (lisa_0_2) ✅ PASSED 384.634

@johnsongeorge-w johnsongeorge-w changed the title BugFix: Add Debian/Ubuntu FIPS enablement support in verify_fips_enablement [AI Generated] BugFix: Add Debian/Ubuntu FIPS enablement support in verify_fips_enablement Jun 12, 2026
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