Skip to content

Navigation Menu

Sign in
Sign up

[AI Generated]: fix fips skip unsupported Ubuntu kernels - #4701

Open
LiliDeng wants to merge 1 commit into
main from
bugfix/ubuntu-24-04-fips-enablement
Open

[AI Generated]: fix fips skip unsupported Ubuntu kernels #4701
LiliDeng wants to merge 1 commit into
main from
bugfix/ubuntu-24-04-fips-enablement

Conversation

@LiliDeng

@LiliDeng LiliDeng commented Sep 4, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI lite review requested due to automatic review settings September 4, 2026 05:18

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.

🟡 Changes recommended

The updated Debian/Ubuntu enablement test now depends on node.tools[Fips], but the tool factory does not currently support Debian, which will cause the test to fail with UnsupportedDistroException.
Key Test Cases:
verify_fips_enablement|verify_azl_fips_status

Impacted LISA Features:
StartStop

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts latest
  • debian debian-12 12 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3 latest

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the FIPS tooling and security test coverage to better handle cases where /proc/sys/crypto/fips_enabled may be missing (treating it as "not in FIPS mode"), and refactors the Debian/Ubuntu enablement flow to use the shared Fips.is_kernel_fips_mode() helper.

Changes:

  • Extend lisa.tools.Fips factory logic to return a tool instance on Ubuntu, and make is_kernel_fips_mode() tolerant of missing /proc/sys/crypto/fips_enabled.
  • Refactor Debian/Ubuntu FIPS enablement verification to use Fips.is_kernel_fips_mode() and improve the post-enable assertion message.
  • Mark the node dirty before changing GRUB kernel cmdline and rebooting.
File summaries
File Description
lisa/tools/fips.py Adds Ubuntu support in the tool factory and makes kernel FIPS mode detection tolerant to missing /proc flag.
lisa/microsoft/testsuites/security/fips.py Uses Fips.is_kernel_fips_mode() in the Debian/Ubuntu path and marks the node dirty before GRUB changes + reboot.
Review details

Suppressed comments (1)

lisa/tools/fips.py:42

  • FipsTests._verify_fips_enablement_debian() calls node.tools[Fips] on Debian, but the factory currently only creates a tool instance for Ubuntu (and CBLMariner). This will raise UnsupportedDistroException on Debian and break the test; include Debian in the factory branch (and update the error message to match).
 if isinstance(node.os, Ubuntu):
 return Fips(node, args, kwargs)
 raise UnsupportedDistroException(
 os=node.os,
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lisa/tools/fips.py Outdated

LiliDeng commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

AI Test Case Selection

Selected 3 test case(s): verify_openssl_basic,verify_golang_sys_crypto,verify_openssl_speed_test

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

Result: Succeeded

View full logs in Azure DevOps

Copilot AI review requested due to automatic review settings September 4, 2026 06:28
LiliDeng force-pushed the bugfix/ubuntu-24-04-fips-enablement branch from 8509c5f to ef8206c Compare September 4, 2026 06:28

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.

🟡 Changes recommended

The Fips tool is now exposed on Debian-based OSes but still contains CBL-Mariner-specific enable/disable semantics, which creates a correctness risk for future call sites.

Key Test Cases:
verify_fips_enablement|verify_azl_fips_status

Impacted LISA Features:
Disk

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
  • debian debian-12 12-gen2 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lisa/tools/fips.py
Comment thread lisa/tools/fips.py

LiliDeng commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

AI Test Case Selection

Selected 3 test case(s): verify_openssl_basic,verify_golang_sys_crypto,verify_openssl_speed_test

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

Result: Failed

View full logs in Azure DevOps

Copilot AI review requested due to automatic review settings September 4, 2026 15:10
LiliDeng force-pushed the bugfix/ubuntu-24-04-fips-enablement branch from ef8206c to 75ae7ba Compare September 4, 2026 15:10

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.

🟡 Changes recommended

The Debian/Ubuntu path should also skip when /proc/sys/crypto/fips_enabled is missing; otherwise the test may proceed into an enable/verify flow that cannot succeed on unsupported kernels.

Key Test Cases:
verify_fips_enablement|verify_azl_fips_status

Impacted LISA Features:
Disk

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
  • debian debian-12 12-gen2 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

lisa/tools/fips.py:45

  • The factory now returns the Fips tool for Debian-based OS, but the tool's enable/disable/assert paths are AZL/CBLMariner-specific (e.g., dracut-fips package handling). The error message currently implies broad Debian support; consider clarifying that Debian-based support is limited to probing /proc/sys/crypto/fips_enabled unless full Debian enablement is implemented.
 if isinstance(node.os, Debian):
 return Fips(node, args, kwargs)
 raise UnsupportedDistroException(
 os=node.os,
 message="FIPS tool only supports CBLMariner 2.0/3.0 and Debian-based OS.",
 )
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lisa/microsoft/testsuites/security/fips.py
Comment thread lisa/microsoft/testsuites/security/fips.py

LiliDeng commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

AI Test Case Selection

Selected 3 test case(s): verify_openssl_basic,verify_golang_sys_crypto,verify_openssl_speed_test

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

Result: Succeeded

View full logs in Azure DevOps

@LiliDeng LiliDeng changed the title (削除) fix(fips): skip unsupported Ubuntu kernels (削除ここまで) (追記) [AI Generated]: fix fips skip unsupported Ubuntu kernels (追記ここまで) Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort, defaults to Lite
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@johnsongeorge-w Johnson (johnsongeorge-w) Awaiting requested review from johnsongeorge-w johnsongeorge-w is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /