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

feat(xo-web/VM): display accurate Secure Boot status #7751

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

Pizzosaure
Copy link
Contributor

@Pizzosaure Pizzosaure commented Jun 17, 2024

Description

Fixes #7495
secureBootStatus
propagateCertificatesButton
propagateCertificates

Checklist

  • Commit
    • Title follows commit conventions
    • Reference the relevant issue (Fixes #007, See xoa-support#42, See https://...)
    • If bug fix, add Introduced by
  • Changelog
    • If visible by XOA users, add changelog entry
    • Update "Packages to release" in CHANGELOG.unreleased.md
  • PR
    • If UI changes, add screenshots
    • If not finished or not tested, open as Draft

@Pizzosaure Pizzosaure requested a review from pdonias June 24, 2024 15:03
@Pizzosaure Pizzosaure marked this pull request as ready for review June 24, 2024 15:08
</td>
</tr>
)}
{vm.boot.firmware === 'uefi' && semver.satisfies(host?.version, '>=8.3.0') && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the moment the warning "This feature is only available for UEFI VMs" is always displayed, this should be fixed when this PR will be merged, thanks to the fix in #7767

const SECUREBOOT_STATUS_MESSAGES = {
disabled: _('secureBootStatusNotEnforced'),
first_boot: _('secureBootStatusPending'),
ready: _('secureBootStatus'),
Copy link
Collaborator

@stormi stormi Jun 26, 2024

Choose a reason for hiding this comment

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

This displays just "Secure Boot status". I think that it's a mistake and that a secureBootStatusReady message is missing.

Copy link
Collaborator

@stormi stormi left a comment

Choose a reason for hiding this comment

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

Most things work well, but I found a few issues, and there's also something important from the specs that is missing : "This should be displayed both in the general VM view, because it's an important piece of information, and also below the Secure Boot switch in the Advanced view of the VM, updated whenever someone changes the switch's state." (by "general VM view", I meant the VM's "General" tab).

Comment on lines +200 to +201
setup_mode: _('secureBootWantedButDisabled'),
certs_incomplete: _('secureBootWantedButCertificatesMissing'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I initially thought all message identifiers were to start with secureBootStatus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some identifiers are already pretty long and I wanted to keep a certain consistency, but reading this again I see I failed at that in some of them... Maybe change this one to just secureBootNoDbx or change them all to start with securebootStatus

>
{_('propagateCertificates')}
</ActionButton>
{isDisabled && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I read it well, this condition is not enough. It should not display the warning about UEFI being required in the case when the reason why it's disabled is because poolGuestSecurebootReadiness === 'not_ready'.

As currently implemented, when the pool is not ready for Secure Boot, both warnings are displayed. We should only see one.

image

})
}

await vmSetUefiMode(vm, 'user')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This fails with method not found: vm.setUefiMode.

In addition to this, the error popup has a "show logs" button, but when clicked it doesn't show any log that is related to the error.

</td>
</tr>
)}
{vm.boot.firmware === 'uefi' && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it was not very clear in the specs, but the new method that allows to propagate certificates is only available starting with XCP-ng 8.3 (and possibly XenServer 8, but they don't really need it).

@Pizzosaure Pizzosaure requested review from pdonias and MathieuRA and removed request for pdonias June 27, 2024 14:25
packages/xo-web/src/xo-app/vm/tab-general.js Outdated Show resolved Hide resolved
packages/xo-web/src/common/xo/index.js Outdated Show resolved Hide resolved
@xen-orchestra/xapi/vm.mjs Outdated Show resolved Hide resolved
CHANGELOG.unreleased.md Outdated Show resolved Hide resolved
}

getGuestSecureBootReadiness.params = {
pool: {
Copy link
Member

Choose a reason for hiding this comment

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

name the param as id instead

packages/xo-server/src/xapi-object-to-xo.mjs Outdated Show resolved Hide resolved
packages/xo-server/src/xapi-object-to-xo.mjs Outdated Show resolved Hide resolved
packages/xo-web/src/common/xo/index.js Outdated Show resolved Hide resolved
@@ -36,6 +36,7 @@ import {
import { CpuSparkLines, MemorySparkLines, NetworkSparkLines, XvdSparkLines } from 'xo-sparklines'
import { injectState, provideState } from 'reaclette'
import { find } from 'lodash'
import { subscribeSecurebootReadiness } from '../../common/xo'
Copy link
Member

Choose a reason for hiding this comment

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

move this import into the xo import. Line 15

packages/xo-server/src/api/pool.mjs Outdated Show resolved Hide resolved
packages/xo-web/src/common/xo/index.js Outdated Show resolved Hide resolved
Pizzosaure and others added 2 commits June 28, 2024 10:08
Co-authored-by: Pierre Donias <pierre.donias@gmail.com>
CHANGELOG.unreleased.md Outdated Show resolved Hide resolved
CHANGELOG.unreleased.md Show resolved Hide resolved
Pizzosaure and others added 2 commits June 28, 2024 10:44
Co-authored-by: Mathieu <70369997+MathieuRA@users.noreply.github.com>
@Pizzosaure Pizzosaure requested a review from pdonias June 28, 2024 08:54
Copy link
Member

@pdonias pdonias left a comment

Choose a reason for hiding this comment

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

Nothing to add.

This will need to be tested again end-to-end after the latest changes.
Don't forget to add xo-server in the commit message's scope.

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.

Display accurate Secure Boot status and allow to fix a VM's UEFI certs
4 participants