SlideShare a Scribd company logo
Securing Your Containerized
Applications with NGINX
Kevin Jones
Sr Product Manager
NGINX, now part of F5
@webopsx
• Benefits of a Reverse Proxy for Security
• NGINX Best Practices for TLS
• Running NGINX in Docker
• Q&A
Todays talk!
Benefits of a Reverse
Proxy
● HTTP Security and Façade Routing
● TLS Offload
● Authentication / Authorization Offload
HTTP Security & Façade Routing
● Restrict Access to Specific URLs
● Intercept Response Headers from Upstream Servers
● Control Request Methods
● Control Domain Level Access
● Provide a Layer of Façade URLs for Routing to
Microservices
● Rewrite URLs for Backwards Compatibility
● API Version Control / Testing (A/B)
A Reverse Proxy can…
Service C
Service B
Service AService A
Login
Service
/login
:32706
Service B
Inventory
Service
/inventory
:32717
Service C
Partner
API
/api/beta
:32724
api.example.com
*:80
/api/v2/login
/api/v1/inventory
/admin/
partner.example.com
*:80
/api/v1
GET
Reverse Proxy /
Gateway
PUT
PATCH
Service C
Service B
Service AService A
Login
Service
/login
:32706
Service B
Inventory
Service
/inventory
:32717
Service C
Partner
API
/api/beta
:32724
api.example.com
*:80
/api/v2/login
/api/v1/inventory
/admin/
partner.example.com
*:80
/api/v1
Reverse Proxy /
GatewayNGINX Directive
server_name
listen
location
limit_except
proxy_pass
upstream
map
if
PUT
PATCH
GET
SSL/TLS
● SSL/TLS Protocols
● Ciphers
● Sessions
● Certificate and Key Management
● OCSP
● Performance Degradation
● Security Vulnerabilities and Patching
Complexities of TLSComplexities of TLS RSA, DH, ECDH,
SRP, PSK??!
Let's Encrypt
● A Cron process can update
certificates and keys
NGINX
API
Cron (Certbot)
● The certificates and keys can be
stored on disk or in memory
depending on security
requirements
● If you are using NGINX,
certificates and keys can be
loaded from disk on demand
(lazy load)
● If using NGINX Plus, your
certificates and keys can be
stored in the NGINX Plus key-
value database
Authentication &
Authorization
● Offload credential validation
● Intercept unauthenticated requests
● Support integration with an IDP or other
authentication flows
● Support multi factor requirements
● Once that client is validated, authorization provides
policy enforcement on specific HTTP access
Authentication and
Authorization
GET w/ JSON Web
Token
JSON Web Key
Payload
{
"alg": "HS256",
"typ": "JWT"
}
Header
{
"alg": "HS256",
"typ": "JWT"
}
Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd
WIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gR
G9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.N3Hb-
h4CdvYDpm6iT-kQVAXt_q2vBnnZ-BDLfOPrd18
Raffle Time! Check the chat to
see if you've won!
NGINX Best Practices
For Configuring TLS
https://www.ssllabs.com/ssltest/
server {
listen 443 ssl default_server;
server_name example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
# SSL protocols
ssl_protocols TLSv1.3 TLSv1.2;
# SSL ciphers
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-
SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
# DH parameters and curve
ssl_dhparam /path/to/dhparam.pem;
ssl_ecdh_curve secp384r1;
}
CODE EDITOR
Generate
stronger DH
parameters
• This will take a while, be
patient
• For highest security, It is
recommended to use a bit
length of 4096
CODE EDITOR
$ openssl dhparam -out /etc/ssl/certsdhparam.pem 4096
Generating DH parameters, 4096 bit long safe prime, generator 2
This is going to take a long time
............+.......................+..................................................................
.........................................................................................................
...........................+............................................................................
............................................................+...........................................
.........................................................................................................
..................................................................................................+.....
.........+...........................+.................................................................
https://www.ssllabs.com/ssltest/
CODE EDITOR
server {
# HTTP STS
add_header Strict-Transport-Security "max-
age=31536000; includeSubDomains; preload" always;
}
Enable HTTP
Strict
Transport
Security
• Informs browsers to always
interact with your site over
HTTPS
• This will protect your site
against various attacks such as
downgrade attacks and
possible cookie hijacking
https://www.ssllabs.com/ssltest/
Deploying NGINX on
Docker
Service C
Service B
Service AService A
Login
Service
:32706
Service B
Inventory
Service
:32717
Service C
Partner
API
:32724
api.example.com
*:80 / *:443
/api/v2/login
/api/v1/inventory
/admin/
partner.example.com
:443
/api/v1
Reverse Proxy /
Gateway
api.example.com
*:80 / *:443
/api/v2/login
/api/v1/inventory
/admin
partner.example.com
:443
/api/v1
Configure
NGINX with
Docker Compose
• Configure services you want
to communicate thru NGINX
using "expose"
• Link your services together
with the "links" option
• Then publish your NGINX
service using the "ports"
mapping
CODE EDITOR
nginx:
build: ./nginx
container_name: nginx
restart: always
links:
- login
ports:
- "80:80"
volumes:
- ./etc/nginx/conf.d/server.conf:/etc/nginx/conf.d/server.conf
login:
build: ./login
container_name: login
restart: always
expose:
- "80"
NGINX
Configuration
CODE EDITOR
user nginx;
events {
worker_connections 1024;
}
http {
server {
listen 80;
location /login {
proxy_pass http://login:80;
}
}
}
Use the proxy_pass
directive to configure
NGINX to resolve the
embedded Docker DNS
server; this will support
any scaling of your
services while using
Docker Compose
Login
Servicelogin.example.com
Reverse Proxy
Inventory
Serviceinventory.example.com
Reverse Proxy
Partner
APIpartner.example.com
Reverse Proxy
Login
Service
127.0.0.1:9001login.example.com
Sidecar Proxy
Inventory
Service
127.0.0.1:7001inventory.example.com
Sidecar Proxy
Partner
API
127.0.0.1:5001partner.example.com
Sidecar Proxy
Sidecar
Proxy
Deploying NGINX as a
Sidecar Proxy provides
the ability to optimize
TLS, standardize on
HTTP protocol behavior
and offload functionality
that is already designed
into NGINX without the
need of developing it as
code, such as
authentication and
authorization
Sidecar Proxy
• Using proxy_pass you can
route requests to your
application listening on
localhost within the
container
CODE EDITOR
http {
server {
listen 80;
server_name partner.example.com;
location /api/v2 {
proxy_pass http://127.0.0.1:5001;
}
}
}
Partner
API
127.0.0.1:5001partner.example.com
Sidecar Proxy
Thank you for watching!
Visit https://swag-nginx.com
Use code: DOCKERCON30
For 30% off!
Questions?
kevin@nginx.com

