You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/deploy/virt-cloud-agent.service

53 lines
1.7 KiB
INI

[Unit]
Description=Virt Cloud Go host agent
Documentation=https://g.luoli.live/root/virt/-/blob/go-agent/docs/GO_AGENT_DEPLOYMENT.md
After=network-online.target libvirtd.service virtqemud.service
Wants=network-online.target
# Do not add an ExecStartPre permission/ownership probe here. The agent must
# keep loopback liveness available when its journal, identity, or TLS material
# is unavailable. A remote bind without usable mTLS exits instead of exposing
# a plaintext listener; loopback remains degraded and rejects mutating calls.
[Service]
Type=exec
User=root
Group=root
WorkingDirectory=/
EnvironmentFile=-/etc/virt-cloud-agent/agent.env
ExecStart=/usr/local/bin/virt-cloud-agent
Restart=on-failure
RestartSec=5s
TimeoutStopSec=30s
UMask=0077
# The agent invokes the host libvirt client and may access explicitly
# allowlisted storage paths. Root is an interim boundary until a dedicated
# service account and libvirt ACL contract are proven. Do not broaden
# ReadWritePaths without reviewing the artifact/storage operation contract.
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/var/lib/virt-cloud-agent
ReadWritePaths=/var/lib/virt-cloud-agent/artifacts
ReadWritePaths=/var/lib/virt-cloud-agent/tmp
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
RestrictSUIDSGID=true
RestrictRealtime=true
SystemCallArchitectures=native
LimitNOFILE=65536
LimitCORE=0
# Artifact and VM-disk operations must add exact host paths in a reviewed
# drop-in, for example:
# ReadWritePaths=/var/lib/libvirt/images
# Never grant the whole filesystem or a user-controlled path.
[Install]
WantedBy=multi-user.target