Slide 1

Slide 1 text

Mike West, @mikewest, [email protected] https://goo.gl/F0o9kR Hardening the Web Platform

Slide 2

Slide 2 text

Slides: https://goo.gl/F0o9kR

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

https://goo.gl/MycPb7

Slide 7

Slide 7 text

"Sharpening", https://flic.kr/p/sbo18H

Slide 8

Slide 8 text

"Vintage Camillus 1006", https://flic.kr/p/eNbtJ8

Slide 9

Slide 9 text

"Vintage Camillus 1006", https://flic.kr/p/eNbtJ8

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

https://securethe.news/

Slide 12

Slide 12 text

https://letsencrypt.org/

Slide 13

Slide 13 text

https://caddyserver.com/

Slide 14

Slide 14 text

https://goo.gl/ptS8FO https://goo.gl/nzbqQo

Slide 15

Slide 15 text

Pro tip: Content-Security-Policy: default-src https:; report-uri /reports-r-us

Slide 16

Slide 16 text

Content-Security-Policy: upgrade-insecure-requests https://goo.gl/hcin3m

Slide 17

Slide 17 text

https://goo.gl/51hqZa

Slide 18

Slide 18 text

https://goo.gl/Kd2eMQ

Slide 19

Slide 19 text

https://goo.gl/ciyreA

Slide 20

Slide 20 text

https://goo.gl/rStTGz

Slide 21

Slide 21 text

AppCache getUserMedia crypto.subtle.* ServiceWorker navigator.credentials navigator.geolocation PaymentRequest EME https://goo.gl/rStTGz Notification

Slide 22

Slide 22 text

https://goo.gl/Wwpnjw https://goo.gl/fzVgNt

Slide 23

Slide 23 text

127.0.0.1 192.168.1.1 192.220.74.179 https://goo.gl/Wwpnjw

Slide 24

Slide 24 text

"Vintage Camillus 1006", https://flic.kr/p/eNbtJ8

Slide 25

Slide 25 text

https://goo.gl/Wamh7S

Slide 26

Slide 26 text

default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com *.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com

Slide 27

Slide 27 text

https://goo.gl/lJq6jj https://goo.gl/dqPkYn

Slide 28

Slide 28 text

script-src https://connect.facebook.net https://cm.g.doubleclick.net https://ssl.google-analytics.com https://graph.facebook.com https://twitter.com 'unsafe-eval' https://*.twimg.com https://api.twitter.com https://analytics.twitter.com https://publish.twitter.com https://ton.twitter.com https://syndication.twitter.com https://www.google.com https://t.tellapart.com 'nonce-LrNe0GlzopB0DPFNqwdllg==' https://platform.twitter.com https://www.google-analytics.com 'self'; frame-ancestors 'self'; font-src https://twitter.com https://*.twimg.com data: https://ton.twitter.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com https://netdna.bootstrapcdn.com 'self'; media-src https://twitter.com https://*.twimg.com https://ton.twitter.com blob: 'self'; connect-src https://graph.facebook.com https://*.giphy.com https://*.twimg.com https://embed.pscp.tv https://api.twitter.com https://pay.twitter.com https://analytics.twitter.com https://*.twprobe.net https://media.riffsy.com https://embed.periscope.tv https://upload.twitter.com 'self'; style-src https://fonts.googleapis.com https://twitter.com https://*.twimg.com https://translate.googleapis.com https://ton.twitter.com 'unsafe-inline' https://platform.twitter.com https://maxcdn.bootstrapcdn.com https://netdna.bootstrapcdn.com 'self'; object-src https://twitter.com https://pbs.twimg.com; default-src 'self'; frame-src https://staticxx.facebook.com https://twitter.com https://*.twimg.com https://5415703.fls.doubleclick.net https://player.vimeo.com https://pay.twitter.com https://www.facebook.com https://ton.twitter.com https://syndication.twitter.com https://vine.co twitter: https://www.youtube.com https://platform.twitter.com https://upload.twitter.com https://s-static.ak.facebook.com https://4337974.fls.doubleclick.net 'self' https://donate.twitter.com; img-src https://graph.facebook.com https://*.giphy.com https://twitter.com https://*.twimg.com https://ad.doubleclick.net data: https://lumiere-a.akamaihd.net https://fbcdn-profile-a.akamaihd.net https://www.facebook.com https://ton.twitter.com https://*.fbcdn.net https://syndication.twitter.com https://media.riffsy.com https://www.google.com https://stats.g.doubleclick.net https://api.mapbox.com https://www.google-analytics.com blob: 'self'; report-uri https://twitter.com/i/csp_report?a=NVQWGYLXFVZXO2LGOQ%3D%3D%3D%3D%3D%3D&ro=false;

Slide 29

Slide 29 text

https://goo.gl/wSH6sV

Slide 30

Slide 30 text

https://srihash.org/

Slide 31

Slide 31 text

https://goo.gl/yxEJiO https://goo.gl/IrPX7b

Slide 32

Slide 32 text

Set-Cookie: user_session=...; path=/; secure; HttpOnly; SameSite=Lax

Slide 33

Slide 33 text

https://goo.gl/QcZIBI

Slide 34

Slide 34 text

✘ Set-Cookie: __Host-SID=12345; Secure; Path=/ ✘ Set-Cookie: __Host-SID=12345 ✘ Set-Cookie: __Host-SID=12345; Secure ✘ Set-Cookie: __Host-SID=12345; Secure; Path=/subdirectory/ ✘ Set-Cookie: __Host-SID=12345; Domain=example.com ✘ Set-Cookie: __Host-SID=12345; Domain=example.com; Path=/ ✘ Set-Cookie: __Host-SID=12345; Secure; Domain=example.com; Path=/ ✘ Set-Cookie: __Secure-SID=12345; Secure; ✘ Set-Cookie: __Secure-SID=12345

Slide 35

Slide 35 text

https://goo.gl/gF2clJ

Slide 36

Slide 36 text

https://goo.gl/FHAeAm

Slide 37

Slide 37 text

Credential Management API @ I/O: https://goo.gl/FbrO5x navigator.credentials.get({ "password": true, "unmediated": true }) .then(c => { if (!c) return; // Hooray, we have a credential! signInToYourApplication(c); });

Slide 38

Slide 38 text

Credential Management API @ I/O: https://goo.gl/FbrO5x function signInToYourApplication(c) { fetch("/signin", { "method": "POST", "credentials": c }) .then(r => { if (r.status == 200) { renderSignedInExperience(r); // or: window.location = "/signedin"; } else { renderUsefulErrorMessage(); } }); }

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

https://goo.gl/Un07eJ

Slide 41

Slide 41 text

https://goo.gl/ILUP12

Slide 42

Slide 42 text

https://goo.gl/eZ9SKg

Slide 43

Slide 43 text

scheme://host:port

Slide 44

Slide 44 text

scheme://host:port scheme://sub1_host:port scheme://sub2_host:port

Slide 45

Slide 45 text

https://goo.gl/VhLsq2

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Thank you! https://goo.gl/F0o9kR @mikewest [email protected]