aboutsummaryrefslogtreecommitdiff
path: root/pam_fscrypt/pam_fscrypt.go
AgeCommit message (Collapse)Author
2021-03-08pam_fscrypt: make "lock_policies" the default behaviorEric Biggers
All pam_fscrypt configuration guides that I'm aware of say to use the "lock_policies" option for the pam_fscrypt.so session hook. The Debian/Ubuntu pam-config-framework config file has it too. Make locking the default behavior, since this is what everyone wants. Existing configuration files that contain the "lock_policies" option will continue to work, but that option won't do anything anymore. (We could add an option "unlock_only" to restore the old default behavior, but it's not clear that it would be useful. So for simplicity, leave it out for now.)
2021-03-08pam_fscrypt: decide cache dropping behavior automaticallyEric Biggers
Configuring whether pam_fscrypt drops caches or not isn't really something the user should have to do, and it's also irrelevant for v2 encryption policies (the default on newer systems). It's better to have pam_fscrypt automatically decide whether it needs to drop caches or not. Do this by making pam_fscrypt check whether any encryption policy keys are being removed from a user keyring (rather than from a filesystem keyring). If so, it drops caches; otherwise it doesn't. This supersedes the "drop_caches" option, which won't do anything anymore.
2020-01-05cmd/fscrypt, keyring: add --all-users option to 'fscrypt lock'Eric Biggers
Allow root to provide the --all-users option to 'fscrypt lock' to force an encryption key to be removed from the filesystem (i.e., force an encrypted directory to be locked), even if other users have added it. To implement this option, we just need to use the FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl rather than FS_IOC_REMOVE_ENCRYPTION_KEY. In theory this option could be implemented for the user keyrings case too, but it would be difficult and the user keyrings are being deprecated for fscrypt, so don't bother.
2020-01-05Keyring support for v2 encryption policiesEric Biggers
Implement adding/removing v2 encryption policy keys to/from the kernel. The kernel requires that the new ioctls FS_IOC_ADD_ENCRYPTION_KEY and FS_IOC_REMOVE_ENCRYPTION_KEY be used for this. Root is not required. However, non-root support brings an extra complication: the kernel keeps track of which users have called FS_IOC_ADD_ENCRYPTION_KEY for the same key. FS_IOC_REMOVE_ENCRYPTION_KEY only works as one of these users, and it only removes the calling user's claim to the key; the key is only truly removed when the last claim is removed. Implement the following behavior: - 'fscrypt unlock' and pam_fscrypt add the key for the user, even if other user(s) have it added already. This behavior is needed so that another user can't remove the key out from under the user. - 'fscrypt lock' and pam_fscrypt remove the key for the user. However, if the key wasn't truly removed because other users still have it added, 'fscrypt lock' prints a warning. - 'fscrypt status' shows whether the directory is unlocked for anyone.
2020-01-05pam_fscrypt: update to handle filesystem keyringEric Biggers
FS_IOC_ADD_ENCRYPTION_KEY and FS_IOC_REMOVE_ENCRYPTION_KEY require root for v1 policy keys, so update the PAM module to re-acquire root privileges while provisioning/deprovisioning policies that need this. Also, only set up the user keyring if it will actually be used.
2019-09-08Fix various typos and grammatical errors (#141)ebiggers
These were found by a combination of manual review and a custom script that checks for common errors. Also removed an outdated sentence from the comment for setupBefore().
2018-08-23Improve debug and error output for pam_fscryptJoe Richey joerichey@google.com
2018-02-11lint: Remove all build tagsJoseph Richey
Our current build tags set off the linter. We will later add in more comprehensive build tags that will be properly formatted.
2017-10-02security: Sync filesystem before dropping cachesJoe Richey joerichey@google.com
2017-08-30pam_fscrypt: Added logging and use of new pam APIJoe Richey
2017-08-29Added +build linux,cgo flagsJoe Richey
2017-08-24Updated documentation for PAM module helpJoseph Richey
2017-08-23pam_fscrypt: Session accounting completedJoe Richey joerichey@google.com
2017-08-22pam_fscrypt: lock all PAM policies w/ flagJoe Richey joerichey@google.com
2017-08-22pam_fscrypt: Updated module to use new APIsJoe Richey joerichey@google.com
2017-08-22pam_fscrypt: The actual PAM module and configJoe Richey joerichey@google.com