Skip to content

eBPF-based security platform

1.2 KB
Raw Blame
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2026 Authors of shirudo
#
# shirudo reboot-persistence unit: the root file system's half.
#
# bpffs and the kernel keyrings do not survive a reboot, so the BPF LSM
# and the loaded upatch set must be re-applied on every boot. This unit
# runs `shirudo init` as early as a filesystem-dependent service can,
# inside the sysinit phase.
#
# The initrd loads the authenticated runtime and signed config before
# switch-root. Install the runtime-service.conf drop-in generated with the
# runtime image; it starts the trusted loader and executable for this phase.
# This run adopts the initrd eventlog record and checks the existing state.

[Unit]
Description=shirudo: bring up the BPF LSM and re-apply signed upatches
DefaultDependencies=no
After=local-fs.target systemd-tpm2-setup-early.service
After=systemd-pcrnvdone.service
Before=sysinit.target shutdown.target
Conflicts=shutdown.target
RequiresMountsFor=/var/lib/shirudo
ConditionPathIsMountPoint=/run/shirudo/runtime

[Service]
Type=oneshot
SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
RemainAfterExit=yes
KeyringMode=inherit
EnvironmentFile=-/etc/shirudo/init.env
ExecStart=@bindir@/shirudo init $SHIRUDO_INIT_ARGS

[Install]
WantedBy=sysinit.target