Server Hardening Moses Ike and Paul Murley TexSAW 2015 Credit to Daniel Waymel and Corrin Thompson.

Slides:



Advertisements
Similar presentations
CSCI 530 Lab Firewalls. Overview Firewalls Capabilities Limitations What are we limiting with a firewall? General Network Security Strategies Packet Filtering.
Advertisements

Chapter 10: Data Centre and Network Security Proxies and Gateways * Firewalls * Virtual Private Network (VPN) * Security issues * * * * Objectives:
Web Server Administration TEC 236 Securing the Web Environment.
Web Server Administration Chapter 10 Securing the Web Environment.
Security Presented by : Qing Ma. Introduction Security overview security threats password security, encryption and network security as specific.
FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. 6 Packet Filtering By Whitman, Mattord, & Austin© 2008 Course Technology.
Beyond Security Ltd. Port Knocking Beyond Security Noam Rathaus CTO Sunday, July 11, 2004 Presentation on.
Payment Card Industry (PCI) Data Security Standard
© 2010 VMware Inc. All rights reserved VMware ESX and ESXi Module 3.
Remote access and file transfer Getting files on and off Bio-Linux.
Ssh: secure shell. overview Purpose Protocol specifics Configuration Security considerations Other uses.
4-1 PSe_4Konf.503 EAGLE Getting Started and Configuration.
Course 201 – Administration, Content Inspection and SSL VPN
Securing Windows 7 Lesson 10. Objectives Understand authentication and authorization Configure password policies Secure Windows 7 using the Action Center.
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
Chapter 14: Remote Server Administration BAI617. Chapter Topics Configure Windows Server 2008 R2 servers for remote administration Remotely connect to.
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
Chapter 6: Packet Filtering
Csci5233 Computer Security1 Bishop: Chapter 27 System Security.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Application Layer Functionality and Protocols.
SCSC 455 Computer Security Network Security. Control access to system Access control mechanisms in specific network programs  e.g. 1, wu-FTP server support.
Honeypot and Intrusion Detection System
OV Copyright © 2013 Logical Operations, Inc. All rights reserved. Network Security  Network Perimeter Security  Intrusion Detection and Prevention.
FIREWALLS Prepared By: Hilal TORGAY Uğurcan SOYLU.
Chapter 1: The Internet and the WWW CIS 275—Web Application Development for Business I.
| nectar.org.au NECTAR TRAINING Module 5 The Research Cloud Lifecycle.
OV Copyright © 2011 Element K Content LLC. All rights reserved. Network Security  Network Perimeter Security  Intrusion Detection and Prevention.
Implementing a Port Knocking System in C Honors Thesis Defense by Matt Doyle.
AE6382 Secure Shell Usually referred to as ssh, the name refers to both a program and a protocol. The program ssh is one of the most useful networking.
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
User Access to Router Securing Access.
Linux Networking Security Sunil Manhapra & Ling Wang Project Report for CS691X July 15, 1998.
1 Quick Overview Overview Network –IPTables –Snort Intrusion Detection –Tripwire –AIDE –Samhain Monitoring & Configuration –Beltaine –Lemon –Prelude Conclusions.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
1 © 2005 Cisco Systems, Inc. All rights reserved. 111 © 2004, Cisco Systems, Inc. All rights reserved. CNIT 221 Security 1 ver.2 Module 6 City College.
Integrating and Troubleshooting Citrix Access Gateway.
Linux Security. Module 13 – Linux Security ♦ Overview Linux is more prone today to security loopholes and attacks, both inside and outside the network.
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
ORAFACT The Secure Shell. ORAFACT Secure Shell Replaces unencrypted utilities rlogin and telnet rsh rcp Automates X11 authentication Supports tunneling.
Operating Systems Proj.. Background A firewall is an information technology (IT) security device which is configured to permit, deny or proxy data connections.
Security and Firewalls Ref: Keeping Your Site Comfortably Secure: An Introduction to Firewalls John P. Wack and Lisa J. Carnahan NIST Special Publication.
Linux Services Configuration
XWN740 X-Windows Configuring and Using Remote Access (Chapter 13: Pages )‏
Firewalls Group 11Group 12 Bryan Chapman Richard Dillard Rohan Bansal Huang Chen Peijie Shen.
CITA 310 Section 9 Securing the Web Environment (Textbook Chapter 10)
| nectar.org.au NECTAR TRAINING Module 5 The Research Cloud Lifecycle.
Module 10: Windows Firewall and Caching Fundamentals.
Web Server Administration Chapter 10 Securing the Web Environment.
Understand Network Isolation Part 2 LESSON 3.3_B Security Fundamentals.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
SSH. 2 SSH – Secure Shell SSH is a cryptographic protocol – Implemented in software originally for remote login applications – One most popular software.
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
Chapter 14.  Upon completion of this chapter, you should be able to:  Identify different types of Intrusion Detection Systems and Prevention Systems.
Chapter 8.  Upon completion of this chapter, you should be able to:  Understand the purpose of a firewall  Name two types of firewalls  Identify common.
Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
Securing your network But still be able to access it Hugh Mahon.
Ssh: secure shell.
FIREWALL configuration in linux
Securing the Network Perimeter with ISA 2004
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
Chapter 27: System Security
Lab 7 - Topics Establishing SSH Connection Install SSH Configure SSH
Securing Windows 7 Lesson 10.
Firewall Installation
Designing IIS Security (IIS – Internet Information Service)
Computer Networks Protocols
Presentation transcript:

Server Hardening Moses Ike and Paul Murley TexSAW 2015 Credit to Daniel Waymel and Corrin Thompson

Outline Introduction Securing Your Access Restrict Unwanted Access Monitoring and Alerts Note: Slides provide a good basic overview of material covered, but in-person demos will be important to a full understanding.

Systems Linux (Ubuntu 14.04) Server Always on Always connected to the internet Client used to administer server Could be anything, we will use Ubuntu 14.04

Objectives Understand how to: Configure secure remote access Defend against basic network based attacks Configure remote alerts and monitoring Apply concepts we talk about in new and exciting ways

Securing Your Access

Objectives Access your system securely and reliably via a command shell Provide basic authentication measures to prevent others from accessing your server We will look at telnet (bad) and SSH (good) Other relevant protocols: SFTP (Secure File Transfer Protocol) HTTPS (Secure Hypertext Transfer Protocol) RDP (Remote Desktop Protocol)

First Thing’s First Basic server access Maybe physical access available Maybe not! In any case, we need to have a user on our server: # adduser # adduser sudo

Telnet – The “Old School” Solution Username/Password authentication Grants shell on remote computer *** TELNET IS COMPLETELY UNENCRYPTED! *** Why do we care?

SSH – A Better Solution SSH (Secure Shell) provides telnet functionality through an encrypted tunnel You can authenticate with a password, crypto keys, or both (more on this in a minute) Highly configurable based on your needs

Securing SSH Restrict access via ssh: # nano /etc/ssh/sshd_config Additional lines: # PermitRootLogin no Disallows ssh access for root account

Securing SSH – Password SSH must be installed on server “sudo apt-get install ssh” (while connected to internet) Client must know username, password, and IP of server

Securing SSH – RSA Keys

On client system: $ ssh-keygen –t rsa Now hit enter a few times… $ cd ~/.ssh $ ls You should see at least two important files: id_rsa (private key file) Id_rsa.pub (public key file)

Securing SSH – RSA Keys How do we let the server know it should trust the client? By giving the server the public key of the client! Trusted public keys should go in : ~/.ssh/authorized_keys How do we do this?

Restricting Unwanted Access

Objectives Be reasonably confident that unauthorized access will be unsuccessful We will look at: Lockout of IP addresses following failed access attempts Basic firewall configuration (iptables) Security by Obscurity: using knockd Other related topics: Network Intrusion Detection and Prevention Systems (IDS/IPS)

