2017 © Pedro Peláez
 

simplesamlphp-module simplesamlphp-module-mfa

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

image

silinternational/simplesamlphp-module-mfa

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  • Monday, March 5, 2018
  • by forevermatt
  • Repository
  • 4 Watchers
  • 0 Stars
  • 307 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 7 % Grown

The README.md

Archived

This repository is no longer maintained. It has been included directly in https://github.com/silinternational/ssp-base., (*1)

--, (*2)

Multi-Factor Authentication (MFA) simpleSAMLphp Module

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.)., (*3)

This mfa module is implemented as an Authentication Processing Filter, or AuthProc. That means it can be configured in the global config.php file or the SP remote or IdP hosted metadata., (*4)

It is recommended to run the mfa module at the IdP, and configure the filter to run before all the other filters you may have enabled., (*5)

How to use the module

Simply include simplesamlphp/composer-module-installer and this module as required in your composer.json file. The composer-module-installer package will discover this module and copy it into the modules folder within simplesamlphp., (*6)

You will then need to set filter parameters in your config. We recommend adding them to the 'authproc' array in your metadata/saml20-idp-hosted.php file., (*7)

Example (for metadata/saml20-idp-hosted.php):, (*8)

use Sil\PhpEnv\Env;
use Sil\Psr3Adapters\Psr3SamlLogger;

// ...

'authproc' => [
    10 => [
        // Required:
        'class' => 'mfa:Mfa',
        'employeeIdAttr' => 'employeeNumber',
        'idBrokerAccessToken' => Env::get('ID_BROKER_ACCESS_TOKEN'),
        'idBrokerAssertValidIp' => Env::get('ID_BROKER_ASSERT_VALID_IP'),
        'idBrokerBaseUri' => Env::get('ID_BROKER_BASE_URI'),
        'idBrokerTrustedIpRanges' => Env::get('ID_BROKER_TRUSTED_IP_RANGES'),
        'idpDomainName' => Env::get('IDP_DOMAIN_NAME'),
        'mfaSetupUrl' => Env::get('MFA_SETUP_URL'),

        // Optional:
        'loggerClass' => Psr3SamlLogger::class,
    ],

    // ...
],

The employeeIdAttr parameter represents the SAML attribute name which has the user's Employee ID stored in it. In certain situations, this may be displayed to the user, as well as being used in log messages., (*9)

The loggerClass parameter specifies the name of a PSR-3 compatible class that can be autoloaded, to use as the logger within ExpiryDate., (*10)

The mfaSetupUrl parameter is for the URL of where to send the user if they want/need to set up MFA., (*11)

The idpDomainName parameter is used to assemble the Relying Party Origin (RP Origin) for WebAuthn MFA options., (*12)

Testing Locally

Setup

Add entries to your hosts file to associate mfa-sp.local and mfa-idp.local with the IP address of your docker containers (which is the IP address from the Vagrantfile if you are running docker within the Vagrant VM)., (*13)

Automated Testing

Run make test., (*14)

Manual Testing

Go to http://mfa-sp.local:52021/module.php/core/authenticate.php?as=mfa-idp in your browser and sign in with one of the users defined in development/idp-local/config/authsources.php. Example: username = must_set_up_mfa, password = a, (*15)

Go to http://mfa-sp.local:52021/module.php/core/as_logout.php?ReturnTo=/&AuthId=mfa-idp to logout., (*16)

Why use an AuthProc for MFA?

Based on..., (*17)

  • the existence of multiple other simpleSAMLphp modules used for MFA and implemented as AuthProcs,
  • implementing my solution as an AuthProc and having a number of tests that all confirm that it is working as desired, and
  • a discussion in the SimpleSAMLphp mailing list about this:
    https://groups.google.com/d/msg/simplesamlphp/ocQols0NCZ8/RL_WAcryBwAJ

... it seems sufficiently safe to implement MFA using a simpleSAMLphp AuthProc., (*18)

For more of the details, please see this Stack Overflow Q&A:
https://stackoverflow.com/q/46566014/3813891, (*19)

Contributing

To contribute, please submit issues or pull requests at https://github.com/silinternational/simplesamlphp-module-mfa, (*20)

Acknowledgements

This is adapted from the silinternational/simplesamlphp-module-expirychecker module, which itself is adapted from other modules. Thanks to all those who contributed to that work., (*21)

The Versions

05/03 2018
05/03 2018
05/03 2018

dev-feature/fix-tests-when-new-dependencies

dev-feature/fix-tests-when-new-dependencies

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1-or-later

The Requires

 

The Development Requires

by Matt Henderson

08/02 2018
07/02 2018

2.0.4

2.0.4.0

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1-or-later

The Requires

 

The Development Requires

by Matt Henderson

06/02 2018

2.0.3

2.0.3.0

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1-or-later

The Requires

 

The Development Requires

by Matt Henderson

01/02 2018

2.0.2

2.0.2.0

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1-or-later

The Requires

 

The Development Requires

by Matt Henderson

01/02 2018

dev-feature/update-to-ssp-1-15

dev-feature/update-to-ssp-1-15

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1-or-later

The Requires

 

The Development Requires

by Matt Henderson

23/01 2018
23/01 2018
10/01 2018
28/11 2017

dev-feature/update-ssp-base-tags

dev-feature/update-ssp-base-tags

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1

The Requires

 

The Development Requires

by Matt Henderson

27/11 2017
01/11 2017
06/10 2017

dev-feature/demo-with-silauth

dev-feature/demo-with-silauth

A simpleSAMLphp module for prompting the user for MFA credentials (such as a TOTP code, etc.).

  Sources   Download

LGPL-2.1

The Requires

 

The Development Requires

by Matt Henderson