beveiliging en rest services

22
Beveiliging en REST services Maurice de Beijer

Upload: maurice-beijer

Post on 20-Dec-2014

3.152 views

Category:

Technology


0 download

DESCRIPTION

Beveiliging en REST services tijdens Engineering World 2012.

TRANSCRIPT

Page 1: Beveiliging en REST services

Beveiliging en REST services

Maurice de Beijer

Page 2: Beveiliging en REST services

Waar gaan we het over hebbenWaarom beveiligen we REST servicesHTTP SecurityToken based security

Page 3: Beveiliging en REST services

Wie ben ikMaurice de Beijer.The Problem Solver.Microsoft CSD MVP.DevelopMentor instructor.Twitter: @mauricedb of @HTML5SupportNLBlog: http://msmvps.com/blogs/

theproblemsolver/default.aspxWeb:http://www.HTML5Support.nlE-mail: [email protected]

Page 4: Beveiliging en REST services

Authentication

Authentication is the act of confirming the truth of an

attribute of a datum or entity.

Page 5: Beveiliging en REST services

Authorization

Authorization is the function of specifying access rights to

resources

Page 6: Beveiliging en REST services

Confidentiality

Confidentiality is an ethical principle. In ethics some types of communication between a person and one of these professionals are

"privileged" and may not be discussed or divulged to third

parties.

Page 7: Beveiliging en REST services

HTTP SecurityHTTPS en SSL/TLSBasic AuthenticationForms AuthenticationIntegrated Windows Authentication

Page 8: Beveiliging en REST services

HTTPS en SSL/TLSZorgt er alleen voor dat het transport veilig is

Point to PointZegt niets over de client of server

Hoe veilig is https://ƤayƤal.com?

Page 9: Beveiliging en REST services

Basic AuthenticationEen van de meest eenvoudige HTTP

standaardsMaar wel effectief!

Usernaam en wachtwoord staat in de header van het request Base64 encoded => gebruik HTTPS!

GET /private/index.html HTTP/1.1Host: localhostAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Page 10: Beveiliging en REST services

Forms AuthenticationWerkt met een Forms Authentication Cookie

Het cookie gaat mee met elk HTTP requestHou rekening met HTTP Session hijacking

Gebruik HTTPS bij elk request!Niet alleen bij het inloggen

Page 11: Beveiliging en REST services

Integrated Windows AuthenticationSingle Sign On

Werkt net als in een websitePerfect voor gebruik binnen een AD domain

Maar lastig met gebruikers daar buiten

Page 12: Beveiliging en REST services

Token based securityOAuthAmazon's S3 AuthenticationFederated security

Page 13: Beveiliging en REST services

Three legged OAuthPopulair bij veel consumer sites

TwitterGoogleFacebook

Er zijn 3 entiteiten bijbetrokken

Zelden nuttig bij B2B

Page 14: Beveiliging en REST services

Three legged Oauth flow

Page 15: Beveiliging en REST services

Two legged Oauth flow

Page 16: Beveiliging en REST services

Amazon's S3 AuthenticationGebruikt een HMAC

Hash Message Authentication CodeWordt berekend over het request met een

secret keyDe server berekent dezelfde HMAC

Zowel voor authentication als message tamperingGebruik HTTPS voor confidentiality

GET /photos/puppy.jpg HTTP/1.1Host: johnsmith.s3.amazonaws.comDate: Mon, 26 Mar 2007 19:37:58 +0000

Authorization: AWS AKIAIOSFODNN7EXAMPLE:frJIUN8DYpKDtOLCwo//yllqDzg=

Page 17: Beveiliging en REST services

S3 Authentication - Client

Page 18: Beveiliging en REST services

S3 Authentication - Server

Page 19: Beveiliging en REST services

Federated securityMaakt gebruik van Security Token Service

(STS)De STS doet de authenticatie van de gebruikerDe service ziet alleen de tokens van de STS

Kan bv met Windows Azure Access Control ServiceEr worden Simple Web Tokens (SWT) gebruikt

Werkt prima samen met Windows Identity Foundation (WIF)

Page 20: Beveiliging en REST services

Federated security

Page 21: Beveiliging en REST services

ConclusieHTTP Security

Eenvoudig en in veel gevallen voldoendeWerkt samen met de beveiliging van een

websiteToken based security

OAuth is vaak niet nodig bij B2BFederated security kan met SWT tokens

Bijvoorbeeld via ACS en WIF