Secure Services withapache CXF



Similar documents
REST and SOAP Services with Apache CXF

Improving performance for security enabled web services. - Dr. Colm Ó héigeartaigh

Technik und Informatik. SOAP Security. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Version April 11, 2012

02267: Software Development of Web Services

JVA-122. Secure Java Web Development

Web Services. Web Service Security. Copyright 2010 Davide Cerri & Srdjan Komazec

Security and Reliability for Web Services

Configuring SAML2 for Single Sign-On to Smartsheet (Enterprise Only)

Configuring SAML2 for Single Sign-On to Smartsheet (Enterprise Only)

OIOIDWS for Healthcare Token Profile for Authentication Tokens

Design and Implementaion of a Single Sign-On Library Supporting SAML (Security Assertion Markup Language) for Grid and Web Services Security

HTTP Authentication. RFC 2617 obsoletes RFC 2069

Web Services Security: SAML Token Profile 1.1

Core Feature Comparison between. XML / SOA Gateways. and. Web Application Firewalls. Jason Macy jmacy@forumsys.com CTO, Forum Systems

This Working Paper provides an introduction to the web services security standards.

Security As A Service Leveraged by Apache Projects. Oliver Wulff, Talend

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Automatic Penetration Test Tool for Detection of XML Signature Wrapping Attacks in Web Services

SAML Profile for SSO in Danish Public Sector V2.0 Assertion Examples,

Penetration Test Tool for XML-based Web Services

GCSS-AF SOA and Web Services Infrastructure & Support

Copyright: WhosOnLocation Limited

Brief History of Software

On Breaking SAML: Be Whoever You Want to Be OWASP The OWASP Foundation Juraj Somorovsky and Christian Mainka

CICS Web Service Security. Anthony Papageorgiou IBM CICS Development March 13, 2012 Session: 10282

IBM SPSS Collaboration and Deployment Services Version 6 Release 0. Single Sign-On Services Developer's Guide

Web Services Security: What s Required To Secure A Service-Oriented Architecture. An Oracle White Paper January 2008

Mid-Project Report August 14 th, Nils Dussart

Automatic Recognition, Processing and Attacking of Single Sign-On Protocols with Burp Suite

Authenticate and authorize API with Apigility. by Enrico Zimuel Software Engineer Apigility and ZF2 Team

Apache CXF Web Services

Szolgáltatásorientált rendszerintegráció. WS-* standards

From the Intranet to Mobile. By Divya Mehra and Stian Thorgersen

The BritNed Explicit Auction Management System. Kingdom Web Services Interfaces

Design REST Services with CXF JAX- RS implementation: best practices and lessons learned

Hack Proof Your Webapps

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

How to secure your Apache Camel deployment

Final Project Report December 9, Cloud-based Authentication with Native Client Server Applications. Nils Dussart

Microsoft Active Directory Oracle Enterprise Gateway Integration Guide

OSCI-Transport, Version 2.0

Secure Single Sign-On

