Request: waagent auto-connect for tpm and installation/auto-connect for tpm-event-log (system-files)

name: waagent
description: >-
  Microsoft Azure Linux Agent, packaged as a strictly confined snap for Ubuntu
  Core. It reports VM health to Azure, processes goal states, and runs Azure VM
  extensions, including Microsoft's GuestAttestation extension.
snapcraft: https://github.com/canonical/snap-waagent/blob/428a780/snap/snapcraft.yaml
upstream: https://github.com/Azure/WALinuxAgent
upstream-relation: >-
  Canonical publishes and maintains the snap packaging for Ubuntu Core;
  Microsoft maintains the upstream Azure Linux Agent.
plugs:
  tpm:
    request-type: auto-connection
    reasoning: >-
      Microsoft's GuestAttestation extension runs under waagent's confinement
      and requires TPM device access to obtain attestation-key information,
      PCR values, and a signed PCR quote. Without this connection, TPM interface
      initialization fails. Successful guest attestation is required by Azure's
      certification test before the image can be published in Azure Marketplace
      with Trusted Launch support.
  tpm-event-log:
    interface: system-files
    attributes:
      read:
        - /sys/kernel/security/tpm0/binary_bios_measurements
    request-type: auto-connection
    reasoning: >-
      GuestAttestation must read the kernel's TCG measured-boot event log, which
      the tpm interface does not expose. Without this connection, AppArmor denies
      the read and Azure rejects attestation because TcgLogs is empty. Connecting
      this plug fixes attestation. Installation approval for these system-files
      attributes is also requested: revision 9 is currently blocked on human
      review. Both permissions are needed for working attestation by default.
slots: {}

Hello Store reviewers,

Please grant the following snap-declaration permissions for waagent (snap ID fRhDiEoI3Ey1HmMdfWaLetIPVN6npr8U):

  • Installation and auto-connection of the tpm-event-log plug, using system-files with read access to /sys/kernel/security/tpm0/binary_bios_measurements only.
  • Auto-connection of the existing tpm interface.

This is for the strictly confined Azure Linux Agent snap used in our Ubuntu Core 26 Azure images. We are not proposing a new snapd interface: the request concerns a new, narrowly scoped system-files plug and use of the existing tpm interface.

Why this is required: Azure Marketplace Trusted Launch certification

Azure’s Marketplace image certification requires the Microsoft GuestAttestation extension to perform successful guest attestation. We cannot publish our Ubuntu Core image with Trusted Launch support (including the ability to enable Secure Boot) in Azure Marketplace unless it passes this Azure certification test. This is an Azure publication requirement, not a check imposed by our own image-building workflow. Having Secure Boot and a vTPM enabled on the test VM is not sufficient to pass: the extension must actually be able to collect the evidence and complete remote attestation.

The Linux extension is Microsoft.Azure.Security.LinuxAttestation.GuestAttestation. It uses the VM’s vTPM and measured-boot event log to submit boot-integrity evidence to Microsoft’s attestation service. Microsoft’s Trusted Launch documentation describes vTPM-based remote attestation, and its boot-integrity monitoring documentation documents this extension, including its Linux publisher and deployment settings.

waagent installs and launches Azure VM extensions. On Ubuntu Core, these extension processes run within the agent snap’s confinement. Consequently, the GuestAttestation client needs these permissions on the agent’s plug connections, even though the client collecting attestation evidence is an extension rather than the agent’s provisioning code itself. The kernel denial below confirms that the extension runs under snap.waagent.waagent.

Why both connections are needed

  1. tpm permits communication with /dev/tpm* and /dev/tpmrm*. The client uses TPM commands to obtain attestation-key information, PCR values, and a signed PCR quote. Without this connection, our test extension cannot initialize its TPM Command Transmission Interface (TCTI).
  2. tpm-event-log permits reading the kernel’s binary TCG measured-boot log. The log describes the boot measurements corresponding to the PCR evidence. The tpm interface does not grant this file access: its snapd 2.77.1 policy grants TPM device access, not the securityfs event log.

Microsoft’s public attestation library illustrates the failure path: GetMeasurements() catches failures reading the TCG log, logs “TCG logs not found on device”, and proceeds with empty measurements. Its Linux log reader throws when it cannot open the log. The deployed extension independently demonstrates this behavior below: an AppArmor denial becomes an empty TcgLogs field, which the remote service rejects.

The requested declaration is:

plugs:
  tpm-event-log:
    interface: system-files
    read:
      - /sys/kernel/security/tpm0/binary_bios_measurements

apps:
  waagent:
    plugs:
      - tpm
      - tpm-event-log

This excerpt omits the app’s existing command and other plugs. The change was introduced in commit 3c7f926 (“feat: add tpm interfaces for agent guest attestation”) and merged in 428a780.

