SlideShare a Scribd company logo
1 of 27
Download to read offline
Linux Server Security and Hardering
Antonio C. Vélez Báez
24, october 2018
ABOUT ME ...
• Antonio C. Vélez Báez
• OSCP, RHCE, RHCSA-RHOS, Linux+
• Vidalinux.com Founder
• OVOX LLC. Co-Founder
• Red Hat Certified Instructor and examiner
• Red Hat Certified Training Center
• First Linux distribution made in Puerto Rico
https://en.wikipedia.org/wiki/VidaLinux
• Email: acvelez@vidalinux.com
• Website: www.vidalinux.com
MYTHS ABOUT LINUX SECURITY
• Linux is invulnerable and virus-free.
• Virus writers do not target Linux because it has a low market share.
• Windows malware cannot run on Linux.
• On Linux you install software from software repositories, which
contain only trusted software.
• I don't need a firewall because Linux has no open ports by default.
VULNERABILITIES STATS
Linux kernel Vulnerabilities Stats
1999 - present
Vulnerabilities Stats by Vendor
1999 - present
source: https://www.cvedetails.com
EXPLOITS STATS
TOP VULNERABILITIES
• Dirty Cow: CVE-2016-5195 (Privilege escalation vulnerability)
• Heatbleed: CVE-2014-0160 (OpenSSL library vulnerability)
• Shellshock: CVE-2014-6271 (GNU Bash Remote Code Execution Vulnerability)
• Glibc: CVE-2015-7547 (getaddrinfo stack-based buffer overflow)
• VENOM: CVE-2015-3456 (security vulnerability in the virtual floppy drive code)
• Misconfiguration of Enterprise Services NIS/NFS
• Misconfiguration of Simple Network Management Protocol (SNMP)
• User account weak password
• Application vulnerabilities
• No updates or OS end-of-life
SHELLSHOCK
Live demo
NFS MISCONFIGURATION
If no_root_squash is used, remote root users are able to change
any file on the shared file system and leave applications infected
by Trojans for other users to inadvertently execute
ENTERPRISE LINUX
Red Hat offers subscription services for each major release of Red Hat Enterprise Linux
throughout four life-cycle phases—called Full Support, Maintenance Support 1, Maintenance
Support 2, and an Extended Life Phase.
ENTERPRISE LINUX
LTS or ‘Long Term Support’ releases are published every two years in April. LTS releases are the
‘enterprise grade’ releases of Ubuntu, and they are much more heavily used (something like 95%
of all Ubuntu installations are LTS releases).
LINUX SEC ADVISORIES
At the OS level, major distro vendors regularly publish details on
security issues with their platform. Examples include:
• https://access.redhat.com/security/
• https://www.suse.com/support/security/
• https://www.ubuntu.com/usn/
• https://security.gentoo.org/glsa
• https://security.archlinux.org/
• https://www.debian.org/security/
DISK PARTITIONS
Servers should have separate file systems for /, /boot, /usr, /dev, /var,
/tmp, and /home.
POST INSTALLATION
• Install latest updates
• Terminate unauthorized users
• Identify and shut down unused daemons
• Set firewall rules
• Disable USB devices
• Set GRUB boot loader password
• Configure root user timeout
ACCOUNTS & PASSWORDS
• Unused Accounts
• Enabling Password Aging
• Stronger Password Enforcement
• Restricting Use of Previous Passwords
• Locking User Accounts After Too Many Login Failures
• Set password expiration
FILE PERMISSIONS
• SUID/SGID Files
• World-Writable Files
• Orphaned or Unowned Files
SSH SECURITY
• Configure idle timeout interval
• Limit users for ssh access
• Disable password login
• Disable root login
• Disable empty passwords
• Use public/private keys for authentication
• Display login Banner
• Change default port
KERNEL SECURITY
• Disable IP Forwarding (also known as Internet routing)
net.ipv4.ip_forward parameter = 0
• Disable the Send Packet Redirects (send routing information to other hosts)
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
• Ignore all to ICMP (ping)
net.ipv4.icmp_echo_ignore_all = 1
• Enable Bad Error Message Protection (alert about error messages in network)
net.ipv4.icmp_ignore_bogus_error_responses = 1
• Enable IP spoofing protection (packets which claim to be from another host)
net.ipv4.conf.all.rp_filter = 1
https://www.cyberciti.biz/faq/linux-kernel-etcsysctl-conf-security-hardening/
SELINUX
SELinux disable SELinux enable
SELinux, Security-Enhanced Linux, is an additional method to protect your system.
SELinux is a set of security rules that determine which process can access which files,
directories, ports, etc. Every file, process, directory and port has a special security label called
SELinux contexts. A context is simply a name that is used by the SELinux policy to determine
whether or not a process can access a file, directory or port.
PHP SECURITY
• disable_functions = exec,system,shell_exec,passthru
• register_globals = Off
• expose_php = Off
• display_errors = Off
• track_errors = Off
• html_errors = Off
• magic_quotes_gpc = Off
APACHE INFO LEAKAGE
• ServerTokens Prod
• ServerSignature Off
• TraceEnable Off
• Header unset ETag
• FileETag None
• Header always unset "X-Powered-By"
• Header unset "X-Powered-By"
MODSECURITY
ModSecurity is a web application firewall for the Apache web
server. In addition to providing logging capabilities, ModSecurity
can monitor the HTTP traffic in real time in order to detect
attacks. ModSecurity also operates as a web intrusion detection
tool, allowing you to react to suspicious events that take place at
your web systems.
MODEVASIVE
Mod Evasive is an evasive maneuvers module for Apache that
provides evasive action in the event of an HTTP DoS attack or
brute force attack. It is also designed to be a detection and
network management tool, and can be easily configured to talk to
ipchains, firewalls, routers, and more. mod_evasive presently
reports abuse via email and syslog facilities.
BAN SUSPICIOUS HOSTS
• Fail2ban
• SshGuard
• Denyhosts
• HeatShield
• Portknocking
SCANNER AND AUDITING
• Lynis
• Logwatch
• Nmap
• Openscap
• Metasploit
• Nikto
• Nessus
• OpenVAS
OPENSCAP
Live demo
LYNIS
Live demo
¿QUESTIONS?

More Related Content

What's hot

Elastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleElastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleHani Perkasa
 
Terminal Access Controller
Terminal Access ControllerTerminal Access Controller
Terminal Access ControllerKHNOG
 
Operating Systems: A History of Linux
Operating Systems: A History of LinuxOperating Systems: A History of Linux
Operating Systems: A History of LinuxDamian T. Gordon
 
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...Anne Nicolas
 
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerHackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerPau Garcia Quiles
 
Introduction to “X86 PCC Software”
Introduction to “X86 PCC Software”Introduction to “X86 PCC Software”
Introduction to “X86 PCC Software”HermesDDS2015
 
Kwort Linux 4.3 the new stable version is released
Kwort Linux 4.3 the new stable version is releasedKwort Linux 4.3 the new stable version is released
Kwort Linux 4.3 the new stable version is releasedLinux Training Chennai
 
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...James Morris
 

What's hot (20)

Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
 
Elastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleElastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA module
 
Linux
LinuxLinux
Linux
 
Apache
ApacheApache
Apache
 
FreeBSD is not Linux
FreeBSD is not LinuxFreeBSD is not Linux
FreeBSD is not Linux
 
Kalilinux
KalilinuxKalilinux
Kalilinux
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Terminal Access Controller
Terminal Access ControllerTerminal Access Controller
Terminal Access Controller
 
2. introduction to linux
2. introduction to linux2. introduction to linux
2. introduction to linux
 
Operating Systems: A History of Linux
Operating Systems: A History of LinuxOperating Systems: A History of Linux
Operating Systems: A History of Linux
 
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...
Distro Recipes 2013 : Introduction to Arch Linux: a simple, rolling-release d...
 
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerHackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
 
Fosscon2013
Fosscon2013Fosscon2013
Fosscon2013
 
Self2013
Self2013Self2013
Self2013
 
Introduction to “X86 PCC Software”
Introduction to “X86 PCC Software”Introduction to “X86 PCC Software”
Introduction to “X86 PCC Software”
 
Olf2012
Olf2012Olf2012
Olf2012
 
Kwort Linux 4.3 the new stable version is released
Kwort Linux 4.3 the new stable version is releasedKwort Linux 4.3 the new stable version is released
Kwort Linux 4.3 the new stable version is released
 
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
 
Expo ciberseguridad
Expo ciberseguridadExpo ciberseguridad
Expo ciberseguridad
 

Similar to Linux Server Security and Hardering

Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxAmitesh Bharti
 
Bn 1027 demo linux adminstration
Bn 1027 demo  linux adminstrationBn 1027 demo  linux adminstration
Bn 1027 demo linux adminstrationconline training
 
Hardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/LinuxHardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/LinuxMartin Holovský
 
