Code Monkey home page Code Monkey logo

pam_panic's Introduction

Build Status Language grade: C/C++

pam_panic

Purpose

pam_panic is a PAM module that protects sensitive data and provides a panic function for emergency situations.

How it works

You can choose from one of two options:

Using two removable media previous your own password

There are two removable media which work as keys: the auth key and the panic key. The auth key will let you pass to the password prompt whereas the panic key, if provided, will securely erase the LUKS header, rendering the data unreadable.

Using two passwords previous your own password

There are two passwords you are able to set: the key password and the panic password. The key password will let you pass to the original password prompt whereas the panic password, if provided, will securely erase the LUKS header, rendering the data unreadable.

Installation

Arch Linux AUR

There is

Ubuntu

There's a PPA updating for new releases.

To install the package using the PPA:

sudo add-apt-repository ppa:bandie/pampanic
sudo apt-get update
sudo apt-get install pampanic

From sources

You will need GCC or similar, as well as the PAM headers. Some distributions package the PAM headers as libpam0g-dev. Also you need dialog, autoconf and gettext. Some also need autopoint.

To compile and install it, do the following within the project's root directory:

$ [ ! -e ./configure ] && autoreconf -i
$ ./configure
$ make
$ sudo make install

Note: the paths of the reboot, poweroff, and cryptsetup commands are passed to the module at compile-time.

Preparation

If you want to use removable media you'll need two GPT-formatted removable storage devices, and said devices must have at least one partition. Here's an example fdisk session, showing how this might be accomplished:

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): g
Created a new GPT disklabel (GUID: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA).

Command (m for help): n
Partition number (1-128, default 1): 
First sector (2048-15661022, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-15661022, default 15661022): 

Created a new partition 1 of type 'Linux filesystem' and of size 7.5 GiB.
Command (m for help): w

You'll find the UUID of your partition in /dev/disk/by-partuuid/. You can find out which device is which typing ls -l /dev/disk/by-partuuid/ in your favourite shell.

Configuration

The more easy way is to run pam_panic_config.

The hard way:
To configure the module, add the following to the appropriate PAM configuration file(s): (see pam.conf(5) for details on these files)

Using the removable media:

auth       requisite    /usr/local/lib/security/pam_panic.so auth=<UUID> reject=<UUID> reboot serious=<UUID>
account    requisite    /usr/local/lib/security/pam_panic.so

Using the two passwords:

auth       requisite    /usr/local/lib/security/pam_panic.so password reboot serious=<UUID>
account    requisite    /usr/local/lib/security/pam_panic.so

To set your passwords run pam_panic_pw as root in your preferred shell.

More information

See man 8 pam_panic and man 1 pam_panic_pw for more information.

TODO

Addendum

Poisoning memory when issuing a reboot or shutdown

If you want to be sure to have your memory clear of all information when issuing a reboot/shutdown you might want to add the options page_poison=on and slub_debug=P to your kernel arguments. For GRUB2 you just append it on your GRUB_CMDLINE_LINUX entry in /etc/default/grub and then issue a rebuild of the GRUB2 config: grub-mkconfig -o /boot/grub/grub.cfg

pam_panic's People

Contributors

bandie avatar codacy-badger avatar dangeredwolf avatar iw0nderhow avatar jordydickinson avatar rhaamo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pam_panic's Issues

Bug: Using media devices doesn't work anymore

Describe the bug
Using media devices doesn't work anymore

To Reproduce
Steps to reproduce the behavior:

  1. Configure pam_panic to use media devices
  2. No authentication possible

Expected behavior
A clear and concise description of what you expected to happen.

  1. It will authenticate.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Distribution/Version [e.g. Ubuntu 18.04, Arch Linux, ...]

Additional context
Add any other context about the problem here.

BUG: pam_panic password: Using xscreensaver: After timeout xscreensaver crashes.

Reproducing steps

  1. Having pam_panic in your pam.d of xscreensaver using the password function,
  2. Trigger the keyboard/mouse to let pam_panic prompt for its password,
  3. Wait for xscreensaver to pass the timeout.
  4. xscreensaver crashes and you can use the computer without authentication.

Expected

  1. xscreensaver should blank out and keep the screen locked.

