]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
filesystem: create metadata files with mode 0600
authorEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
committerEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
commit06c989df4e31dd9f172f94fbd6243f49d4dd0b92
tree4edd3e73cd237bf37a746705b6dd1f9f5cf01b80
parent312bc381a3751e397995eeb2e63e66856912fafb
filesystem: create metadata files with mode 0600

Currently, fscrypt policies and protectors are world readable, as they
are created with mode 0644.  While this can be nice for use cases where
users share these files, those use cases seem to be quite rare, and it's
not a great default security-wise since it exposes password hashes to
all users.  While fscrypt uses a very strong password hash algorithm, it
would still be best to follow the lead of /etc/shadow and keep this
information non-world-readable.

Therefore, start creating these files with mode 0600.

Of course, if users do actually want to share these files, they have the
option of simply chmod'ing them to a less restrictive mode.  An option
could also be added to make fscrypt use the old mode 0644; however, the
need for that is currently unclear.
README.md
cli-tests/t_lock.out
cli-tests/t_lock.sh
filesystem/filesystem.go
filesystem/filesystem_test.go