Top ten OSS products cutting out costs and making a difference in the public ...
Top ten OSS products cutting out costs and making a difference in the public ...Top ten OSS products cutting out costs and making a difference in the public ...
Top ten OSS products cutting out costs and making a difference in the public ...Ubertas
 
Systems administration for coders presentation
Systems administration for coders presentationSystems administration for coders presentation
Systems administration for coders presentationMatt Willsher
 
100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdf100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdfMAHESHUMANATHGOPALAK
 
SOC-BlueTEam.pdf
SOC-BlueTEam.pdfSOC-BlueTEam.pdf
SOC-BlueTEam.pdfBeratAkit
 
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUESEMERSON EDUARDO RODRIGUES
 
Linux a free and open source operating system
Linux a free and open source operating systemLinux a free and open source operating system
Linux a free and open source operating systembanwait
 
Linux a free and open source operating system
Linux a free and open source operating systemLinux a free and open source operating system
Linux a free and open source operating systembanwait
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guideCraig Cannon
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNGene Kartavtsev
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
Protecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxProtecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxGiuseppe Paterno'
 

Similar to Linux Server Security and Hardering (20)

Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in Linux
 
Ceh v5 module 18 linux hacking
Ceh v5 module 18 linux hackingCeh v5 module 18 linux hacking
Ceh v5 module 18 linux hacking
 
Bn 1027 demo linux adminstration
Bn 1027 demo  linux adminstrationBn 1027 demo  linux adminstration
Bn 1027 demo linux adminstration
 
Hardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/LinuxHardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/Linux
 
cibers
ciberscibers
cibers
 
Top ten OSS products cutting out costs and making a difference in the public ...
Top ten OSS products cutting out costs and making a difference in the public ...Top ten OSS products cutting out costs and making a difference in the public ...
Top ten OSS products cutting out costs and making a difference in the public ...
 
Systems administration for coders presentation
Systems administration for coders presentationSystems administration for coders presentation
Systems administration for coders presentation
 
100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdf100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdf
 
SOC-BlueTEam.pdf
SOC-BlueTEam.pdfSOC-BlueTEam.pdf
SOC-BlueTEam.pdf
 
100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdf100 Security Operation Center Tools.pdf
100 Security Operation Center Tools.pdf
 
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES
100 Security Operation Center Tools EMERSON EDUARDO RODRIGUES
 
Linux a free and open source operating system
Linux a free and open source operating systemLinux a free and open source operating system
Linux a free and open source operating system
 
Linux a free and open source operating system
Linux a free and open source operating systemLinux a free and open source operating system
Linux a free and open source operating system
 
linux.pptx
linux.pptxlinux.pptx
linux.pptx
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guide
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MN
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Linux basics (part 2)
Linux basics (part 2)Linux basics (part 2)
Linux basics (part 2)
 
Kali linux os
Kali linux osKali linux os
Kali linux os
 
Protecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxProtecting confidential files using SE-Linux
Protecting confidential files using SE-Linux
 

