Linux Security 2016 GenCyber JMU Bootcamp for High School Teachers.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

1 Introduction to UNIX Ke Liu
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 10 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Guide To UNIX Using Linux Fourth Edition
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
The file structure and related utilities CS240 Computer Science II.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Hacking Linux Systems.  Text Editors  vi, ex, pico, jove, GNU emacs  Shells  chs (C Shell), sh (Bourne Shell)  File navigation  cd, ls, cp, mv,
Unix Basics Chapter 4.
2INC0 Operating Systems Introduction to Linux
A few Linux basics Network Monitoring & Management.
Unix Operating Systems Module 7. Unix Operating System Versions Basic Information User and Group Settings File Permissions Local Firewall Local Security.
Linux+ Guide to Linux Certification, Second Edition
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
Linux Introduction What is Linux? How do you use it?
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
Chapter Two Exploring the UNIX File System and File Security.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
Linux Commands C151 Multi-User Operating Systems.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
SCSC 455 Computer Security Chapter 3 User Security.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
Learning basic Unix command It 325 operating system.
Embedded Software Design Week II Linux Intro Linux Kernel.
Ubuntu Checklist. 1.Examine the ReadMe.txt file 2.Manage user and root passwords – sudo passwd change password of username –Change password policies in.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Linux Filesystem Management
AFA CyberCamp Module 4. Day One Cyber Safety Day Two Windows System Administration Day Three Intermediate Windows Security Day Four Intro to Linux and.
EE516: Embedded Software Project 1
Getting started with CentOS Linux
Linux 101 Training Module Linux Basics.
Linux file system "On a UNIX system, everything is a file;
Basic Commands ls cp ls –l (in detail format) echo ls –a
Chapter 11: Managing Users
C151 Multi-User Operating Systems
The Linux Operating System
9 Linux on the Desktop.
Introduction to UNIX.
Exploring the UNIX File System and File Security
IS3440 Linux Security Unit 9 Linux System Logging and Monitoring
Web Programming Essentials:
Chapter 7 File and file System structure
Getting started with CentOS Linux
Operating System Security
Working with Mac OS and Linux
CSE 303 Concepts and Tools for Software Development
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
1.3 Given a scenario, apply appropriate Microsoft command line tools
January 26th, 2004 Class Meeting 2
Presentation transcript:

Linux Security 2016 GenCyber JMU Bootcamp for High School Teachers

OS Security In General Some common OS security topics  Manage user accounts  OS update  Enable firewall  Disable guest account  Monitor logs  Check file permissions  Manage services Linux2 OSServices OS Kernel CPU, I/O Applications

Ubuntu Security Some common OS security topics  Manage user accounts  OS update  Enable firewall  Disable guest account  Monitor logs  Check file permissions  Manage services Linux3 OSServices OS Kernel CPU, I/O Applications

 Manage User Accounts

 OS Updates

 Ubuntu Firewall Install Gufw

 Ubuntu Firewall

 Disable guest account Save the change Need to restart

Set password policies

Set password history

Set account policy

 Monitor logs

 Check file permissions For a file, – Can its owner read/write/execute it? – Can other users in the same group read/write/execute it? – Can other users in the system read/write/execute it?

 Check file permissions View file permission, ls –l myfile

Change file permission: chmod

Set audit policy

 Manage services

The Linux File System Every user has a home directory (default location for his/her files) Find out what the current user’s home directory is: echo $HOME Associated with every shell is a location in the file system called the working directory Find out what the current working directory is: pwd

Listing Files and Directories To see what files and directories are in the current working directory use the ls command: ls Most commands take options that affect their behaviour: ls -l – show a “long” listing ls -a – show all files and directories ls -la – show a “long” listing of all files and directories

Creating, Removing, and Changing Directories To create a new directory (in the current working directory) use the mkdir command: mkdir foo To change the current working directory use the cd command: cd. – go to the current directory cd.. – go to the parent directory cd foo – go to the “foo” directory cd – go to the user’s home directory To remove an empty directory use the rmdir command: rmdir foo

Absolute and Relative Paths Relative – specify a file or directory relative to the current directory cd foo cd../.. Absolute – specify a file or directory starting from the top (root) of the file system cd / cd /home/elvis/foo

The Linux File System A hierarchy of files and directories: / bin/dev/etc/home/root/tmp/ alice/ bob/ fred/ memos/ report.doc

Important Linux Directories /bin – common commands (e.g. ls and ps) /boot – files used at boot time /dev – files representing access points to system I/O devices (e.g. terminals, printers, disks, CDs) /etc – system configuration files /home – user home directories /proc – information about system resources /root – home directory for root user /sbin – administrative command

Viewing and Editing Files Many ways to display the contents of text files:  cat command (no scrolling)  more and less commands (scrolling) Many editors available:  pico/nano (simple)  vi  emacs

