GithubHelp home page GithubHelp logo

isabella232 / duo_unix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/infrastructure-duo_unix

0.0 0.0 0.0 1.03 MB

Duo two-factor authentication for Unix systems

Home Page: http://www.duosecurity.com

License: Other

C 62.33% Shell 3.10% Python 11.38% Perl 1.65% Makefile 0.70% M4 5.54% Roff 1.17% Terra 0.51% Ruby 12.08% Raku 1.55%

duo_unix's Introduction

Duo Unix

Build Status Issues Forks Stars License

Duo two-factor authentication for Unix systems.

Duo Unix includes a PAM module or alternatively a stand alone executable that can be used to protect programs such as SSH or Sudo.

This repository is meant to be used for development or cutting edge versions of Duo Unix. For production deployments Duo recommends using our stable release tarballs or packages. Instructions can be found on our documentation page Duo Unix Docs

Getting Started

These instructions are geared towards getting you up and running on your local machine for development and testing purposes. See the deployment section for notes on how to deploy Duo Unix in production.

Prerequisites

You will likely want to have some kind of virtual machine when developing Duo Unix. If Duo Unix is configured incorrectly it has the potential to lock you out of a system. It's better to have that happen on a virtual machine instead of your computer.

We recommend something like Vagrant or Docker

Installing

Install the necessary third party libraries.

  • Debian based Systems
$ sudo apt-get install autoconf libtool libpam-dev libssl-dev
  • RHEL based systems
$ sudo yum install autoconf libtool pam-devel openssl-devel
  • RHEL 7 and CentOS 7 systems with SELinux enabled
$ sudo yum install selinux-policy-devel bzip2

Clone the Duo Unix project down and enter the directory

$ git clone <paste the url here>
$ cd duo_unix/

Run bootstrap to generate the configure script.

$ ./bootstrap

Run configure to generate your makefiles.

$ ./configure --with-pam --prefix=/usr

Build the project locally

$ make

Install the project. The install location will be the same as the prefix you specified in the configure step.

$ sudo make install

After installation add your integration keys to the config files

  • Visit the Duo Admin Panel and create a "Unix" integration if you don't have one already
  • Copy your ikey, skey, and api_host into the proper fields of the config files
$ vim /etc/duo/login_duo.conf
$ vim /etc/duo/pam_duo.conf

Finally, test an auth!

$ sudo login_duo -f myusername 'echo "Hello World"'

You should only see "Hello World" if the authentication succeeds.

Running the tests

The additional prereq for running the tests is python

#  RHEL Based
$ sudo yum install python
#  Debian Based
$ sudo apt-get install python

To run all the automated tests simply run

$ make check

To run an individual test

$ cd tests/
$ python cram.py login_duo-1.t

Cram Tests

For Duo Unix we use Cram to do our testing. Each test file typically starts by creating a mock duo service. After we create that service we list commands followed by the expected output of that command. If the output matches, then the cram test passes. If not, it fails.

Example passing test

$ echo "Hello World"
Hello World

Example failing test

$ echo "Hello World"
Goodbye World

Other testing tips

Each test creates the mockduo server for you, but if you need to run it manually to test things you can. Below is an example of running a mockduo server in one session and authenticating against it in another.

$ cd tests/
$ python mockduo.py certs/mockduo.pem
Now in a separate terminal window
$ ../login_duo/login_duo -d -c confs/mockduo.conf -f my_username echo "Success"

This mock server can be a bit brittle so you may have to restart it if you start seeing very weird behavior.

Static analysis

Install cppcheck

$ cppcheck --quiet --force -i tests --suppressions-list=.false_positive.txt --error-exitcode=1 .

Deployment

For production deployments Duo recommends using our stable release tarballs or packages. Instructions can be found on our documentation page Duo Unix Docs

Contributing

Please read CODEOFCONDUCT.md and CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

License

This project is licensed under the GPLv2 License - see the LICENSE file for details

Support

Report any bugs, feature requests, etc. to [email protected]

duo_unix's People

Contributors

dugsong avatar xdesai avatar ben-duo avatar vbscott avatar flameeyes avatar bradleyhiggins avatar adrikim avatar zsprackett avatar clambertus avatar mschwager avatar mbish avatar kees avatar yizshi avatar aaronpohl avatar zcoughl avatar jumanjiman avatar humbedooh avatar sanjaymsh avatar alichator avatar skemper avatar 4-rodrigo-salazar avatar ripienaar avatar nelhage avatar ndbroadbent avatar mstanislav avatar lisa avatar kvar avatar jeffreyparker avatar jasonn3 avatar thomasjp0x42 avatar

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.