More Related Content

What's hot

NGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPCNGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPC
NGINX, Inc.
 
The 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference ArchitectureThe 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference Architecture
NGINX, Inc.
 
What's New in NGINX Plus R12?
What's New in NGINX Plus R12? What's New in NGINX Plus R12?
What's New in NGINX Plus R12?
NGINX, Inc.
 
What’s New in NGINX Plus R15?
What’s New in NGINX Plus R15?What’s New in NGINX Plus R15?
What’s New in NGINX Plus R15?
NGINX, Inc.
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINX
NGINX, Inc.
 
ModSecurity 3.0 and NGINX: Getting Started - EMEA
ModSecurity 3.0 and NGINX: Getting Started - EMEAModSecurity 3.0 and NGINX: Getting Started - EMEA
ModSecurity 3.0 and NGINX: Getting Started - EMEA
NGINX, Inc.
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
NGINX, Inc.
 
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEANGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
NGINX, Inc.
 
Lcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINXLcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINX
Linaro
 
NGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern WebNGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern Web
Kevin Jones
 
NGINX Plus R19 : EMEA
NGINX Plus R19 : EMEANGINX Plus R19 : EMEA
NGINX Plus R19 : EMEA
NGINX, Inc.
 
NGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best PracticesNGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best Practices
NGINX, Inc.
 
What’s New in NGINX Plus R16? – EMEA
What’s New in NGINX Plus R16? – EMEAWhat’s New in NGINX Plus R16? – EMEA
What’s New in NGINX Plus R16? – EMEA
NGINX, Inc.
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEA
NGINX, Inc.
 
What's New in NGINX Plus R8
What's New in NGINX Plus R8What's New in NGINX Plus R8
What's New in NGINX Plus R8
NGINX, Inc.
 
Using NGINX and NGINX Plus as a Kubernetes Ingress
Using NGINX and NGINX Plus as a Kubernetes IngressUsing NGINX and NGINX Plus as a Kubernetes Ingress
Using NGINX and NGINX Plus as a Kubernetes Ingress
Kevin Jones
 
Maximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINXMaximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINX
NGINX, Inc.
 
