Skip to content

Commit f00022e

Browse files
authored
Merge pull request #28242 from berrange/cond-sec-cvm
Detect and expose the confidential virtualization technology in various places
2 parents b9b0f33 + 6e2e83b commit f00022e

File tree

17 files changed

+450
-4
lines changed

17 files changed

+450
-4
lines changed

man/org.freedesktop.systemd1.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ node /org/freedesktop/systemd1 {
305305
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
306306
readonly s Virtualization = '...';
307307
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
308+
readonly s ConfidentialVirtualization = '...';
309+
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
308310
readonly s Architecture = '...';
309311
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
310312
readonly s Tainted = '...';
@@ -1010,6 +1012,8 @@ node /org/freedesktop/systemd1 {
10101012

10111013
<variablelist class="dbus-property" generated="True" extra-ref="Virtualization"/>
10121014

1015+
<variablelist class="dbus-property" generated="True" extra-ref="ConfidentialVirtualization"/>
1016+
10131017
<variablelist class="dbus-property" generated="True" extra-ref="Architecture"/>
10141018

10151019
<variablelist class="dbus-property" generated="True" extra-ref="Tainted"/>
@@ -1765,6 +1769,12 @@ node /org/freedesktop/systemd1 {
17651769
Note that only the "innermost" virtualization technology is exported here. This detects both
17661770
full-machine virtualizations (VMs) and shared-kernel virtualization (containers).</para>
17671771

1772+
<para><varname>ConfidentialVirtualization</varname> contains a short ID string describing the confidential
1773+
virtualization technology the system runs in. On bare-metal hardware this is the empty string. Otherwise,
1774+
it contains an identifier such as <literal>sev</literal>, <literal>sev-es</literal>, <literal>sev-snp</literal>,
1775+
<literal>tdx</literal> and so on. For a full list of IDs see
1776+
<citerefentry><refentrytitle>systemd-detect-virt</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>.
1777+
17681778
<para><varname>Architecture</varname> contains a short ID string describing the architecture the
17691779
systemd instance is running on. This follows the same vocabulary as
17701780
<varname>ConditionArchitectures=</varname>.</para>

man/systemd-detect-virt.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,16 @@
257257
for more information.</para></listitem>
258258
</varlistentry>
259259

260+
<varlistentry>
261+
<term><option>--cvm</option></term>
262+
263+
<listitem><para>Detect whether invoked in a confidential virtual machine.
264+
The result of this detection may be used to disable features that should
265+
not be used in confidential VMs. It must not be used to release security
266+
sensitive information. The latter must only be released after attestation
267+
of the confidential environment.</para></listitem>
268+
</varlistentry>
269+
260270
<varlistentry>
261271
<term><option>-q</option></term>
262272
<term><option>--quiet</option></term>
@@ -271,6 +281,12 @@
271281
<listitem><para>Output all currently known and detectable container and VM environments.</para></listitem>
272282
</varlistentry>
273283

284+
<varlistentry>
285+
<term><option>--list-cvm</option></term>
286+
287+
<listitem><para>Output all currently known and detectable confidential virtualization technologies.</para></listitem>
288+
</varlistentry>
289+
274290
<xi:include href="standard-options.xml" xpointer="help" />
275291
<xi:include href="standard-options.xml" xpointer="version" />
276292
</variablelist>

man/systemd.generator.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@
204204
<command>systemd-creds --system cat</command> command.</para></listitem>
205205
</varlistentry>
206206

207+
<varlistentry>
208+
<term><varname>$SYSTEMD_CONFIDENTIAL_VIRTUALIZATION</varname></term>
209+
210+
<listitem><para>If the service manager is run in a confidential virtualized environment,
211+
<varname>$SYSTEMD_CONFIDENTIAL_VIRTUALIZATION</varname> is set to a string that identifies
212+
the confidential virtualization hardware technology. If no confidential virtualization is
213+
detected this variable will not be set. This data is identical to what
214+
<citerefentry><refentrytitle>systemd-detect-virt</refentrytitle><manvolnum>1</manvolnum></citerefentry>
215+
detects and reports, and uses the same vocabulary of confidential virtualization
216+
technology identifiers.</para></listitem>
217+
</varlistentry>
207218
</variablelist>
208219
</refsect1>
209220

man/systemd.unit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,8 @@
14041404
security technology is enabled on the system. Currently, the recognized values are
14051405
<literal>selinux</literal>, <literal>apparmor</literal>, <literal>tomoyo</literal>,
14061406
<literal>ima</literal>, <literal>smack</literal>, <literal>audit</literal>,
1407-
<literal>uefi-secureboot</literal> and <literal>tpm2</literal>. The test may be negated by prepending
1408-
an exclamation mark.</para>
1407+
<literal>uefi-secureboot</literal>, <literal>tpm2</literal> and <literal>cvm</literal>.
1408+
The test may be negated by prepending an exclamation mark.</para>
14091409
</listitem>
14101410
</varlistentry>
14111411

man/udev.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@
279279
for possible values.</para>
280280
</listitem>
281281
</varlistentry>
282+
<varlistentry>
283+
<term><literal>cvm</literal></term>
284+
<listitem>
285+
<para>System's confidential virtualization technology. See
286+
<citerefentry><refentrytitle>systemd-detect-virt</refentrytitle><manvolnum>1</manvolnum></citerefentry>
287+
for possible values.</para>
288+
</listitem>
289+
</varlistentry>
282290
</variablelist>
283291
<para>Unknown keys will never match.</para>
284292
</listitem>

shell-completion/bash/systemd-detect-virt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ _systemd_detect_virt() {
2828
local i verb comps
2929

3030
local -A OPTS=(
31-
[STANDALONE]='-h --help --version -c --container -v --vm -q --quiet
32-
--private-users'
31+
[STANDALONE]='-h --help --version -c --container -v --vm -q --quiet --cvm
32+
--private-users --list --list-cvm'
3333
)
3434

3535
_init_completion || return

0 commit comments

Comments
 (0)