Evidence from an Azure Ubuntu Core 26 VM

Tested on November 5, 2026, with strict confinement throughout. Azure reports securityType: TrustedLaunch, secureBootEnabled: true, and vTpmEnabled: true. The TPM devices and event-log file exist on the guest; this is not missing hardware or disabled vTPM.

Environment: amd64, Ubuntu Core 26, snapd 2.77.1, kernel 7.0.0-1017-azure, and GuestAttestation handler 1.0.1.48. The initial Store snap was revision 8, version 0+git.225e1b0, with WALinuxAgent 2.15.0.1. The new snap was sideloaded as strictly confined local revision x1, version 0+git.428a780, containing WALinuxAgent 2.16.0.2.

State GuestAttestation result
Initial revision 8, without the new TPM plugs Failed to initialize TCTI context, code=655370
New revision x1, tpm connected, tpm-event-log disconnected Remote attestation rejected: TcgLogs is empty in attestation request.
Same revision x1, both plugs connected Successfully completed guest attestation

The event-log failure and success were tested using the same new snap and extension version, changing the event-log connection and restarting/retriggering the extension. No devmode or AppArmor relaxation was used.

Actual extension-generated AppArmor denial

With tpm connected but tpm-event-log disconnected:

Nov 05 10:40:50 gjolly-core26-vm kernel: audit: type=1400 audit(1793875250.198:1446): apparmor="DENIED" operation="open" class="file" profile="snap.waagent.waagent" name="/sys/kernel/security/tpm0/binary_bios_measurements" pid=5986 comm="AttestationClie" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

The requester is already root (fsuid=0), and the file is root-owned (ouid=0). It is the snap’s AppArmor policy that blocks this read.

At the same time, the extension logs:

[05-11-2026 10-40-50Z] Level:Warn Tag:AttestatationClientLib GetMeasurements:749 TCG logs not found on device

Its Azure-reported substatus contains the service rejection:

{"error":{"code":"InvalidParameter","message":"The requested item is not found","innererror":{"code":"MissingKey","message":"TcgLogs is empty in attestation request."}}}

Importantly, Azure still reports the extension’s top-level provisioning as Succeeded, with “Enable operation succeeded with warnings”. The guest attestation itself has failed, as shown by the warning substatus. Merely checking extension installation/provisioning success would miss the problem.

Connecting the event-log plug fixes attestation

After:

sudo snap connect waagent:tpm-event-log
sudo snap restart waagent

and retriggering GuestAttestation, a read inside snap run --shell waagent succeeds and returns 56,579 bytes of event-log data. The extension then logs:

[05-11-2026 10-41-39Z] Level:Info Tag:AttestatationClientLib Attest:237 Successfully attested and decrypted response.
[05-11-2026 10-41-39Z] Level:Info Tag:AttestatationClient AttestAndDecrypt:96 Successfully completed guest attestation

Azure’s instance view now reports:

{
  "code": "ComponentStatus/GuestAttestation/succeeded",
  "level": "Info",
  "message": "Successfully completed guest attestation"
}

Why auto-connection, not just installation approval

These permissions are necessary for an expected platform capability of our default Azure agent: running the attestation extension used to validate the image’s Trusted Launch readiness. They must be available when Azure deploys that extension, including on fresh VMs created for image certification and by Marketplace customers.

Requiring an operator to SSH into every VM and connect the interfaces before the extension can attest would leave the image’s default behavior failing this requirement. Installation approval alone would unblock the upload but leave the runtime failure in place. We therefore request both installation permission for the scoped system-files plug and automatic connection of both plugs.

The current upload of waagent_0+git.428a780_amd64.snap is held for review with:

human review required due to 'allow-installation' constraint (plug-attributes)

The system-files base declaration requires installation approval and denies auto-connection by default; tpm also denies auto-connection by default.

Scope and security considerations

  • The new system-files plug requests read access to one kernel-provided measured-boot log, not write access, a general securityfs directory, or unrelated host logs.
  • The tpm interface is not read-only: TPM command transport requires read/write device access, and the interface exposes broader TPM command capability than just reading a log. This is an explicit part of the request, justified by the platform’s attestation-key/PCR/quote operations.
  • Extension code inherits the agent snap’s confinement; the permissions apply to processes in that confinement, not exclusively to this one extension. All other snap confinement remains in effect.
  • The permission is for Canonical’s Azure platform-agent snap, to enable Microsoft’s platform attestation workflow. It does not require classic confinement or devmode, nor any write permission to the measured-boot log.

Please approve this scoped installation permission and auto-connection so the agent can support working guest attestation by default on our Ubuntu Core Azure images.

This request has been added to the queue for review by the @reviewers team.