5 things you didn't know nginx could do
5 things you didn't know nginx could do5 things you didn't know nginx could do
5 things you didn't know nginx could do
sarahnovotny
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
NGINX, Inc.
 
What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?
NGINX, Inc.
 

What's hot (20)

NGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPCNGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPC
 
The 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference ArchitectureThe 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference Architecture
 
What's New in NGINX Plus R12?
What's New in NGINX Plus R12? What's New in NGINX Plus R12?
What's New in NGINX Plus R12?
 
What’s New in NGINX Plus R15?
What’s New in NGINX Plus R15?What’s New in NGINX Plus R15?
What’s New in NGINX Plus R15?
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINX
 
ModSecurity 3.0 and NGINX: Getting Started - EMEA
ModSecurity 3.0 and NGINX: Getting Started - EMEAModSecurity 3.0 and NGINX: Getting Started - EMEA
ModSecurity 3.0 and NGINX: Getting Started - EMEA
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
 
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEANGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
 
Lcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINXLcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINX
 
NGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern WebNGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern Web
 
NGINX Plus R19 : EMEA
NGINX Plus R19 : EMEANGINX Plus R19 : EMEA
NGINX Plus R19 : EMEA
 
NGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best PracticesNGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best Practices
 
What’s New in NGINX Plus R16? – EMEA
What’s New in NGINX Plus R16? – EMEAWhat’s New in NGINX Plus R16? – EMEA
What’s New in NGINX Plus R16? – EMEA
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEA
 
What's New in NGINX Plus R8
What's New in NGINX Plus R8What's New in NGINX Plus R8
What's New in NGINX Plus R8
 
Using NGINX and NGINX Plus as a Kubernetes Ingress
Using NGINX and NGINX Plus as a Kubernetes IngressUsing NGINX and NGINX Plus as a Kubernetes Ingress
Using NGINX and NGINX Plus as a Kubernetes Ingress
 
Maximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINXMaximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINX
 
5 things you didn't know nginx could do
5 things you didn't know nginx could do5 things you didn't know nginx could do
5 things you didn't know nginx could do
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?
 

Similar to DockerCon Live 2020 - Securing Your Containerized Application with NGINX

NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
NGINX, Inc.
 
Adopting Modern SSL / TLS
Adopting Modern SSL / TLSAdopting Modern SSL / TLS
Adopting Modern SSL / TLS
Avi Networks
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
What’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEAWhat’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEA
NGINX, Inc.
 
Kafka Security
Kafka SecurityKafka Security
F5 TLS & SSL Practices
F5 TLS & SSL PracticesF5 TLS & SSL Practices
F5 TLS & SSL Practices
Brian A. McHenry
 
NGINX Plus R18: What's new
NGINX Plus R18: What's newNGINX Plus R18: What's new
NGINX Plus R18: What's new
NGINX, Inc.
 
Random musings on SSL/TLS configuration
Random musings on SSL/TLS configurationRandom musings on SSL/TLS configuration
Random musings on SSL/TLS configuration
extremeunix
 
Webservice security considerations and measures
Webservice security considerations and measuresWebservice security considerations and measures
Webservice security considerations and measures
Maarten Smeets
 
All you need to know about transport layer security
All you need to know about transport layer securityAll you need to know about transport layer security
All you need to know about transport layer security
Maarten Smeets
 
IBM MQ V8 Security: Latest Features Deep-Dive
IBM MQ V8 Security: Latest Features Deep-DiveIBM MQ V8 Security: Latest Features Deep-Dive
IBM MQ V8 Security: Latest Features Deep-Dive
Morag Hughson
 
Securing oracle e-business suite 12.1 and 12.2 technology infrastructure
Securing oracle e-business suite 12.1 and 12.2 technology infrastructureSecuring oracle e-business suite 12.1 and 12.2 technology infrastructure
Securing oracle e-business suite 12.1 and 12.2 technology infrastructure
vasuballa
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
Edorian
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
 
21 05-2018
21 05-201821 05-2018
21 05-2018
Praaveen Vr
 
Decrypting and Selectively Inspecting Modern Traffic
Decrypting and Selectively Inspecting Modern TrafficDecrypting and Selectively Inspecting Modern Traffic
Decrypting and Selectively Inspecting Modern Traffic
Shain Singh
 
What's new in NGINX Plus R19
What's new in NGINX Plus R19What's new in NGINX Plus R19
What's new in NGINX Plus R19
NGINX, Inc.
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
 
