3 ms·
The continued pathology of systemd. You can't use d-bus for this because d-bus isn't available early enough, relies on user accounts, and can't enumerate thr
by themafia 1y ago
The continued pathology of systemd.
You can't use d-bus for this because d-bus isn't available early enough, relies on user accounts, and can't enumerate through large sets of objects with optional filtering they had to create and invoke the completely separate "Varlink." Which is _closer_ to the traditional Unix/Plan9 service model without actually achieving it meaningfully.
The infamous part of d-bus, that it helps inject arbitrary binary payloads into existing text protocols, is now reversed in varlink, it takes what should be arbitrary binary payloads (user records, certificates, etc..) and instead forces you to manage them as JSON objects. Signing and conveying signatures for this object are predictably painful.
"The signature section contains one or more cryptographic signatures of a reduced version of the user record. This is used to ensure that only user records defined by a specific source are accepted on a system, by validating the signature against the set of locally accepted signature public keys. The signature is calculated from the JSON user record with all sections removed, except for regular, privileged, perMachine. Specifically, binding, status, signature itself and secret are removed first and thus not covered by the signature. This section is optional, and is only used when cryptographic validation of user records is required (as it is by systemd-homed.service for example)."
This all seems very brittle and I don't see the kinds of testing that would project confidence in this system. Good luck to all who use this and trust it.
- surajrmal 1y agoUltimately ipc, service discovery, and security all need to be codesigned to work together. Systemd is unfortunately trying to work in an ecosystem where it does not have the luxury of a clean first principles approach. Generally I would argue moving off of dbus and onto varlink is in the right direction. I'm not sure what you think is brittle about the approach of using ipc and a schema for the data sent over it. If they had gone in the other direction and mandated grpc ala http instead, would that have been "less brittle"?
- amluto 1y agoThat IMO does not, in any respect, excuse the signature design. This JSON+blobs design is totally new other than needing to support a handful of preexisting fields. And it’s very much the case that a lot of the record is trusted in the sense that loading malicious data could compromise the integrity or availability of the machine. So structure it like that! Have a whole file that is signed or otherwise integrity-checked in its entirely. Have another file with fields that are per-(user,machine) and integrity-check that. “Integrity-check” means that you validate the binary contents of the file before you even attempt to parse it, and then you parse the literal bytes that you checked. It’s not the nineties anymore, and architects should know better.