SlideShare a Scribd company logo
TLS AND CERTIFICATES
IF YOU THINK THEY ARE EASY,
YOU ARE (PROBABLY) DOING THEM WRONG
Karri Huhtanen, Radiator Software Oy
Doing TLS is easy, right?
>>> import httplib
>>> conn = httplib.HTTPSConnection("www.python.org")
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
>>> print r1.status, r1.reason
200 OK
NO
It is more complicated than that...
>>> import httplib
>>> conn = httplib.HTTPSConnection("www.python.org")
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
>>> print r1.status, r1.reason
200 OK
Who is this www.python.org? What DNS are we
using? What is the IP of this www.python.org in
the DNS we are using? Do these match, do we
get exception if they don’t? Do we verify the
certificate? Who do we accept as certifiers for
the certificate? What is the allowed use of
certificate? What TLS/SSL version we are
using? What encryption? Do we have Perfect
Forward Secrecy? What are the other TLS
connection parameters? What wrapper,
TLS/SSL library we are using and what are their
defaults? ...
Making the connection...
class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address[, context]]]]]]])
A subclass of HTTPConnection that uses SSL for communication with secure servers. Default port is 443. If
context is specified, it must be a ssl.SSLContextinstance describing the various SSL options.
key_file and cert_file are deprecated, please use ssl.SSLContext.load_cert_chain() instead, or let
ssl.create_default_context() select the system’s trusted CA certificates for you.
Please read Security considerations for more information on best practices.
New in version 2.0.
Changed in version 2.6: timeout was added.
Changed in version 2.7: source_address was added.
Changed in version 2.7.9: context was added.
This class now performs all the necessary certificate and hostname checks by default. To revert to the previous,
unverified, behavior ssl._create_unverified_context() can be passed to the context parameter.
CVE-2014-9365 – HTTPS man-in-the-middle attack
against Python clients using default settings
Checking context...
ssl.create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None)
Return a new SSLContext object with default settings for the given purpose. The settings are chosen by the ssl module,
and usually represent a higher security level than when calling the SSLContext constructor directly.
cafile, capath, cadata represent optional CA certificates to trust for certificate verification, as in
SSLContext.load_verify_locations(). If all three are None, this function can choose to trust the system’s default CA
certificates instead.
The settings are: PROTOCOL_SSLv23, OP_NO_SSLv2, and OP_NO_SSLv3 with high encryption cipher suites without
RC4 and without unauthenticated cipher suites. Passing SERVER_AUTH as purpose sets verify_mode to
CERT_REQUIRED and either loads CA certificates (when at least one of cafile, capath or cadata is given) or uses
SSLContext.load_default_certs() to load default CA certificates.
Note The protocol, options, cipher and other settings may change to more restrictive values anytime without prior
deprecation. The values represent a fair balance between compatibility and security. If your application needs specific
settings, you should create a SSLContext and apply the settings yourself.
Who can be the certifier?
What TLS protocols are allowed?
To ensure consistent settings, DIY?
Purpose here is not the X.509 certificate
extended parameter purpose
This does not feel so difficult...
So I make my own context correctly, make the
connection, check the possible exceptions and
then it is no worries mate?
NO
So what is missing?
Certificate revocation check (against CRL)
SSLContext.verify_flags
The flags for certificate
verification operations. You
can set flags like
VERIFY_CRL_CHECK_LEAF
by ORing them together. By
default OpenSSL does
neither require nor verify
certificate revocation lists
(CRLs). Available only with
openssl version 0.9.8+.
#!/usr/bin/env python
import httplib
import ssl
context=ssl.create_default_context()
context.verify_flags=context.verify_flags|ssl.VERIFY_CRL_CHECK_CHAIN
conn = httplib.HTTPSConnection("www.python.org",context=context)
conn.request("GET", "/")
r1 = conn.getresponse()
print r1.status, r1.reason
The code works, I was able to see connection to crl servers, but soon the
CRL was cached by the OpenSSL and could not get a dump with contents
to see if anything was transferred.
Certificate revocation lists (CRL)
● Are retrieved and cached the first time a
request to check the certificate chain is made
● SSL library handles caching
● CRLs have LastUpdate and NextUpdate Fields
to control caching
● But what if first time CRL cannot be retrieved?
Case: Internet Explorer and Wi-Fi captive portals
● Internet Explorer users were complaining that getting to web
authentication page took too long. Other browser users were
fine.
● It was discovered that Internet Explorer wanted to check the
CRL of the captive portal WWW server and because it could
not get it, it waited until all of its tries timeouted.
● The solution was to define at least some of the CRL server
IPs as pass through addresses in the captive portal.
● When Internet Explorer was able to get and verify CRLs, the
delay vanished.
HTTPS is easy compared to other TLS services
● In most cases everybody just trusts all CA certificates in
browser or operating system certificate store.
● With HTTPS one usually has enough network connectivity to
retrieve CRLs or even use Online Certificate Status Protocol
(OCSP).
● DNS-IP Address-Certificate verification (and others even
better verifications) can be performed against used service.
● With other TLS services everything is not so straight forward.
Securing TLS services
● For VPN or network access accepting any CA signed
certificates is probably not a good idea.
● For email, instant messaging, software updates etc.
accepting any CA signed certificates will mean that at least
state actors can have access to your data and devices.
● The certifying CA, purpose of the certificate and checking
what it really verifies becomes increasingly important.
● Methods that help detecting service certificate changes
(certificate pinning) and verify certificates offline (OCSP
stapling) help to prevent MitM attacks.
Case: TLS VPN with certificate authentication
● PKI with Root CA and separate Intermediate CAs for People and
Servers
● VPN termination point misconfigured to trust Root CA verified
certificates, VPN clients misconfigured to trust Root CA
● Now Root, Servers and People CA signed client certificates can
authenticate successfully against VPN termination point, VPN
clients accept any certificates certified by previous CAs as VPN
termination point.
● This is made possible by not being careful in configuring CA
settings, hostname, certificate and certificate purpose checks.
Think about if we would in addition trust to any CA in system?
Case: WPA Enterprise Wi-Fi authentication
● Without IP connectivity terminal starts authentication process with
RADIUS server.
● Terminal is supposed to verify RADIUS server certificate and
certificate details (usually hostname) against certain CA certificate.
● Often these checks are bypassed, sometimes they are not even
configurable without creating and deploying separate device
management configuration profiles in devices.
● At least username and password hash are in danger to be
captured by anyone setting up Wi-Fi AP and RADIUS server with a
certificate and network name accepted by the client device.
● Once again certificate checks and configuration matter.
Securing WPA Enterprise Wi-Fi Authentication
● Certificate check and configuration, (forcing) device
profiles
● Switching from username-password to client
certificate, SIM or elliptic curves (EAP-PWD) based
authentication
● Using certificate pinning for RADIUS server certificate
● Using OCSP stapling [1]
[1] http://radiatorcookbook.open.com.au/2018/02/new-feature-ocsp-and-ocsp-stapling.html
Summary
● TLS and certificates are not easy. They require careful design,
implementation, testing, configuration and deployment.
● This presentation did not cover everything. It barely scratched PKI
and more advanced certificate verification.
● Hopefully this presentation raised more concern or interest in
ensuring that TLS and certificates are properly done in your
projects, services and systems.
● Doing everything properly needs understanding of the whole stack
(PKI, users, application/service, programming language, TLS
wrappers, TLS library, configurations and Internet/transport in
between service and terminal).
Thank you. Questions?
For more information:
Karri Huhtanen
Radiator Software Oy
https://radiatorsoftware.com/

