Giter VIP home page Giter VIP logo

dam's Introduction

Deadswitch Access-decision Manager

Dam is a bash login shell used to securly allow password login to an otherwise key-based-authentication only linux server. It is intended to be used for the sole purpose of allowing rightful systems administrators access in an emergency situation where they do not have access to a machine whos public key was setup with their account, and thereforce must revert back to password-based login.

Overview

When used as a login shell for a pre-defined recovery system user (called, for example, dam) the script uses the following mechanisms to allow password login to a server that otherwise allows only key-based authentication:

  • Runs in a restricted bash enviornment
  • Requires the entry of a valid user account on the system
  • Requires that the above user is also granted to use DAM per the script config
  • Sends a randomly generated secret-key (default of 128 bytes) to the email specified per the script config
  • Requires that the user retreive the secret and provide it back to confirm access to the e-mail
  • Requires the correct local-password is entered for the requested user account

If any of the above require statements fail, the user is automatically kicked and DAM locked. Hence, Deadswitch Access-decision Manager. To unlock DAM, an administrator must logon using key-based authentication and remove the lock file.

Restricted Bash Enviornment

Running this script within a restricted bash enviornment provides the power of bash, with the exception that some actions or disalloed or not performed.

Some of the more significant restrictions are outlined below. It is important to also note that the below restrictions are applied after any startup scripts run.

  • Cannot change directories using cd
  • Cannot set or unset the values of SHELL, PATH, ENV, or BASH_ENV
  • Cannot specify command named containing /
  • Cannot specify a file name containing a / as an argument to the builtin . - or "source" - command
  • Cannot redirect output using the >, >|, <>, >&, &>, and >> redirection operators
  • Cannot use the exec builtin command to replace the shell
  • Cannot use +r to turn off restricted mode
  • Cannot use +o to change exit behavious

Installation/Use

Choose a location to store the Dam repository - /opt is a good choice. Enter the directory, clone this repo, and enter it (you may need to set correct permissions to do this):

cd /opt
git clone [email protected]:scribenet/dam.git
cd dam

Copy the allowed_accounts.dist file as allowed_accounts and edit it to include a space-separated list of users you want to allow to perform functions using the Dam service:

cp allowed_accounts.dist allowed_accounts
nano allowed_accounts

Add the new login shell to the list of system-allowed login shells by editing /etc/shells and appending the full filepath to the login file within Dam. Assuming the dir/file placement above, the path would be /opt/dam/login.

Next, create the local user for people to access Dam with:

sudo adduser --shell /opt/dam/login dam

Assuming your have PasswordAuthentication set to no in your /etc/ssh/sshd_config file (as you should...otherwise this script is meaningless) you must add an exclusion entry for the dam user. Open /etc/ssh/sshd_config and append the following lines to the end of the file:

Match User dam
PasswordAuthentication yes

Lastly, be sure to open up and edit the configuration values within the /opt/dam/login file to suite your needs.

Contact

Please contact [email protected] with any questions.

Copying

This software is licensed under the MIT License included within this repository.

dam's People

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

robfrawley

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.