Adding a "duress" password with PAM Duress
Users often store a lot of sensitive information on their computers—from credentials to banned texts to family photos—that they might normally expect to be protected by the login password of their account. Under some circumstances, though, users can be required to log into their system so that some third party (e.g. government agent) can examine and potentially copy said data. A new project, PAM Duress, provides a way to add other passwords to an account, each with its own behavior, which might be a way to avoid granting full access to the system, though the legality is in question.
As its name would imply, PAM Duress is a pluggable authentication module (PAM), which is the mechanism used on Linux and other Unix operating systems to easily allow adding different kinds of authentication methods. PAM is not exactly standardized, however, so there are multiple implementations of it, including Linux PAM that is used by Linux distributions. The Duress module allows administrators to configure the system to check for one or more extra passwords if the normal password associated with the user account does not match what is provided.
The project page gives a few examples of the kind of actions that could be triggered by an alternate password:
This functionality could be used to allow someone pressed to give a password under [coercion] to provide a password that grants access but in the background runs scripts to clean up sensitive data, close connections to other networks to limit lateral movement, and/or to send off a [notification] or alert (potentially one with detailed information like location, visible wifi hotspots, a picture from the camera, a link to a stream from the microphone, etc). You could even spawn a process to remove the pam_duress module so the threat actor won't be able to see if the duress module was available.
Scripts or binaries that are meant to be used when duress passwords are entered (i.e. duress programs) can be placed in either /etc/duress.d, for global duress actions, or ~/.duress for those specific to a particular user. In either case, the duress_sign script is used to process a file into something that PAM Duress can use. The script will prompt for a password, which it hashes with SHA-256, using the SHA-256 hash of the file's contents as the salt; the resulting hash value is written to duress-script-name.sha256. That stored hash protects against changes to the script and securely "stores" the password within a single hash value.
In order to use PAM Duress, the system's PAM authentication file (e.g. /etc/pam.d/common-auth) needs to be set up to try the user's password first (with the normal pam_unix.so module); if that fails, it should be configured to invoke pam_duress.so to check for any matching duress passwords. As shown in the documentation, that might look like the following:
# Example /etc/pam.d/common-auth auth [success=2 default=ignore] pam_unix.so auth [success=1 default=ignore] pam_duress.so auth requisite pam_deny.so
When invoked, PAM Duress will look at each file in the two duress program directories, hashing the provided password using the hash of the file's contents as salt, then comparing it to the value in the corresponding .sha256 file; if there is a match, the duress program gets invoked. If any file matches, success will be returned to PAM, which will result in access being granted and the user's login shell being invoked after the duress programs are run.
A simple example to demonstrate the module is provided in the repository. The pushover.sh script uses the API of the Pushover service to send a message reporting that the duress password has been used. The message includes the username of who logged in along with the local and external IP addresses of the system.
On the page describing the example, the script is signed with a password that is meant to be given to each person when it gets installed on their system. The example points out that the password should be changed if someone who knows it leaves the organization, but other strategies could be used (e.g. individual passwords). The integrity hash on the scripts seems to mostly be aimed at preventing inadvertent changes, since an attacker with access to the filesystem has lots of other ways to compromise the system. The demonstration script uses a configuration file for API keys that has no hash protection so it could be changed without detection—not that it really matters in the grand scheme of things.
Sending a message when the duress password has been used seems relatively innocuous from a legal perspective, but some of the other possible uses may not be. In a lengthy Hacker News discussion about PAM Duress, multiple commenters pointed out that deleting files in the background when requested to log in at a border crossing may well be an offense—if it is detected. It is, as with everything regarding security, a question of the type of threats being protected against. As "jeroenhd" put it:
If you're held under gunpoint, that script that wipes your entire hard drive will only make your day worse.AFAIK if you actually get detained and questioned at airports, your drive will already get imaged before any password is even tried. You may be able to get away with this on a mobile device where this feature isn't generally expected (because who uses Linux on a smartphone in the first place).
I always wonder at what scenarios like these are supposed to be about. If saying no is not an option, pissing off your captors by giving them fake info probably isn't either.
I don't know what law enforcement would be looking for on my work drive, but if saying no is no longer an option, my encryption password isn't worth getting shot over.
"Spooky23" said
that the idea of handling the situation with a technical means like PAM
Duress is "silly nerd porn
". Someone who has data that the
authorities want access to should not be crossing a border with it on
their device: "The only way to win is not to play.
" But
others pointed out that the intent of a duress password is to "give
the appearance of compliance
" as "dredmorbius" said, which may be
enough to satisfy the investigator and head off further inquiry.
No discussion of this sort ever happens without a reference to the xkcd pipe wrench scenario. Technical means to avert the often arbitrary and capricious nature of border searches and the like are certainly attractive to those of a technical bent. But providing plausible deniability by way of hidden encrypted disk partitions, filesystems that look like gibberish, or other schemes of that nature can all fall prey to the wrench scenario. If the authorities (or criminals, though it is sometimes hard to tell the difference these days) want to access the data badly enough, they are going to find a—quite possibly non-technical—means to do so.
As might be guessed, there were suggestions of other ideas for technical measures, such as a mechanism to "nuke" an encrypted disk if a duress password is entered. There was also a pointer to an earlier project, pam_duress, which has much the same focus as its nearly identical name would imply. In addition, there were suggestions of storing the sensitive data elsewhere (e.g. encrypted in the cloud) for restoration once the destination has been reached.
In the final analysis, having no sensitive data when crossing a border or otherwise being in a situation where there is a potential for duress being applied is the safest solution. Storing said data "elsewhere" has its own set of risks, of course—the cloud is hardly beyond the reach of nation-state actors. Dangerous-to-possess data, which is often defined quite differently in various parts of the world, is difficult to handle; technical means can certainly help but they are no panacea.
Index entries for this article | |
---|---|
Security | Authentication |
Security | Passwords |
Posted Aug 24, 2021 20:24 UTC (Tue)
by jebba (guest, #4439)
[Link] (17 responses)
How about a hypothetical like: You're fleeing a country after it's government has fallen. To get to the airport you have to go through a hostile checkpoint. You have lists, documents, photos, records of your and your colleagues' work. You just need to reveal enough of your data on your phone to bullshit some fake cop and get thru the checkpoint. You need to make sure you don't lose the rest of the data to the hands of the fake police.
pam_duress should be made user friendly installed by default once it is ready.
Posted Aug 24, 2021 21:01 UTC (Tue)
by jafd (subscriber, #129642)
[Link] (3 responses)
Usually even in the countries governments are expected to maintain at least an appearance of abiding the law, border officers are given way more leeway than you would normally expect from other authorities. Sure you can sue them later, provided you come out of it alive.
Posted Aug 25, 2021 0:50 UTC (Wed)
by frostsnow (subscriber, #114957)
[Link] (2 responses)
Posted Aug 29, 2021 3:58 UTC (Sun)
by patrakov (subscriber, #97174)
[Link] (1 responses)
Posted Aug 31, 2021 23:57 UTC (Tue)
by frostsnow (subscriber, #114957)
[Link]
Posted Aug 25, 2021 2:31 UTC (Wed)
by sjj (guest, #2020)
[Link] (6 responses)
Posted Aug 25, 2021 16:11 UTC (Wed)
by jebba (guest, #4439)
[Link] (5 responses)
Posted Aug 26, 2021 0:12 UTC (Thu)
by jafd (subscriber, #129642)
[Link] (1 responses)
Posted Aug 26, 2021 13:45 UTC (Thu)
by jake (editor, #205)
[Link]
thanks,
jake
Posted Aug 26, 2021 6:14 UTC (Thu)
by gfernandes (subscriber, #119910)
[Link] (2 responses)
In this case, I would probably simply have the data encrypted on a portable drive, and the key, in a Password Manager on my laptop. I'd then go to the airport another day to "drop a relative", drop the drive off. And then later arrive for departure myself with the laptop.
Both are useless on their own.
There are various permutations of this approach.
Posted Aug 26, 2021 14:23 UTC (Thu)
by jebba (guest, #4439)
[Link] (1 responses)
Look at what is happening in Kabul. This is very unrealistic.
Posted Aug 30, 2021 22:32 UTC (Mon)
by ssmith32 (subscriber, #72404)
[Link]
Also, they seemed more concerned that the huge crowds of people without papers made it impossible to get through with their papers, then the Taliban finding them with papers.
The other report I read (in FT) was an American / Afgani citizen that kept putting off going until someone drove her to a spot where she was then helicoptered to the airport.
In short, even with the limited information we have, it seems the situation is a lot more dynamic and complex then the simple hypothetical proposed.
Some American reporters (LA Times) got beat up because they wore local dress and had enough melanin that they were mistaken for a local. Then another Taliban apologized for the mistake, offered them an energy drink and a ?friendly? ride, which they turned down.
Posted Aug 25, 2021 7:12 UTC (Wed)
by vadim (subscriber, #35271)
[Link] (4 responses)
If you fear for your life you can't afford to play games with people who may want to kill you, and they also may have smart people on their side. The safest way is not to give them anything to work with, and hope that's enough.
Posted Aug 25, 2021 16:08 UTC (Wed)
by jebba (guest, #4439)
[Link] (3 responses)
My "hypothetical" is actually a real-world situation, I thought people would see that. What I'm referring to is the people trying to get thru the Taliban and military checkpoints at Hamid Karzai International Airport. US citizens, and others, have to show docs, often on their phones to the Taliban to get to the inner checkpoint. You suggest they just smash their phone? Then they won't get through checkpoints and will have to remain in Kabul.
Posted Aug 25, 2021 22:33 UTC (Wed)
by vadim (subscriber, #35271)
[Link] (1 responses)
* It doesn't apply to cell phones anyway.
* Ideally, carry your documentation on paper. It doesn't run out of battery, and it's far easier to leave home without incriminating papers than without incriminating files on your disk. Computers store all kind of caches, logs and history data all over the place.
* If you already know you're going to go through a checkpoint, you can just wipe whatever you were going to in advance, without having to hope they're not going to image your drive first, that it'll work as intended, and that nobody will notice what happened before letting you through.
* If you think you can be searched unpredictably, the best solution to that is not to have anything interesting on you. Keep your basic docs and cat pictures. Ditch all the incriminating info, or bury it somewhere it can't be easily found if it must remain in existence.
Posted Aug 26, 2021 19:11 UTC (Thu)
by JanC_ (guest, #34940)
[Link]
The problems many Afghan people have/had is that the documents they need to pass the military guards at the Kabul airport are the same documents that can get them killed if the Taliban find them. So you have to leave your home for the airport with incriminating documents, or there is no point in leaving it at all.
Posted Aug 30, 2021 22:35 UTC (Mon)
by ssmith32 (subscriber, #72404)
[Link]
Posted Sep 2, 2021 9:20 UTC (Thu)
by eduperez (guest, #11232)
[Link]
Posted Aug 24, 2021 20:26 UTC (Tue)
by pizza (subscriber, #46)
[Link] (2 responses)
Posted Aug 25, 2021 10:44 UTC (Wed)
by farnz (subscriber, #17727)
[Link] (1 responses)
Combine that with removing all local temporary tokens (short expiry X.509 certificates for browser TLS and VPNs, Kerberos tickets etc), and you're in a position where you plausibly have to call the mothership to get your access restored. Not going to protect you from a suitably vicious regime (I wouldn't, for example, want to rely on this to protect me in North Korea), but enough to help if the local threat isn't operating with the full support of their government.
Posted Aug 26, 2021 6:34 UTC (Thu)
by nuvious (guest, #153911)
[Link]
Posted Aug 24, 2021 20:57 UTC (Tue)
by sub2LWN (subscriber, #134200)
[Link] (1 responses)
IMO the legality (or morality) of however it's used is separate from the basic mechanism itself. Situations of duress could also occur in government, infrastructure, workplace, or home settings, and the aggressor needn't have nation-state resources nor any particular authority behind their coercion.
Without modifying your login daemon, you could also set any manner of innocuous canaries to initiate various processes throughout your dotfiles. AFAIK the legality of dotfiles has never yet been called into question, but who knows what wonders the future has in store. :-)
Posted Aug 25, 2021 12:18 UTC (Wed)
by taladar (subscriber, #68407)
[Link]
Posted Aug 24, 2021 21:06 UTC (Tue)
by rgmoore (✭ supporter ✭, #75)
[Link]
One case where this might be useful is if you are worried about someone looking at your social media accounts. In that case, the content is inherently not on your device in the first place, so getting rid of the dangerous content is as simple as logging out of an incriminating account and logging in to an innocuous one. It's not going to survive really careful scrutiny, but it could be helpful against less thorough examination.
Posted Aug 24, 2021 22:57 UTC (Tue)
by gerdesj (subscriber, #5446)
[Link]
For me, if you have to get data across a border then a 32 GB micro SD card can be hidden quite easily - they are 11x15mm. I'm no expert at evasion but I'd stick it close to a lump of metal eg a belt buckle, luggage zip, back of a watch (inside it?) or whatever. I might even drop one inside the laptop case. I would not try to swallow one or try to hide it internally otherwise unless my naked body is all I have to work with, in which case I might question what on earth I'm up to!
Posted Aug 25, 2021 2:23 UTC (Wed)
by sjj (guest, #2020)
[Link] (1 responses)
There are a limited number of people for whom this kind of threat model makes sense. The intersection with people who run Linux on their laptop and understand PAM is likely somewhat more limited.
The people writing these tend to live in countries where they themselves will never be subjected to this level of government scrutiny. They are free to self-aggrandize and fantasize about how they would cheat The Man from peeking into their porn and anime collections and that copy of the anarchist cookbook.
Banned texts? Information control in modern autocracies is more about burying inconvenient data under mountains of bullshit, than hunting after samizdata. And if they want my family pictures, they can just follow my sister on Facebook like everybody else.
In today's world, is your only file transfer method really to personally carry the data in your laptop across borders? There are hundreds of places online where you can upload your encrypted data. Download it back when you arrive in your destination.
Posted Aug 26, 2021 6:26 UTC (Thu)
by nuvious (guest, #153911)
[Link]
Posted Aug 25, 2021 10:58 UTC (Wed)
by wjb (subscriber, #71810)
[Link]
Posted Aug 25, 2021 13:16 UTC (Wed)
by kowallis (subscriber, #140201)
[Link] (7 responses)
Posted Aug 25, 2021 15:53 UTC (Wed)
by rgmoore (✭ supporter ✭, #75)
[Link] (6 responses)
I'm not sure how useful a "warn on old password use" process would be. My employer requires me to change my password every 90 days or so, and I regularly forget I changed and try logging in with the old one at least once before I drill the new password into my muscle memory. Any system that looks for old password use is going to have to take that kind of false positive into account, and my guess is that it's going to be far more common than an actual attacker using an old password.
Posted Aug 25, 2021 16:49 UTC (Wed)
by mathstuf (subscriber, #69389)
[Link] (4 responses)
> Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically). However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.
[1] https://pages.nist.gov/800-63-3/sp800-63b.html#memsecretver
Posted Aug 25, 2021 18:10 UTC (Wed)
by rgmoore (✭ supporter ✭, #75)
[Link]
I think we've hit the root cause of my problems right here. My employer, like so many others, seems to operate on a combination of hunches and out of date information when deciding this kind of security policy. It's odd, because for remote connections- including accessing email remotely- they've adopted an app-based 2FA that seems like it's much more in step with modern security recommendations. They could add a whole lot more security by going to 2FA for all logins than with all their security theater around passwords.
Posted Aug 26, 2021 5:55 UTC (Thu)
by tyler569 (subscriber, #137973)
[Link] (2 responses)
> Change user passwords/passphrases at least once every 90 days.
There isn't a lot of room for negotiation there, and so I have to change my password every 90 days. My hope is that organizations like PCI pick up on the new NIST guidance before long.
[1] https://www.pcisecuritystandards.org/documents/PCI_DSS_v3...
Posted Aug 26, 2021 20:14 UTC (Thu)
by amacater (subscriber, #790)
[Link]
Posted Aug 29, 2021 8:10 UTC (Sun)
by nilsmeyer (guest, #122604)
[Link]
Posted Sep 20, 2021 16:20 UTC (Mon)
by kowallis (subscriber, #140201)
[Link]
Posted Aug 25, 2021 15:25 UTC (Wed)
by MortenSickel (subscriber, #3238)
[Link] (2 responses)
Posted Aug 25, 2021 19:54 UTC (Wed)
by JanC_ (guest, #34940)
[Link]
Posted Aug 26, 2021 6:31 UTC (Thu)
by nuvious (guest, #153911)
[Link]
The scripts that were executed could signal some outside mechanism that could then turn its attention to the VM in question to monitor its activity to see what the intruder is up to.
In the end though, it's a very edge-case utility that I mainly wrote for fun. Humbled it's getting this much attention.
Posted Aug 26, 2021 3:36 UTC (Thu)
by gdt (subscriber, #6284)
[Link] (3 responses)
Why this conflation of law and mechanism? As long as there are reasonable legal uses, then its the use of the device illegally which is illegal. Just as 'using' a laptop is illegal when using it to whack someone's head with intent to murder them. (And yes this is a generalisation, but in the absence of legislation outlawing duress devices themselves, it is their use which matters). Are there legal uses? Yes. For example, a person can be under duress during a robbery to operate a banking application. As more transactions occur electronically then it makes sense to start to add duress features to protect those transactions, such as zeroising stored passwords and application tokens. A duress password need not do anything dramatic or illegal -- a contemporaneous record that an act was done under duress is itself useful when seeking to have those acts reversed or to be evidence of your intent during those acts.
Posted Aug 28, 2021 21:45 UTC (Sat)
by giraffedata (guest, #1954)
[Link]
Posted Aug 31, 2021 14:31 UTC (Tue)
by Wol (subscriber, #4433)
[Link] (1 responses)
Some burglar alarms have a code that shuts off the alarm system, but sends an alert to the police as if the alarm had been set off. Useful if burglars have kidnapped an employee to force them to disable the alarm.
It also alerts police to the fact it's a hostage burglary, not just a break-in ...
Cheers,
Posted Sep 22, 2021 1:02 UTC (Wed)
by dfsmith (guest, #20302)
[Link]
Posted Aug 26, 2021 6:12 UTC (Thu)
by nuvious (guest, #153911)
[Link]
As with any mitigation tool there's risks and benefits and this module isn't without its risks if not properly implemented. The ideal scenario I was considering was a "silent alarm"; a script runs to notify IT and Security, then another script runs to delete the notification script and the duress module itself so by the time the threat agent drops to a shell there's no evidence anything happened. All other scenarios present some risk but many often take such risks on a routine basis such as journalists that "sneak" video, pictures and images out of areas where journalists are treated with hostility.
In the end though, it was just a thought experiment and excuse to do some PAM dev that I had a lot of fun programming. Again, humbled that it provoked such great discussions and it's inspired me to continue development on the project.
Posted Aug 31, 2021 6:00 UTC (Tue)
by angdraug (subscriber, #7487)
[Link]
If you think this use case isn't immediately useful and urgently needed, you're not paying attention to what's going on in the world.
Just within the last year, in just one small country of Belarus (Central Europe, 9m people, not as of yet a war zone), there were two high profile cases (Mikola Dziadok, Raman Pratasevich) where having a duress password configured on one person's computer could have saved livelihoods (and potentially lives) of many others. In both cases, access to their computers obtained using torture was then used to expose other activists and their relatives who were then either arrested or had to flee Belarus. This is more than a thought experiment. This is something that can save lives.
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Seems to me that they'd ideally want an immediate image of the powered-on device in case disk encryption is in use.
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
The real benefit of this is notification
The real benefit of this is notification
The real benefit of this is notification
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Monitor use of old passwords
Monitor use of old passwords
Monitor use of old passwords
Monitor use of old passwords
If your employer cares
Monitor use of old passwords
Monitor use of old passwords
Monitor use of old passwords
Monitor use of old passwords
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
I thought the discussion of whether it would legal to use this was in the context of deciding if it was worthwhile. If people won't use it because they'll go to prison if they do, maybe it's not worth the cost of maintaining it.
Adding a "duress" password with PAM Duress - conflation of law and mechanism
Adding a "duress" password with PAM Duress
Wol
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress
Adding a "duress" password with PAM Duress