More Related Content

What's hot

Implementing Cisco AAA
Implementing Cisco AAAImplementing Cisco AAA
Implementing Cisco AAA
dkaya
 
AAA & RADIUS Protocols
AAA & RADIUS ProtocolsAAA & RADIUS Protocols
AAA & RADIUS Protocols
Peter R. Egli
 
Cisco acs configuration guide
Cisco acs configuration guideCisco acs configuration guide
Cisco acs configuration guide
RichardsCCNA
 
RADIUS
RADIUSRADIUS
RADIUS
amogh_ubale
 
The Future of PKI. Using automation tools and protocols to bootstrap trust in...
The Future of PKI. Using automation tools and protocols to bootstrap trust in...The Future of PKI. Using automation tools and protocols to bootstrap trust in...
The Future of PKI. Using automation tools and protocols to bootstrap trust in...
DATA SECURITY SOLUTIONS
 
Kerberos presentation
Kerberos presentationKerberos presentation
Kerberos presentationChris Geier
 
Kerberos case study
Kerberos case studyKerberos case study
Kerberos case study
Mayuri Patil
 
Deep Dive In To Kerberos
Deep Dive In To KerberosDeep Dive In To Kerberos
Deep Dive In To Kerberos
Ishan A B Ambanwela
 
Authentication services
Authentication servicesAuthentication services
Authentication services
Greater Noida Institute Of Technology
 
Kerberos protocol
Kerberos protocolKerberos protocol
Kerberos protocol
Ajit Dadresa
 
Kerberos
KerberosKerberos
Kerberos
Prafull Johri
 
An introduction to X.509 certificates
An introduction to X.509 certificatesAn introduction to X.509 certificates
An introduction to X.509 certificates
Stephane Potier
 
Kerberos explained
Kerberos explainedKerberos explained
Kerberos explained
Dotan Patrich
 
Kerberos
KerberosKerberos
Authentication Application in Network Security NS4
Authentication Application in Network Security NS4Authentication Application in Network Security NS4
Authentication Application in Network Security NS4koolkampus
 

What's hot (20)

Implementing Cisco AAA
Implementing Cisco AAAImplementing Cisco AAA
Implementing Cisco AAA
 
AAA & RADIUS Protocols
AAA & RADIUS ProtocolsAAA & RADIUS Protocols
AAA & RADIUS Protocols
 
Kerberos part 1
Kerberos part 1Kerberos part 1
Kerberos part 1
 
Cisco acs configuration guide
Cisco acs configuration guideCisco acs configuration guide
Cisco acs configuration guide
 
RADIUS
RADIUSRADIUS
RADIUS
 
10215 A 14
10215 A 1410215 A 14
10215 A 14
 
The Future of PKI. Using automation tools and protocols to bootstrap trust in...
The Future of PKI. Using automation tools and protocols to bootstrap trust in...The Future of PKI. Using automation tools and protocols to bootstrap trust in...
The Future of PKI. Using automation tools and protocols to bootstrap trust in...
 
Kerberos presentation
Kerberos presentationKerberos presentation
Kerberos presentation
 
Kerberos case study
Kerberos case studyKerberos case study
Kerberos case study
 
SSO with kerberos
SSO with kerberosSSO with kerberos
SSO with kerberos
 
Deep Dive In To Kerberos
Deep Dive In To KerberosDeep Dive In To Kerberos
Deep Dive In To Kerberos
 
Authentication services
Authentication servicesAuthentication services
Authentication services
 
Kerberos protocol
Kerberos protocolKerberos protocol
Kerberos protocol
 
Kerberos
KerberosKerberos
Kerberos
 
An introduction to X.509 certificates
An introduction to X.509 certificatesAn introduction to X.509 certificates
An introduction to X.509 certificates
 
Kerberos explained
Kerberos explainedKerberos explained
Kerberos explained
 
Kerberos
KerberosKerberos
Kerberos
 
PIW ISE best practices
PIW ISE best practicesPIW ISE best practices
PIW ISE best practices
 
Kerberos
KerberosKerberos
Kerberos
 
Authentication Application in Network Security NS4
Authentication Application in Network Security NS4Authentication Application in Network Security NS4
Authentication Application in Network Security NS4
 

Similar to TLS and Certificates

Configuration of Self Signed SSL Certificate For CentOS 8
Configuration of Self Signed SSL Certificate For CentOS 8Configuration of Self Signed SSL Certificate For CentOS 8
Configuration of Self Signed SSL Certificate For CentOS 8
Kaan Aslandağ
 
Training Slides: 302 - Securing Your Cluster With SSL
Training Slides: 302 - Securing Your Cluster With SSLTraining Slides: 302 - Securing Your Cluster With SSL
Training Slides: 302 - Securing Your Cluster With SSL
Continuent
 
Demystfying secure certs
Demystfying secure certsDemystfying secure certs
Demystfying secure certs
Gary Williams
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
zznate
 
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
DataStax Academy
 
How to validate server certificate
How to validate server certificateHow to validate server certificate
How to validate server certificate
codeandyou forums
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
zznate
 
RIPE 84: Revocation
RIPE 84: RevocationRIPE 84: Revocation
RIPE 84: Revocation
APNIC
 
SSL self signed deployment on Ubuntu 16.04
SSL self signed deployment on Ubuntu 16.04SSL self signed deployment on Ubuntu 16.04
SSL self signed deployment on Ubuntu 16.04
MH Qapandaran
 
Rhel5
Rhel5Rhel5
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
BU
 
Improving password-based authentication
Improving password-based authenticationImproving password-based authentication
Improving password-based authentication
Frank Denis
 
Cisco iso based CA (certificate authority)
Cisco iso based CA (certificate authority)Cisco iso based CA (certificate authority)
Cisco iso based CA (certificate authority)
Netwax Lab
 
Implementation of ssl injava
Implementation of ssl injavaImplementation of ssl injava
Implementation of ssl injavatanujagrawal
 
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
Andrejs Vorobjovs
 
SSL Certificates and Operations
SSL Certificates and OperationsSSL Certificates and Operations
SSL Certificates and Operations
Nisheed KM
 
TLS
TLSTLS
In headers / Padlocks / Certificate authorities / site seals we trust
In headers / Padlocks / Certificate authorities / site seals we trustIn headers / Padlocks / Certificate authorities / site seals we trust
In headers / Padlocks / Certificate authorities / site seals we trust
pipasnacave
 
IoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideasIoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideas
Jean-Baptiste Trystram
 

Similar to TLS and Certificates (20)

Configuration of Self Signed SSL Certificate For CentOS 8
Configuration of Self Signed SSL Certificate For CentOS 8Configuration of Self Signed SSL Certificate For CentOS 8
Configuration of Self Signed SSL Certificate For CentOS 8
 
Training Slides: 302 - Securing Your Cluster With SSL
Training Slides: 302 - Securing Your Cluster With SSLTraining Slides: 302 - Securing Your Cluster With SSL
Training Slides: 302 - Securing Your Cluster With SSL
 
Demystfying secure certs
Demystfying secure certsDemystfying secure certs
Demystfying secure certs
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
 
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
 
How to validate server certificate
How to validate server certificateHow to validate server certificate
How to validate server certificate
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
 
RIPE 84: Revocation
RIPE 84: RevocationRIPE 84: Revocation
RIPE 84: Revocation
 
SSL self signed deployment on Ubuntu 16.04
SSL self signed deployment on Ubuntu 16.04SSL self signed deployment on Ubuntu 16.04
SSL self signed deployment on Ubuntu 16.04
 
Rhel5
Rhel5Rhel5
Rhel5
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
Improving password-based authentication
Improving password-based authenticationImproving password-based authentication
Improving password-based authentication
 
Cisco iso based CA (certificate authority)
Cisco iso based CA (certificate authority)Cisco iso based CA (certificate authority)
Cisco iso based CA (certificate authority)
 
Implementation of ssl injava
Implementation of ssl injavaImplementation of ssl injava
Implementation of ssl injava
 
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...
 
SSL Certificates and Operations
SSL Certificates and OperationsSSL Certificates and Operations
SSL Certificates and Operations
 
TLS
TLSTLS
TLS
 
SSL-image
SSL-imageSSL-image
SSL-image
 
In headers / Padlocks / Certificate authorities / site seals we trust
In headers / Padlocks / Certificate authorities / site seals we trustIn headers / Padlocks / Certificate authorities / site seals we trust
In headers / Padlocks / Certificate authorities / site seals we trust
 
IoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideasIoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideas
 

More from Karri Huhtanen

Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and PrivacyDisobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
Karri Huhtanen
 
Wi-Fi Roaming Security and Privacy
Wi-Fi Roaming Security and PrivacyWi-Fi Roaming Security and Privacy
Wi-Fi Roaming Security and Privacy
Karri Huhtanen
 
OpenRoaming and CapPort
OpenRoaming and CapPortOpenRoaming and CapPort
OpenRoaming and CapPort
Karri Huhtanen
 
Suomen eduroam-juuripalvelun uudistukset
Suomen eduroam-juuripalvelun uudistuksetSuomen eduroam-juuripalvelun uudistukset
Suomen eduroam-juuripalvelun uudistukset
Karri Huhtanen
 
Adding OpenRoaming to existing IdP and roaming federation service
Adding OpenRoaming to existing IdP and roaming federation serviceAdding OpenRoaming to existing IdP and roaming federation service
Adding OpenRoaming to existing IdP and roaming federation service
Karri Huhtanen
 
OpenRoaming -- Wi-Fi Roaming for All
OpenRoaming -- Wi-Fi Roaming for AllOpenRoaming -- Wi-Fi Roaming for All
OpenRoaming -- Wi-Fi Roaming for All
Karri Huhtanen
 
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoamingBeyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
Karri Huhtanen
 
Cooperative labs, testbeds and networks
Cooperative labs, testbeds and networksCooperative labs, testbeds and networks
Cooperative labs, testbeds and networks
Karri Huhtanen
 
Privacy and traceability in Wi-Fi networks
Privacy and traceability in Wi-Fi networksPrivacy and traceability in Wi-Fi networks
Privacy and traceability in Wi-Fi networks
Karri Huhtanen
 
What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?
Karri Huhtanen
 
What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?
Karri Huhtanen
 
Building secure, privacy aware, quality Wi-Fi coverage via cooperation
Building secure, privacy aware, quality Wi-Fi coverage via cooperationBuilding secure, privacy aware, quality Wi-Fi coverage via cooperation
Building secure, privacy aware, quality Wi-Fi coverage via cooperation
Karri Huhtanen
 
Connecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
Connecting the Dots: Integrating RADIUS to Network Measurement and MonitoringConnecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
Connecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
Karri Huhtanen
 
Building city and nationwide Wi-Fi coverage via cooperation
Building city and nationwide Wi-Fi coverage via cooperationBuilding city and nationwide Wi-Fi coverage via cooperation
Building city and nationwide Wi-Fi coverage via cooperation
Karri Huhtanen
 
eduroam diagnostics in NTLR, IdPs and SPs
eduroam diagnostics in NTLR, IdPs and SPseduroam diagnostics in NTLR, IdPs and SPs
eduroam diagnostics in NTLR, IdPs and SPs
Karri Huhtanen
 
Using NoSQL databases to store RADIUS and Syslog data
Using NoSQL databases to store RADIUS and Syslog dataUsing NoSQL databases to store RADIUS and Syslog data
Using NoSQL databases to store RADIUS and Syslog data
Karri Huhtanen
 
Open WiFi or Broken WiFi?
Open WiFi or Broken WiFi?Open WiFi or Broken WiFi?
Open WiFi or Broken WiFi?
Karri Huhtanen
 
Cloud Based Identity Management
Cloud Based Identity ManagementCloud Based Identity Management
Cloud Based Identity Management
Karri Huhtanen
 
eduroam ennen, nyt ja tulevaisuudessa
eduroam ennen, nyt ja tulevaisuudessaeduroam ennen, nyt ja tulevaisuudessa
eduroam ennen, nyt ja tulevaisuudessa
Karri Huhtanen
 
Joukkoliikennedatan ongelmat ja ratkaisuja
Joukkoliikennedatan ongelmat ja ratkaisujaJoukkoliikennedatan ongelmat ja ratkaisuja
Joukkoliikennedatan ongelmat ja ratkaisuja
Karri Huhtanen
 

More from Karri Huhtanen (20)

Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and PrivacyDisobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
Disobey 2024: Karri Huhtanen: Wi-Fi Roaming Security and Privacy
 
Wi-Fi Roaming Security and Privacy
Wi-Fi Roaming Security and PrivacyWi-Fi Roaming Security and Privacy
Wi-Fi Roaming Security and Privacy
 
OpenRoaming and CapPort
OpenRoaming and CapPortOpenRoaming and CapPort
OpenRoaming and CapPort
 
Suomen eduroam-juuripalvelun uudistukset
Suomen eduroam-juuripalvelun uudistuksetSuomen eduroam-juuripalvelun uudistukset
Suomen eduroam-juuripalvelun uudistukset
 
Adding OpenRoaming to existing IdP and roaming federation service
Adding OpenRoaming to existing IdP and roaming federation serviceAdding OpenRoaming to existing IdP and roaming federation service
Adding OpenRoaming to existing IdP and roaming federation service
 
OpenRoaming -- Wi-Fi Roaming for All
OpenRoaming -- Wi-Fi Roaming for AllOpenRoaming -- Wi-Fi Roaming for All
OpenRoaming -- Wi-Fi Roaming for All
 
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoamingBeyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
Beyond eduroam: Combining eduroam, (5G) SIM authentication and OpenRoaming
 
Cooperative labs, testbeds and networks
Cooperative labs, testbeds and networksCooperative labs, testbeds and networks
Cooperative labs, testbeds and networks
 
Privacy and traceability in Wi-Fi networks
Privacy and traceability in Wi-Fi networksPrivacy and traceability in Wi-Fi networks
Privacy and traceability in Wi-Fi networks
 
What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?
 
What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?What is Network Function Virtualisation (NFV)?
What is Network Function Virtualisation (NFV)?
 
Building secure, privacy aware, quality Wi-Fi coverage via cooperation
Building secure, privacy aware, quality Wi-Fi coverage via cooperationBuilding secure, privacy aware, quality Wi-Fi coverage via cooperation
Building secure, privacy aware, quality Wi-Fi coverage via cooperation
 
Connecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
Connecting the Dots: Integrating RADIUS to Network Measurement and MonitoringConnecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
Connecting the Dots: Integrating RADIUS to Network Measurement and Monitoring
 
Building city and nationwide Wi-Fi coverage via cooperation
Building city and nationwide Wi-Fi coverage via cooperationBuilding city and nationwide Wi-Fi coverage via cooperation
Building city and nationwide Wi-Fi coverage via cooperation
 
eduroam diagnostics in NTLR, IdPs and SPs
eduroam diagnostics in NTLR, IdPs and SPseduroam diagnostics in NTLR, IdPs and SPs
eduroam diagnostics in NTLR, IdPs and SPs
 
Using NoSQL databases to store RADIUS and Syslog data
Using NoSQL databases to store RADIUS and Syslog dataUsing NoSQL databases to store RADIUS and Syslog data
Using NoSQL databases to store RADIUS and Syslog data
 
Open WiFi or Broken WiFi?
Open WiFi or Broken WiFi?Open WiFi or Broken WiFi?
Open WiFi or Broken WiFi?
 
Cloud Based Identity Management
Cloud Based Identity ManagementCloud Based Identity Management
Cloud Based Identity Management
 
eduroam ennen, nyt ja tulevaisuudessa
eduroam ennen, nyt ja tulevaisuudessaeduroam ennen, nyt ja tulevaisuudessa
eduroam ennen, nyt ja tulevaisuudessa
 
