Securing SSH Access
Pavel Shukhman, OWASP Meetup
Ottawa, August 2019
Attack Vectors
• Brute-force attacks
• SSH traffic intercepts
(MITM)
• Attacks on administrator
workstations
• Insider attacks
Photo by Olga Levshina
PART 1. BRUTE-FORCE ATTACKS
Brute Force Today • Millions of daily brute-force
attacks on a large honeypot
built by UIUC (2017-2018)
• Bots increasingly try keys
• Chalubo IoT Botnet
(September 2018)
Photo by Markus Spiske on Unsplash
Protect from Brute Force - I
• Disable password authentication
• Disable root user access
• White-list user logins that may access SSH
• Use non-standard port, i.e. 5xxxx instead of 22
Protect from Brute Force - II
• Limit the source IP range
• Use 2FA on SSH, i.e. with Google-
Authenticator
• Just-in-time access configured on Provider
• Add monitoring on auth.log
Protect from Brute Force - Tools
• SSHGuard (default on GCP images)
• Fail2ban (protects SSH and other services)
• DenyHosts
PART 2. MAN-IN-THE-MIDDLE
MITM Vulnerabilities
• SSH v1 was proven
vulnerable in late 90-s
• Theoretical vulnerability with
CBC ciphers in November
2008
• Timing attacks
• Snowden leaked information
about NSA breaking SSH (Dec
2014)Photo by Samuel Zeller on Unsplash
MITM Mitigation
• Update Ciphers block in sshd_config to only
include strong ciphers (AES, ChaCha20)
• Require only strong ciphers on clients
• How to manage host keys?
Bastion-style Infrastructure
• Idea: only allow external SSH on Bastion nodes
• SSH to production nodes only done through
Bastions
• Mitigation of MITM honeypot because it is
hard to replicate
• Mitigates other attacks on infrastructure
Bastion Architecture
VPC
Bastions
SSH
SSH
Application Nodes
(only private IPs)
Signed SSH Certificates
• HashiCorp Vault provides an open source solution
• CA for signing public keys
• Additional layer of security with host key signing
• A PAM solution, but super-admin can circumvent
PART 3. ADMIN WORKSTATION
Suppose, laptop is broken into…
What can an attacker get?
• Private keys?
• Host IPs?
• Host public keys?
• Cloud Service Provider tokens?
Known Hosts, Remote IPs,
Host Keys
• Add HashKnownHosts yes
to ssh_config on client
• Did not find an alternative
on Windows
• Essentially, remote IPs are
hard to protect
cat ~/.ssh/known_hosts
Where do you store
private keys?
• Your Laptop (Better:
secured location on laptop)
• USB key (Better: encrypted)
• SmartCard (i.e. YubiKey)
• Worst: When people start
moving private keys around
Using YubiKeys
• Best option security-wise
• But: non-user-friendly configuration
• Have to use PGP instead of standard SSH keys
• Need at least 2 keys per person
• Must generate keys on the card and back up cert
Authentication Strategies
• Keep organization-wide inventory of public
keys with rotation and scanners
• LDAP / Kerberos
• Signed certificates (HashiCorp Vault style)
Cloud Provider Access
• Require MFA for Cloud Provider access
• Try not to store access tokens on laptop
• General hygiene: encrypted disks, secured
access to OS, lock laptop when away, etc
PART 4. INSIDER ATTACKS
HR Considerations
• Limit the number of SSH admins to minimum
• Select most trusted people for the job (i.e., >2
years on the job)
• Regular, at least bi-weekly, one-on-ones
• Keep staff happy and motivated
• Establish proper offboarding process
IAM, PIM, PAM
• Mainly commercial tools in the space
• May proxy SSH connections
• May record SSH sessions
• But questions remain
Remaining Questions on PIM, PAM
• “You have to trust someone” (CS101)
• Chicken-and-egg problem
• What about PIM/PAM vendors?
• Video recording of sessions not enough to
prevent attacks (like street cameras)
Other Options
• Minimize number of times when SSH access is
needed
• Shamir’s Secret Sharing principle and separation
of concerns – a path forward
• Open Source Solution – HashiCorp Vault
• Recommendations solve many issues, but unable
to mitigate all insider attacks
References
• https://www.usenix.org/system/files/nsdi19-cao.pdf
• https://en.wikipedia.org/wiki/Secure_Shell#Vulnerabilities
• https://www.vaultproject.io/docs/secrets/ssh/signed-ssh-
certificates.html
• https://worklifenotes.com/2019/07/05/yubikey-for-ssh-on-
windows-complete-walkthrough/
• https://www.engineerbetter.com/blog/yubikey-ssh/
• https://www.youtube.com/watch?v=exjorJyddok
About me, Pavel Shukhman
• Working with Infrastructure, DevOps,
DevSecOps, DataOps for more than 10
years
• In the early stage of building Reliza, my 3rd
self-founded Start-Up, and 5th total
• https://www.linkedin.com/in/pshukhman
Thank you!