Permissions Define access rights of various users to each file View file permissions with the ls –l command: drwxr-xr-x 2 elvis elvis 4096 Jan 12 18:32 Desktop -rw-rw-r-- 1 elvis elvis 102 Jan 13 14:37 numbers Note: 10 permission bits  Bit 1 (leftmost): file type  Bits 2-4 : owner’s permissions (read, write, and execute)  Bits 5-7 : group’s permissions (read, write, and execute)  Bits 8-10 : world’s permissions (read, write, and execute)

Permissions (cont) Read (file) – view contents Read (directory) – see what files and subdirectories it contains Write (file) – change contents of, rename, or delete the file Write (directory) – add files or subdirectories Execute (file) – run the file as a program Execute (directory) – cd into the directory

Modifying Permissions Use the chmod command: chmod 777 filerwxrwxrwx chmod 755 filerwxr-xr-x chmod 644 filerw-r--r-- chmod 600 filerw chmod 000 file

Modifying Permissions (cont) Use the chmod command with +/-:  a = all  u = user  g = group  o = other (world) Examples: chmod a-w filer-xr-xr-x chmod go-rwx filer-x chmod a+w filerwx-w--w-

Moving, Copying, and Removing Files Moving: mv file1 file2 Copying: cp file1 file2 Removing: rm file1

User database Stored in /etc/passwd Each line contains the account information for a single user: – Username – UID – GID – Home directory – Default shell

Shadowed and Salted Passwords Linux protects the password hashes: –Password hashes usually stored in a protected file: /etc/shadow  A salt value is used Password hashes can still be cracked

Securing a Linux Server Best Practices: –Patches –Accounts –Audit –Services –Firewall –Malware defense –Mandatory Access Controls Security guides and tools

Linux Patching As with Windows, patches for the Linux OS and its applications and libraries are released often Tools: –Red Hat: up2date –Debian (including Ubuntu): apt-get/aptitude –RHEL, Fedora, CentOS: yum

Ubuntu Patching o Tools: - Update Manager (GUI) - apt-get/aptitude - Third party tools (e.g.

Apt-get Can be used to: –Install/Remove/Update packages Example: –Sudo apt-get install emacs

Accounts Delete/disable unnecessary accounts –Users settings GUI –useradd/userdel commands Never have any account with no/default password –Change all passwords to good ones Account policies: –/etc/pam.d/common-password – password policies –chage command - used to view/set password expiration options of individual users

Logging Most log files are text files located in /var/log: –auth.log – account log in and log out –lastlog – binary file used by lastlog program to display most recent log in of all users –wtmp – binary file used by last program to display listing of last users logged in –Certain applications also store their logs in subdirectories in /var/log: Apache, mysql, etc.

Reviewing Logs Manually inspect log files –System Log Viewer GUI Automated tools: –Logwatch Logcheck/Logsentry ools/ –Others…

Services Delete/disable unnecessary services and programs –The services GUI –Starting/stopping of all services is controlled by scripts in /etc/rcX.d (where X is a run level 0-6) –Use invoke-rc.d program to start/stop services immediately sudo invoke-rc.d apache2 stop –Use update-rc.d program to enable/disable a service at boot time

Services (cont) Secure all necessary services Don’t install untrusted software –Consider the source –Consider the signature

Host-based Firewall Uncomplicated Firewall (ufw) – firewall configuration utility –$ sudo ufw allow ssh/tcp –$ sudo ufw logging on –$ sudo ufw enable –$ sudo ufw status Rules and configuration stored in /etc/ufw

Firewall (cont) Block all unnecessary/unauthorized traffic Allow traffic to necessary services Other network security options: –TCP Wrappers – network access control list –PortSentry – protect against port scans –Port scan attack detector (psad)

Malicious Software Defence Clam ( kages-linux/) Avast! ( AVG ( Chkrootkit (

Mandatory Access Controls Users (thorough file permissions) can define discretionary access controls (DAC) on files Mandatory Access Controls (MAC) are rules enforced by the system regardless of the users’ DAC Several On-going Projects: –Security-Enhanced Linux –GRSecurity –Linux Intrusion Detection System –Rule-Set Based Access Control

SELinux Project originally developed by National Security Agency to implement Mandatory Access Controls within the Linux Kernel Incorporated into 2.6 Linux kernel System Checks DAC then MAC policy before granting access to a resource Ubuntu supports SELinux (but it is not installed by default)

Bastille Linux (cont) An interactive Linux-hardening tool See Helps check/configure: –File permissions –Account security –System auditing –Services Mail server Web server FTP server –Firewall

Linux Security Guides Many are available Ubuntu Community:

Summary Best Practices: –Patches –Accounts –Audit –Services –Firewall –Malware defense –Mandatory Access Control Security guides and tools (i.e. Bastille)