SlideShare a Scribd company logo
1 of 33
Download to read offline
Hardening Linux
and introducing Securix GNU/Linux
Hardening basics

From lowest to highest level
Tune every part of system and applications
Follow standards and security policies
Regularly check system health
Install security patches when possible
Log and audit every action


                                         secured linux by default | www.securix.org
Physical security
 Locked rack
 BIOS setup password

 Console in different rack

 // How it helps?
 Avoid unauthorized access where
 somebody can:
 - shutdown server
 - reboot server into single-user
 mode and change password
 - boot live CD and access data
 - sniff data on ethernet cable
 - steal hard disks
Encrypting partitions
 its essential to have encrypted all partitions except /boot and
 swap ( / , usr, home, var, opt, tmp)

 no impact on resources where is HW acceleration possible

 my recommendation is LUKS
 cryptsetup -c aes-xts-plain -y -s 512 -h whirlpool luksFormat /dev/xyz


 // How it helps?

 data stored are unreadable for attacker

 passwords can’t be changed during boot from live CD


                                                        secured linux by default | www.securix.org
Securing Grub
protect grub using password
password --md5 $1$Ul0TR0$fK/7jE2gCbkBAnzBQWWYf/


generate hash using grub-md5-crypt

protect single-user boot via password as well

setup fallback option

// How it helps?

avoid unauthorized single-user mode boot

fallback in case of problems with new kernel


                                                  secured linux by default | www.securix.org
Kernel configuration

 enabled only options which are really needed
 - smaller/faster kernel
 - secure - big piece of code isn't really needed
 enabled PaX and Grsecurity
 - no LSM
 - robust multi-level security system
 Securix have minimalistic predefined kernel setup which
 should boot on many systems by default


                                           secured linux by default | www.securix.org
/etc/securetty

 limit root access to console and serial port only
 # file: /etc/securetty
 # limit root access
 console
 vc/1
 tty1
 tty2
 # serial console access
 ttyS0
 ttyS1
 ...




                                            secured linux by default | www.securix.org
Use phrases, not passwords
Use phrases, not passwords
/etc/sysctl.conf
 build with focus on security and network stack tuning
 some examples:
 # Kernel EXEC shield
 kernel.exec-shield = 1

 # Make the addresses of mmap base, stack, heap and VDSO page randomized
 kernel.randomize_va_space = 2

 # Reboot system when kernel panic occur, oops will wait 30 seconds untill call panic()
 kernel.panic = 30
 kernel.panic_on_oops = 30

 # Disable magic-sysrq key
 kernel.sysrq = 0




                                                                       secured linux by default | www.securix.org
/etc/sysctl.conf
 # Prevent SYN attack
 net.ipv4.tcp_syncookies = 1
 net.ipv4.tcp_max_syn_backlog = 4096
 net.ipv4.tcp_syn_retries = 5
 net.ipv4.tcp_synack_retries = 2

 # Enable IP spoofing protection, turn on source route verification
 net.ipv4.conf.all.rp_filter = 1
 net.ipv4.conf.default.rp_filter = 1

 # Increase allowed local port range
 net.ipv4.ip_local_port_range = 1024 64000

 # Enable tcp_window_scaling
 net.ipv4.tcp_window_scaling = 1


 ...and much more


                                                                    secured linux by default | www.securix.org
iptables configuration

 script for pushing/editing/saving firewall rules
 port scan detection
 access logging
 traffic divided into chains
 strict default policy



                                            secured linux by default | www.securix.org
/etc/security/limits.conf
 # default limits
 *         soft core        0
 *         hard core        0
 *         hard nproc       200
 *         hard nofile       2000
 *         hard fsize       1024000
 *         -     maxlogins 3
 # operator group limits
 @operators hard nproc            2000
 @operators hard nofile            4000
 @operators hard fsize           10240000
 @operators -        maxlogins    10
 # service group limits
 @services      hard nproc       40000
 @services      hard nofile      45000
 @services      hard fsize      1024000000
 @services      -   maxlogins    100




                                             secured linux by default | www.securix.org
/etc/ssh/sshd_config
Port 55522
Protocol 2
ServerKeyBits 2048
Ciphers aes256-cbc,aes256-ctr,blowfish-cbc
Compression yes
ClientAliveInterval 15
ClientAliveCountMax 3
TCPKeepAlive no

PermitRootLogin no
PermitEmptyPasswords no
UsePrivilegeSeparation yes
StrictModes yes

AllowTcpForwarding no
X11Forwarding no
GatewayPorts no
...




                                            secured linux by default | www.securix.org
PaX - NOEXEC
The goal of NOEXEC is to prevent the injection and
execution of code into a task's address space and render
this exploit technique unusable under PaX.

- segmentation based non-executable page protection [IA-32 only]
(SEGMEXEC)

- paging based non-executable page protection (PAGEEXEC)

- mmap() and mprotect() restrictions (MPROTECT)



                                             secured linux by default | www.securix.org
Pax - ASLR
decrease success rate of attacks that require advanced
knowledge of memory addresses via Address Space Layout
Randomization (ASLR)

- Main executable code/data/bss segment base address
randomization (RANDEXEC) - ET_EXEC ELF

- mmap() and brk() managed memory [libraries, heap, thread
stacks, shared memory, etc] address randomization (RANDMMAP)
ET_DYN ELF

- User stack base address randomization (RANDUSTACK)
- Kernel stack base address randomization (RANDKSTACK)
                                          secured linux by default | www.securix.org
Grsecurity

 “Unlike other expensive security "solutions" that pretend to achieve
 security through known-vulnerability patching, signature-based
 detection, or other reactive methods, grsecurity provides real
 proactive security. The only solution that hardens both your
 applications and operating system, grsecurity is essential for
 public-facing servers and shared-hosting environments.

 Grsecurity increased authentication for administrators, audit
 important system events, and confine your system with no manual
 configuration through advanced Role-Based Access Control.”



                                                secured linux by default | www.securix.org
Grsecurity - features
 high scalable Role-Based Access Control
 learning mode for RBAC policies
 restrict access to /dev/kmem, /proc/<pid>/maps, /proc,
 kernel processes, linking, FIFO, dmesg, IO, ptrace, ...
 trusted path execution
 hardened chroot environment
 fork bomb protection & randomized PIDs


                                          secured linux by default | www.securix.org
Grsecurity - features 2
 network protections - randomized IP IDs, larger entropy
 pools, random TCP sequence numbers, randomized TCP
 source ports, tcp/udp blackhole, altered ping payload,
 socket restrictions, ...
 auditing - exec & chroot exec, ptrace, chdir, un/mount,
 signal sent, fork failure, time change, append client IP
 address where possible, denied RWX mmap/mprotect
 (PaX)
 ...and much more


                                           secured linux by default | www.securix.org
Grsecurity benchmark
Apache Benchmark:
This test profile measures
how many requests per
second a given system can
sustain when carrying out
700,000 requests with 100
requests being carried out
concurrently.
Source: http://grsecurity.net/~spender/benchmarks.txt

     Vanilla
     All grsecurity/PaX features enabled
     All but RBAC
     All but UDEREF
     All but KERNEXEC/UDEREF
     All but KERNEXEC/UDEREF/SANITIZE
     All but KERNEXEC/UDEREF/SANITIZE/STACKLEAK
Grsecurity benchmark
Apache Benchmark:
This test profile measures                                             11000
how many requests per
second a given system can
sustain when carrying out                                           8250
700,000 requests with 100
requests being carried out
concurrently.                                                       5500
Source: http://grsecurity.net/~spender/benchmarks.txt

     Vanilla                                                    2750
     All grsecurity/PaX features enabled
     All but RBAC
                                                        Score
     All but UDEREF                                             0
     All but KERNEXEC/UDEREF
     All but KERNEXEC/UDEREF/SANITIZE
     All but KERNEXEC/UDEREF/SANITIZE/STACKLEAK
Why not SELinux?

build as Linux Security Module (LSM)
doesn't contain features as Grsecurity (NX, ASLR, DoS
and fingerprint mitigation, entropy pools, auditing, ...)
complicated policy & no learning mode
worse performance in benchmark tests
developed and maintained by NSA (“Big Brother”)



                                          secured linux by default | www.securix.org
Securix GNU/Linux




                    secured linux by default | www.securix.org
Securix GNU/Linux
follow “best practices” and standards with high focus on security and
performance

all services and system configuration secured by default

