The kdbuswreck
The kdbuswreck
Posted Apr 23, 2015 14:41 UTC (Thu) by drag (guest, #31333)In reply to: The kdbuswreck by ncm
Parent article: The kdbuswreck
In the most basic mode Systemd could pass tickts to launched processes through tags in service files. For backwards compatibility to dbus systemd then can examine the capabilities of a process and assign a set of tickets based on that.
Later on a more advanced of gaining tickets can be developed were the process itself is able to negiotiate with systemd-related daemon 'ticket granting service' ala kerberos-style system.
The upside of this from the kernel's perspective is that the tickets themselves are meaningless in terms of kernel privileges. They don't mean anything at all to the kernel in terms of what type of system calls the process can do or anything like that. All the kdbus does is just provide a simple way to share ticket information. Then it really is just metadata only relevent to systemd and systemd related privileged daemons.
They would be read-only from a individual process's perspective. Having a simple /proc/<pid>/ktickets file that would list them for userspace.
To avoid issues with 'nested' operating system namespaces a associated hash can be tied to the tickets so that some process can have it's privileges associated with a specific container and avoid issues when that information leaks out into parent containers/hosting namespaces.
From a userspace perspective this ticket system would be superior to using capabilities because it would offer a much larger amount of flexiblity.
Say, for example:
I am writing a embedded system for controlling hot air balloon. It would consist of a USB device attached to a Linux laptop that would provide various telementary data and other information about the state of the balloon to a 'balloon management daemon'.
For the UI it would be a simple python application running on the user's desktop and it would use kdbus to communicate with the daemon. I am interested in allowing other people to write their own UIs, but I want to make sure that some potentially malicious program or non-privileged user account won't be able to do fool around with the balloon.
So if we were using a ticket system I could provide a service file (or whatever) that would essentially say: "If user is part of 'balloon' group and then the processes launched by this service then assign 'balloon-priv:<host hash>:<time stamp>' ticket to process. Users and programs can easily check if they are getting the tickets correctly by checking out the /proc/<pid>/ktickets file. Kdbus itself wouldn't depend on that file, of course... it's just informational to show what kdbus metadata gets provided along with dbus messages.
...
If I was trying to depend on a capabilities system then what sort of capability would I want to use?
I think that if we see capabilities being used then you would have all sorts of crazy attempts by user space programs to overload capabilities and make the represent weird privileges that they were never intended to represent.... With pure-metadata tickets then that can allow flexiblity and allow userspace to evolve and change without forcing the kernel developers to make difficult choices about breaking backwards compatibility.
