webauthn with php...webauthn with php arne blankerts co-founder, the php consulting company...

77
International PHP Conference 2019 - Spring Edition - Berlin The Future of Authentication WebAuthn with PHP

Upload: others

Post on 07-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

International PHP Conference 2019 - Spring Edition - Berlin

The Future of AuthenticationWebAuthn with PHP

Page 2: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Arne Blankerts

Co-Founder, The PHP Consulting Company

Page 3: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Passwords are a shared secret

Page 4: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

How to find a good password

Page 5: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

A good Password policy?

Must contain numbers

Must contain mixed case

Must contain special char

Must be at least 5 characters long

...

Page 6: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

A good password?

theseer@nyda ~ $ pwgen -syn 32 1

O;v;RzO/5z:4`!VF0onL&Tb"Cq*+h4/R

Page 7: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

⟫ Your password contains illegal chars.

Page 8: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 9: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

A good enough password?

theseer@nyda ~ $ pwgen -sn 32 1

YN1XCWvo10fxD816xdSIjYVrC5b4jaCO

Page 10: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

⟫ Your password is too long.

Page 11: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 12: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

"Do I really want to sign up here?" - password

theseer@nyda ~ $ pwgen -synB -r \" 10 1

+{-LmJC4~#

Page 13: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

⟫ Password successfully set.

Page 14: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 15: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 16: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 17: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

https://xkcd.com/936

⟫ Through 20 years of e�ort, we'vesuccessfully trained everyone to usepasswords that are hard for humans toremember, but easy for computers toguess.

Page 18: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Yet, every major website and service uses passwords

Page 19: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Most of them had security breaches

Page 20: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Most of them had security breaches

Password got stolen

Page 21: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Sites should not be trusted to store passwords

Page 22: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

How to avoid using passwords?

Page 23: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 24: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Remember me

Page 25: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

HTTPS

Page 26: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Client Side Certificates!

Page 27: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Client Side Certificates with NGINX

server { listen 443;

ssl on; ssl_certificate /etc/ssl/certs/not_self_signed.crt; ssl_certificate_key /etc/ssl/private/not_self_signed.key; ssl_session_timeout 5m;

ssl_client_certificate /etc/ssl/ca/certs/ca.crt; ssl_crl /etc/ssl/ca/private/ca.crl;

ssl_verify_client on;

location / { fastcgi_param VERIFIED $ssl_client_verify; fastcgi_param DN $ssl_client_s_dn; include fastcgi_params; }

}

Page 28: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 29: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 30: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Keep passwords?

Page 31: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Keep passwords?

Just reduce impact of stolen passwords

Page 32: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Two Factor Authentication

Page 33: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

One Time Passwords

via SMS

RSA Key

OTP Application on Phone or USB Key

Page 34: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

One Time Passwords

via SMS

RSA Key

OTP Application on Phone or USB Key

Page 35: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

One Time Passwords

via SMS

RSA Key

OTP Application on Phone or USB Key

Page 36: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

https://yourbank.com.5xefxd232exfgcetre.totallylegit.ru

Page 37: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

https://yourbank.com.5xefxd232exfgcetre.totallylegit.ru

aka Phishing

Page 38: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must
Page 39: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Passwords don't work.

Page 40: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Passwords don't work.

Time for something new.

Page 41: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn

https://www.w3.org/TR/webauthn/

Page 42: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn

O�cial W3C Standard

A sub-spec of FIDO2 specs

Public keys for authentication in browsers

Page 43: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Registration

Page 44: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

Page 45: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2Registration

Page 46: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3Registration Fetch registration page

Page 47: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4

Registration Fetch registration page

HTML + JS

Page 48: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

Registration Fetch registration page

HTML + JS

Fetch args

Page 49: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

6

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Page 50: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Create key

Page 51: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Create keyGo?

Page 52: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Create keyGo?

Go!

Page 53: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9 10

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Create keyGo?

Go!

Public key & Signature

Page 54: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9 10 11

Registration Fetch registration page

HTML + JS

Fetch args

Create args

Create keyGo?

Go!

Public key & Signature Public key & Signature

Page 55: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Authentication

Page 56: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

Page 57: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2Login

Page 58: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3Login Fetch login page

Page 59: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4

Login Fetch login page

HTML + JS

Page 60: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

Login Fetch login page

HTML + JS

Challenge?

Page 61: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

6

Login Fetch login page

HTML + JS

Challenge?

The challenge

Page 62: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

Login Fetch login page

HTML + JS

Challenge?

The challenge

Please sign challenge

Page 63: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

Login Fetch login page

HTML + JS

Challenge?

The challenge

Please sign challengeGo?

Page 64: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9

Login Fetch login page

HTML + JS

Challenge?

The challenge

Please sign challengeGo?

Go!

Page 65: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9 10

Login Fetch login page

HTML + JS

Challenge?

The challenge

Please sign challengeGo?

Go!

Signature

Page 66: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browser Server

1

UserFIDO2-HW

2 3

4 5

67

8

9 10 11

Login Fetch login page

HTML + JS

challenge?

The challenge

Please sign challengeGo?

Go!

Signature Signature

Page 67: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Phot

o Co

pyrig

ht b

y Yub

ico,

http

s://

ww

w.yu

bico

.com

/pro

duct

/sec

urity

-key

-nfc

-by-

yubi

co-2

-pac

k

Page 68: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Phot

o Co

pyrig

ht b

y Yub

ico,

http

s://

ww

w.yu

bico

.com

/pro

duct

/sec

urity

-key

-nfc

-by-

yubi

co-2

-pac

k

Page 69: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn & PHP

Page 70: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn & PHP

As the relying party

Page 71: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn & PHP

As the relying party

(aka server side)

Page 72: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn & PHP

https://github.com/web-auth/webauthn-frameworkComes with a ready to use Symfony Bundles

https://github.com/asbiin/laravel-webauthnLaravelWebauthn is an adapter to use Webauthn on Laravel

Uses the above library

https://github.com/Firehed/u2f-phpAn implementation of the FIDO U2F server protocol in PHP

https://github.com/lbuchs/WebAuthnA simple PHP WebAuthn (FIDO2) server library

https://github.com/madwizard-thomas/webauthn-serverEarly stage of development

Page 73: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

WebAuthn Demos

https://webauthn.io/

https://webauthn.me/

https://demo.yubico.com/webauthn/

https://webauthn.lubu.ch/For lbuchs' WebAuthn Implementation

Page 74: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Demo Time

https://webauthn.lubu.ch/

Page 75: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

Browsers with WebAuthn Support

Firefox 60+Only USB supported

Chrome 67+On Android 70+

Opera 54+

Edge 18+

Page 76: WebAuthn with PHP...WebAuthn with PHP Arne Blankerts Co-Founder, The PHP Consulting Company Passwords are a shared secret How to find a good password A good Password policy? Must

With WebAuthn ...

no passwords neededno more weak passwords

no password reuse

no sensitive information is stored on the server

users do not need to trust the website

phishing is fundamentally not working

Read up more on https://webauthn.guide/