{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/4667","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/4667/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/4667/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/4667/events","html_url":"https://github.com/systemd/systemd/issues/4667","id":189110775,"number":4667,"title":"[RFE] Public API for requesting unique values derived from machine-id","user":{"login":"sgallagher","id":739555,"avatar_url":"https://avatars.githubusercontent.com/u/739555?v=3","gravatar_id":"","url":"https://api.github.com/users/sgallagher","html_url":"https://github.com/sgallagher","followers_url":"https://api.github.com/users/sgallagher/followers","following_url":"https://api.github.com/users/sgallagher/following{/other_user}","gists_url":"https://api.github.com/users/sgallagher/gists{/gist_id}","starred_url":"https://api.github.com/users/sgallagher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgallagher/subscriptions","organizations_url":"https://api.github.com/users/sgallagher/orgs","repos_url":"https://api.github.com/users/sgallagher/repos","events_url":"https://api.github.com/users/sgallagher/events{/privacy}","received_events_url":"https://api.github.com/users/sgallagher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-14T13:21:32Z","updated_at":"2016-11-14T13:30:22Z","closed_at":null,"body":"### Submission type\r\n\r\n  - [ ] Bug report\r\n  - [X] Request for enhancement (RFE)\r\n\r\n\r\nDuring recent discussions on the Fedora development mailing list, we have been discussing ways that we might generate a default hostname based off of the machine-id. Lennart suggested the following:\r\n\r\n```\r\nPlease do not use MD5 anymore. And please calculate your ID as\r\n\r\n       SHA(x || k)\r\n\r\nx refers to the machine id, \"||\" refers to concatenation and \"k\"\r\nrefers to some app-specific key (which is OK to be publically\r\nknown). It's important to concatenate the app-specific key, so that it\r\nis not possible to map the machine IDs used by one app to the machine\r\nIDs used by another..\r\n```\r\n\r\nIt was also discussed later in the same thread that:\r\n```\r\nWhich lies in the problem. If people are going to derive hashes from\r\nit they will do so any way the want and most likely it will be leaked\r\nout by someone doing a sum  or just copying it etc. If there is\r\nsomething 'unique' on a system, it will leak out eventually. All you\r\ncan do is try to design to drip out slowly or pour out all at once.\r\n```\r\n-- Stephen John Smoogen\r\n\r\n\r\n\r\nMy response here is that what we should do is have systemd provide an official API for generating unique values derived (repeatably) from the machine-id that are irreversible. By having it come from systemd, we can strongly encourage people to use this version as the safe approach and thereby discourage roll-your-own implementations or just direct use of the machine-id.\r\n\r\nI suggest something similar to:\r\n```\r\nconst char *\r\ngenerate-machine-id(uint64_t app-specific-key,\r\n                    char *acceptable_chars,\r\n                    size_t num_characters)\r\n```\r\n(C example given, but probably we'd actually want this in D-BUS to be\r\nlanguage-agnostic.)"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/260334527","html_url":"https://github.com/systemd/systemd/issues/4667#issuecomment-260334527","issue_url":"https://api.github.com/repos/systemd/systemd/issues/4667","id":260334527,"user":{"login":"grawity","id":31021,"avatar_url":"https://avatars.githubusercontent.com/u/31021?v=3","gravatar_id":"","url":"https://api.github.com/users/grawity","html_url":"https://github.com/grawity","followers_url":"https://api.github.com/users/grawity/followers","following_url":"https://api.github.com/users/grawity/following{/other_user}","gists_url":"https://api.github.com/users/grawity/gists{/gist_id}","starred_url":"https://api.github.com/users/grawity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grawity/subscriptions","organizations_url":"https://api.github.com/users/grawity/orgs","repos_url":"https://api.github.com/users/grawity/repos","events_url":"https://api.github.com/users/grawity/events{/privacy}","received_events_url":"https://api.github.com/users/grawity/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T13:30:22Z","updated_at":"2016-11-14T13:30:22Z","body":"I'm not sure if `SHA(x || k)` is the best choice; I think HMAC is the usual recommendation for keyed hashes?\r\n\r\nRelated: I wonder if the existing `o.f.DBus.Peer.GetMachineID`, as implemented in sd-bus, should return a keyed ID instead of the real one. (Keyed with the service's DBus name, maybe?)"}}
{"actor":{"display_login":"grawity"}}