Product SiteDocumentation Site

Fedora 19

Security Guide

A Guide to Securing Fedora Linux

Edition 19.1

Logo

Johnray Fuller

Red Hat

John Ha

Red Hat

David O'Brien

Red Hat

Scott Radvan

Red Hat

Eric Christensen

Fedora Project Documentation Team

Adam Ligas

Fedora Project

Murray McAllister

Red Hat Engineering Content Services

Scott Radvan

Red Hat Engineering Content Services

Daniel Walsh

Red Hat Security Engineering

Dominick Grift

Technical editor for the Introduction, SELinux Contexts, Targeted Policy, Working with SELinux, Confining Users, and Troubleshooting chapters. 

Eric Paris

Technical editor for the Mounting File Systems and Raw Audit Messages sections. 
Red Hat Security Engineering

James Morris

Technical editor for the Introduction and Targeted Policy chapters. 
Red Hat Security Engineering

Legal Notice

Copyright © 2007-2013 Fedora Project Contributors.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the Fedora Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
For guidelines on the permitted uses of the Fedora trademarks, refer to https://fedoraproject.org/wiki/Legal:Trademark_guidelines.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
All other trademarks are the property of their respective owners.
Abstract
The Fedora Security Guide is designed to assist users of Fedora in learning the processes and practices of securing workstations and servers against local and remote intrusion, exploitation, and malicious activity. Focused on Fedora Linux but detailing concepts and techniques valid for all Linux systems, the Fedora Security Guide details the planning and the tools involved in creating a secured computing environment for the data center, workplace, and home. With proper administrative knowledge, vigilance, and tools, systems running Linux can be both fully functional and secured from most common intrusion and exploit methods.

Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
1. Security Overview
1.1. Introduction to Security
1.1.1. What is Computer Security?
1.1.2. SELinux
1.1.3. Security Controls
1.1.4. Conclusion
1.2. Attackers and Vulnerabilities
1.2.1. A Quick History of Hackers
1.2.2. Threats to Network Security
1.2.3. Threats to Server Security
1.2.4. Threats to Workstation and Home PC Security
1.3. Vulnerability Assessment
1.3.1. Thinking Like the Enemy
1.3.2. Defining Assessment and Testing
1.3.3. Evaluating the Tools
1.4. Common Exploits and Attacks
1.5. Security Updates
1.5.1. Updating Packages
1.5.2. Verifying Signed Packages
1.5.3. Installing Signed Packages
1.5.4. Applying the Changes
2. Basic Hardening Guide
2.1. General Principles
2.2. Physical Security
2.3. Why this is important
2.4. Networking
2.4.1. iptables
2.4.2. IPv6
2.5. Keeping software up to date
2.6. Services
2.7. NTP
3. Securing Your Network
3.1. Workstation Security
3.1.1. Evaluating Workstation Security
3.1.2. BIOS and Boot Loader Security
3.1.3. Password Security
3.1.4. Administrative Controls
3.1.5. Available Network Services
3.1.6. Personal Firewalls
3.1.7. Security Enhanced Communication Tools
3.2. Server Security
3.2.1. Securing Services With TCP Wrappers and xinetd
3.2.2. Securing Portmap
3.2.3. Securing NIS
3.2.4. Securing NFS
3.2.5. Securing the Apache HTTP Server
3.2.6. Securing FTP
3.2.7. Securing Sendmail
3.2.8. Verifying Which Ports Are Listening
3.3. Single Sign-on (SSO)
3.3.1. Introduction
3.3.2. Getting Started with your new Smart Card
3.3.3. How Smart Card Enrollment Works
3.3.4. How Smart Card Login Works
3.3.5. Configuring Firefox to use Kerberos for SSO
3.4. Multifactor Authentication Solutions
3.4.1. Yubikey
3.5. Pluggable Authentication Modules (PAM)
3.5.1. Advantages of PAM
3.5.2. PAM Configuration Files
3.5.3. PAM Configuration File Format
3.5.4. Sample PAM Configuration Files
3.5.5. Creating PAM Modules
3.5.6. PAM and Administrative Credential Caching
3.5.7. PAM and Device Ownership
3.5.8. Additional Resources
3.6. TCP Wrappers and xinetd
3.6.1. TCP Wrappers
3.6.2. TCP Wrappers Configuration Files
3.6.3. xinetd
3.6.4. xinetd Configuration Files
3.6.5. Additional Resources
3.7. Kerberos
3.7.1. What is Kerberos?
3.7.2. Kerberos Terminology
3.7.3. How Kerberos Works
3.7.4. Kerberos and PAM
3.7.5. Configuring a Kerberos 5 Server
3.7.6. Configuring a Kerberos 5 Client
3.7.7. Domain-to-Realm Mapping
3.7.8. Setting Up Secondary KDCs
3.7.9. Setting Up Cross Realm Authentication
3.7.10. Additional Resources
3.8. Using Firewalls
3.8.1. Introduction to firewalld
3.8.2. Understanding firewalld
3.8.3. Comparison of Firewalld to system-config-firewall and iptables
3.8.4. Understanding Network Zones
3.8.5. Choosing a Network Zone
3.8.6. Understanding Predefined Services
3.8.7. Understanding The Direct Interface
3.8.8. Check if firewalld is installed
3.8.9. Disabling firewalld
3.8.10. Start firewalld
3.8.11. Check if firewalld is running
3.8.12. Installing firewalld
3.8.13. Configuring the Firewall
3.8.14. Additional Resources
4. Encryption
4.1. Data at Rest
4.1.1. Full Disk Encryption
4.1.2. File Based Encryption
4.2. Data in Motion
4.2.1. Virtual Private Networks (VPNs)
4.2.2. Secure Shell
4.2.3. LUKS Disk Encryption
4.2.4. 7-Zip Encrypted Archives
4.2.5. Using GNU Privacy Guard (GnuPG)
5. General Principles of Information Security
6. Secure Installation
6.1. Disk Partitions
6.2. Utilize LUKS Partition Encryption
7. Software Maintenance
7.1. Install Minimal Software
7.2. Plan and Configure Security Updates
7.3. Adjusting Automatic Updates
7.4. Install Signed Packages from Well Known Repositories
8. Common Vulnerabilities and Exposures
8.1. YUM Plugin
9. SELinux
9.1. Introduction
9.1.1. Benefits of running SELinux
9.1.2. Examples
9.1.3. SELinux Architecture
9.1.4. SELinux on Other Operating Systems
9.2. SELinux Contexts
9.2.1. Domain Transitions
9.2.2. SELinux Contexts for Processes
9.2.3. SELinux Contexts for Users
9.3. Targeted Policy
9.3.1. Confined Processes
9.3.2. Unconfined Processes
9.3.3. Confined and Unconfined Users
9.4. Working with SELinux
9.4.1. SELinux Packages
9.4.2. Which Log File is Used
9.4.3. Main Configuration File
9.4.4. Enabling and Disabling SELinux
9.4.5. SELinux Modes
9.4.6. Booleans
9.4.7. SELinux Contexts - Labeling Files
9.4.8. The file_t and default_t Types
9.4.9. Mounting File Systems
9.4.10. Maintaining SELinux Labels
9.5. Confining Users
9.5.1. Linux and SELinux User Mappings
9.5.2. Confining New Linux Users: useradd
9.5.3. Confining Existing Linux Users: semanage login
9.5.4. Changing the Default Mapping
9.5.5. xguest: Kiosk Mode
9.5.6. Booleans for Users Executing Applications
9.6. Troubleshooting
9.6.1. What Happens when Access is Denied
9.6.2. Top Three Causes of Problems
9.6.3. Fixing Problems
9.7. Further Information
9.7.1. Contributors
9.7.2. Other Resources
10. Managing Confined Services
10.1. Introduction
10.2. Targeted policy
10.2.1. Type Enforcement
10.2.2. Confined processes
10.2.3. Unconfined processes
10.3. The Apache HTTP Server
10.3.1. The Apache HTTP Server and SELinux
10.3.2. Types
10.3.3. Booleans
10.3.4. Configuration examples
10.4. Samba
10.4.1. Samba and SELinux
10.4.2. Types
10.4.3. Booleans
10.4.4. Configuration examples
10.5. File Transfer Protocol
10.5.1. FTP and SELinux
10.5.2. Types
10.5.3. Booleans
10.5.4. Configuration Examples
10.6. Network File System
10.6.1. NFS and SELinux
10.6.2. Types
10.6.3. Booleans
10.6.4. Configuration Examples
10.7. Berkeley Internet Name Domain
10.7.1. BIND and SELinux
10.7.2. Types
10.7.3. Booleans
10.7.4. Configuration Examples
10.8. Concurrent Versioning System
10.8.1. CVS and SELinux
10.8.2. Types
10.8.3. Booleans
10.8.4. Configuration Examples
10.9. Squid Caching Proxy
10.9.1. Squid Caching Proxy and SELinux
10.9.2. Types
10.9.3. Booleans
10.9.4. Configuration Examples
10.10. MySQL
10.10.1. MySQL and SELinux
10.10.2. Types
10.10.3. Booleans
10.10.4. Configuration Examples
10.11. PostgreSQL
10.11.1. PostgreSQL and SELinux
10.11.2. Types
10.11.3. Booleans
10.11.4. Configuration Examples
10.12. rsync
10.12.1. rsync and SELinux
10.12.2. Types
10.12.3. Booleans
10.12.4. Configuration Examples
10.13. Postfix
10.13.1. Postfix and SELinux
10.13.2. Types
10.13.3. Booleans
10.13.4. Configuration Examples
A. Encryption Standards
A.1. Synchronous Encryption
A.1.1. Advanced Encryption Standard - AES
A.1.2. Data Encryption Standard - DES
A.2. Public-key Encryption
A.2.1. Diffie-Hellman
A.2.2. RSA
A.2.3. DSA
A.2.4. SSL/TLS
A.2.5. Cramer-Shoup Cryptosystem
A.2.6. ElGamal Encryption
B. Revision History