Securing Microservices

25

Transcript of Securing Microservices

Page 1: Securing Microservices
Page 2: Securing Microservices

SECURING MICROSERVICESPrabath Siriwardena, WSO2.Twitter: @prabath Blog: http://facilelogin.com

Page 3: Securing Microservices

MICROSERVICES

Page 4: Securing Microservices

4

SOA TO MICROSERVICES• Service Oriented Architecture (SOA) is a design approach where multiple services collaborate to provide some end set of capabilities.

• A service is an isolated process — and the inter-service communication happens over the network

• Microservices is the SOA done right!• Provides focused, scoped and modular approach for application design.

Page 5: Securing Microservices

5

RECOMMENDED READING• Building Microservices by Sam Newman, http://www.amazon.com/dp/1491950358/

• Summary of the book: http://bit.ly/1sHXJMq

Page 6: Securing Microservices

6

KEY PRINCIPALS• Model around business concepts• Adopt the culture of automation• Hide internal implementation details• Decentralize all the things• Independently deployable• Isolate failures• Highly observable

Page 7: Securing Microservices

7

MONOLITHIC VS. MICROSERVICES

Page 8: Securing Microservices

8

CHALLENGES• Larger number of service-to-service interactions• Wider attack surface• Immutable servers• Service per host deployment model• Small team ownership

Page 9: Securing Microservices

SERVICE TO SERVICE COMMUNICATION

Page 10: Securing Microservices

10

JSON WEB TOKEN (JWT)

Page 11: Securing Microservices

11

JSON WEB TOKEN (JWT)• JWT defines a container to transport data between interested parties

• A JWT can be used to• Propagate one’s identity between interested parties• Propagate user entitlements between interested parties• Transfer data securely between interested parties over a

unsecured channel• Assert one’s identity, given that the recipient of the JWT trusts the

asserting party.

Page 12: Securing Microservices

12

JSON WEB TOKEN (JWT)• A signed JWT is known as a JWS (JSON Web Signature)

• An encrypted JWT is known as a JWE (JSON Web Encryption)

Page 13: Securing Microservices

13

CLIENT CERTIFICATES• TLS Mutual Authentication• Trusted Sub-system Pattern• Certificate Revocation

• CRL• OCSP• OCSP stapling• OCSP stapling required

Page 14: Securing Microservices

14

SHORT-LIVED CERTIFICATES• Identical to a regular certificate, except that the validity period is a short span of time such as a few days.

• Used by Netflix• Addresses challenges with certificate revocation

Page 15: Securing Microservices

15

SHORT-LIVED CERTIFICATES @ NETFLIX

Page 16: Securing Microservices

16

XACML• Policy language, component architecture, request/response protocol

• The de facto standard for fine-grained access control• JSON profile for XACML

Page 17: Securing Microservices

17

XACML COMPONENT ARCHITECTURE

Page 18: Securing Microservices

18

ACCESS CONTROL

Page 19: Securing Microservices

19

ACCESS CONTROL (IN-PROCESS-PDP)

Page 20: Securing Microservices

THE EDGE SECURITY

Page 21: Securing Microservices

21

API GATEWAY PATTERN

Page 22: Securing Microservices

22

OAUTH 2.0• Framework for access delegation• Doing something on behalf of someone else, preserving the identity of both

• Self-contained access tokens

Page 23: Securing Microservices

23

OAUTH 2.0

Page 24: Securing Microservices

24

EDGE SECURITY WITH OAUTH 2.0 / OIDC

Page 25: Securing Microservices

25