own monitoring system which can fix or inform administrator about
problems by email or motd (rkhunter, checksec.sh, secxmon.sh,
secxwatch.sh, XCCDF, OVAL, ...)

update tool which can align system with current Securix configuration

actively implement protection against new attack vectors (via update
tool) where applicable


                                                  secured linux by default | www.securix.org
Securix GNU/Linux




                    secured linux by default | www.securix.org
Securix GNU/Linux
anyone can contribute or suggest improvement!

build good pre-defined RBAC policies

binaries build with SSP and PIE protection

proactive security against buffer/heap/stack overflow and exploits

every new settings must be tested on production environment

basically “it is still Hardened Gentoo” with great support on
forums, IRCs and mailing lists

...stay tuned


                                                secured linux by default | www.securix.org
Securix Installer




                    secured linux by default | www.securix.org
Securix Installer
 written in bash under GPLv3 license

 system environment check and setup

 advanced auto-partitioning with LVM and LUKS support
 (noatime, nodev, nosuid, noexec)

 auto-detection/setup of architecture, bonding, serial console, http
 proxy, profile, ...

 all you need is setup some essential variables like root passphrase,
 hostname, root mail, etc.

 following methods KISS (Keep It Simple Stupid) and DASQ (Don't Ask
 Stupid Questions)

                                                    secured linux by default | www.securix.org
Q&A?



       secured linux by default | www.securix.org
Thank you!
         Martin Čmelík
             [ cm3l1k1 ]

martin.cmelik [ at ] security-portal.cz
       www.security-portal.cz
         www.securix.org




                                          secured linux by default | www.securix.org
Links
 www.securix.org

 www.grsecurity.net

 http://pax.grsecurity.net/docs/

 http://www.gentoo.org/proj/en/hardened/

 http://en.wikibooks.org/wiki/Grsecurity

 http://www.pjvenda.net/linux/doc/pax-performance/

 www.cs.virginia.edu/~jcg8f/SELinux%20grsecurity%20paper.pdf

 www.ece.cmu.edu/~dbrumley/courses/18739c-s11/docs/aslr.pdf

 http://www.cyberciti.biz/

 ...



                                                               secured linux by default | www.securix.org
Top security stories of 2011
(by Kaspersky)




                       secured linux by default | www.securix.org
Top security stories of 2011
(by Kaspersky)


  Rise of “Hactivism” -     Sony Playstation Network
  Anonymous, LulzSec, ...   hack
  HBGary Federal Hack       Rise of Android / Mobile
                            malware
  RSA, Comodo and
  DigiNotar incident        CarrierIQ - spy and
                            monitoring tool
  Duqu (Stuxnet) -
  undetectable for years    ...we need Securix




                                     secured linux by default | www.securix.org

More Related Content

What's hot

Securing Hadoop with OSSEC
Securing Hadoop with OSSECSecuring Hadoop with OSSEC
Securing Hadoop with OSSEC
Vic Hargrave
 
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLICCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
Hoàng Hải Nguyễn
 
Nessus v6 command_line_reference
Nessus v6 command_line_referenceNessus v6 command_line_reference
Nessus v6 command_line_reference
Craig Cannon
 
Host Based Security Best Practices
Host Based Security Best PracticesHost Based Security Best Practices
Host Based Security Best Practices
webhostingguy
 
Squid Caching for Web Content Accerlation
Squid Caching for Web Content AccerlationSquid Caching for Web Content Accerlation
Squid Caching for Web Content Accerlation
rahul8590
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
railsconf
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
Buland Singh
 

What's hot (20)

Recommended Software and Modifications for Server Security
Recommended Software and Modifications for Server SecurityRecommended Software and Modifications for Server Security
Recommended Software and Modifications for Server Security
 
10 Tips for AIX Security
10 Tips for AIX Security10 Tips for AIX Security
10 Tips for AIX Security
 
Brief summary-standard-password-hashes-Aix-FreeBSD-Linux-Solaris-HP-UX-May-20...
Brief summary-standard-password-hashes-Aix-FreeBSD-Linux-Solaris-HP-UX-May-20...Brief summary-standard-password-hashes-Aix-FreeBSD-Linux-Solaris-HP-UX-May-20...
Brief summary-standard-password-hashes-Aix-FreeBSD-Linux-Solaris-HP-UX-May-20...
 
Securing Hadoop with OSSEC
Securing Hadoop with OSSECSecuring Hadoop with OSSEC
Securing Hadoop with OSSEC
 
High performance content hosting
High performance content hosting High performance content hosting
High performance content hosting
 
OTRS
OTRSOTRS
OTRS
 
Project on squid proxy in rhel 6
Project on squid proxy in rhel 6Project on squid proxy in rhel 6
Project on squid proxy in rhel 6
 
Known basic of NFV Features
Known basic of NFV FeaturesKnown basic of NFV Features
Known basic of NFV Features
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLICCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
 
Nessus v6 command_line_reference
Nessus v6 command_line_referenceNessus v6 command_line_reference
Nessus v6 command_line_reference
 
Host Based Security Best Practices
Host Based Security Best PracticesHost Based Security Best Practices
Host Based Security Best Practices
 
Squid Caching for Web Content Accerlation
Squid Caching for Web Content AccerlationSquid Caching for Web Content Accerlation
Squid Caching for Web Content Accerlation
 
Cisco Ios Suneet
Cisco Ios SuneetCisco Ios Suneet
Cisco Ios Suneet
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
 
Cisco Router and Switch Security Hardening Guide
Cisco Router and Switch Security Hardening GuideCisco Router and Switch Security Hardening Guide
Cisco Router and Switch Security Hardening Guide
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
 
Intro to Exploitation
Intro to ExploitationIntro to Exploitation
Intro to Exploitation
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
 

Viewers also liked

Operating systems security 2007 vulnerability report
Operating systems security 2007 vulnerability reportOperating systems security 2007 vulnerability report
Operating systems security 2007 vulnerability report
Ajit Gaddam
 
Operating system vulnerability and control
Operating system vulnerability and control Operating system vulnerability and control
Operating system vulnerability and control
أحلام انصارى
 

Viewers also liked (20)

20130912_mit _geordie_rose
20130912_mit _geordie_rose20130912_mit _geordie_rose
20130912_mit _geordie_rose
 
Hardening Linux Server Security
Hardening Linux Server SecurityHardening Linux Server Security
Hardening Linux Server Security
 
Linux Hardening
Linux HardeningLinux Hardening
Linux Hardening
 
Linux Security
Linux SecurityLinux Security
Linux Security
 
Security, Hack1ng and Hardening on Linux - an Overview
Security, Hack1ng and Hardening on Linux - an OverviewSecurity, Hack1ng and Hardening on Linux - an Overview
Security, Hack1ng and Hardening on Linux - an Overview
 
Securing Your Linux System
Securing Your Linux SystemSecuring Your Linux System
Securing Your Linux System
 
WordPress Security Hardening
WordPress Security HardeningWordPress Security Hardening
WordPress Security Hardening
 
Getting started with GrSecurity
Getting started with GrSecurityGetting started with GrSecurity
Getting started with GrSecurity
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Application
 
Protection in Operating System Layer
Protection in Operating System LayerProtection in Operating System Layer
Protection in Operating System Layer
 
Unitrends Sales Presentation 2010
Unitrends Sales Presentation 2010Unitrends Sales Presentation 2010
Unitrends Sales Presentation 2010
 
Operating systems security 2007 vulnerability report
Operating systems security 2007 vulnerability reportOperating systems security 2007 vulnerability report
Operating systems security 2007 vulnerability report
 
Jaundice
Jaundice Jaundice
Jaundice
 
Application hardening, Secure Socket Layer(SSL) & Secure Electronic Transacti...
Application hardening, Secure Socket Layer(SSL) & Secure Electronic Transacti...Application hardening, Secure Socket Layer(SSL) & Secure Electronic Transacti...
Application hardening, Secure Socket Layer(SSL) & Secure Electronic Transacti...
 
Operating system vulnerability and control
Operating system vulnerability and control Operating system vulnerability and control
Operating system vulnerability and control
 
Introduction To Linux Security
Introduction To Linux SecurityIntroduction To Linux Security
Introduction To Linux Security
 
Security Configuration Management for Dummies
Security Configuration Management for DummiesSecurity Configuration Management for Dummies
Security Configuration Management for Dummies
 
How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?
 
Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyone
 
Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in Linux
 

Similar to Hardening Linux and introducing Securix Linux

Secure development on Kubernetes by Andreas Falk
Secure development on Kubernetes by Andreas FalkSecure development on Kubernetes by Andreas Falk
Secure development on Kubernetes by Andreas Falk
SBA Research
 

Similar to Hardening Linux and introducing Securix Linux (20)

Hardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/LinuxHardening Linux, introducing Securix GNU/Linux
Hardening Linux, introducing Securix GNU/Linux
 
Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009
 
System Integrity
System IntegritySystem Integrity
System Integrity
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & docker
 
Cl116
Cl116Cl116
Cl116
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in Linux
 
SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
 
Securing Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container PlatformSecuring Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container Platform
 
Security on a Container Platform
Security on a Container PlatformSecurity on a Container Platform
Security on a Container Platform
 
Securing Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container PlatformSecuring Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container Platform
 
Ubuntu 16.04 LTS Security Features
Ubuntu 16.04 LTS Security FeaturesUbuntu 16.04 LTS Security Features
Ubuntu 16.04 LTS Security Features
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
 
Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware ARM hypervisor
Sierraware ARM hypervisor
 
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century ThreatsLinux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
 
Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn
Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn
Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisor
 
Linux Security Overview
Linux Security OverviewLinux Security Overview
Linux Security Overview
 
Secure development on Kubernetes by Andreas Falk
Secure development on Kubernetes by Andreas FalkSecure development on Kubernetes by Andreas Falk
Secure development on Kubernetes by Andreas Falk
 

More from Security Session

More from Security Session (20)

Getting your hands dirty: How to Analyze the Behavior of Malware Traffic / SE...
Getting your hands dirty: How to Analyze the Behavior of Malware Traffic / SE...Getting your hands dirty: How to Analyze the Behavior of Malware Traffic / SE...
Getting your hands dirty: How to Analyze the Behavior of Malware Traffic / SE...
 
