SecSign ID Plugin: Unix PAM - Integration Tutorial

2016-11-28 5 minutes to read

Two-Factor Authentication for PAM

The Pluggable Authentication Modules (PAM) is a software library which offers a general programming interface for authentication services. By using the PAM-API one does no longer need to define the settings for every single authentication application. Instead, individual standarized modules can be used. The modules can be assigned to individual services in the configuration file. There is no need to change the compilation of the corresponding software. PAM is available for AIX, HP-UX, Solaris, Linux, FreeBSD, NetBSD, Mac OS X and DragonFly BSD.

PAM Overview
Integration

Integration of the plugin into your setup

SecSign ID Integration

Please configure your desired integration of the SecSign ID Two Factor Authentication

Choose a system, where you want to add the secure login

Do you need your own ID Server inside your protected network or prefer if we manage and maintain it for you

The location to save the assigned SecSign IDs to a user account or the IDM alltogether

System to protect
?
The System you want to protect - Choose a system, where you want to add the secure login
SecSign ID Server location
?
Do you need your own ID Server inside your protected network or prefer if we manage and maintain it for you
User account location
?
The system to save the assigned SecSign IDs to a user account or the IDM alltogether
edit the settings to change the integration
Authentication
2FA
2FA blind
2FA no AP
2SA
2SA no AP
2SA blind
OTP
Enrollment
Custom ID
Pattern
IDP Custom Website
Enrollment initiated by SP
Enrollment with IDM
Show Network
Hide Network
Fullscreen
Request Solution
x
The authentication was successful
Application

Areas of application

There are several areas of application for secure Two-Factor Authentication with the SecSign ID Pluggable Authentication Module.

We offer the SecSign ID RADIUS Proxy for authentication services using the RADIUS Server and Active Directory. This way the SecSign IDs are requested from the Active Directory as compared to the configuration file.

  • SSH
  • FTP
  • Apache HTTP Auth
  • Desktop Logins
Authentication Process

Authentication Process

The user provides, with an SSH connection for this example, his user name and password. He receives a push-notification to his smartphone within seconds, providing the service name and address of the service he wants to log in to. As soon as he confirms the request the SSH connection is established.

That is everything there is to do for the user to enjoy truly secure Two-Factor Authentication and prevent access to the system even with leaked password information.

That is how the authentication for the SSH example works:

pam-sequence-1

  1. A SSH client opens the SSH connection to the server.
  2. The SSHd application accepts the request and in turn places an authentication request to the PAM library.
  3. The corresponding configuration file is reviewed for the correct PAMs. In the example it is asked for the user password, just like for SSH connections.
  4. In the second step the SecSign ID PAM is called.
  5. The SecSign ID PAM loads the configuration file and looks for the corresponding user’s SecSign ID.
  6. In the next step the SecSign ID Server is notified about the SecSign ID authentication request.
  7. The SecSign ID Server sends a push-notification to the user’s smartphone.
  8. The user can now accept the login on his smartphone.
  9. The PAM requests the authentication status from the SecSign ID Server. If the login is accepted that information is forwarded to the PAM.
  10. The SecSign ID PAM evaluates the server’s answer and determines if the authentication is valid. The PAM status is sent to the PAM library if the authentication is verified.
  11. The PAM library checks for additional authentication routines and forwards the authentication confirmation to the application, in this case SSHd.
  12. SSHd receives confirmation from the PAM about the valid authentication and establishes a SSH connection.
Setup

Setup

Download the SecSign ID PAM archive and unpack it. The library contains four files:

  • Makefile: Is used to compile the source library
  • libsecsinid.c: C library for the SecSign ID Two-Factor Authentication
  • libsecsinid.h: Corresponding header-file with type definitions and function prototypes
  • secsignid.c: PAM to use the SecSign ID
  • secsignid.config: Comfiguration file which combines user name and corresponding SecSign ID

To compile and accurately render the program the following requirements must be met:

  • Unix Platform or Mac
  • gcc compiler
  • libcurl installed
  • libpam installed
  • Internet connection (the SecSignID server communicates via Port 443)

The gcc compiler and libcurl can be installed with Debian:

and with Ubuntu:

and with RHEL:

The easiest way to install the compiler gcc, libcurl and libpam on Mac OS X is via Homebrew.