More Related Content

PDF
Kochetova+osipv atm how_to_make_the_fraud__final
PDF
Protecting Passwords
PDF
proxy2: HTTPS pins and needles
PDF
Wi-Fi Hotspot Attacks
PDF
Defcon 22-david-wyde-client-side-http-cookie-security
PPTX
Lets talk about bug hunting
PPTX
Заполучили права администратора домена? Игра еще не окончена
PDF
Maemo 6 Platform Security
Kochetova+osipv atm how_to_make_the_fraud__final
Protecting Passwords
proxy2: HTTPS pins and needles
Wi-Fi Hotspot Attacks
Defcon 22-david-wyde-client-side-http-cookie-security
Lets talk about bug hunting
Заполучили права администратора домена? Игра еще не окончена
Maemo 6 Platform Security

What's hot (20)

PDF
Malware cryptomining uploadv3
PPTX
Security Onion Conference - 2015
PPTX
Infrastructure management using a VPN Concentrator
PPTX
Sticky Keys to the Kingdom
PPTX
kali linux
PPT
Attacking Embedded Devices (No Axe Required)
PDF
CMS Hacking Tricks - DerbyCon 4 - 2014
PDF
Infrastructure management presented to GPNOG (Updated)
PPTX
Kali Linux
DOCX
kali linix
PDF
CSF18 - BitLocker Deep Dive - Sami Laiho
PDF
Infosecurity.be 2019: What are relevant open source security tools you should...
PDF
BlueHat v18 || Massive scale usb device driver fuzz without device
PPTX
Kali Linux
PDF
Virtual Machine Introspection in a Hyberid Honeypot Architecture
PPTX
Kali linux
PDF
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
PPT
Network ssecurity toolkit
PPTX
kali linux.pptx
Malware cryptomining uploadv3
Security Onion Conference - 2015
Infrastructure management using a VPN Concentrator
Sticky Keys to the Kingdom
kali linux
Attacking Embedded Devices (No Axe Required)
CMS Hacking Tricks - DerbyCon 4 - 2014
Infrastructure management presented to GPNOG (Updated)
Kali Linux
kali linix
CSF18 - BitLocker Deep Dive - Sami Laiho
Infosecurity.be 2019: What are relevant open source security tools you should...
BlueHat v18 || Massive scale usb device driver fuzz without device
Kali Linux
Virtual Machine Introspection in a Hyberid Honeypot Architecture
Kali linux
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
Network ssecurity toolkit
kali linux.pptx
Ad

Similar to Securing SSH Access by Pavel Shukhman at OWASP Ottawa Meetup, August 2019 (20)

