25
Design and Implementation of Web Forward Proxy with Shibboleth Authentication Shibboleth Authentication KOMURA Takaaki Kyoto University SANO Hiroaki Kyoto University Library DEMIZU Noritoshi OCTOPATH corporation MAKIMURA Ken OCTOPATH corporation SAINT 2011 WS (MidArch) @ Munich 2011/07/21

Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Design and Implementation ofWeb Forward Proxy withShibboleth AuthenticationShibboleth Authentication

KOMURA Takaaki Kyoto University

SANO Hiroaki Kyoto University Library

DEMIZU Noritoshi OCTOPATH corporation

MAKIMURA Ken OCTOPATH corporation

SAINT 2011 WS (MidArch) @ Munich  2011/07/21

Page 2: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

ContentsContents

• Proposal Overview

• Background

• Proposal Details

• Implementation and EvaluationsImplementation and Evaluations

2

Page 3: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Proposal OverviewProposal Overview

• Shibboleth Authentication introduced into proxy authentication scheme (Proxy‐Auth)p y ( y )

ShibbolethIdP (Identify Provider)

(2) Authentication by IdP

(1) Try to access via Proxy

F d P

(3) Access via Proxy (4) Proxy relay request

( ) y y

Web ServerForward ProxyShibboleth SP (Service Provider)

Web Browser

3

Page 4: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

BACKGROUND

4

Page 5: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Necessity of Proxy and Proxy AuthNecessity of Proxy and Proxy‐Auth

ThThree reasons• Gateway from private network to the Internet• Rapid incident response• Keep track of access statistics for E‐Journal (EJ) 

isites– License fee of EJ will be charged for departmentsdepending on the number of downloading papersdepending on the number of downloading papers

→ Forward Proxy for EJ has been installed in our→ Forward Proxy for EJ has been installed in ouruniversity since 2006

5

Page 6: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Forward ProxyForward ProxyForward ProxyBrowser Web ServerForward ProxyBrowser Web Server

http://example.comGET http://example.com/doc

GET http://example com/docGET http://example.com/doc

200 OK

200 OK

6

Page 7: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Authentication to use Forward ProxyAuthentication to use Forward ProxyWeb ServerForward ProxyBrowser Web ServerForward ProxyBrowser

http://example.comGET http://example.com/doc

407 Proxy Auth RequiredProxy-Authenticate: BasicProxy Authenticate: Basic

realm="XXXXXX"

GET http://example com/doc

GET http://example.com/docProxy-Authorization: Basic

BASE64ENC==re

GET http://example.com/doc

200 OK

200 OK

epeat

200 OK

7

Page 8: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Problems of Existing Proxy AuthProblems of Existing Proxy‐Auth

S C h i i• BASIC Authentication– User ID and password travel in plain text

th t kacross the network 

• Digest Authentication– The proxy needs Users’ raw password=> Security risk is increased

• No method exists to distinguish proxy is real or fake– ID and password might be exploited by fake proxy

8

Page 9: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Purpose and ProposalPurpose and Proposal

Purpose• More secure Proxy‐Authfor users and administrators

• No modification on web browsers– Modifications or plugins are unsuited to practical use

Proposal• Shibboleth Authentication capable• Shibboleth Authentication‐capableforward proxy

9

Page 10: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

PROPOSAL DETAILS

10

Page 11: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Basic IdeaBasic IdeaWeb ServerBrowser

IdP(Identity Provider) Proxy as a SPBrowser (Identity Provider)

(Service Provider)

http://example.comAuth Request(ID & password)

302 HTTP redirect

GET http://example.com/doc

Auth OK

Issue session cookie

Check session cookie andGET htt :// l /d

Set-Cookie: LH741Q…

GET http://example.com/doc

200 OK

relay remaining requestsrepeat

GET http://example.com/docCookie: LH741Q…

200 OK200 OK

t

11

Page 12: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Session Cookie RestrictionSession Cookie Restriction

• Browsers send only the cookies which issued by the web server itselfy– The proxy must pretend the web serverwhen the cookies issue (Set‐Cookie)when the cookies issue (Set Cookie)

– The proxy must issue new cookieswhenever browser access to new web servers.

→Single Sign‐On scheme of Shibboleth could avoid bothering for a lot of re‐authentications 

12

Page 13: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Ordinary Shibboleth Auth FlowOrdinary Shibboleth Auth FlowSPBrowser IdPBrowser

GET http://example com/doc/GET http://example.com/doc/

POST ID and password

SP endpoint

POST https://example.com/Shibboleth.sso/SAML2/…POST https //example.com/Shibboleth.sso/SAML2/

Set-Cookie: LH741Q…

GET http://example.com/doc/Cookie: LH741Q…

repeat

13

t

Page 14: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Proposed Auth FlowProposed Auth FlowWeb ServerBrowser

P SP

Forward ProxyIdP

GET http://example.com/doc/http://example.com

Proxymodule

SPmodule

https://proxy.net

GET https://proxy.net/Shibboleth.sso/Proxy/…

POST https://proxy.net/Shibboleth.sso/SAML2/…

GET http://example com/Shibboleth sso/Proxy/GET http://example.com/Shibboleth.sso/Proxy/…

