Skip to content

Conversation

LaserEyess
Copy link

See commit message for an overview, but this is an RFC, I can understand if the project does not want this. The goal here is defense in depth. If there is a bug in any access control or authentication mechanism in rsync, there should be additional protections to not compromise a system running rsync --daemon as root. This can be accomplished through systemd, so that the damage done by a hypothetical RCE is minimized as much as possible.

I have personally tested this and it does not affect file transfers for either unit. That being said, I understand a lot of the options may be confusing. I can explain why each one of these is a safe default that does not affect file transfers.

This commit adds hardening to the systemd service with a variety of
knobs designed to restrict damage that rsync can do as root, while
making sure that no file transfers are interrupted. For example,
ProtectHome= is still off, and CapabilityBoundingSet is still unlimited
to allow for chown/chmod to work unimpeded.

The [email protected] has some additional options to restrict all network
access and only use the socket on stdin. An equivalent change was done
in rsync.service to only allow TCP, but full network isolation is not
possible for that unit.
@LaserEyess LaserEyess marked this pull request as draft August 28, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant