Securing Your Linux System

31
Securing Your Linux System Hardening and Tweaking Your SUSE® Linux Enterprise Server Roman Drahtmüller Linux Security Architect [email protected]

description

This session provides a schematic overview of the security properties, architecture, tweaks and settings of a SUSE Linux Enterprise 11 installation. It will also deliver a systematic, hands-on experience for analyzing and adjusting these security properties. This session will cover both networked and non-networked security properties, and may be applied to both the desktop and the server use of the system.

Transcript of Securing Your Linux System

Page 1: Securing Your Linux System

Securing Your Linux SystemHardening and Tweaking Your SUSE® Linux Enterprise Server

Roman DrahtmüllerLinux Security [email protected]

Page 2: Securing Your Linux System

© Novell, Inc. All rights reserved.2

Overview

What? and Why?

Architecture Dive: Inspection

Tools

Page 3: Securing Your Linux System

What? and Why?What Should “Security” Be?

Page 4: Securing Your Linux System

© Novell, Inc. All rights reserved.4

What is Security?

Good software...

...does what you expect it to do, and does it well.

Secure software...

...is good software that does nothing else.

Page 5: Securing Your Linux System

© Novell, Inc. All rights reserved.5

...So What to Do?

Software contains errors

Malfunctions

Crashes

Downtime

Security Vulnerabilities

Data loss and disclosure, identity theft, system abuse, privilege transition

Page 6: Securing Your Linux System

© Novell, Inc. All rights reserved.6

Zoom Views

AdministrationPurpose, responsibilities, mandates, team play

InfrastructureNetwork and network boundaries, services

Security ZonesAssets and protection, domains, domain transitions

SystemsDeployment, installation, configuration (hardening),

monitoring, maintenance decommissioning

Page 7: Securing Your Linux System

© Novell, Inc. All rights reserved.7

Zoom Views

AdministrationPurpose, responsibilities, mandates, team play

InfrastructureNetwork and network boundaries, services

Security ZonesAssets and protection, domains, domain transitions

SystemsDeployment, installation, configuration (hardening),

monitoring, maintenance decommissioning

Page 8: Securing Your Linux System

Inspection, Configuration, Hardening

Page 9: Securing Your Linux System

© Novell, Inc. All rights reserved.9

Admin Network

InnerNetworks

DMZ 0

DMZ 1

Shu

ttle

Net

wor

ks

Page 10: Securing Your Linux System

© Novell, Inc. All rights reserved.10

Page 11: Securing Your Linux System

© Novell, Inc. All rights reserved.11

Page 12: Securing Your Linux System

© Novell, Inc. All rights reserved.12

Page 13: Securing Your Linux System

© Novell, Inc. All rights reserved.13

Page 14: Securing Your Linux System

© Novell, Inc. All rights reserved.14

Page 15: Securing Your Linux System

© Novell, Inc. All rights reserved.15

Page 16: Securing Your Linux System

© Novell, Inc. All rights reserved.16

Page 17: Securing Your Linux System

© Novell, Inc. All rights reserved.17

Page 18: Securing Your Linux System

© Novell, Inc. All rights reserved.18

Page 19: Securing Your Linux System

© Novell, Inc. All rights reserved.19

...What It Does in the Background...

Run another Yast module

Change settings in files in /etc/sysconfig

Modify configuration files directly

Page 20: Securing Your Linux System

© Novell, Inc. All rights reserved.20

aic7xxxSCSIPCI

Schematical Overview: O/S Kernel + UserlandH

uman

Physics/Electronics

Kernel-landdrivers,kernel threads

User-landprocesses

VFSreiserfsext3 vfat NFS

SCSIsgsdeth0 Li

brar

ies

Shel

l

(mount table)

system callsdevice files

proc, sys KDE

UDPICMPTCP

opp0

IP

BT USB Serial

Page 21: Securing Your Linux System

© Novell, Inc. All rights reserved.21

Inspection...

Approach your system as if you were an attacker:

network ports services processes files kernel

Page 22: Securing Your Linux System

© Novell, Inc. All rights reserved.22

Network

Interface addresses: all interfaces enabled and conn.?

Routing setup: IP-forwarding on/off?

Netfilter rules: active, any?

Other tweakables:

txqueuelen, mtu

ICMP replies, ICMP redirects

ECN

slow-start

Page 23: Securing Your Linux System

© Novell, Inc. All rights reserved.23

Ports

port scan: Open TCP and UDP socketsnmap -sS -v -O ip.address.on.network

Compare to output ofnetstat -anpl

Discrepancies...?(Not all services are userland process bound! (knfsd))

Watch out for UDP sockets!

Page 24: Securing Your Linux System

© Novell, Inc. All rights reserved.24

Services

Disable all services that are not needed, permanently

Remove the runlevel symlinks (insserv -r <servicename>)

Kill the servers (rcapache2 stop)

Verify if they the services are really dead! :)

Remove the packages from the system?

Page 25: Securing Your Linux System

© Novell, Inc. All rights reserved.25

Processes

Get to know all processes on your system in person...

ps faux

rpm -qfi /usr/sbin/nscd

...and deactivate whatever is not needed running.

Page 26: Securing Your Linux System

© Novell, Inc. All rights reserved.26

Files

Permissions: /etc/permissions* from /etc/sysconfig/securityUse chkstat -set <permissions file> or SuSEconfigfind / /usr ... -mount -type f \( -perm +2000 -o -perm +4000 \) -ls

Integrity measures: wireshark, RPMmaintain offsite RPM database backup for rpm -Vamaintain wireshark database

Mount options: /etc/fstab, /proc/mounts

Page 27: Securing Your Linux System

© Novell, Inc. All rights reserved.27

Kernel: Use AppArmor!

Example profile: dhcp client daemon#include <tunables/global>

/usr/sbin/dhcpd { #include <abstractions/base> #include <abstractions/nameservice>

capability dac_override, capability net_bind_service, capability net_raw, capability setgid, capability setuid, capability sys_chroot,

/db/dhcpd.leases* lrw, /etc/dhcpd.conf r, /etc/hosts.allow r, /etc/hosts.deny r, /usr/sbin/dhcpd rmix, /var/lib/dhcp/dhcpd.leases* rwl, /var/lib/dhcp/etc/dhcpd.conf r, /var/run/dhcpd.pid wl,}

Page 28: Securing Your Linux System

Tools

Page 29: Securing Your Linux System

© Novell, Inc. All rights reserved.29

Tools

The YaST Security Center

The YaST AppArmor profile generator

Integrity: Wireshark and RPM

Port Scanner: nmap

Vulnerability scanner: nessus

Page 30: Securing Your Linux System
Page 31: Securing Your Linux System

Unpublished Work of Novell, Inc. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.

General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for Novell products remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.