Skip to content

/etc/machine-id should not be inherited from templates #8833

@emanruse

Description

@emanruse

Qubes OS release

4.1.2

Brief summary

Currently, all VMs based on a particular template inherit its /etc/machine-id, because it is persistent. This has privacy implications.

From machine-id documentation:

"This ID uniquely identifies the host. It should be considered "confidential", and must not be exposed in untrusted environments, in particular on the network. If a stable unique identifier that is tied to the machine is needed for some application, the machine ID or any part of it must not be used directly."

Steps to reproduce

cat /etc/machine-id in template and VMs using it.

Expected behavior

Qubes OS's templates are essentially golden images. As also described in systemd's documentation, "each instance should automatically acquire its own identifying credentials on first boot", i.e. /etc/machine-id must not be shared across qubes.

Actual behavior

All qubes based on a certain template have template's /etc/machine-id.

A simple and effective solution is to run this in the template:

touch /run/machine-id                                                           
ln -sfT /run/machine-id /etc/machine-id
sed -ri 's/#Storage=.*/Storage=volatile/g' /etc/systemd/journald.conf

After that, on each boot, the VM will have a new unique machine-id.

The last command ensures that journal will be volatile too (thus, not exercise unnecessary writes to SSDs). Related issue:

#8832

Metadata

Metadata

Assignees

Labels

C: coreThis issue pertains to a Qubes core component.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.privacyThis issue pertains to privacy in Qubes OS or something controlled by the Qubes OS Project.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions