Lock That Sh*t
Down!
Auth Security Patterns for
Apps, APIs, and Infra
Brian Demers and Matt Raible
@briandemers / @mraible
April 13, 2022
@briandemers / @mraible
Who are we?
Brian Demers
Open Source Developer and Java Champion
Fun facts: likes to snowboard; into 🐝
@bdemers
Matt Raible
Open Source Developer and Java Champion
Fun facts: likes to ski; into classic VWs ✌
@mraible
@briandemers / @mraible
Today's Agenda What is Auth?
AuthN vs AuthZ
01
App Auth Security Patterns
Web, SPA, Mobile
02
API Auth Security Patterns
Tokens, OAuth, Secrets
03
Infra Auth Security Patterns
Linux, SSH, Docker, Kubernetes
04
Action!
How to implement these patterns
05
@briandemers / @mraible
@briandemers / @mraible
01
What is Auth?
@briandemers / @mraible
@briandemers / @mraible
Soooo ...
Why should you care?
@briandemers / @mraible
A brief history of Auth
@briandemers / @mraible
60s: First
Password
1977:
RSA
1994:
SSL
2006:
SAML 2.0
2012:
OAuth 2.0
2014:
OIDC
2017:
PKCE
@briandemers / @mraible
Developer Personas
App Developer
Frontend Developer
Mobile App Developer
Web Developer
API Developer
Java Developer
Backend Developer
Probably likes tests
DevOps
System Administrator
Deployer
Operations
Monitoring
Security
Concerned Consultant
Paranoid Geek
Security over
performance
@briandemers / @mraible
@briandemers / @mraible
02
App Auth
Security
Patterns
@briandemers / @mraible
@briandemers / @mraible
Web vs SPA vs
Mobile App
@briandemers / @mraible
@briandemers / @mraible
HTTP Basic Authentication
@briandemers / @mraible
@briandemers / @mraible
Form-based Authentication
@briandemers / @mraible
CHALLENGE SOLUTION
@briandemers / @mraible
SAML
@briandemers / @mraible
SAML is to OIDC as
SOAP is to REST.
-Joël Franusic (@jf)
@briandemers / @mraible
JWT Authentication
@briandemers / @mraible
@briandemers / @mraible
@briandemers / @mraible
Why JWTs Suck as Session Tokens
-@rdegges on developer.okta.com, 2017
What do we do about JWT?
-Security. Cryptography. Whatever. podcast, 2021
@briandemers / @mraible
OpenID Connect (OIDC) for Auth
@briandemers / @mraible
Identity
Provider
🔒Verify
@briandemers / @mraible
Multi-Factor Authentication (MFA)
@briandemers / @mraible
@briandemers / @mraible
Multi-Factor Authentication (MFA)
@briandemers / @mraible
Passwordless
password
Password1
Password1!
We like to think we know what we are talking
about, at least Okta hasn't fired us yet…
@briandemers / @mraible
@briandemers / @mraible
SAML
⭐ ⭐
App Auth
Security
Patterns HTTP Basic
⭐
Embedded Auth
⭐
OpenID Connect
⭐ ⭐ ⭐ ⭐
MFA
⭐ ⭐ ⭐ ⭐ ⭐
Passwordless
⭐ ⭐ ⭐ ⭐ ⭐
JWT Auth
⭐ ⭐
@briandemers / @mraible
@briandemers / @mraible
App Auth Security Patterns
Tired Wired
Apps handling passwords
Stateless to scale
OAuth Implicit Flow
Sensitive data in URL
Let someone else worry about it
Sessions are tried and true
OAuth Auth Code with PKCE
Use headers or the body
@briandemers / @mraible
@briandemers / @mraible
03
API Auth
Security
Patterns
@briandemers / @mraible
@briandemers / @mraible
HTTP Basic
@briandemers / @mraible
spring:
cloud:
config:
fail-fast: true
retry:
initial-interval: 1000
max-interval: 2000
max-attempts: 100
uri: http://admin:${jhipster.registry.password}@localhost:8761/config
# name of the config server's property source (file.yml) that we want to use
name: store
profile: prod # profile(s) of the property source
label: main # toggle to switch to a different version stored in git
jhipster:
registry:
password: admin
@briandemers / @mraible
Tokens
@briandemers / @mraible
$20
@briandemers / @mraible
OAuth 2.0
@briandemers / @mraible https://aaronparecki.com/2019/12/12/21/its-time-for-oauth-2-dot-1
@briandemers / @mraible
OAuth 2.0
@briandemers / @mraible
@briandemers / @mraible
OAuth 2.0
@briandemers / @mraible
@briandemers / @mraible
OAuth 2.1
@briandemers / @mraible
https://oauth.net/2.1
Authorization Code + PKCE
Client Credentials
Device Grant
@briandemers / @mraible
OAuth Client Credentials
@briandemers / @mraible
@briandemers / @mraible
API Gateway
API
Gateway
App
App
App
/dogs
/cats
/fish
@briandemers / @mraible
{ Rest }
Client
@briandemers / @mraible
Use API SDKs
@briandemers / @mraible
@briandemers / @mraible
Encrypt and Rotate Secrets
@briandemers / @mraible
@briandemers / @mraible
RBAC and ACLs
@briandemers / @mraible
Groups
Admin
User
Help Desk
Privilege
Record : Read
Record : Create
Record : Update
Record : Delete
Users
@briandemers / @mraible
OAuth 2.1
⭐ ⭐ ⭐ ⭐ ⭐
API Auth
Security
Patterns HTTP Basic
⭐ ⭐
Tokens
⭐ ⭐ ⭐
API SDKs
⭐ ⭐ ⭐ ⭐
Encrypt Secrets
⭐ ⭐ ⭐ ⭐ ⭐
RBAC and ACLs
⭐ ⭐ ⭐ ⭐ ⭐
API Gateway
⭐ ⭐ ⭐ ⭐ ⭐
@briandemers / @mraible
@briandemers / @mraible
API Auth Security Patterns
Tired Wired
Build it yourself
Static API Tokens
CORS wildcard
Use existing libraries
Short lived access tokens
Restrict access with CORS
@briandemers / @mraible
@briandemers / @mraible
04
Infra Auth
Security
Patterns
@briandemers / @mraible
CHALLENGE SOLUTION
@briandemers / @mraible
Linux
@briandemers / @mraible
Software is Automation
and Automation is
less toil.
-Mark Shuttleworth
Canonical CEO
Larry Ewing
@briandemers / @mraible
SSH with Keys
@briandemers / @mraible
https://www.ssh.com/academy/ssh/protocol
Certificates
CC BY 3.0: EFF.org
@briandemers / @mraible
@briandemers / @mraible
@briandemers / @mraible
SSO for Servers
https://www.redhat.com/sysadmin/pluggable-authentication-modules-pam
Active Directory
Pluggable Authentication Modules (PAM) for Linux
Okta's Advanced Server Access
https://www.redhat.com/sysadmin/pluggable-authentication-modules-pam
Scan Docker Images
@briandemers / @mraible
@briandemers / @mraible
Know Your Cloud and Cluster Security
@briandemers / @mraible https://twitter.com/acloudguru/status/1344724013122260993
@briandemers / @mraible
The 4C's of Cloud Native Security
https://kubernetes.io/docs/concepts/security/overview/
@briandemers / @mraible
@briandemers / @mraible
Kubernetes Tips
Kubernetes Tips
Only expose what needs to be public
Scan and update Kubernetes YAML
Check out Kubescape
https://www.infoq.com/podcasts/continuous-delivery-with-kubernetes
@briandemers / @mraible
@briandemers / @mraible
Encrypt Kubernetes Secrets
@briandemers / @mraible
apiVersion: v1
kind: Secret
metadata:
name: registry-secret
namespace: demo
type: Opaque
data:
registry-admin-password: ZTVmNzU2YWEtMmEyMy00NzE3LTgwOTMtNzcyYTRkOTliZDI4 # base64
encoded "e5f756aa-2a23-4717-8093-772a4d99bd28"
@briandemers / @mraible
Automation is Key
@briandemers / @mraible
WSJ
@briandemers / @mraible
@briandemers / @mraible
@briandemers / @mraible
Certificates
⭐ ⭐ ⭐ ⭐
Infra Auth
Security
Patterns Linux
⭐ ⭐ ⭐ ⭐ ⭐
SSH with Keys
⭐ ⭐ ⭐
Scan Docker Images
⭐ ⭐ ⭐ ⭐ ⭐
Encrypt K8s Secrets
⭐ ⭐ ⭐ ⭐ ⭐
Automate Your Infra
⭐ ⭐ ⭐ ⭐ ⭐
SSO for Servers
⭐ ⭐ ⭐ ⭐ ⭐
@briandemers / @mraible
@briandemers / @mraible
Infra Auth Security Patterns
Tired Wired
FROM: some-large-image:1.2.3
Secrets in Images
Shared Credentials
Use minimal images
HashiCorp Vault
Limit Access
@briandemers / @mraible
@briandemers / @mraible
05
Action!
@briandemers / @mraible
@briandemers / @mraible
Action
How to codify these patterns?
@briandemers / @mraible
spring
security
@briandemers / @mraible
Action
How to test for lack of
patterns?
@briandemers / @mraible
https://implicitdetector.io
Audit Server Access
@briandemers / @mraible
Action
How to test for vulnerabilities?
@briandemers / @mraible
@briandemers / @mraible
What about ?
@briandemers / @mraible
The OWASP Top 10 really
hasn’t changed all that
much in the last ten years.
-Johnny Xmas (@J0hnnyXm4s)
@briandemers / @mraible
@briandemers / @mraible
developer.okta.com/blog
@oktadev
@briandemers / @mraible
@briandemers / @mraible
Thanks!
Brian Demers
@briandemers @bdemers
@bdemers
brian.demers@okta.com
Matt Raible
@mraible @mraible
@mraible
matt.raible@okta.com
https://speakerdeck.com/mraible
developer.okta.com

More Related Content

PDF
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
PDF
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
PDF
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra
PDF
Centralise legacy auth at the ingress gateway, SREday
PDF
Centralise legacy auth at the ingress gateway
PDF
Web App Security for Java Developers - PWX 2021
PDF
Web App Security for Java Developers - UberConf 2021
PDF
Centralise legacy auth at the ingress gateway
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra
Centralise legacy auth at the ingress gateway, SREday
Centralise legacy auth at the ingress gateway
Web App Security for Java Developers - PWX 2021
Web App Security for Java Developers - UberConf 2021
Centralise legacy auth at the ingress gateway

Similar to Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devnexus 2022 (20)

PDF
JDD2015: Security in the era of modern applications and services - Bolesław D...
PDF
Building an API Security Ecosystem
PDF
Best Practices in Building an API Security Ecosystem
PDF
Secured REST Microservices with Spring Cloud
PDF
APIsecure 2023 - OAuth, OIDC and protecting third-party credentials, Ed Olson...
PDF
Draft Ietf Oauth V2 12
PDF
When and Why Would I use Oauth2?
PPTX
Microservices security - jpmc tech fest 2018
PDF
Keycloak cloud native
PDF
Cloud Native App Security
PPTX
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
PDF
Draft Hammer Oauth 10
PPTX
OAuth - Don’t Throw the Baby Out with the Bathwater
PDF
QA Fest 2019. Диана Пинчук. Тестирование аутентификации и авторизации (AuthN ...
PDF
CCICI CIP 1.0 Testbed - Security access implementation and reference - v1.0
PDF
OpenID Foundation FAPI WG: June 2017 Update
PDF
Implementing Microservices Security Patterns & Protocols with Spring
PPTX
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
PDF
API Security Best Practices & Guidelines
PPTX
DevSecOps in a cloudnative world
JDD2015: Security in the era of modern applications and services - Bolesław D...
Building an API Security Ecosystem
Best Practices in Building an API Security Ecosystem
Secured REST Microservices with Spring Cloud
APIsecure 2023 - OAuth, OIDC and protecting third-party credentials, Ed Olson...
Draft Ietf Oauth V2 12
When and Why Would I use Oauth2?
Microservices security - jpmc tech fest 2018
Keycloak cloud native
Cloud Native App Security
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
Draft Hammer Oauth 10
OAuth - Don’t Throw the Baby Out with the Bathwater
QA Fest 2019. Диана Пинчук. Тестирование аутентификации и авторизации (AuthN ...
CCICI CIP 1.0 Testbed - Security access implementation and reference - v1.0
OpenID Foundation FAPI WG: June 2017 Update
Implementing Microservices Security Patterns & Protocols with Spring
Enterprise Access Control Patterns for REST and Web APIs Gluecon 2011, Franco...
API Security Best Practices & Guidelines
DevSecOps in a cloudnative world
Ad

More from Matt Raible (20)

PDF
Keep Identities in Sync the SCIMple Way - ApacheCon NA 2022
PDF
Micro Frontends for Java Microservices - Belfast JUG 2022
PDF
Micro Frontends for Java Microservices - Dublin JUG 2022
PDF
Micro Frontends for Java Microservices - Cork JUG 2022
PDF
Comparing Native Java REST API Frameworks - Seattle JUG 2022
PDF
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
PDF
Comparing Native Java REST API Frameworks - Devoxx France 2022
PDF
Native Java with Spring Boot and JHipster - Garden State JUG 2021
PDF
Java REST API Framework Comparison - PWX 2021
PDF
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
PDF
Java REST API Framework Comparison - UberConf 2021
PDF
Native Java with Spring Boot and JHipster - SF JUG 2021
PDF
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
PDF
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
PDF
JHipster and Okta - JHipster Virtual Meetup December 2020
PDF
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
PDF
Security Patterns for Microservice Architectures - SpringOne 2020
PDF
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
PDF
Security Patterns for Microservice Architectures - London Java Community 2020
Keep Identities in Sync the SCIMple Way - ApacheCon NA 2022
Micro Frontends for Java Microservices - Belfast JUG 2022
Micro Frontends for Java Microservices - Dublin JUG 2022
Micro Frontends for Java Microservices - Cork JUG 2022
Comparing Native Java REST API Frameworks - Seattle JUG 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Comparing Native Java REST API Frameworks - Devoxx France 2022
Native Java with Spring Boot and JHipster - Garden State JUG 2021
Java REST API Framework Comparison - PWX 2021
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
Java REST API Framework Comparison - UberConf 2021
Native Java with Spring Boot and JHipster - SF JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
JHipster and Okta - JHipster Virtual Meetup December 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Security Patterns for Microservice Architectures - London Java Community 2020
Ad

Recently uploaded (20)

PDF
What Makes a Great Data Visualization Consulting Service.pdf
PDF
AI Guide for Business Growth - Arna Softech
PPTX
hospital managemt ,san.dckldnklcdnkdnkdnjadnjdjn
PPTX
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PDF
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
PDF
AI-Powered Fuzz Testing: The Future of QA
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
Guide to Food Delivery App Development.pdf
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PPTX
HackYourBrain__UtrechtJUG__11092025.pptx
PPTX
Lecture 5 Software Requirement Engineering
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
PDF
CapCut PRO for PC Crack New Download (Fully Activated 2025)
PPT
3.Software Design for software engineering
PPTX
ROI from Efficient Content & Campaign Management in the Digital Media Industry
PPTX
Python is a high-level, interpreted programming language
What Makes a Great Data Visualization Consulting Service.pdf
AI Guide for Business Growth - Arna Softech
hospital managemt ,san.dckldnklcdnkdnkdnjadnjdjn
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
BoxLang Dynamic AWS Lambda - Japan Edition
Cloud Native Aachen Meetup - Aug 21, 2025
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
AI-Powered Fuzz Testing: The Future of QA
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Guide to Food Delivery App Development.pdf
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Full-Stack Developer Courses That Actually Land You Jobs
Chapter 1 - Transaction Processing and Mgt.pptx
HackYourBrain__UtrechtJUG__11092025.pptx
Lecture 5 Software Requirement Engineering
Understanding the Need for Systemic Change in Open Source Through Intersectio...
CapCut PRO for PC Crack New Download (Fully Activated 2025)
3.Software Design for software engineering
ROI from Efficient Content & Campaign Management in the Digital Media Industry
Python is a high-level, interpreted programming language

Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devnexus 2022