BRKSEC-3771 - WSA with wccp.pdf
BRKSEC-3771 - WSA with wccp.pdfBRKSEC-3771 - WSA with wccp.pdf
BRKSEC-3771 - WSA with wccp.pdf
MenakaDevi14
 

Similar to DockerCon Live 2020 - Securing Your Containerized Application with NGINX (20)

NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
Adopting Modern SSL / TLS
Adopting Modern SSL / TLSAdopting Modern SSL / TLS
Adopting Modern SSL / TLS
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
What’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEAWhat’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEA
 
Kafka Security
Kafka SecurityKafka Security
Kafka Security
 
F5 TLS & SSL Practices
F5 TLS & SSL PracticesF5 TLS & SSL Practices
F5 TLS & SSL Practices
 
NGINX Plus R18: What's new
NGINX Plus R18: What's newNGINX Plus R18: What's new
NGINX Plus R18: What's new
 
Random musings on SSL/TLS configuration
Random musings on SSL/TLS configurationRandom musings on SSL/TLS configuration
Random musings on SSL/TLS configuration
 
Webservice security considerations and measures
Webservice security considerations and measuresWebservice security considerations and measures
Webservice security considerations and measures
 
All you need to know about transport layer security
All you need to know about transport layer securityAll you need to know about transport layer security
All you need to know about transport layer security
 
IBM MQ V8 Security: Latest Features Deep-Dive
IBM MQ V8 Security: Latest Features Deep-DiveIBM MQ V8 Security: Latest Features Deep-Dive
IBM MQ V8 Security: Latest Features Deep-Dive
 
Securing oracle e-business suite 12.1 and 12.2 technology infrastructure
Securing oracle e-business suite 12.1 and 12.2 technology infrastructureSecuring oracle e-business suite 12.1 and 12.2 technology infrastructure
Securing oracle e-business suite 12.1 and 12.2 technology infrastructure
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
 
21 05-2018
21 05-201821 05-2018
21 05-2018
 
Decrypting and Selectively Inspecting Modern Traffic
Decrypting and Selectively Inspecting Modern TrafficDecrypting and Selectively Inspecting Modern Traffic
Decrypting and Selectively Inspecting Modern Traffic
 
What's new in NGINX Plus R19
What's new in NGINX Plus R19What's new in NGINX Plus R19
What's new in NGINX Plus R19
 
CCNP Security-VPN
CCNP Security-VPNCCNP Security-VPN
CCNP Security-VPN
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
 
BRKSEC-3771 - WSA with wccp.pdf
BRKSEC-3771 - WSA with wccp.pdfBRKSEC-3771 - WSA with wccp.pdf
BRKSEC-3771 - WSA with wccp.pdf
 

Recently uploaded

Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 

Recently uploaded (20)

Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 