Základy reverse engineeringu a assembleru / KAREL LEJSKA, MILAN BARTOŠ [DEFEN...
Základy reverse engineeringu a assembleru / KAREL LEJSKA, MILAN BARTOŠ [DEFEN...Základy reverse engineeringu a assembleru / KAREL LEJSKA, MILAN BARTOŠ [DEFEN...
Základy reverse engineeringu a assembleru / KAREL LEJSKA, MILAN BARTOŠ [DEFEN...
 
Zabezpečení nejen SSH na serveru pomocí Fail2Ban a jednoduchého honeypotu. / ...
Zabezpečení nejen SSH na serveru pomocí Fail2Ban a jednoduchého honeypotu. / ...Zabezpečení nejen SSH na serveru pomocí Fail2Ban a jednoduchého honeypotu. / ...
Zabezpečení nejen SSH na serveru pomocí Fail2Ban a jednoduchého honeypotu. / ...
 
Insights of a brute-forcing botnet / VERONICA VALEROS [CISCO]
Insights of a brute-forcing botnet / VERONICA VALEROS [CISCO]Insights of a brute-forcing botnet / VERONICA VALEROS [CISCO]
Insights of a brute-forcing botnet / VERONICA VALEROS [CISCO]
 
Softwarove protektory / KAREL LEJSKA, MILAN BARTOŠ [DEFENDIO]
Softwarove protektory / KAREL LEJSKA, MILAN BARTOŠ [DEFENDIO]Softwarove protektory / KAREL LEJSKA, MILAN BARTOŠ [DEFENDIO]
Softwarove protektory / KAREL LEJSKA, MILAN BARTOŠ [DEFENDIO]
 
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
 
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
 
#ochranadat pred sebou samotným / MATEJ ZACHAR [SAFETICA TECHNOLOGIES S.R.O.]
#ochranadat pred sebou samotným / MATEJ ZACHAR [SAFETICA TECHNOLOGIES S.R.O.]#ochranadat pred sebou samotným / MATEJ ZACHAR [SAFETICA TECHNOLOGIES S.R.O.]
#ochranadat pred sebou samotným / MATEJ ZACHAR [SAFETICA TECHNOLOGIES S.R.O.]
 
Co vše skrývá síťový provoz a jak detekovat kybernetické hrozby? / MARTIN ŠKO...
Co vše skrývá síťový provoz a jak detekovat kybernetické hrozby? / MARTIN ŠKO...Co vše skrývá síťový provoz a jak detekovat kybernetické hrozby? / MARTIN ŠKO...
Co vše skrývá síťový provoz a jak detekovat kybernetické hrozby? / MARTIN ŠKO...
 
Bezpečnější pošta díky protokolu DANE / ONDŘEJ CALETKA [CESNET]
Bezpečnější pošta díky protokolu DANE / ONDŘEJ CALETKA [CESNET]Bezpečnější pošta díky protokolu DANE / ONDŘEJ CALETKA [CESNET]
Bezpečnější pošta díky protokolu DANE / ONDŘEJ CALETKA [CESNET]
 
Prezentace brno
Prezentace brnoPrezentace brno
Prezentace brno
 
OSINT and beyond
OSINT and beyondOSINT and beyond
OSINT and beyond
 
Exploitace – od minulosti po současnost - Jan Kopecký
Exploitace – od minulosti po současnost - Jan KopeckýExploitace – od minulosti po současnost - Jan Kopecký
Exploitace – od minulosti po současnost - Jan Kopecký
 
Kontrola uživatelských účtů ve Windows a jak ji obejít - Martin Dráb
Kontrola uživatelských účtů ve Windows a jak ji obejít - Martin DrábKontrola uživatelských účtů ve Windows a jak ji obejít - Martin Dráb
Kontrola uživatelských účtů ve Windows a jak ji obejít - Martin Dráb
 
Research in Liveness Detection - Martin Drahanský
Research in Liveness Detection - Martin DrahanskýResearch in Liveness Detection - Martin Drahanský
Research in Liveness Detection - Martin Drahanský
 
Dolování dat z řeči pro bezpečnostní aplikace - Jan Černocký
Dolování dat z řeči pro bezpečnostní aplikace - Jan ČernockýDolování dat z řeči pro bezpečnostní aplikace - Jan Černocký
Dolování dat z řeči pro bezpečnostní aplikace - Jan Černocký
 
Turris - Robert Šefr
Turris - Robert ŠefrTurris - Robert Šefr
Turris - Robert Šefr
 
Co se skrývá v datovém provozu? - Pavel Minařík
Co se skrývá v datovém provozu? - Pavel MinaříkCo se skrývá v datovém provozu? - Pavel Minařík
Co se skrývá v datovém provozu? - Pavel Minařík
 
Jak odesílat zprávy, když někdo vypne Internet - Pavel Táborský
Jak odesílat zprávy, když někdo vypne Internet - 	Pavel TáborskýJak odesílat zprávy, když někdo vypne Internet - 	Pavel Táborský
Jak odesílat zprávy, když někdo vypne Internet - Pavel Táborský
 
Two Years with botnet Asprox - Michal Ambrož
Two Years with botnet Asprox - Michal AmbrožTwo Years with botnet Asprox - Michal Ambrož
Two Years with botnet Asprox - Michal Ambrož
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Recently uploaded (20)

Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Hardening Linux and introducing Securix Linux

  • 2. Hardening basics From lowest to highest level Tune every part of system and applications Follow standards and security policies Regularly check system health Install security patches when possible Log and audit every action secured linux by default | www.securix.org
  • 3. Physical security Locked rack BIOS setup password Console in different rack // How it helps? Avoid unauthorized access where somebody can: - shutdown server - reboot server into single-user mode and change password - boot live CD and access data - sniff data on ethernet cable - steal hard disks
  • 4. Encrypting partitions its essential to have encrypted all partitions except /boot and swap ( / , usr, home, var, opt, tmp) no impact on resources where is HW acceleration possible my recommendation is LUKS cryptsetup -c aes-xts-plain -y -s 512 -h whirlpool luksFormat /dev/xyz // How it helps? data stored are unreadable for attacker passwords can’t be changed during boot from live CD secured linux by default | www.securix.org
  • 5. Securing Grub protect grub using password password --md5 $1$Ul0TR0$fK/7jE2gCbkBAnzBQWWYf/ generate hash using grub-md5-crypt protect single-user boot via password as well setup fallback option // How it helps? avoid unauthorized single-user mode boot fallback in case of problems with new kernel secured linux by default | www.securix.org
  • 6. Kernel configuration enabled only options which are really needed - smaller/faster kernel - secure - big piece of code isn't really needed enabled PaX and Grsecurity - no LSM - robust multi-level security system Securix have minimalistic predefined kernel setup which should boot on many systems by default secured linux by default | www.securix.org
  • 7. /etc/securetty limit root access to console and serial port only # file: /etc/securetty # limit root access console vc/1 tty1 tty2 # serial console access ttyS0 ttyS1 ... secured linux by default | www.securix.org
  • 8. Use phrases, not passwords
  • 9. Use phrases, not passwords
  • 10. /etc/sysctl.conf build with focus on security and network stack tuning some examples: # Kernel EXEC shield kernel.exec-shield = 1 # Make the addresses of mmap base, stack, heap and VDSO page randomized kernel.randomize_va_space = 2 # Reboot system when kernel panic occur, oops will wait 30 seconds untill call panic() kernel.panic = 30 kernel.panic_on_oops = 30 # Disable magic-sysrq key kernel.sysrq = 0 secured linux by default | www.securix.org
  • 11. /etc/sysctl.conf # Prevent SYN attack net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.tcp_syn_retries = 5 net.ipv4.tcp_synack_retries = 2 # Enable IP spoofing protection, turn on source route verification net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 # Increase allowed local port range net.ipv4.ip_local_port_range = 1024 64000 # Enable tcp_window_scaling net.ipv4.tcp_window_scaling = 1 ...and much more secured linux by default | www.securix.org
  • 12. iptables configuration script for pushing/editing/saving firewall rules port scan detection access logging traffic divided into chains strict default policy secured linux by default | www.securix.org
  • 13. /etc/security/limits.conf # default limits * soft core 0 * hard core 0 * hard nproc 200 * hard nofile 2000 * hard fsize 1024000 * - maxlogins 3 # operator group limits @operators hard nproc 2000 @operators hard nofile 4000 @operators hard fsize 10240000 @operators - maxlogins 10 # service group limits @services hard nproc 40000 @services hard nofile 45000 @services hard fsize 1024000000 @services - maxlogins 100 secured linux by default | www.securix.org
  • 14. /etc/ssh/sshd_config Port 55522 Protocol 2 ServerKeyBits 2048 Ciphers aes256-cbc,aes256-ctr,blowfish-cbc Compression yes ClientAliveInterval 15 ClientAliveCountMax 3 TCPKeepAlive no PermitRootLogin no PermitEmptyPasswords no UsePrivilegeSeparation yes StrictModes yes AllowTcpForwarding no X11Forwarding no GatewayPorts no ... secured linux by default | www.securix.org
  • 15. PaX - NOEXEC The goal of NOEXEC is to prevent the injection and execution of code into a task's address space and render this exploit technique unusable under PaX. - segmentation based non-executable page protection [IA-32 only] (SEGMEXEC) - paging based non-executable page protection (PAGEEXEC) - mmap() and mprotect() restrictions (MPROTECT) secured linux by default | www.securix.org
  • 16. Pax - ASLR decrease success rate of attacks that require advanced knowledge of memory addresses via Address Space Layout Randomization (ASLR) - Main executable code/data/bss segment base address randomization (RANDEXEC) - ET_EXEC ELF - mmap() and brk() managed memory [libraries, heap, thread stacks, shared memory, etc] address randomization (RANDMMAP) ET_DYN ELF - User stack base address randomization (RANDUSTACK) - Kernel stack base address randomization (RANDKSTACK) secured linux by default | www.securix.org
  • 17. Grsecurity “Unlike other expensive security "solutions" that pretend to achieve security through known-vulnerability patching, signature-based detection, or other reactive methods, grsecurity provides real proactive security. The only solution that hardens both your applications and operating system, grsecurity is essential for public-facing servers and shared-hosting environments. Grsecurity increased authentication for administrators, audit important system events, and confine your system with no manual configuration through advanced Role-Based Access Control.” secured linux by default | www.securix.org
  • 18. Grsecurity - features high scalable Role-Based Access Control learning mode for RBAC policies restrict access to /dev/kmem, /proc/<pid>/maps, /proc, kernel processes, linking, FIFO, dmesg, IO, ptrace, ... trusted path execution hardened chroot environment fork bomb protection & randomized PIDs secured linux by default | www.securix.org
  • 19. Grsecurity - features 2 network protections - randomized IP IDs, larger entropy pools, random TCP sequence numbers, randomized TCP source ports, tcp/udp blackhole, altered ping payload, socket restrictions, ... auditing - exec & chroot exec, ptrace, chdir, un/mount, signal sent, fork failure, time change, append client IP address where possible, denied RWX mmap/mprotect (PaX) ...and much more secured linux by default | www.securix.org
  • 20. Grsecurity benchmark Apache Benchmark: This test profile measures how many requests per second a given system can sustain when carrying out 700,000 requests with 100 requests being carried out concurrently. Source: http://grsecurity.net/~spender/benchmarks.txt Vanilla All grsecurity/PaX features enabled All but RBAC All but UDEREF All but KERNEXEC/UDEREF All but KERNEXEC/UDEREF/SANITIZE All but KERNEXEC/UDEREF/SANITIZE/STACKLEAK
  • 21. Grsecurity benchmark Apache Benchmark: This test profile measures 11000 how many requests per second a given system can sustain when carrying out 8250 700,000 requests with 100 requests being carried out concurrently. 5500 Source: http://grsecurity.net/~spender/benchmarks.txt Vanilla 2750 All grsecurity/PaX features enabled All but RBAC Score All but UDEREF 0 All but KERNEXEC/UDEREF All but KERNEXEC/UDEREF/SANITIZE All but KERNEXEC/UDEREF/SANITIZE/STACKLEAK
  • 22. Why not SELinux? build as Linux Security Module (LSM) doesn't contain features as Grsecurity (NX, ASLR, DoS and fingerprint mitigation, entropy pools, auditing, ...) complicated policy & no learning mode worse performance in benchmark tests developed and maintained by NSA (“Big Brother”) secured linux by default | www.securix.org
  • 23. Securix GNU/Linux secured linux by default | www.securix.org
  • 24. Securix GNU/Linux follow “best practices” and standards with high focus on security and performance all services and system configuration secured by default own monitoring system which can fix or inform administrator about problems by email or motd (rkhunter, checksec.sh, secxmon.sh, secxwatch.sh, XCCDF, OVAL, ...) update tool which can align system with current Securix configuration actively implement protection against new attack vectors (via update tool) where applicable secured linux by default | www.securix.org
  • 25. Securix GNU/Linux secured linux by default | www.securix.org
  • 26. Securix GNU/Linux anyone can contribute or suggest improvement! build good pre-defined RBAC policies binaries build with SSP and PIE protection proactive security against buffer/heap/stack overflow and exploits every new settings must be tested on production environment basically “it is still Hardened Gentoo” with great support on forums, IRCs and mailing lists ...stay tuned secured linux by default | www.securix.org
  • 27. Securix Installer secured linux by default | www.securix.org
  • 28. Securix Installer written in bash under GPLv3 license system environment check and setup advanced auto-partitioning with LVM and LUKS support (noatime, nodev, nosuid, noexec) auto-detection/setup of architecture, bonding, serial console, http proxy, profile, ... all you need is setup some essential variables like root passphrase, hostname, root mail, etc. following methods KISS (Keep It Simple Stupid) and DASQ (Don't Ask Stupid Questions) secured linux by default | www.securix.org
  • 29. Q&A? secured linux by default | www.securix.org
  • 30. Thank you! Martin Čmelík [ cm3l1k1 ] martin.cmelik [ at ] security-portal.cz www.security-portal.cz www.securix.org secured linux by default | www.securix.org
  • 31. Links www.securix.org www.grsecurity.net http://pax.grsecurity.net/docs/ http://www.gentoo.org/proj/en/hardened/ http://en.wikibooks.org/wiki/Grsecurity http://www.pjvenda.net/linux/doc/pax-performance/ www.cs.virginia.edu/~jcg8f/SELinux%20grsecurity%20paper.pdf www.ece.cmu.edu/~dbrumley/courses/18739c-s11/docs/aslr.pdf http://www.cyberciti.biz/ ... secured linux by default | www.securix.org
  • 32. Top security stories of 2011 (by Kaspersky) secured linux by default | www.securix.org
  • 33. Top security stories of 2011 (by Kaspersky) Rise of “Hactivism” - Sony Playstation Network Anonymous, LulzSec, ... hack HBGary Federal Hack Rise of Android / Mobile malware RSA, Comodo and DigiNotar incident CarrierIQ - spy and monitoring tool Duqu (Stuxnet) - undetectable for years ...we need Securix secured linux by default | www.securix.org