Joukkoliikennedatan ongelmat ja ratkaisuja
Joukkoliikennedatan ongelmat ja ratkaisujaJoukkoliikennedatan ongelmat ja ratkaisuja
Joukkoliikennedatan ongelmat ja ratkaisuja
 

Recently uploaded

Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 

Recently uploaded (20)

Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 

TLS and Certificates

  • 1. TLS AND CERTIFICATES IF YOU THINK THEY ARE EASY, YOU ARE (PROBABLY) DOING THEM WRONG Karri Huhtanen, Radiator Software Oy
  • 2. Doing TLS is easy, right? >>> import httplib >>> conn = httplib.HTTPSConnection("www.python.org") >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> print r1.status, r1.reason 200 OK
  • 3. NO
  • 4. It is more complicated than that... >>> import httplib >>> conn = httplib.HTTPSConnection("www.python.org") >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> print r1.status, r1.reason 200 OK Who is this www.python.org? What DNS are we using? What is the IP of this www.python.org in the DNS we are using? Do these match, do we get exception if they don’t? Do we verify the certificate? Who do we accept as certifiers for the certificate? What is the allowed use of certificate? What TLS/SSL version we are using? What encryption? Do we have Perfect Forward Secrecy? What are the other TLS connection parameters? What wrapper, TLS/SSL library we are using and what are their defaults? ...
  • 5. Making the connection... class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address[, context]]]]]]]) A subclass of HTTPConnection that uses SSL for communication with secure servers. Default port is 443. If context is specified, it must be a ssl.SSLContextinstance describing the various SSL options. key_file and cert_file are deprecated, please use ssl.SSLContext.load_cert_chain() instead, or let ssl.create_default_context() select the system’s trusted CA certificates for you. Please read Security considerations for more information on best practices. New in version 2.0. Changed in version 2.6: timeout was added. Changed in version 2.7: source_address was added. Changed in version 2.7.9: context was added. This class now performs all the necessary certificate and hostname checks by default. To revert to the previous, unverified, behavior ssl._create_unverified_context() can be passed to the context parameter. CVE-2014-9365 – HTTPS man-in-the-middle attack against Python clients using default settings
  • 6. Checking context... ssl.create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None) Return a new SSLContext object with default settings for the given purpose. The settings are chosen by the ssl module, and usually represent a higher security level than when calling the SSLContext constructor directly. cafile, capath, cadata represent optional CA certificates to trust for certificate verification, as in SSLContext.load_verify_locations(). If all three are None, this function can choose to trust the system’s default CA certificates instead. The settings are: PROTOCOL_SSLv23, OP_NO_SSLv2, and OP_NO_SSLv3 with high encryption cipher suites without RC4 and without unauthenticated cipher suites. Passing SERVER_AUTH as purpose sets verify_mode to CERT_REQUIRED and either loads CA certificates (when at least one of cafile, capath or cadata is given) or uses SSLContext.load_default_certs() to load default CA certificates. Note The protocol, options, cipher and other settings may change to more restrictive values anytime without prior deprecation. The values represent a fair balance between compatibility and security. If your application needs specific settings, you should create a SSLContext and apply the settings yourself. Who can be the certifier? What TLS protocols are allowed? To ensure consistent settings, DIY? Purpose here is not the X.509 certificate extended parameter purpose
  • 7. This does not feel so difficult... So I make my own context correctly, make the connection, check the possible exceptions and then it is no worries mate?
  • 8. NO
  • 9. So what is missing?
  • 10. Certificate revocation check (against CRL) SSLContext.verify_flags The flags for certificate verification operations. You can set flags like VERIFY_CRL_CHECK_LEAF by ORing them together. By default OpenSSL does neither require nor verify certificate revocation lists (CRLs). Available only with openssl version 0.9.8+. #!/usr/bin/env python import httplib import ssl context=ssl.create_default_context() context.verify_flags=context.verify_flags|ssl.VERIFY_CRL_CHECK_CHAIN conn = httplib.HTTPSConnection("www.python.org",context=context) conn.request("GET", "/") r1 = conn.getresponse() print r1.status, r1.reason The code works, I was able to see connection to crl servers, but soon the CRL was cached by the OpenSSL and could not get a dump with contents to see if anything was transferred.
  • 11. Certificate revocation lists (CRL) ● Are retrieved and cached the first time a request to check the certificate chain is made ● SSL library handles caching ● CRLs have LastUpdate and NextUpdate Fields to control caching ● But what if first time CRL cannot be retrieved?
  • 12. Case: Internet Explorer and Wi-Fi captive portals ● Internet Explorer users were complaining that getting to web authentication page took too long. Other browser users were fine. ● It was discovered that Internet Explorer wanted to check the CRL of the captive portal WWW server and because it could not get it, it waited until all of its tries timeouted. ● The solution was to define at least some of the CRL server IPs as pass through addresses in the captive portal. ● When Internet Explorer was able to get and verify CRLs, the delay vanished.
  • 13. HTTPS is easy compared to other TLS services ● In most cases everybody just trusts all CA certificates in browser or operating system certificate store. ● With HTTPS one usually has enough network connectivity to retrieve CRLs or even use Online Certificate Status Protocol (OCSP). ● DNS-IP Address-Certificate verification (and others even better verifications) can be performed against used service. ● With other TLS services everything is not so straight forward.
  • 14. Securing TLS services ● For VPN or network access accepting any CA signed certificates is probably not a good idea. ● For email, instant messaging, software updates etc. accepting any CA signed certificates will mean that at least state actors can have access to your data and devices. ● The certifying CA, purpose of the certificate and checking what it really verifies becomes increasingly important. ● Methods that help detecting service certificate changes (certificate pinning) and verify certificates offline (OCSP stapling) help to prevent MitM attacks.
  • 15. Case: TLS VPN with certificate authentication ● PKI with Root CA and separate Intermediate CAs for People and Servers ● VPN termination point misconfigured to trust Root CA verified certificates, VPN clients misconfigured to trust Root CA ● Now Root, Servers and People CA signed client certificates can authenticate successfully against VPN termination point, VPN clients accept any certificates certified by previous CAs as VPN termination point. ● This is made possible by not being careful in configuring CA settings, hostname, certificate and certificate purpose checks. Think about if we would in addition trust to any CA in system?
  • 16. Case: WPA Enterprise Wi-Fi authentication ● Without IP connectivity terminal starts authentication process with RADIUS server. ● Terminal is supposed to verify RADIUS server certificate and certificate details (usually hostname) against certain CA certificate. ● Often these checks are bypassed, sometimes they are not even configurable without creating and deploying separate device management configuration profiles in devices. ● At least username and password hash are in danger to be captured by anyone setting up Wi-Fi AP and RADIUS server with a certificate and network name accepted by the client device. ● Once again certificate checks and configuration matter.
  • 17. Securing WPA Enterprise Wi-Fi Authentication ● Certificate check and configuration, (forcing) device profiles ● Switching from username-password to client certificate, SIM or elliptic curves (EAP-PWD) based authentication ● Using certificate pinning for RADIUS server certificate ● Using OCSP stapling [1] [1] http://radiatorcookbook.open.com.au/2018/02/new-feature-ocsp-and-ocsp-stapling.html
  • 18. Summary ● TLS and certificates are not easy. They require careful design, implementation, testing, configuration and deployment. ● This presentation did not cover everything. It barely scratched PKI and more advanced certificate verification. ● Hopefully this presentation raised more concern or interest in ensuring that TLS and certificates are properly done in your projects, services and systems. ● Doing everything properly needs understanding of the whole stack (PKI, users, application/service, programming language, TLS wrappers, TLS library, configurations and Internet/transport in between service and terminal).
  • 19. Thank you. Questions? For more information: Karri Huhtanen Radiator Software Oy https://radiatorsoftware.com/