New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pam_zfs_key: support keyfile for filesystem mount in sm_open_session #11247
base: master
Are you sure you want to change the base?
Conversation
|
Adding @behlendorf , @aerusso and @felixdoerre for your insights and suggestions. I can do rebase #11226 when needed. |
|
I am not really sure what the use of this behavior would be. This essentially disables pam_zfs_key on datasets not having |
|
Main objective here is that We can create new |
|
The current behavior (which I find correct) is that pam_zfs_key ignores the configured source and always assumes "prompt", because "why would you use pam_zfs_key, if the key isn't prompted for?". Currently (according to documentation) there are only possible key sources "prompt" and "file". I am also not sure that the way this PR handles "changing" of So I find this behavior rather confusing. I'd be ok with the pam module just ignoring all datasets where keylocation is not So I'd find this behavior resonable:
|
|
Thanks for your feedback, I will include the modification in next revision. |
Use pam's pw_get to decrypt the filesystem if 'keylocation=prompt', otherwise use zfs_crypto_load_key to verify and parse the keylocation in order to get the key loaded. If the authentication token is being changed for a user, the dataset in relation to that user will do password change conditionally. Only conditionally do if 'keylocation=prompt' already in use or argv convKeyPrompt has been set. Thr former one will get the dataset updated naturally without the need of convKeyPrompt. The latter one, convKeyPrompt, does change keyformat and keylocation to passphrase and prompt respectively even the original key is a file. Signed-off-by: Crag Wang <crag0715@gmail.com>
4ebe901
to
6a7f7f1
Compare
pam_zfs_key: support keyfile for filesystem mount in sm_open_session
Use pam's pw_get to decrypt the filesystem if 'keylocation=prompt',
otherwise use zfs_crypto_load_key to verify and parse the keylocation
in order to get the key loaded.
If the authentication token is being changed for a user, the dataset in
relation to that user will do password change conditionally.
Only conditionally do if 'keylocation=prompt' already in use or argv
convKeyPrompt has been set. Thr former one will get the dataset updated
naturally without the need of convKeyPrompt.
The latter one, convKeyPrompt, does change keyformat and keylocation to
passphrase and prompt respectively even the original key is a file.
Signed-off-by: Crag Wang crag0715@gmail.com
Motivation and Context
Support keyfile to mount a filesystem when user session opens up.
Description
decrypt_mount()intopam_sm_open_session's bodypromptin use from the encrypted datasetpw_get()ifpromptin use from the encrypted dataset, for the others usezfs_crypto_load_key()How Has This Been Tested?
Compiled successfully on top of
04a82e, deployed onto Ubuntu 20.04 for testing throughssh,suand graphical login . The encrypted dataset corresponding to the user can be mounted successfully, the key worked from not onlypassphrasefrompw_get()but alsokeyfile.Tests for
convKeyPrompt:Types of changes
Checklist:
Signed-off-by.