Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#71902 - [bird] 2.0.8-2 uses DynamicUser=true which makes permission management hard
Attached to Project:
Community Packages
Opened by Tim (bastelfreak) - Monday, 23 August 2021, 08:29 GMT
Last edited by Toolybird (Toolybird) - Saturday, 03 June 2023, 23:18 GMT
Opened by Tim (bastelfreak) - Monday, 23 August 2021, 08:29 GMT
Last edited by Toolybird (Toolybird) - Saturday, 03 June 2023, 23:18 GMT
|
DetailsDescription:
since bird 2.0.8-2 our unit file DynamicUser=true. This makes permission management a bit tricky. On other distributions it's common that a real user is created, it owns the configuration files and also the unix socket. Other services that need to access the socket, for example to extract metrics like https://github.com/czerwonk/bird_exporter/releases does it, run as a separate user and are added to the bird group. This won't work with DynamicUser=true. Are there any huge benefits I miss by using DynamicUser=true? Additional info: * package version(s) bird 2.0.8-2 and newer * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: * install bird * try to add another user to the nonexistent bird group I'm happy to provide a sysusers file or to comaintain/adopt the package, but then it would need to be moved to community. Cheers, Tim |
This task depends upon
Static (and well-known) ids are required when the package ship files owned by an uid > 0.
The permission management should be equivalent as soon you have created static users/group.
So, I understand your issue is more about the user/group not created when the package is installed.
Here, this is done on purpose, to add some extra security and reduce the number of useless static users.
IMO DynamicUser=true is only usable when (at minimum) all of the following conditions are met:
a) The application has no sensitive configuration data.
b) The application has no unix socket for external communication.
c) The application has no persistent state.
Bird fails conditions (a) and (b). I suppose technically (c) is the only hard blocker to DynamicUser, but if users of the package have to create a system user/group for sensible and secure operation anyway, what's benefit of not shipping it for them as standard, like all other distros do?
I cannot see a good argument for forcing users to do this work post-install, simply to avoid creating a sysuser - every user of this package will want to configure a static user for it (whether they know it or not), and this is the standard deployment strategy for all other distros.
If its as simple as a single config file that needs ownership, this does not strictly require a static id when systemd tmpfiles feature is used. One example is umurmur:
https://github.com/archlinux/svntogit-community/blob/packages/umurmur/trunk/umurmur.tmpfiles#L1
https://github.com/archlinux/svntogit-community/blob/packages/umurmur/trunk/umurmur.sysusers
Well, the config has sensible defaults and DynamicUser= does not force the config to be insecure.
The common use case for bird is to exchange routes with network peers, which do not require a defined uid/gid, a persistent static directory or even a secret in config file.
So, on the contrary, making the daemon run by default with no persistent files/static uid/gid, enforced by systemd seems to me rather healthy.
If we imagine more complicated use cases like:
1) You require a secret in your bird config.
=> You could easily change the permission on /etc/bird.conf.
2) You want regular users to be able to talk to the daemon (add routes, restart, etc)
=> You could define a static gid and start assigning users to group.
I don't have a dogmatic opinion on the subject, I have other packages that work that way for different reasons.
> But is this worth it? every other bird package I found provides a static user, just Arch Linux goes a different path and that probably leads to confusion for some people. Also I think it's common practice that files containing secrets should be owned and only readable by the user that requires it. That's not possible out of the box on Arch Linux. I still think we should ship a sysusers file.
I don't see any positive sideeffect of DynamicUser= and just the fact that it makes system administration way way easier if the Arch Linux box has the same defaults as every other distribution would be a reason for me to add the sysusers file. That's also how I handle it with my own packages in community.
DynamicUser forces the config to be insecure in that must be world-readable.
> The common use case for bird is to exchange routes with network peers, which do not require a defined uid/gid, a persistent static directory or even a secret in config file.
I guess this is the rationale for the package being configured the way it is, but this statement is false. Secrets are typically required in the bird config - this is not a "complicated use case", it's the common use case.
> You could define a static gid and start assigning users to group.
I've not heard what the rationale is for forcing users to deal with this, instead of providing sensible defaults in the package.
I believe that the package should add a dedicated uid/gid, and that by default the config file should be mode 0640, with owner root:bird.
One example is umurmur:
https://github.com/archlinux/svntogit-community/blob/packages/umurmur/trunk/umurmur.tmpfiles#L1
https://github.com/archlinux/svntogit-community/blob/packages/umurmur/trunk/umurmur.sysusers