FAIL2BAN Block bad SSH attempts Fail2ban allows easy lockouts following failed connection attempts. Uses Iptables. Sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local Sudo services fail2ban restart Can edit jail.local to make changes Enable for more services besides SSH Change ban time Change allowed attempts Whitelist IPs Send alerts by (or SMS via -to-SMS gateway)

Firewalling Concept Two main approaches: Specify what to allow ( Whitelisting ) Allow only these IP addresses Specify what to not allow ( Blacklisting ) Allow all except these IP addresses In this scenario, whitelist is easy and more effective

IPTABLES Firewall rules that runs with kernel privileges Firewall sits between your machine and the external world Rules are evaluated top-down. The first rule that fits is applied, and the rest rules are ignored This means that ordering of rules is important

IPTABLES RULES ALLOW SSH CONNECTIONS iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT ALLOW SSH CONNECTION FROM A SPECIFIC NETWORK iptables -A INPUT -i eth0 -p tcp -s /24 --dport 22 -m state -- state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT

Rule ordering is important ! ALLOW only HTTP and SSH iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT Iptables –A INPUT –I eth0 –p tcp –j DENY iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT

Authentication Three possible ways to authenticate Something you know. (e.g. password) Something you have. (e.g. crypto card) Something you are. (e.g. physical identifiers, fingerprints) Single-Factor Authentication: choose one type of the above Two-Factor Authentication: choose two types above

PORT KNOCKING ADDING ANOTHER LAYER OF SECURITY Port Knocking is similar to two-factor authentication Our example case SSH is the only service we are running All ports are closed Requesting a connection (which will be refused as all ports are closed) on a pre-determined sequence of ports within a specified time period will open the port for SSH The port closes automatically after the allowed window has passed

PORT KNOCKING ADDING ANOTHER LAYER OF SECURITY For our scenario Must “Knock” on three ports in sequence within a 10 second period. Standard SSH port 22 will open for 10 seconds receiving connection attempts before closing automatically Security through Obscurity ??

PORT KNOCKING SETTING UP PORT KNOCKING sudo apt-get install knockd This will install both the knockd daemon, as well as the knock utility Default configuration is to have one knock sequence to open a port, and another sequence to close the port Problem: What if you forget to close it?

Monitoring and Alerts

Objectives Increase awareness of important events on the remote system We will look at Automated /SMS alerts System Logs Other related topics Anti-Virus Host-based IDS

Sending Notification SMTP CONFIGURATION Monitoring for events and logging is good, but only if those logs and events are known Failed access attempts (SSH in our case) Unexpected system changes (flagged by IDS, such as tripwire) Benign events Task has completed Message received (ex. IRC)..

Sending Notifications SSMTP CONFIGURATION Ssmtp can be used to easily send notifications For this scenario: Create a gmail account to use for sending Configure ssmtp on the system to use that account Create a script to streamline sending notifications

SYSTEM LOGS TRACKING EVENTS Some logs related to topics covered /var/log/auth.log /var/log/syslog /var/log/fail2ban.log /var/log/mail.log ~/portknock.log Useful tool to determine what has happened on a given system. Acts as timeline of events, unauthorized access, etc

RECAP Covered the following Securing remote access Root Login, Public-key Login Restricting unauthorized access Configure Lockouts after bad access attempts, basic firewall rules, and a means of adding more layers of defense Setting up notification of system events Setup /SMS alerts Brief Look at system logs What about a Windows system? Tablets, notebooks, etc (Discussion)

Recap Covered the following for a Linux system: Securing (individual) remote access Login using on-root account using keyfiles only; no remote root access permitted Restricting unwanted access Configure lockouts after bad access attempts, basic firewall rules, and a means of adding more layers of defense Setting up notification of system events Setup /SMS alerts; discussed means of system changes triggering alerts Brief look at system logs What about a Windows system? Portable systems (tablets, notebooks, etc)?