@voit3k
AUTHOR
Securing the Perimeter around Your Microservices Wojciech Lesniak - - PowerPoint PPT Presentation
Securing the Perimeter around Your Microservices Wojciech Lesniak AUTHOR @voit3k Module Overview Basic Certificates Tokens, JWT Oauth2, OpenID authentication Connect Identity provider Microservices API Gateway Challenges with Edge
@voit3k
AUTHOR
Basic authentication
Certificates Tokens, JWT Oauth2, OpenID Connect
Microservices Identity provider API Gateway
External API consumers
Human (User) Non-human (Service or system)
Authe uthenti nticati tion The process of identifying who the consumer is. Autho uthoriza zati tion The process of identifying what the consumer can do.
Human (User) Non-human (Service or system)
Client Victoria /victoria Microservice
Proprietary data User data User Clients
Authenticate user (resource owner) Get their consent to authorize client access to their resources
Victoria Joe Withdraw Delegate
Data Access Support REST Data Access Portfolio REST
Data Access Pricing REST Data Access Pricing Support HTML Portfolio REST
PORT: 80
Account
in-process
Session
PORT: 8080 PORT: 8081 PORT: 8082
Data Access Support REST Data Access Portfolio REST Data Access Pricing REST
PORT: 8080 PORT: 8081 PORT: 8082
Data Access Support REST Data Access Portfolio REST Data Access Pricing REST
PORT: 8080 PORT: 8081 PORT: 8082
Audit logs QOS checks Throttling DOS prevention
API Gateway Firewall MITM API Gateway API Gateway API Gateway
username:password
dXNlcm5hbWU6cGFzc3dvcmQK
Base64 encoded
Authentication is more complex then just a username and password, requiring 2 Factor or Multifactor.
For persistent login the credentials would have to be stored on the client. In a distributed system, credentials are exposed to multiple services. Delegation can only be done by requesting the users credentials.
Data Access Support REST Data Access Portfolio REST Data Access Pricing REST
PORT: 8080 PORT: 8081 PORT: 8082
API Gateway Firewall MITM
Public / private key, signed by CA
Certificate Authority Client
Public / private key, signed by CA
API Gateway mTLS
Certificate issuers by CA CA public key, verify server
Does not solve the delegated access or the confused deputy problem. You have to maintain a Public Key Infrastructure and your Certificate Authority. Key provisioning, bootstrapping, and rotation, and invalidating keys can be challenging as the number of clients and services increases.
API Gateway Firewall Authenticate Portfolio Support Pricing STS Introspection Get resource
Name: Victoria Email: vic@email.com
1234567 Id:1234567 Identity Provider
Microservices are never exposed to the users or clients password. “Single responsibility Principal” your microservices development teams don’t need to focus on non-functional security requirements. Tokens can be used to provide delegated authorization.
Human user like Victoria
Machine Software
Username: victoriaN name: Victoria Smith dob: 15/05/1988 Email: vic@send.com Address: 1 Bond st London gender: Female Username: victoriaN Email: vic@send.com Address: 1 Bond st London gender: Female dob: 15/05/1988 name: Victoria Smith name: Victoria Smith Address: 1 Bond st London gender: Female dob: 15/05/1988
Subject Principals
Data Access Support REST Data Access Portfolio REST principal principal principal Get principal Get principal Get principal
sync sync
API Gateway application application
Data Access Support REST Data Access Portfolio REST principal API Gateway Monolithic data store App data App data Get principal Get principal Get principal
API Gateway Firewall Authenticate Portfolio Support Pricing Identity provider STS Authz Server Verify Get resource
Victoria Client API Gateway Microservices Portfolio Support Pricing /portfolio 401 Unauthorized
Victoria Client API Gateway Microservices Portfolio Support Pricing Identity provider LDAP principal /portfolio
Identity provider verify
username: victoria name: Victoria Lesniak Derpartment: reserch
username: victoria name: Victoria Lesniak derpartment: reserch
Identity provider LDAP principal
Signed with providers private key
1990s
Kerberos Protocol specific
2002
SAML Protocol specific
2015
JWT Protocol agnostic
1990s
Kerberos Protocol specific
2002
SAML Protocol specific
2015
JWT Protocol agnostic
1990s
Kerberos Protocol specific
2002
SAML Protocol specific
2015
JWT Protocol agnostic
JSON Web Token (JWT)
(JWA) JSON Web Algorithm (JWS) JSON Web Signature (JWE) JSON Web Encryption
Protected resource Resource Owner
Resource server protects Client Issues access token to client Authorization server
Crypto Portfolio User Browser
client id secret client id secret
Victoria Client
Authorization server Resource Server
https/ /auth-server-uri/ ?client_id=crypto-portfolio&scope=profile,portfolio&response_type=code &redirect_uri=crypto-portfolio-uri&state=987654 Crypto Portfolio would like to access your profile and portfolio data. Approve https/ / crypto-portfolio-redirect-uri /?code=123456&state=987654 http POST: code:123456 client_id: crypto-portfolio client_secret: secret
Proprietary data User data User Clients
Authenticate user (resource owner) Get their consent to authorize client access to their resources
User data
id: victoria name: Victoria Lesniak email: vic@email.com
Victoria Client Oauth2 Session victoria
OIDC – Authentication layer OAuth2 – Delegated authorization
Spring Cloud Gateway
Cloud Foundry UAA Gluu Keycloak
Data Access Support REST Data Access Portfolio REST Data Access Pricing REST
PORT: 8080 PORT: 8081 PORT: 8082
API Gateway Firewall Authz provider authenticate verify
Defence in depth Zero trust