Skip to content

Commit 1572b87

Browse files
authored
Merge pull request #667 from gibmat/add-swtpm-support
Add swtpm fallback for systems without physical TPM
2 parents e7217aa + 718ba7c commit 1572b87

35 files changed

Lines changed: 2110 additions & 525 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ incus-osd/generate-manifests
1919
incus-osd/image-customizer
2020
incus-osd/image-publisher
2121
incus-osd/incus-osd
22+
incus-osd/measure-pcrs
2223

2324
mkosi.packages/initrd-tmpfs-root*
2425

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ generate-manifests:
2525
(cd incus-osd && go build ./cmd/generate-manifests)
2626
strip incus-osd/generate-manifests
2727

28+
.PHONY: measure-pcrs
29+
measure-pcrs:
30+
(cd incus-osd && go build ./cmd/measure-pcrs)
31+
strip incus-osd/measure-pcrs
32+
2833
.PHONY: initrd-deb-package
29-
initrd-deb-package:
34+
initrd-deb-package: measure-pcrs
3035
$(eval OSNAME := $(shell grep "ImageId=" mkosi.conf | cut -d '=' -f 2))
36+
cp incus-osd/measure-pcrs mkosi.packages/initrd-tmpfs-root/
3137
(cd mkosi.packages/initrd-tmpfs-root && cp initrd-boot-message.service.in initrd-boot-message.service && sed -i -e "s/@OSNAME@/${OSNAME}/" initrd-boot-message.service && debuild)
3238
rm -rf mkosi.packages/initrd-tmpfs-root/debian/.debhelper/ mkosi.packages/initrd-tmpfs-root/debian/debhelper-build-stamp \
3339
mkosi.packages/initrd-tmpfs-root/debian/files \mkosi.packages/initrd-tmpfs-root/debian/initrd-tmpfs-root.postrm.debhelper \

doc/.wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Furo
2424
FuturFusion
2525
GiB
2626
Github
27+
homelab
2728
HTTPS
2829
Incus
2930
IncusOS
@@ -69,6 +70,7 @@ proxied
6970
Proxmox
7071
Proxmox's
7172
raidz
73+
RaspberryPi
7274
resilver
7375
RSA
7476
SLAAC

doc/getting-started/requirements.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ Minimum system requirements:
1212
- At least 4GiB of RAM (for system use only)
1313
- At least 50GiB of storage
1414
- At least one wired network port
15+
16+
```{note}
17+
For homelab and evaluation use, it is possible for IncusOS to rely on a software-backed TPM implementation. This is useful in scenarios such as running IncusOS on most consumer-grade ARM systems that may lack physical TPM chips.
18+
19+
Be aware that this will weaken the overall security of the IncusOS server, and is not supported in enterprise deployments. For further details, see [Installing without a TPM](../reference/installing-without-tpm.md).
20+
```

doc/reference.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Applications </reference/applications>
1111
Services </reference/services>
1212
System configuration </reference/system>
1313
API </reference/api>
14+
Installing without a TPM </reference/installing-without-tpm>
1415
Partitioning scheme </reference/partitioning-scheme>
1516
Recovery </reference/recovery>
16-
Seed </reference/seed>
1717
Security </reference/security>
18+
Seed </reference/seed>
1819
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Installing without a TPM
2+
3+
IncusOS depends on the TPM in conjunction with Secure Boot to provide trusted measurements of the system state when applying updates and automatically unlocking encrypted storage pools at boot. However, not all hardware systems come with a TPM, and for those that don't it may be cost prohibitive to purchase a TPM. A common example are consumer-grade ARM systems, such as the RaspberryPi.
4+
5+
To support homelab users and others who wish to run IncusOS on physical machines without a TPM, a [`swtpm`-backed](https://github.com/stefanberger/swtpm) TPM can be configured. Please be aware that this will **WEAKEN THE OVERALL SECURITY OF THE INCUSOS SERVER**:
6+
7+
* Unlike a physical TPM, it is trivial to inspect and change the software TPM state.
8+
9+
* A physical TPM has already measured several critical PCR values before the kernel starts booting. IncusOS performs these same measurements early in the boot process, but from user-space. This opens some avenues of attack, but is at least partially mitigated by the Secure Boot configuration.
10+
11+
Running IncusOS in an enterprise environment without a physical TPM is **UNSUPPORTED**.
12+
13+
IncusOS will display a prominent warning on its status screen when running with a software-backed TPM.
14+
15+
```{warning}
16+
Here Be Dragons!
17+
18+
It must be reiterated that running IncusOS without a physical TPM weakens the overall security of the system and is not intended for use in enterprise deployments.
19+
20+
Any IncusOS system that has ever booted with a software-backed TPM will permanently record this fact and report it via the Security API `system_state_is_trusted` field. IncusOS systems that are not fully trusted may be treated differently by Operations Center or other products that interact with IncusOS via its API.
21+
```
22+
23+
## Install seed
24+
25+
When configuring the IncusOS [install seed](./seed.md), set the `use_swtpm` field to `true`. This will cause IncusOS to configure a software TPM during installation. This option will only take affect if no physical TPM is detected.
26+
27+
## Running off a live USB drive
28+
29+
If booting IncusOS off of a live USB drive, IncusOS will automatically configure a software TPM on first boot if no physical TPM is detected and then automatically restart. This restart is necessary to properly initialize the software TPM and setting up the encrypted disk partitions for use.

0 commit comments

Comments
 (0)