Set-Cookie: LH741Q…

repe

GET http://example.com/doc/Cookie: LH741Q… GET http://example.com/doc/

eat

14

Page 15: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

The Role of New EndpointsWeb ServerBrowser

P SP

Forward ProxyIdPThe Role of New Endpoints

Gather requests to all EJ sites into only one hostnameto reduce patterns of SP metadata

GET http://example.com/doc/http://example.com

Proxymodule

SPmodule

https://proxy.net

to reduce patterns of SP metadata.“proxy.net” is registered as the SP in this example.

GET https://proxy.net/Shibboleth.sso/Proxy/…

POST https://proxy.net/Shibboleth.sso/SAML2/…

GET http://example com/Shibboleth sso/Proxy/GET http://example.com/Shibboleth.sso/Proxy/…

Set-Cookie: LH741Q…

repe

GET http://example.com/doc/

GET http://example.com/doc/Cookie: LH741Q…

To cope with session cookie restriction

eat

15

To cope with session cookie restrictionThe forward proxy pretends the web server when session cookies is issued (Set‐Cookie)

Page 16: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

IMPLEMENTATION AND EVALUATIONS

16

Page 17: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

ImplementationImplementation

• Shibboleth auth capable forward proxy (shibproxy) based on( p y)– Shibboleth SP 2.4.2

• 880 lines modification (diff –u style)880 lines modification (diff  u style)

• supports new endpoints

Apache 2 2 17– Apache 2.2.17• Not modified

d f f d• mod_proxy for forward‐proxy 

• mod_rewrite for redirection to the new endpoints

17

Page 18: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Experiments and ResultsExperiments and Results

P PAC fil hi h di t b t• Prepare PAC file which directs browser to– shibproxy for restricted access EJ sitesUniversity’s official anonymous forward proxy for– University’s official anonymous forward proxy for other sites

• Visit several EJ sites by 5 popular browsersPAC: Proxy Auto‐Configuration written in JavaScript

Visit several EJ sites by 5 popular browsers– IE8, Safari, Firefox, Opera and Chrome

• shibproxy work well– User can access EJ sites through shibproxyUser can access EJ sites through shibproxy– Authentication is required only once– Single Sign‐On for ordinary SPs work well

18

Page 19: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Some Problems and SolutionsSome Problems and Solutions

Thi d t ki bl• Third party cookie problems– Some EJ sites use multiple host namee g www example com and portal example come.g. www.example.com and portal.example.com

(sibling servers under example.com)→Send “Set‐Cookie” header with 

“d i l ” ib“domain=.exmaple.com” attribute• No cookie is sent for some requests

f i i– favicon.ico– OpenSearchpass through the requests whose URL matches regular– pass through the requests whose URL matches regular expression (e.g. /favicom₩w*.ico$/ )

19

Page 20: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Future WorkFuture Work

S S• Support HTTPS– Our proposal can not support HTTPS– Shibproxy can not intercept cookies in HTTPS session→Reverse‐Proxy, wildcard certification

difi i lor modification protocol

• Hybrid Proxy (forward proxy + reverse proxy)– HTTP → forward proxy– HTTPS → reverse proxy– Both can run on one host– Both support Shibboleth SSO authentication

20

Page 21: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

ConclusionConclusion

Shibb l th bl f d• Shibboleth‐capable forward proxy– We will use the proxy to access to E‐Journal sitesThe proxy pretends the web server when cookies– The proxy pretends the web server when cookies issue

• Some problems and solutionsSome problems and solutions– Third party cookie → add “domain” attribute– No cookie is sent for some resourcesNo cookie is sent for some resources→ pass thorough them specified by REGEXP

• Future work– Hybrid forward‐reverse proxy

for both HTTP and HTTPS 

21

Page 22: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

HTTPS Through Forward ProxyHTTPS Through Forward ProxyForward ProxyBrowser Web ServerForward ProxyBrowser Web Server

http://example.comCONNECT example.com:443

GET http://example.com/docSSL encrypted

200 OK

22

Page 23: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

Phantom URLPhantom URLWeb ServerBrowser

P SP

Forward ProxyIdP

GET http://example.com/doc/http://example.com

Proxymodule

SPmodule

https://proxy.net

GET https://proxy.net/Shibboleth.sso/Proxy/…

h Redirect to

POST https://proxy.net/Shibboleth.sso/SAML2/…

GET http://example com/Shibboleth sso/Proxy/

Phantom URL Redirect tophantom URL

GET http://example.com/Shibboleth.sso/Proxy/…

Set-Cookie: LH741Q…

Cookie for the Web Server

repe

GET http://example.com/doc/Cookie: LH741Q… GET http://example.com/doc/

eat

23

Page 24: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

PROPOSAL OVERVIEW

24

Page 25: Design and Implementation of Web Proxy with Shibboleth Authenticationarchive.apan.net/meetings/apan32/Session/Slides/... · 2011-09-01 · Design and Implementation of Web Forward

iconsiconsOrigin Server

DS IdPProxyBrowser SPDS IdPProxyBrowser SP

Cookei: LH741Q…

Origin Server

IdPDS ProxyBrowser

25