Re: [Cryptography] Does anyone here know PAM?
On Tue, Apr 4, 2017 at 10:04 AM, Phillip Hallam-Baker <phill@hallambaker.com> wrote:
This is a call for technical assistance with a crypto project. Hopefully it will be of wider benefit if successful.
The Mathematical Mesh has the goal of making computers easier to use by
You mean http://www.prismproof.org/
making them more secure. Note the order. While there are some times that it is appropriate for a cryptographic key to require the user to enter a PIN or the like to use it, that cannot be the default requirement, nor is it acceptable to just leave private keys sitting on disk unencrypted.
Windows and OSX both provide features that cause private keys and other credentials to be unlocked automatically using the user's password as a PIN. I want to achieve the same on Ubuntu. I am happy if the solution can also be carried across to other Linux and FreeBSD but don't have resources to cover anything else.
Various tools / ports / projects in both Linux and BSD do exist that will get you magical login encrypted homedirs. OSX also has it. Now that per dataset crypto keying is in ZFS, you might expect to see some uniform use of it spread across everything except Windows. http://open-zfs.org/wiki/ZFS-Native_Encryption https://youtu.be/frnLiXclAMo https://drive.google.com/file/d/0B5hUzsxe4cdmU3ZTRXNxa2JIaDQ/view?usp=sharin... http://pefs.io/ https://github.com/glk/pefs https://wiki.freebsd.org/PEFS http://glebkurtsou.blogspot.com/search/label/pefs You could find other implementations, FUSE, PAM, login, etc here... https://www.freebsd.org/ports/categories-grouped.html Linux does bunch of things with FUSE / PAM / dmcrypt. Even the old NFS crypto loopback still exists.
The authentication mechanism is PAM. So far, the only documentation I have found has been of the barely more comprehensible than the code variety.
https://en.wikipedia.org/wiki/OpenPAM http://www.openpam.org/ https://www.freebsd.org/cgi/man.cgi?apropos=1&query=pam https://www.freebsd.org/cgi/man.cgi?query=pam.conf
* Is hooking PAM the way to go
Probably, or quite commonly. More tricky is defining and detecting whatever is considered to be a logout state, timeout, loss of human user, etc.
or should I try to make use of an encrypted directory mechanism instead?
If that is what you want as part of an outcome, then yes.
* If PAM is the way to go, where might I find a working example for using the login password to unlock a private keystore?
See above links. Other people will probably post others.
* Has someone already done this for GPG Agent?
Probably.
In addition, one of the layered applications, Mesh/Confirm offers two factor authentication (among other things) so an example showing how to integrate a network authentication mechanism would be useful.
The architecture I am thinking of would be:
1) User logs in with password.
2) Password is passed to the unlock keys mechanism which uses it to unlock a master key.
3) Processes running under the master key account can request unlocking of profile data stored under it.
Of course, it is quite possible that the magic required to bridge the gap between 2 and 3 means effectively recreating GPGAgent.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/04/2017 01:44 PM, grarpamp wrote:
On Tue, Apr 4, 2017 at 10:04 AM, Phillip Hallam-Baker <phill@hallambaker.com> wrote:
* Has someone already done this for GPG Agent?
Probably.
gnupg-agent is in serious need of some bugfixes, at least the version that makes it into Mint. Once it sees a pass phrase, gnupg-agent retains it until the system is shut down; stored pass phrases persist through user logout/login. This behavior is supposed to be controlled by a config file where a timeout can be set, but none is present in the default installations I have seen on Mint, and creating a new gpg-agent.conf as directed in the man page for gnupg-agent does exactly nothing to alter its behavior. The Debian devs say this is a non-issue. Their excuse: "Physical access is game over." How's that for convenient? Never mind that broken gnupg-agent means physical access by any unskilled snooper gives that person the ability to read and copy encrypted documents and files, or apply your signature to anything, while your back is turned. Not an issue. The presence of your pass phrase in system memory, as/when a non-persistent exploit checks to see if pass phrases for the secring keys it just sent to its owner are available in memory is not a potential issue, either. My work-arounds for this BS: http://pilobilus.net/gnupg-agent_work_around_for_linux_mint.html Come to think of it, I'm gonna copy this reply to a new thread. It's on topic to the group and deserves more attention. :o) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJY4/YAAAoJEECU6c5XzmuqaugH/A1/4Whop9ZaqFee6+vgba09 PRMJsX6MJY+ZmuFxS7P+AQIJUUXqjRXzbK3oXS7zq6pBu2bi7CVD8NA5ZH/FYeFD jTtF4Tk9A8bmKb2bdsSigSzaU5hFNOXHr5bKf2dE/jFE3rxL7aR2S7TtKqWSBx3I GTyyv0BHFoYTW08zz2vFEHSZPjF5PWkNIa5LohoSW1NkyMWvcy1ua1LkqbSyzE6F icj9rK1y6q3XrenZflXRJxsvwzPbjOl4xi+PIL8RxfbCwPXbSH7RRIRrsFbg7+IQ pkO9PufV0ohVjk1iQblcRbhsDDddaLLRqeZD582l/t1OXv3XJIyJJL8/aqbFl34= =BsdF -----END PGP SIGNATURE-----
This is also common tool... https://github.com/libfuse/sshfs
On Tue, Apr 04, 2017 at 07:51:50PM -0400, grarpamp wrote:
This is also common tool... https://github.com/libfuse/sshfs
Tried using that ~4 years ago, and experienced too many hangs and not enough time to debug it at the time. -Very- handy when it worked, but was not reliable enough (for just personal use) back then. Hopefully it's better now.
participants (3)
-
grarpamp
-
Steve Kinney
-
Zenaan Harkness