Дмитрий Хоревич "Cloud native security with UAA \ Как защитить...

42

Transcript of Дмитрий Хоревич "Cloud native security with UAA \ Как защитить...

Page 1: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"
Page 2: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

About meJava developer since 2008

Works for Altoros Development

Love mountain biking and jogging

Page 3: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Agenda1. Authentication in monolithic applications vs microservices

2. Introduction to OAuth2.0

3. CloudFoundry User Account and Authentication (UAA) Server

4. How we use UAA in our project

5. Q&A

Page 4: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Base definition

● Authentication

● Authorization

● Session

● Token

Page 5: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

A Traditional Service

Page 6: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

With Traditional Subsystem

Page 7: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

and traditional scalability

Page 8: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

A microservice

Page 9: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Many microservices

Page 10: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Scaling microservices

Page 11: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

So what’s the problem?

Page 12: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Securing a traditional service

Page 13: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

So for microservice that would mean

Page 14: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"
Page 15: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

How to solve?

● Basic authentication

● SAML

● OAuth

Page 16: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Lets talk about OAuth

It’s not for Authentication

…and not for Authorization

OAuth is a scalable delegation protocol

Page 17: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

History

● OAuth started around November 2006, while Blaine Cook was working on the

Twitter OpenID implementation.

● In April 2007, a Google group was created with a small group of implementers

to write a proposal for an open protocol.

● In July 2007 the team drafted an initial specification and the group was

opened to anyone interested in contributing.

Page 18: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

OAuth 2.0

+ Designed to simplify creation of client application

+ Token retrieval is simplified

+ Scalability is better

- Is not compatible with 1-st version

Page 19: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

OAuth Roles

OAuth defines four roles:

● Resource Owner (User)

● Client

● Resource Server

● Authorization Server

Page 20: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

OAuth2 workflow

Page 21: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

OAuth2 grant type

● Authorization Code (web apps)

● Implicit (browser-based and mobile apps)

● Resource Owner Password Credentials (user / password)

● Client Credentials (application)

● Refresh Token

Page 22: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

About UAA● User Account and Authorisation server● Secures all CF components● OAuth2 and OpenID connect● SCIM API for user management in internal user database● Integration with SAML and LDAP● OAuth2 client registration API

Page 23: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

UAA for Cloud Native Security● In CF there is more to security then just UAA

○ Network security/ security group○ Cross container traffic / trusted workloads○ end to end TLS

● UAA is for application-level security

Page 24: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

You want to secure your apps

Example:

You want to host your API application on Cloud Foundry

Page 25: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

You want to secure your apps

Example

It will be accessed by a web app hosted on CF

Page 26: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

You want to secure your apps

Example

It will be accessed through a mobile app as well

Page 27: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

You want to secure your apps

Perfect! Use UAA

Page 28: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

You want to secure your apps

Perfect! Use UAA

UAA

– Client for web app -> Authorization Code

– Client for mobile app -> Implicit

– API app token verification

Page 29: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

UAA end user

● SpaceDevelopers, OrgManagers○ Platform users, no problem

● Sales guy○ Not a platform user, problem

Page 30: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

The Principle of Least Privilege

● You (or the application, process, module, etc) should have the minimum level

of access required for performing their job

● Sales guy should not have been added to the platform UAA

Page 31: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Solutions

● Create your own authorization server

● Deploy your own UAA

Page 32: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Deploy your own UAA

● cf push cloudfoundry-identity-uaa.war

● Yaml config

● Bootstrap users

● Provision DB

● Do the above manually, or as part of a Bosh deployment

Page 33: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Running your own UAAPros:

● Principle of least privilege○ Systems secured by your UAA cannot affect systems secured by the platform UAA

● You can fork it

Cons:

● Overhead

● Manual upgrades

● “yak shaving” a bosh release

Page 34: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Solutions

● Create your own authorization server

● Deploy your own UAA

● Multitenant UAA

Page 35: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

What is Multitenant UAA● CF v208+● The built-in UAA with subdomains● Subdomain maps to Identity Zone● Total segregation between Identity Zones● API for creating Identity Zones● Existing API stays the same

Page 36: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Multitenant UAA● Pros:

○ Principle of least privilege

○ API calls for creating a new tenant (aka Identity Zone)

○ Zone administrators instead of bootstrap users

● Cons: ○ Overhead

○ Manual upgrades

○ “yak shaving” a bosh release

○ You can’t fork it

Page 37: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

How we use UAA in our project

Page 38: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

How we use UAA in our project

Page 39: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Sample

Page 40: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

One more thing...How to manage UAA:

● curl● UAAC (gem install cf-uaac)

Page 42: Дмитрий Хоревич "Cloud native security with UAA \ Как защитить микросервисы с помощью UAA"

Q&A