PAM Configuration

PAM Configuration

The file secsignid.c contains configuration settings for the module. Paths to the configuration file and the log- and debug files can be adjusted.

Configuration file

The configuration file secsignid.config combines the user name and corresponding SecSign ID. The file should be stored at /etc/secsignid/secsignid.config or at a location with root- or admin access rights. The path to the configuration file is set in the file secsignid.c with the constant CONFIGFILE.

General Settings:
The SecSign ID transmits several details to the ID-Server, which in turn provides these to the user’s smartphone, including service name, the corresponding IP-address or URL:

Output:
The parameter secoutput determines if the console prints status messages like in the example below.

If secoutput=1 the user will see the status messages and needs to press enter before authenticating (this is due to PAM buffering messages without a prompt).

If the parameter secoutputid is set to true, the users SecSign ID will be displayed during the login.

Interval:
DThe PAM Plugin incorporates an interval function. After a successful login, this function skips the 2FA if a user attempts a new login in a given time frame (in minutes). This function is skipped if 0.

For the interval function to work, secsignid.c defines a path to a writable folder. Whenever a user successfully authenticates via 2FA, the PAM will create a file with the username and timestamp. For every login, PAM checks the timestamp of the last 2FA login and decides if another 2FA is needed. Make sure, that you create the folder and set the correct access rights.

User Mapping with the Login Name:
If the user authenticates via SSH (for example), the administrator can decide if the user’s SecSign ID is the same as his login name or if the ID is set manually.

An automatic mapping with the login name is recommended for On-Premise ID Servers only. If you use the public Cloud ID Server, you have to use manual mapping.

Manual SecSign ID Mapping:
If you use the manual mapping, each user needs an entry with the following schema for mapping the linux username and the SecSignId:

ID Server endpoints

If you want to use your own On-Premise ID Server, you can change the endpoints in libsecsignid.c. The predefined cloud endpoints are the following:

Modify the urls to fit your On-Premise ID Server configuration.

Debugging

The library contains a debug modus, which releases any interface communication. That enables the verification of request transmission and requests for session status. To activate the debug modus the following constants have to be adjusted.

DEBUGTYPE specifies how the debug output is handled:

  • NO = No debugging
  • YES = Output on StdOut
  • FILEDEBUG = Output in file

DEBUGFILEPATH describes the path for the debug-file. The file has to be be writeable with the program. If no debug-file exists one is automatically generated.

Logging

Logging is meant for interface error. Technical errors (for example wrong syntax for the parameter) and API error (for example nonexistent user) are logged. Logs are either defined in the Syslog or a separate file:

  • FILELOG = Errors are written in a file, the second parameter is the file name.
  • SYSLOG = Errors are written in the Syslog, the second parameter is ignored but must be present.
  • NO = No log is written, the second parameter is ignored but must be present.

Compilation and Installation

Compilation and Installation

To compile the PAM open the shell or the terminal, respectively, switch to the unpacked directory containing the C-script and enter make. The program pam_secsignid.so is created.

The program can be compiled manually:

After the successful compilation the file has to be stored in the PAM directory. Normally, it is /lib/security or /lib/x86_64-linux-gnu/security:

or

Your own ID-Server

On premise installations of SecSign ID offer the flexibility to connect with your preferred servers, services, and devices. And you can customize the SecSign ID with your own organization’s branding.

Learn More
On Premise 2FA ID

Latest Blog Posts, Updates & Features

Protecting the Home Office VPN with 2FA

In the recent weeks, home office work has increased potentially. And while employees are practicing social distancing from their home computer, attackers are working hard to exploit security issues in this situation that is unfami ...

Mehr Lesen

Two-Factor Authentication (2FA) vs. Two-Step Authentication (2SA)

Two-Factor Authentication and Two-Step Authentication are two options for secure authentication of users. Either one can be a good fit for your setup depending on your requirements and preferences. What is Two-Factor Authenti ...

Mehr Lesen

Options for secure SSO for Atlassian products

Options for securing Atlassian SSO Your users and passwords and services are all over the place? You want to simplify your security and authentication setup but you don’t know where to start? Move beyond your authentication ...

Mehr Lesen
Do NOT follow this link or you will be banned from the site!