DockerCon Live 2020 - Securing Your Containerized Application with NGINX

  • 1. Securing Your Containerized Applications with NGINX Kevin Jones Sr Product Manager NGINX, now part of F5 @webopsx
  • 2. • Benefits of a Reverse Proxy for Security • NGINX Best Practices for TLS • Running NGINX in Docker • Q&A Todays talk!
  • 3. Benefits of a Reverse Proxy ● HTTP Security and Façade Routing ● TLS Offload ● Authentication / Authorization Offload
  • 4. HTTP Security & Façade Routing
  • 5. ● Restrict Access to Specific URLs ● Intercept Response Headers from Upstream Servers ● Control Request Methods ● Control Domain Level Access ● Provide a Layer of Façade URLs for Routing to Microservices ● Rewrite URLs for Backwards Compatibility ● API Version Control / Testing (A/B) A Reverse Proxy can…
  • 6. Service C Service B Service AService A Login Service /login :32706 Service B Inventory Service /inventory :32717 Service C Partner API /api/beta :32724 api.example.com *:80 /api/v2/login /api/v1/inventory /admin/ partner.example.com *:80 /api/v1 GET Reverse Proxy / Gateway PUT PATCH
  • 7. Service C Service B Service AService A Login Service /login :32706 Service B Inventory Service /inventory :32717 Service C Partner API /api/beta :32724 api.example.com *:80 /api/v2/login /api/v1/inventory /admin/ partner.example.com *:80 /api/v1 Reverse Proxy / GatewayNGINX Directive server_name listen location limit_except proxy_pass upstream map if PUT PATCH GET
  • 9. ● SSL/TLS Protocols ● Ciphers ● Sessions ● Certificate and Key Management ● OCSP ● Performance Degradation ● Security Vulnerabilities and Patching Complexities of TLSComplexities of TLS RSA, DH, ECDH, SRP, PSK??!
  • 10. Let's Encrypt ● A Cron process can update certificates and keys NGINX API Cron (Certbot) ● The certificates and keys can be stored on disk or in memory depending on security requirements ● If you are using NGINX, certificates and keys can be loaded from disk on demand (lazy load) ● If using NGINX Plus, your certificates and keys can be stored in the NGINX Plus key- value database
  • 12. ● Offload credential validation ● Intercept unauthenticated requests ● Support integration with an IDP or other authentication flows ● Support multi factor requirements ● Once that client is validated, authorization provides policy enforcement on specific HTTP access Authentication and Authorization
  • 13. GET w/ JSON Web Token JSON Web Key Payload { "alg": "HS256", "typ": "JWT" } Header { "alg": "HS256", "typ": "JWT" } Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd WIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gR G9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.N3Hb- h4CdvYDpm6iT-kQVAXt_q2vBnnZ-BDLfOPrd18
  • 14. Raffle Time! Check the chat to see if you've won!
  • 15. NGINX Best Practices For Configuring TLS
  • 17. server { listen 443 ssl default_server; server_name example.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; # SSL protocols ssl_protocols TLSv1.3 TLSv1.2; # SSL ciphers ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM- SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; # DH parameters and curve ssl_dhparam /path/to/dhparam.pem; ssl_ecdh_curve secp384r1; } CODE EDITOR
  • 18. Generate stronger DH parameters • This will take a while, be patient • For highest security, It is recommended to use a bit length of 4096 CODE EDITOR $ openssl dhparam -out /etc/ssl/certsdhparam.pem 4096 Generating DH parameters, 4096 bit long safe prime, generator 2 This is going to take a long time ............+.......................+.................................................................. ......................................................................................................... ...........................+............................................................................ ............................................................+........................................... ......................................................................................................... ..................................................................................................+..... .........+...........................+.................................................................
  • 20. CODE EDITOR server { # HTTP STS add_header Strict-Transport-Security "max- age=31536000; includeSubDomains; preload" always; } Enable HTTP Strict Transport Security • Informs browsers to always interact with your site over HTTPS • This will protect your site against various attacks such as downgrade attacks and possible cookie hijacking
  • 23. Service C Service B Service AService A Login Service :32706 Service B Inventory Service :32717 Service C Partner API :32724 api.example.com *:80 / *:443 /api/v2/login /api/v1/inventory /admin/ partner.example.com :443 /api/v1 Reverse Proxy / Gateway api.example.com *:80 / *:443 /api/v2/login /api/v1/inventory /admin partner.example.com :443 /api/v1
  • 24. Configure NGINX with Docker Compose • Configure services you want to communicate thru NGINX using "expose" • Link your services together with the "links" option • Then publish your NGINX service using the "ports" mapping CODE EDITOR nginx: build: ./nginx container_name: nginx restart: always links: - login ports: - "80:80" volumes: - ./etc/nginx/conf.d/server.conf:/etc/nginx/conf.d/server.conf login: build: ./login container_name: login restart: always expose: - "80"
  • 25. NGINX Configuration CODE EDITOR user nginx; events { worker_connections 1024; } http { server { listen 80; location /login { proxy_pass http://login:80; } } } Use the proxy_pass directive to configure NGINX to resolve the embedded Docker DNS server; this will support any scaling of your services while using Docker Compose
  • 26. Login Servicelogin.example.com Reverse Proxy Inventory Serviceinventory.example.com Reverse Proxy Partner APIpartner.example.com Reverse Proxy Login Service 127.0.0.1:9001login.example.com Sidecar Proxy Inventory Service 127.0.0.1:7001inventory.example.com Sidecar Proxy Partner API 127.0.0.1:5001partner.example.com Sidecar Proxy Sidecar Proxy Deploying NGINX as a Sidecar Proxy provides the ability to optimize TLS, standardize on HTTP protocol behavior and offload functionality that is already designed into NGINX without the need of developing it as code, such as authentication and authorization
  • 27. Sidecar Proxy • Using proxy_pass you can route requests to your application listening on localhost within the container CODE EDITOR http { server { listen 80; server_name partner.example.com; location /api/v2 { proxy_pass http://127.0.0.1:5001; } } } Partner API 127.0.0.1:5001partner.example.com Sidecar Proxy
  • 28. Thank you for watching! Visit https://swag-nginx.com Use code: DOCKERCON30 For 30% off! Questions? kevin@nginx.com