Prabath	
  Siriwardena	
  –	
  Software	
  Architect,	
  WSO2	
  
Plan for the session

Patterns




              Standards




                          Implementations
Recurring Problems
Patterns




Authentication   Confidentiality   Authorization
   Patterns         Patterns         Patterns
1995
       1997
1999
2004
2005




       SAML2 Web SSO
2008/May
Authentication
           Patterns



    Direct          Brokered
Authentication   Authentication
Direct Authentication
                           for Web Services
Transport	
  Level	
  



                            Basic Authentication

                          Mutual Authentication

                             2-legged OAuth
Direct Authentication
                          for Web Services
Message	
  Level	
  



                       UsernameToken Profile with WS-Security


                            Signing – X.509 Token Profile
                                   with WS-Security
Brokered Authentication
                             for Web Services
Transport	
  Level	
  



                            Mutual Authentication

                               2-legged OAuth
Brokered Authentication
                           for Web Services
Message	
  Level	
  



                                 WS-Trust / STS
                                                    Resource	
  STS	
  

                                  WS-Federation

                           Signing – X.509 Token Profile
                                  with WS-Security

                        Kerberos Token Profile for WS-Security
2006/April
2006/June
2008/2009
2008/2009
2008/2009
2007/Dec
2007/Dec
Authorization
         Patterns



   Direct         Delegated
Authorization   Authorization
Authorization    ActAs	
  in	
  WS-­‐Trust	
  1.4	
  

         Patterns



   Direct         Delegated
Authorization   Authorization
2005/Feb
Message	
  Level	
     Security Solution Patterns




                         Message Interceptor Gateway Pattern


                             Trusted Sub System Pattern
Message	
  Level	
     SOAP Security




                       UsernameToken Profile
SOAP Security


                                                     Key	
  Identifiers	
  
Message	
  Level	
  




                       X.509 Token Profile & Key Referencing




                                                      Direct	
  References	
  
Message	
  Level	
             SOAP Security




                       Symmetric Binding Vs Asymmetric Binding
SOAP Security

                                           •  WS-­‐Security	
  secures	
  SOAP	
  –	
  focuses	
  on	
  
Message	
  Level	
  
   WS	
  –	
  Secure	
  Conversation	
  




                                              message	
  level	
  security	
  
                                           •  Focuses	
  on	
  a	
  single	
  message	
  authentication	
  
                                              model	
  
                                           •  Each	
  message	
  contains	
  everything	
  necessary	
  
                                              to	
  authenticate	
  it	
  self	
  
                                           •  Suitable	
  for	
  a	
  coarse	
  grained	
  messaging	
  in	
  
                                              which	
  a	
  single	
  message	
  at	
  a	
  time	
  from	
  the	
  
                                              same	
  requestor	
  is	
  received	
  
Message	
  Level	
                                              SOAP Security


                                           •  What	
  SSL	
  does	
  at	
  the	
  transport	
  level	
  in	
  point-­‐to-­‐point	
  
   WS	
  –	
  Secure	
  Conversation	
  




                                              communication,	
  WS-­‐SecureConversation	
  does	
  at	
  the	
  
                                              SOAP	
  layer	
  
                                           •  Removes	
  the	
  need	
  of	
  individual	
  SOAP	
  message	
  
                                              carrying	
  authentication	
  information.	
  
                                           •  Establishes	
  a	
  mutually	
  authenticated	
  security	
  context	
  
                                              in	
  which	
  a	
  series	
  of	
  messages	
  are	
  exchanged.	
  
                                           •  Uses	
  public	
  key	
  encryption	
  to	
  exchange	
  a	
  shared	
  
                                              secret	
  and	
  then	
  onwards	
  uses	
  the	
  shared	
  key	
  
Message	
  Level	
     SOAP Security




                          WS-Trust
Message	
  Level	
            SOAP Security




                       Sender Vouches – Subject Confirmation
Message	
  Level	
           SOAP Security




                       Holder-of-Key – Subject Confirmation
SOAP Security




  WS – Security Policy

http://wso2.org/library/3132

http://wso2.org/library/3786
Web Service Security

Web Service Security

  • 1.
    Prabath  Siriwardena  –  Software  Architect,  WSO2  
  • 2.
    Plan for thesession Patterns Standards Implementations
  • 3.
  • 4.
    Patterns Authentication Confidentiality Authorization Patterns Patterns Patterns
  • 5.
    1995 1997
  • 7.
  • 8.
  • 9.
    2005 SAML2 Web SSO
  • 10.
  • 11.
    Authentication Patterns Direct Brokered Authentication Authentication
  • 12.
    Direct Authentication for Web Services Transport  Level   Basic Authentication Mutual Authentication 2-legged OAuth
  • 13.
    Direct Authentication for Web Services Message  Level   UsernameToken Profile with WS-Security Signing – X.509 Token Profile with WS-Security
  • 14.
    Brokered Authentication for Web Services Transport  Level   Mutual Authentication 2-legged OAuth
  • 15.
    Brokered Authentication for Web Services Message  Level   WS-Trust / STS Resource  STS   WS-Federation Signing – X.509 Token Profile with WS-Security Kerberos Token Profile for WS-Security
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
    Authorization Patterns Direct Delegated Authorization Authorization
  • 25.
    Authorization ActAs  in  WS-­‐Trust  1.4   Patterns Direct Delegated Authorization Authorization
  • 26.
  • 27.
    Message  Level   Security Solution Patterns Message Interceptor Gateway Pattern Trusted Sub System Pattern
  • 28.
    Message  Level   SOAP Security UsernameToken Profile
  • 29.
    SOAP Security Key  Identifiers   Message  Level   X.509 Token Profile & Key Referencing Direct  References  
  • 30.
    Message  Level   SOAP Security Symmetric Binding Vs Asymmetric Binding
  • 31.
    SOAP Security •  WS-­‐Security  secures  SOAP  –  focuses  on   Message  Level   WS  –  Secure  Conversation   message  level  security   •  Focuses  on  a  single  message  authentication   model   •  Each  message  contains  everything  necessary   to  authenticate  it  self   •  Suitable  for  a  coarse  grained  messaging  in   which  a  single  message  at  a  time  from  the   same  requestor  is  received  
  • 32.
    Message  Level   SOAP Security •  What  SSL  does  at  the  transport  level  in  point-­‐to-­‐point   WS  –  Secure  Conversation   communication,  WS-­‐SecureConversation  does  at  the   SOAP  layer   •  Removes  the  need  of  individual  SOAP  message   carrying  authentication  information.   •  Establishes  a  mutually  authenticated  security  context   in  which  a  series  of  messages  are  exchanged.   •  Uses  public  key  encryption  to  exchange  a  shared   secret  and  then  onwards  uses  the  shared  key  
  • 33.
    Message  Level   SOAP Security WS-Trust
  • 34.
    Message  Level   SOAP Security Sender Vouches – Subject Confirmation
  • 35.
    Message  Level   SOAP Security Holder-of-Key – Subject Confirmation
  • 36.
    SOAP Security WS – Security Policy http://wso2.org/library/3132 http://wso2.org/library/3786