-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(user accounts): new ghaf user account setup
- introducing userborn - disabling mutable users - re-factoring ghaf account to admin account - introducing login user account with homed + auxiliary accounts - impermanence flake input pinned to userborn patch - /etc/machine-id (gui-vm) is currently hardcoded as login user identity file depends on it. It should be generated on first boot and persistet. Workaround is available upstream (after userborn patch) in impermanence but does not seem to work with our setup, investigation required Signed-off-by: Manuel Bluhm <[email protected]>
- Loading branch information
Showing
37 changed files
with
816 additions
and
321 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Ghaf user setup | ||
|
||
## Rationale | ||
The changes address the separation between declarative and runtime | ||
users. Declarative user definitions are appropriate if their | ||
configuration should be the same across different machines. | ||
Non-declarative users are introduced that allow changes without | ||
re-building the configuration, and are purely device specific. | ||
|
||
For more consistent declarative user management, 'userborn' is | ||
introduced, which increases consistency by managing user parameter | ||
changes across re-builds. It is enabled for host and all VMs by default. | ||
The NixOS configuration `users.mutableUsers` is set to false, thus | ||
the generic user tools cannot be used at runtime (`passwd`, `useradd`, | ||
etc.). | ||
|
||
To manage non-declarative users, 'systemd-homed' is used. It offers a | ||
variety of concepts that are in line with our requirements such as | ||
on-the-fly user creation, encryption, CIFS-integration, and more. | ||
|
||
## Code structure | ||
|
||
common.nix - common settings | ||
admin.nix - admin account settings | ||
desktop.nix - user accounts to manage desktop | ||
other.nix - template to add other declarative users | ||
|
||
## Accounts | ||
All accounts are available to be configured. Note that they are only | ||
available in the respective VM where they are specifically enabled, with | ||
exception for the admin account. | ||
|
||
### Admin account | ||
The 'ghaf' user account is now the admin account (+wheel), and enabled by | ||
default in host and all VMs. As this account is for administrative | ||
purposes, it should not run a desktop session. This currently works with | ||
some limitations, but at the moment we do not run a full-fletched multi-user | ||
system. | ||
|
||
### Login/desktop user account | ||
The 'loginUser' account can be enabled and sets up a non-declarative | ||
user with a reserved UID. It is a self-contained account, that currently | ||
runs the user desktop session. | ||
|
||
### Auxiliary accounts | ||
Two auxiliary accounts are available that share the login users UID to | ||
keep these UIDs consistent across VMs: | ||
1) Proxy user | ||
This user is used in system VMs that provide services. These services | ||
are currently accessible via the dbus proxy, and require the same UID. | ||
2) App user | ||
This user is used in app VMs to run the user sessions (including applications). | ||
The shared UID is helpful to map access rights across machines and support | ||
legacy functionality. | ||
|
||
### Other (declarative/managed) user accounts | ||
While any additional user accounts may be freely created and administered, a template | ||
for configuration managed users is provided. | ||
|
||
## Future work | ||
This patch introduces new account management on Ghaf. Based on the changes, | ||
future work is required to extend it. | ||
|
||
### Extending login-user functionality | ||
Currently, a minimalistic setup script runs on first GUI-VM boot. The login | ||
user setup may be extended with: | ||
|
||
- Improvement of user creation script | ||
- Graphical interface for user creation | ||
- Feature integration: (supported by homed) | ||
- CIFS/remote user storage integration | ||
- FIDO token integration | ||
- User ssh keys | ||
- Avatar/Background/Locale/Timezone/Location | ||
- External home support (e.g., USB or network storage) | ||
- Potential re-work to run graphical session as static user | ||
- Potential multi-user system with migratable data | ||
|
||
### Overall user account improvements | ||
|
||
- removing (hardcoded) ssh dependencies | ||
- removing ssh root access, e.g., update user (PoC available) | ||
- centralized mechanism (profiles) to administer declarative user account data (e.g., passwords) | ||
- password policies mechanism, especially considering declarative users passwords are in nix store | ||
|
||
### User data implications | ||
While the login user setup provides some containment, currently user data is still | ||
spread across the system, such as | ||
- Persistent user-related platform data (e.g., wifi passwords) | ||
- Persistent user data in app VMs (e.g., browser profiles/passwords) | ||
- File sharing between VMs | ||
|
||
Respective mechanisms are currently under investigation. | ||
|
||
## Implementation notes | ||
|
||
- VM storage shares have been re-named for consistency (<name>-vm) | ||
- impermanence flake input pinned to userborn patch | ||
- /etc/machine-id (gui-vm) is currently hardcoded as login user identity file depends on it. | ||
It should be generated on first boot and persistet. Workaround is available upstream (after | ||
userborn patch) in impermanence but does not seem to work with our setup, investigation required |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.