Recently uploaded

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Linux Server Security and Hardering

  • 1. Linux Server Security and Hardering Antonio C. Vélez Báez 24, october 2018
  • 2. ABOUT ME ... • Antonio C. Vélez Báez • OSCP, RHCE, RHCSA-RHOS, Linux+ • Vidalinux.com Founder • OVOX LLC. Co-Founder • Red Hat Certified Instructor and examiner • Red Hat Certified Training Center • First Linux distribution made in Puerto Rico https://en.wikipedia.org/wiki/VidaLinux • Email: acvelez@vidalinux.com • Website: www.vidalinux.com
  • 3. MYTHS ABOUT LINUX SECURITY • Linux is invulnerable and virus-free. • Virus writers do not target Linux because it has a low market share. • Windows malware cannot run on Linux. • On Linux you install software from software repositories, which contain only trusted software. • I don't need a firewall because Linux has no open ports by default.
  • 4. VULNERABILITIES STATS Linux kernel Vulnerabilities Stats 1999 - present Vulnerabilities Stats by Vendor 1999 - present source: https://www.cvedetails.com
  • 6. TOP VULNERABILITIES • Dirty Cow: CVE-2016-5195 (Privilege escalation vulnerability) • Heatbleed: CVE-2014-0160 (OpenSSL library vulnerability) • Shellshock: CVE-2014-6271 (GNU Bash Remote Code Execution Vulnerability) • Glibc: CVE-2015-7547 (getaddrinfo stack-based buffer overflow) • VENOM: CVE-2015-3456 (security vulnerability in the virtual floppy drive code) • Misconfiguration of Enterprise Services NIS/NFS • Misconfiguration of Simple Network Management Protocol (SNMP) • User account weak password • Application vulnerabilities • No updates or OS end-of-life
  • 8. NFS MISCONFIGURATION If no_root_squash is used, remote root users are able to change any file on the shared file system and leave applications infected by Trojans for other users to inadvertently execute
  • 9. ENTERPRISE LINUX Red Hat offers subscription services for each major release of Red Hat Enterprise Linux throughout four life-cycle phases—called Full Support, Maintenance Support 1, Maintenance Support 2, and an Extended Life Phase.
  • 10. ENTERPRISE LINUX LTS or ‘Long Term Support’ releases are published every two years in April. LTS releases are the ‘enterprise grade’ releases of Ubuntu, and they are much more heavily used (something like 95% of all Ubuntu installations are LTS releases).
  • 11. LINUX SEC ADVISORIES At the OS level, major distro vendors regularly publish details on security issues with their platform. Examples include: • https://access.redhat.com/security/ • https://www.suse.com/support/security/ • https://www.ubuntu.com/usn/ • https://security.gentoo.org/glsa • https://security.archlinux.org/ • https://www.debian.org/security/
  • 12. DISK PARTITIONS Servers should have separate file systems for /, /boot, /usr, /dev, /var, /tmp, and /home.
  • 13. POST INSTALLATION • Install latest updates • Terminate unauthorized users • Identify and shut down unused daemons • Set firewall rules • Disable USB devices • Set GRUB boot loader password • Configure root user timeout
  • 14. ACCOUNTS & PASSWORDS • Unused Accounts • Enabling Password Aging • Stronger Password Enforcement • Restricting Use of Previous Passwords • Locking User Accounts After Too Many Login Failures • Set password expiration
  • 15. FILE PERMISSIONS • SUID/SGID Files • World-Writable Files • Orphaned or Unowned Files
  • 16. SSH SECURITY • Configure idle timeout interval • Limit users for ssh access • Disable password login • Disable root login • Disable empty passwords • Use public/private keys for authentication • Display login Banner • Change default port
  • 17. KERNEL SECURITY • Disable IP Forwarding (also known as Internet routing) net.ipv4.ip_forward parameter = 0 • Disable the Send Packet Redirects (send routing information to other hosts) net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 • Ignore all to ICMP (ping) net.ipv4.icmp_echo_ignore_all = 1 • Enable Bad Error Message Protection (alert about error messages in network) net.ipv4.icmp_ignore_bogus_error_responses = 1 • Enable IP spoofing protection (packets which claim to be from another host) net.ipv4.conf.all.rp_filter = 1 https://www.cyberciti.biz/faq/linux-kernel-etcsysctl-conf-security-hardening/
  • 18. SELINUX SELinux disable SELinux enable SELinux, Security-Enhanced Linux, is an additional method to protect your system. SELinux is a set of security rules that determine which process can access which files, directories, ports, etc. Every file, process, directory and port has a special security label called SELinux contexts. A context is simply a name that is used by the SELinux policy to determine whether or not a process can access a file, directory or port.
  • 19. PHP SECURITY • disable_functions = exec,system,shell_exec,passthru • register_globals = Off • expose_php = Off • display_errors = Off • track_errors = Off • html_errors = Off • magic_quotes_gpc = Off
  • 20. APACHE INFO LEAKAGE • ServerTokens Prod • ServerSignature Off • TraceEnable Off • Header unset ETag • FileETag None • Header always unset "X-Powered-By" • Header unset "X-Powered-By"
  • 21. MODSECURITY ModSecurity is a web application firewall for the Apache web server. In addition to providing logging capabilities, ModSecurity can monitor the HTTP traffic in real time in order to detect attacks. ModSecurity also operates as a web intrusion detection tool, allowing you to react to suspicious events that take place at your web systems.
  • 22. MODEVASIVE Mod Evasive is an evasive maneuvers module for Apache that provides evasive action in the event of an HTTP DoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, and more. mod_evasive presently reports abuse via email and syslog facilities.
  • 23. BAN SUSPICIOUS HOSTS • Fail2ban • SshGuard • Denyhosts • HeatShield • Portknocking
  • 24. SCANNER AND AUDITING • Lynis • Logwatch • Nmap • Openscap • Metasploit • Nikto • Nessus • OpenVAS