SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

38
Modern authentication techniques in Python web applications Artur Barseghyan Goldmund, Wyldebeast & Wunderliebe http://www.goldmund-wyldebeast-wunderliebe.nl/ [email protected] https://github.com/barseghyanartur

description

Modern authentication techniques in Python web applications. PyGrunn talk by Artur Barseghyan. Year 2014.

Transcript of SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Page 1: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Modern authentication techniques in Python web

applicationsArtur Barseghyan

Goldmund, Wyldebeast & Wunderliebe

http://www.goldmund-wyldebeast-wunderliebe.nl/[email protected]://github.com/barseghyanartur

Page 2: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Part 1

Single Sign-on using

Central Authentication Service

Page 3: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

A single framework/application

User base

Framework/application

Authentication system

Other importants parts not related to this talk

Page 4: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Typical framework/application authentication flow

User requests content requiring authentication

User gets the content requested

Is user authenticated?

Authenticate user

User provides credentials (login page)

Are credentials

correct?

Yes

No Yes

No

Page 5: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Multiple web frameworks/applications

User base 1

Framework/application 1

Authentication system 1

Other importants parts not related to this talk

User base 2

Framework/application 2

Authentication system 2

Other importants parts not related to this talk

User base N

Framework/application N

Authentication system N

Other importants parts not related to this talk

...

Web portal (ex. DMS, intranet, wiki, etc.)

Page 6: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Without Single Sign-on...● Use a single framework/application and write lots of

apps OR

● Use multiple frameworks/applications and:○ Hack their authentication systems OR○ Expect users to login into each of them OR○ Make them communicate via customly built API

● More (bad) ideas?

Page 7: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

With Single Sign-on...● User logs in once and gains access to all systems

without being prompted to log in again.

Page 8: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

(JaSig) CASEnterprise Single Sign-on solution

● Open source● Well documented● Scalable● Modular and highly pluggable (MySQL,

PostgreSQL, Oracle, LDAP, SPINEGO, RADIUS, etc.)

● Lots of ready-to-use clients and plugins

Page 9: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

(JaSig) CASCAS involves at least three parties: ● A client web browser● Web application requesting authentication ● The CAS server

It also optionally may involve:● Back-end service, such as a database server

Page 10: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

CAS authentication flow

Page 11: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

CAS authentication schema

User requests content which requires authentication

User is asked to provide credentials

(login page)

Create SSO token and redirect

User gets the content requested

No

Yes

No

Yes

Is user authenticated

into app?

No

Yes

Authenticate user (CAS)

CAS server

Authenticate user (locally)

Are credentials

correct?Is user

authenticated into CAS?

CAS client (web application)

Page 12: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Pros of CASPros● Centralised authentication for all frameworks/applications.● Actively maintained and developed. Large community.● Modular and highly pluggable (MySQL, PostgreSQL, Oracle, Active

Directory, LDAP, SPINEGO, RADIUS, etc.).● Lots of ready-to-use packages for many frameworks/applications.● Less passwords to retype, remember and recover. ● More of your own code is reusable.● Happier end-users.● REST API.

Page 13: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Cons of CASCons● SSO availability becomes critical.● SSO security becomes critical.

Page 14: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Our use case

Dashboard app ● Django

Server A

CAS server Server C

User base● Active Directory

Server D

VPN

● Apache● Tomcat● Debian● Java● CAS● OpenVPN● AJP● Python● Django● Plone

More to come Server X

DMS ● Plone

Server B

Page 15: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Conclusion

Page 16: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

CAS alternatives

1 / n

JOSSO http://www.josso.org

OpenAM (formerly known as OpenSSO) http://openam.forgerock.org

Pubcookie http://www.pubcookie.org

CoSign http://weblogin.org

Page 17: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Linkodrome

1 / n

Software packages

JaSig CAS http://www.jasig.org/cas

Django CAS client https://github.com/Goldmund-Wyldebeast-Wunderliebe/django-cas-consumer

Plone CAS client https://github.com/collective/anz.casclient

Detailed installation instructionshttp://bit.ly/1uuk2BS

Page 18: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Part 2

Two-step verification(Two-factor authentication)

Page 19: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Standard authentication flow

User requests content requiring authentication

User gets the content requested

Is user authenticated?

Authenticate user

User provides credentials (login page)

Are credentials

correct?

Yes

Yes

No

No

Page 20: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

● Knowledge factor ("something only the user knows"): a password or a PIN.

● Possession factor ("something only the user has"): ATM card, smart card, mobile phone.

● Inherence factor ("something only the user is"): Fingerprint or voiceprint.

Standard authentication factors

Page 21: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Common advises on remembering many passwords

● Use complex passwords and have them saved in password managers.

● Use complex passwords, write them on paper and carry them in your wallet.

Passwords aren’t enough!

Page 22: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Two-factor authentication● Knowledge factor ("something only the user knows"):

a password or a PIN.

● Possession factor ("something only the user has"): ATM card, smart card, mobile phone.

● Inherence factor ("something only the user is"): Fingerprint or voiceprint.

Page 23: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Standard authentication flow

User requests content requiring

authentication

User provides

credentials

No

Yes

Is user authenticated

?

Authenticate user

Yes

No

Are credentials

correct?

User gets the content requested

Page 24: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Two-factor authentication flow

User requests content requiring

authentication

User provides

credentials

No

YesUser

provides second factor token

Is token

correct?

Yes

No

Second factor

Is user authenticated

?

Authenticate user

Yes

No

Are credentials

correct?

User gets the content requested

Page 25: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

(Common) solutions● SMS authentication● Google Authenticator (mobile app)● Hardware token generators

Page 26: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Google Authenticator

Page 27: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Hardware token generators

Page 28: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Our use cases

● collective.googleauthenticator (uses Google Authenticator app)

● collective.smsauthenticator (login codes sent by SMS)

Page 29: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

collective.googleauthenticator

Page 30: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Setup two-step verification

Page 31: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Authenticate

Page 32: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Verify

Page 33: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Conclusion

Page 34: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Alternatives

● Risk-based authentication (based on behavioral biometrics, keystroke dynamics, etc.)

● Strong authentication

● Reliance authentication

Page 35: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Linkodrome

Plone● collective.googleauthenticator (two-factor authentication using Google Authenticator app)

https://pypi.python.org/pypi/collective.googleauthenticator● collective.smsauthenticator (two-factor authentication using login codes sent by SMS)

https://pypi.python.org/pypi/collective.smsauthenticator

Django● django-two-factor-auth (two-factor authentication using Google Authenticator or login codes sent

by SMS)https://pypi.python.org/pypi/django-two-factor-auth

● django-otp (pluggable framework for adding two-factor authentication using OTP.)https://pypi.python.org/pypi/django-otp

Page 36: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Questions?

Page 37: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)

Thank you!Artur Barseghyan

Goldmund, Wyldebeast & Wunderliebe

[email protected]://github.com/barseghyanartur

Page 38: SSO using CAS + two-factor authentication (PyGrunn 2014 talk)