I can’t install the module pam_panic because of error.

Hi there!
First of all, thank you very much for creating such a software. I think this script is a real work of art and I was happy to find it.
Unfortunately, I was not able to install it. I am a beginner and will not be able to deal with this problem on my own. Thank you in advance for your help!

The bugs:

  1. There is a conflict between "cunit 2.1.3.3" and "bcunit-cunit-compat" so I removed "cunit" and installed "bcunit-cunit-compat".
  2. PGP key (C1E133BC65A822DD) has expired. "pam_panic-0.3.4.tar.gz … Done (WARNING: this key has expired.)"
  3. The error that interrupts the installation:
Suite: Suite pam_panic_authdevice
Test: Authenticate with good device? …passed
Test: Authenticate with bad device? …passed
Test: Authenticate with no device? …passed
Suite: Suite pam_panic_reject
Test: Serious function? …passed
Test: Reboot function? …passed
Test: Poweroff function? …passed
Test: Nothing at all function? …passed
Suite: Suite pam_panic_pw
Test: Write a password into a file? …passed
Test: Check password file with correct passwords? …make[1]: *** [Makefile:717: all] Segmentation error (memory dump done)
make[1]: exit directory “/var/tmp/pamac-build-USER/pam_panic/src/pam_panic-0.3.4/test”
make: *** [Makefile:866: test] Error 2
==> ERROR: Check() failed.
Abort…

There are steps to reproduce the behavior:

  1. Go to 'Manjaro install manager'
  2. Click on 'Install pam_panic'
  3. See errors

My system:
OS: Manjaro Linux x86_64
Kernel: 6.1.7-1-MANJARO
Shell: bash 5.1.16
DE: Plasma 5.26.5

Configuration program for implementing pam_panic's config in supported login procedures

Is your feature request related to a problem? Please describe.
When I want to install pam_panic, I'd like to have help in implementing it in certain login processes.

Describe the solution you'd like
Something like pam_panic_config but just doing this.

Additional context
Determining the different display managers, distributions and so on and do the magic in background.

Help needed for

  • Gaining information about different pam configurations in /etc/pam.d on the different distributions using the default display managers and login processes
  • Gaining information on which display managers and login processes pam_panic doesn't work.

pam_panic_pw doesn't do mkdir

Actual behaviour

  • It doesn't do mkdir for PPASSFILE

Expected behaviour

  • It should

Steps to reproduce the problem

  1. Fresh ubuntu installation
  2. pam_panic_pw
  3. Error.

Specifications

  • Plattform:
  • OS: Ubuntu 18.04
  • Version:

Some man pages are not installed

Actual behaviour

  • French man(1) does not install
  • (Soon to be) Japanese man(1)/man(8) does not install

Expected behaviour

  • $language man pages should be installed

Steps to reproduce the problem

  1. common make install stuff

Specifications

  • Plattform:
  • OS:
  • Version:

Fix is already prepared. Waiting for #51.

Suggestion: use gettext for translation

Gettext integrates well with autotools and po4a can be used to create .po templates in different languages. This would make man page translation easier for translators who don’t know groff formatting.

autotools -> cmake

Actual behaviour

autotools

Expected behaviour

cmake

Steps to reproduce the problem

  1. mkdir build
  2. cmake ..
  3. ????

Specifications

  • Plattform: all
  • OS:
  • Version:

"make" and "make test"

Actual behaviour

After make, make test doesn't work.

Expected behaviour

make and make test work.

Steps to reproduce the problem

  1. autoreconf -i && ./configure && make
  2. make test

Specifications

  • Plattform: Yes
  • OS: Yes
  • Version: git

Additional execution of a script before shredding

Is your feature request related to a problem? Please describe.
Before pam_panic is shredding something, I'd like to have an action before it.

Describe the solution you'd like
Maybe the user can add a custom script.
Also we need to think about security on how to verify that the script hasn't been tempered with.

MBR not supported

Actual behaviour

Device IDs with MBR partitioned systems are not recognized by pam_panic's serious= command.

Expected behaviour

It should do that!¡¹

Specifications

  • Plattform: Any
  • OS: Any
  • Version: 0.2.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.