PDF
Industry Best Practices For SSH - DevOps.com Webinar
PDF
Industry Best Practices for SSH Access
PPTX
SSH Keys: Security Asset or Liability?
PPTX
Advanced Privileged Identity Management: Moving Beyond the Gateway Approach t...
PPTX
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
PPTX
Cyber secure
PPT
Presentation nix
PPT
Presentation nix
PPTX
"Cryptography, Data Protection, and Security For Start-Ups In The Post Snowde...
PPTX
PDF
PROTECT AND SURVIVE – SAFEGUARDING YOUR INFORMATION ASSETS - #MFSummit2017
PPTX
Introduction to Just in Time Access - BrightTalk
PDF
Securing Your Resources with Short-Lived Certificates!
PDF
Dssh @ Confidence, Prague 2010
PDF
PLNOG 8: Merike Kaeo - Guide to Building Secure Infrastructures
PPTX
PPTX
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
PPTX
Gaining the benefits of risk reduction for your ssh key management project
PPTX
IoT Lockdown
PPTX
Simple tips to improve Server Security
Industry Best Practices For SSH - DevOps.com Webinar
Industry Best Practices for SSH Access
SSH Keys: Security Asset or Liability?
Advanced Privileged Identity Management: Moving Beyond the Gateway Approach t...
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
Cyber secure
Presentation nix
Presentation nix
"Cryptography, Data Protection, and Security For Start-Ups In The Post Snowde...
PROTECT AND SURVIVE – SAFEGUARDING YOUR INFORMATION ASSETS - #MFSummit2017
Introduction to Just in Time Access - BrightTalk
Securing Your Resources with Short-Lived Certificates!
Dssh @ Confidence, Prague 2010
PLNOG 8: Merike Kaeo - Guide to Building Secure Infrastructures
Vices & Devices - How IoT & Insecure APIs Became the New Cyber Battlefront
Gaining the benefits of risk reduction for your ssh key management project
IoT Lockdown
Simple tips to improve Server Security
Ad

Recently uploaded (20)

PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Hybrid model detection and classification of lung cancer
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Architecture types and enterprise applications.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Unlock new opportunities with location data.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Getting Started with Data Integration: FME Form 101
PPT
What is a Computer? Input Devices /output devices
PDF
August Patch Tuesday
PPTX
Modernising the Digital Integration Hub
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Module 1.ppt Iot fundamentals and Architecture
Hybrid model detection and classification of lung cancer
A novel scalable deep ensemble learning framework for big data classification...
Tartificialntelligence_presentation.pptx
observCloud-Native Containerability and monitoring.pptx
Architecture types and enterprise applications.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
sustainability-14-14877-v2.pddhzftheheeeee
Unlock new opportunities with location data.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Developing a website for English-speaking practice to English as a foreign la...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Enhancing emotion recognition model for a student engagement use case through...
Getting Started with Data Integration: FME Form 101
What is a Computer? Input Devices /output devices
August Patch Tuesday
Modernising the Digital Integration Hub
CloudStack 4.21: First Look Webinar slides
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf

Securing SSH Access by Pavel Shukhman at OWASP Ottawa Meetup, August 2019

  • 1. Securing SSH Access Pavel Shukhman, OWASP Meetup Ottawa, August 2019
  • 2. Attack Vectors • Brute-force attacks • SSH traffic intercepts (MITM) • Attacks on administrator workstations • Insider attacks Photo by Olga Levshina
  • 4. Brute Force Today • Millions of daily brute-force attacks on a large honeypot built by UIUC (2017-2018) • Bots increasingly try keys • Chalubo IoT Botnet (September 2018) Photo by Markus Spiske on Unsplash
  • 5. Protect from Brute Force - I • Disable password authentication • Disable root user access • White-list user logins that may access SSH • Use non-standard port, i.e. 5xxxx instead of 22
  • 6. Protect from Brute Force - II • Limit the source IP range • Use 2FA on SSH, i.e. with Google- Authenticator • Just-in-time access configured on Provider • Add monitoring on auth.log
  • 7. Protect from Brute Force - Tools • SSHGuard (default on GCP images) • Fail2ban (protects SSH and other services) • DenyHosts
  • 9. MITM Vulnerabilities • SSH v1 was proven vulnerable in late 90-s • Theoretical vulnerability with CBC ciphers in November 2008 • Timing attacks • Snowden leaked information about NSA breaking SSH (Dec 2014)Photo by Samuel Zeller on Unsplash
  • 10. MITM Mitigation • Update Ciphers block in sshd_config to only include strong ciphers (AES, ChaCha20) • Require only strong ciphers on clients • How to manage host keys?
  • 11. Bastion-style Infrastructure • Idea: only allow external SSH on Bastion nodes • SSH to production nodes only done through Bastions • Mitigation of MITM honeypot because it is hard to replicate • Mitigates other attacks on infrastructure
  • 13. Signed SSH Certificates • HashiCorp Vault provides an open source solution • CA for signing public keys • Additional layer of security with host key signing • A PAM solution, but super-admin can circumvent
  • 14. PART 3. ADMIN WORKSTATION
  • 15. Suppose, laptop is broken into… What can an attacker get? • Private keys? • Host IPs? • Host public keys? • Cloud Service Provider tokens?
  • 16. Known Hosts, Remote IPs, Host Keys • Add HashKnownHosts yes to ssh_config on client • Did not find an alternative on Windows • Essentially, remote IPs are hard to protect cat ~/.ssh/known_hosts
  • 17. Where do you store private keys? • Your Laptop (Better: secured location on laptop) • USB key (Better: encrypted) • SmartCard (i.e. YubiKey) • Worst: When people start moving private keys around
  • 18. Using YubiKeys • Best option security-wise • But: non-user-friendly configuration • Have to use PGP instead of standard SSH keys • Need at least 2 keys per person • Must generate keys on the card and back up cert
  • 19. Authentication Strategies • Keep organization-wide inventory of public keys with rotation and scanners • LDAP / Kerberos • Signed certificates (HashiCorp Vault style)
  • 20. Cloud Provider Access • Require MFA for Cloud Provider access • Try not to store access tokens on laptop • General hygiene: encrypted disks, secured access to OS, lock laptop when away, etc
  • 21. PART 4. INSIDER ATTACKS
  • 22. HR Considerations • Limit the number of SSH admins to minimum • Select most trusted people for the job (i.e., >2 years on the job) • Regular, at least bi-weekly, one-on-ones • Keep staff happy and motivated • Establish proper offboarding process
  • 23. IAM, PIM, PAM • Mainly commercial tools in the space • May proxy SSH connections • May record SSH sessions • But questions remain
  • 24. Remaining Questions on PIM, PAM • “You have to trust someone” (CS101) • Chicken-and-egg problem • What about PIM/PAM vendors? • Video recording of sessions not enough to prevent attacks (like street cameras)
  • 25. Other Options • Minimize number of times when SSH access is needed • Shamir’s Secret Sharing principle and separation of concerns – a path forward • Open Source Solution – HashiCorp Vault • Recommendations solve many issues, but unable to mitigate all insider attacks
  • 26. References • https://www.usenix.org/system/files/nsdi19-cao.pdf • https://en.wikipedia.org/wiki/Secure_Shell#Vulnerabilities • https://www.vaultproject.io/docs/secrets/ssh/signed-ssh- certificates.html • https://worklifenotes.com/2019/07/05/yubikey-for-ssh-on- windows-complete-walkthrough/ • https://www.engineerbetter.com/blog/yubikey-ssh/ • https://www.youtube.com/watch?v=exjorJyddok
  • 27. About me, Pavel Shukhman • Working with Infrastructure, DevOps, DevSecOps, DataOps for more than 10 years • In the early stage of building Reliza, my 3rd self-founded Start-Up, and 5th total • https://www.linkedin.com/in/pshukhman