update-notifier message about recording mount passphrase

Bug #352307 reported by Dustin Kirkland 
4
Affects Status Importance Assigned to Milestone
ecryptfs-utils (Ubuntu)
Fix Released
High
Dustin Kirkland 
Jaunty
Fix Released
High
Dustin Kirkland 

Bug Description

Binary package hint: ecryptfs-utils

The ecryptfs-setup-private utility is used to configure a user's encrypted-home or encrypted-private directory.

By default, ecryptfs-setup-private will generate a random 128-bit mount passphrase from /dev/urandom.

If executed on the command line, a message such as the following is displayed to the terminal:

************************************************************************
YOU SHOULD RECORD THIS MOUNT PASSPHRASE AND STORE IN A SAFE LOCATION:
f436f2db331b520e8879d53d012c363a
THIS WILL BE REQUIRED IF YOU NEED TO RECOVER YOUR DATA AT A LATER TIME.
************************************************************************

Jaunty now supports configuring an encrypted-home directory in the installer itself (with the preseed option user-setup/encrypt-home=true).

When this happens, a random mount passphrase is generated, but the user is not given the opportunity to record this passphrase (it was decided that this would interrupt the install experience).

What we desperately need, then, is for ecryptfs-setup-private to trigger an update-notifier message to be displayed on subsequent boots (until dismissed by the user). This message to convey to the user:

 1) That a strong, random mount passphrase has been generated to encrypt their home directory
 2) That this passphrase should be recorded (written down, printed), and stored in a separate location
 3) That this passphrase would be needed if manual data recovery is ever necessary
 4) How to go about retrieving this passphrase
  $ ecryptfs-unwrap-passphrase $HOME/.ecryptfs/wrapped-passphrase
  Passphrase: foobar
  f436f2db331b520e8879d53d012c363a

Martin Pitt has offered to help with this. I hope it can still make Jaunty.

:-Dustin

Changed in ecryptfs-utils (Ubuntu):
assignee: nobody → pitti
importance: Undecided → Critical
status: New → Triaged
Changed in ecryptfs-utils (Ubuntu Jaunty):
importance: Critical → High
Martin Pitt (pitti)
Changed in ecryptfs-utils (Ubuntu Jaunty):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

It just occurred to me that this might get much more tricky than I thought. update-notifier messages are system level, thus (1) only admins will see such a note if I'm not mistaken, and (2) once the first admin ack'ed it, other users won't see it any more.

What we want is a per-user notification. Maybe we can abuse the messaging system that gnome-screensaver has, or otherwise just use libnotify-send. I'll ponder this a bit.

Revision history for this message
Michael Vogt (mvo) wrote :

update-notifier in jaunty supports per-user notifications as well. Just add:
OnlyAdminUsers: False
to the note.

And test if it really works of course ;) But it should

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ecryptfs-utils - 73-0ubuntu3

---------------
ecryptfs-utils (73-0ubuntu3) jaunty; urgency=low

  * Add interactive update-notifier hook for reminding the user to write down
    the autogenerated passphrase: (LP: #352307)
    - Add debian/local/ecryptfs-remind-passphrase: update-notifier hook, with
      German translations. (Unfortunately this package is not gettextized yet,
      thus translations have to be added inline).
    - debian/ecryptfs-utils.install: Install above into
      /usr/share/ecryptfs-utils.
    - Add update-notifier-remind-passphrase.dpatch: Create update-notifier
      message about recording your passphrase, if it was generated randomly,
      and ecryptfs-setup-private is run as root.

 -- Martin Pitt <email address hidden> Sun, 05 Apr 2009 12:34:44 -0700

Changed in ecryptfs-utils (Ubuntu Jaunty):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks, Michael, this works fine.

I uploaded a new ecryptfs-utils which should make this work. I tested it with a new non-admin user "joe" and

  sudo ecryptfs-setup-private -u joe; sudo chown joe:joe /home/joe/.ecryptfs

Caveats:

 - All users with an existing ~/.ecryptfs/wrapped-passphrase get the notification.

 - If I don't do the chown above, /home/joe/.ecryptfs/ gets owned root:root, and the notification fails. Is that a bug in ecryptfs-setup-private, or am I just calling it wrongly?

 - I couldn't really test it the full way from the installer, it is much easier to do this once the package is uploaded and on the daily CDs. Dustin, can you please test this with the next daily and tell me what you think?

 - Please fix my bad English in the strings.

I attach the uploaded debdiff.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 352307] Re: update-notifier message about recording mount passphrase

Martin,

The proper way of testing the encrypt-home bit is:

 $ sudo adduser --encrypt-home joe

As for setting up an encrypted-private, the user 'joe' would set this
up himself by just running:
 joe@ubuntu$ ecryptfs-setup-private

Sorry for not sending you these earlier!

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm reopening this bug, marking in progress, will upload a new fix momentarily. I'm moving around the code that Martin committed just a bit, using the pam_ecryptfs module to conditionally handle the update-notifier.

I worked with him over lunch on this, and I think we have a good solution now.

:-Dustin

Changed in ecryptfs-utils (Ubuntu Jaunty):
assignee: pitti → kirkland
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ecryptfs-utils - 73-0ubuntu5

---------------
ecryptfs-utils (73-0ubuntu5) jaunty; urgency=low

  Reworked the fixes for LP: #352307 (Upstream Committed revision 373)
  * debian/local/ecryptfs-remind-passphrase: run if
    ~/.ecryptfs/.wrapped-passphrase.recorded does NOT exist; touch that
    file upon successful run of unwrap passphrase
  * debian/patches/00list,
    debian/patches/update-notifier-remind-passphrase.dpatch: dropped, since
    this was moved into PAM

 -- Dustin Kirkland <email address hidden> Tue, 07 Apr 2009 14:18:24 -0700

Changed in ecryptfs-utils (Ubuntu Jaunty):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.