How To Make A Multi-Party Communication Secure On A Microsoft Cloud (Minware) System (Plm) (For Free) (Power) (Web) (Netware) (Cloud) (Monetar) (Free) (

Practical Security Evaluation of SAML-based Single Sign-On Solutions

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

On Breaking SAML: Be Whoever You Want to Be

Is SAML An Effective Framework For Secure SSO? Category: Security Technology Secure Access And Defenses

Introduction. About the speaker: 31 years old. Degree in Computer Science (BA) in Professional Java Developer ever since

SAML and OAUTH comparison

Where every interaction matters.

Biometric Single Sign-on using SAML Architecture & Design Strategies

CA SOA Security Manager

A Signing Proxy for Web Services Security

SAML Implementation Guidelines

Secure Identity Propagation Using WS- Trust, SAML2, and WS-Security 12 Apr 2011 IBM Impact

Axway API Gateway. Version 7.4.1

APIs The Next Hacker Target Or a Business and Security Opportunity?

Dell One Identity Cloud Access Manager How to Develop OpenID Connect Apps

Grid Working Draft - Informational, GWD-I-XXX Network Service Interface (NSI) Working Group (WG) September 1, 2010

Oracle Fusion Middleware Oracle API Gateway OAuth User Guide 11g Release 2 ( )

Web Services Security Standards Forum. Dr. Phillip M. Hallam-Baker C.Eng. FBCS VeriSign Inc.

TIBCO Spotfire Platform IT Brief

Web Based Single Sign-On and Access Control

Federated Identity Opportunities & Risks

Web Services Security Tutorial

igovt logon service Context Mapping Service (icms) Messaging Specification Release 9.6

Secure Identity in Cloud Computing

Gateway Apps - Security Summary SECURITY SUMMARY

Analyzing the Interoperability of WS-Security and WS-ReliableMessaging Implementations

Mobile Security. Policies, Standards, Frameworks, Guidelines

> Please fill your survey to be eligible for a prize draw. Only contact info is required for prize draw Survey portion is optional

Agenda. How to configure

GFIPM Web Browser User-to-System Profile Version 1.2

Web Application Report

JAVA API FOR XML WEB SERVICES INTRODUCTION TO JAX-WS, THE JAVA API FOR XML BASED WEB SERVICES (SOAP, WSDL)

Angel Dichev RIG, SAP Labs

Transport Layer Security Protocols

vcommander will use SSL and session-based authentication to secure REST web services.

Web Services Trust and XML Security Standards

WEB SERVICES SECURITY

SAML and OAUTH Technologies WebSphere Application Server

Securing Web Services From Encryption to a Web Service Security Infrastructure

Solutions for Web Services Security

Authentication & Digital Signature

OpenID Connect 1.0 for Enterprise

Security in B2B. Sami Tähtinen FRENDS Technology, Inc. S Security of Communication Protocols January 28 th, 2003

Cloud Security:Threats & Mitgations

FileCloud Security FAQ

Federated Identity and Single Sign-On using CA API Gateway

Network Security Web Security and SSL/TLS. Angelos Keromytis Columbia University

Spoilt for Choice Which Integration Framework to choose? Mule ESB. Integration. Kai Wähner

OAuth2 Ready or not? Dominick Baier

Electronic Bank Account Management - EBAM

Lecture Notes for Advanced Web Security 2015

elearning for Secure Application Development

WELCOME TO Open Source Enterprise Architecture

Identity Management with Spring Security. Dave Syer, VMware, SpringOne 2011

The increasing popularity of mobile devices is rapidly changing how and where we

Secure the Web: OpenSSO

OAuth 2.0 Developers Guide. Ping Identity, Inc th Street, Suite 100, Denver, CO

Transcription:

Karlsruher Entwicklertag 2014 Secure Services withapache CXF Andrei Shakirin, Talend ashakirin@talend.com ashakirin.blogspot.com/

Agenda Introduction in Apache CXF Security Requirements Apply security features to CXF Services (JAX-RS)

AboutMe Software architect in Talend Team PMC and committer in Apache CXF and commiter in Apache Syncope projects Speaker for Apache and Java conferences

Apache CXF

WhyCXF? Alternatives: Jersey RestEasy Axis 2 Metro CXF Benefits: Strong standards support SOAP & Rest services Comprehensive Security Streaming and performance Flexibility Large and active community

Who usescxf? Apache: Camel, ServiceMix, Syncope JBoss JAX-WS stack TomEE JAX-WS and JAX-RS stacks Talend, Fusesource, MuleSoft, WSO2 Google Adwords, TomTom,

Security Requirements Authentication(HTTP basic, digest, UsernameToken, X500, Kerberos, SAML) Authorization(method/resource based, XACML) Confidentiality(SSL, message encryption) Integrity(SSL, message signature) Non-repudiation(message signature)

Transport Layer Security Authentication Confidentiality Integrity

IsSSL Safe?

SSL Handshake

Server CertificateValidation 1. Check certificate validity period 2. Check is Certificate Authority (CA) a trusted CA 3. Check the issuer's digital signature in whole chain 4. Check if domain name in the server's certificate match the domain name of the server itself 5. Check CA revocation list

Recommendations Apply negative security tests using abnormal SSL certificates (self-signed, issues for another host, etc) Don t modify application code and disable certificate validation even for testing Verify libraries default set up, use explicit options if necessary

HTTPS: JAX-RS 2.0 Client

HTTPS: CXF Client

HTTPS Server: Jetty

Authentication HTTP basic, digest Kerberos X509 SAML JWT

HTTP Basic 1. Client: GET /users/ua1b2c3 HTTP/1.0 2. Server: HTTP/1.0 401 Unauthorized WWW-Authenticate: Basic realm="nmrs_m7vkmomq2ym3:" 3. Client: GET /users/ua1b2c3 HTTP/1.0 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Digest 1. Client: GET /users/ua1b2c3 HTTP/1.0 2. Server: HTTP/1.0 401 Unauthorized WWW-Authenticate: Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41" 3. Client: GET / /users/ua1b2c3 HTTP/1.0 Authorization: Digest username= ashakirin", realm="testrealm@host.com", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", uri="/dir/index.html", qop=auth, nc=00000001, cnonce="0a4f113b", response="6629fae49393a05397450978507c4ef1", opaque="5ccc069c403ebaf9f0171e9517f40e41" HA1=MD5(username:realm:password) HA2=MD5(method:digestURI) response=md5(ha1:nonce:ha2)

JAAS

Kerberos

SAML

SAML in Rest Services 1. Enveloped <env:envelope xmlns:env="http://org.apache.cxf/rs/env"> <Book ID="67ca6441-0c4e-4430-af0e-9463ce9226aa"> <id>125</id> <name>cxf</name> </Book> <!-- SAML assertion with an enveloped signature--> <saml2:assertion>... </saml2:assertion> </env:envelope> 2. Authorization header Address: https://localhost:9000/samlheader/bookstore/books/123 Http-Method: GET Headers: {Accept=[application/xml], Authorization=[SAML ejydv1mtokgqf ]} 3. Form values Encoding: ISO-8859-1 Http-Method: POST Content-Type: application/x-www-form-urlencoded Headers: {Accept=[application/xml], Cache-Control=[no-cache], connection=[keepalive] Payload: name=cxf&id=125&samltoken=ejydv1tzqkgqfs+vsdipwcnfjwiduzuigqj

UseCase forws-trust

WS-Trust: Security Token Service

JSON Web Token Signature = HMACSHA256(BASE64URL(UTF8(JWT Header)) +. + BASE64URL(JWT Claims), key)

ChooseAuthentication Method What kind of credentials users will provide for the authentication (passwords, smart cards, public/private keys)? Which authentication methods are supported by existing infrastructure? Should you support Single sign-on? Is it necessary to associate additional data with user principals? Do you need to communicate with external services?

Authorization Container based Simple (mapping user-> role, method-> role) Annotation based XACML OAuth

XACML

Diagram from OAuth 2.0 spec OAuth2.0

OAuth2.0

ChooseAuthorizationMethod What kind of resources should be protected? Does your Web / Application Server provide authorization? What information is required to make authorization decision? Do youneedtoprovidelimited accesstoresourcesforthe third parties?

Message Level Security: XML XML Signature and Encryption JAX-WS: WS-Policy, WSS4J JAX-RS: Enveloped, EnvelopingandDetachedSignatures, Encryption

XKMS UseCase

XML Key Management Service

JSON Web Signature JwsJsonWriterInterceptor; JwsJsonClientResponseFilter and JwsJsonContainerRequestFilter

JSON Web Encryption JweWriterInterceptor; JweClientResponseFilter and JweContainerRequestFilter

JWS/JWE in CXF

Conclusion 1. CXF provides a wide range of security solutions: from very simple to really complicated 2. Choice ofthesecurityfeaturesforyourservicesisbasedon usecase, requirements and existing infrastructre 3. Follow standards and prefer established solutions to secure your services 4. Check security issues for using frameworks 5. Apply negative security tests as part of your system or integration tests

Links CXF Rest Services security: http://cxf.apache.org/docs/secure-jax-rs-services.html CXF Soap Services security: http://cxf.apache.org/docs/ws-security.html http://cxf.apache.org/docs/ws-trust.html http://cxf.apache.org/docs/ws-securitypolicy.html Blogs: http://ashakirin-cxf-security.blogspot.de/ http://coheigea.blogspot.de/ http://sberyozkin.blogspot.com

OAuth2.0 in CXF

Recommendations Don't implement your own security Analyse and evaluate possible attacks Apply negative security tests Use black box testing tools: WS-Attacker (Ruhr-University Bochum, sourceforge) Check certificates, passwords policy, using algorithms and keys for low-level libraries and framewroks Default settings must be secure Check security issues for using frameworks

CXF Security Advisories

XKMS UseCase

XML Key Management Service

AttacksandVulnerabilities Replay Injection(XPath, XML) Wrapping Spoofing (SOAPAction, WS-Addressing) XML DOS (Oversized XML, XML Bomb) Cross-site scripting (XSS: client side script injection) Cross-site request forgery (CSRF)

SignatureWrappingAttack <soap:envelope.> <soap:header> <wsse:security> <ds:signature> <ds:signedinfo> <ds:canonicalizationmethod Algorithm=".../xml-exc-c14n#" /> <ds:signaturemethod Algorithm="...#rsa-sha1" /> <ds:reference URI="#theBody"> <ds:transforms> <ds:transform Algorithm=".../xml-exc-c14n#" /> </ds:transforms> <ds:digestmethod Algorithm=".../xmldsig#sha1" /> <ds:digestvalue>abcdefg0123456789... </ds:digestvalue> </ds:reference> </ds:signedinfo> <ds:signaturevalue>abcdefg0123456789... </ds:signaturevalue> <ds:keyinfo> <wsse:securitytokenreference> <wsse:reference URI="#X509Token" /> </wsse:securitytokenreference> </ds:keyinfo> </ds:signature> </wsse:security> </soap:header> <soap:body wsu:id="thebody"> <getquote Symbol= IBM /> </soap:body> </soap:envelope>

SignatureWrappingAttack <soap:envelope.> <soap:header> <wsse:security> <ds:signature> <ds:signedinfo> <ds:reference URI="#theBody"> <ds:transforms> <ds:transform Algorithm=".../xml-exc-c14n#" /> </ds:transforms> </ds:reference> </ds:signedinfo> <ds:signaturevalue>abcdefg0123456789...</ds:signaturevalue> </ds:signature> </wsse:security> <!--... --> <!-- Original SOAP Body is placed below--> <!--... --> <wrapper> <soap:body wsu:id="thebody"> <getquote Symbol= IBM /> </soap:body> </wrapper> </soap:header> <!--... --> <!-- Maliciously modified SOAP Body is placed below--> <!--... --> <soap:body wsu:id="#thebody"> <getquote Symbol= Evil /> </soap:body> </soap:envelope>

ConfigureSSL in CXF Client: Service:

JWT JSON: JWS, JWE, JWT, JOSE Possible with external libraries Jose4J, JsonCrypto Tight integration is in the pipe line