GL275 Enterprise Linux Network Services
Total Page:16
File Type:pdf, Size:1020Kb
EVALUATION COPY Unauthorized Reproduction or Distribution Enterprise Linux Network Prohibited Services Student Workbook EVALUATION COPY Unauthorized Reproduction GL275 ENTERPRISE LINUX NETWORK SERVICES RHEL7 SLES12 or Distribution The contents of this course and all its modules and related materials, including handouts to audience members, are copyright ©2017 Guru Labs L.C. No part of this publication may be stored in a retrieval system, transmitted or reproduced in any way, including, but not limited to, photocopy, photograph, magnetic, electronic or other record, without the prior written permission of Guru Labs. This curriculum contains proprietary information which is for the exclusive use of customers of Guru Labs L.C., and is not to be shared with personnel other than those in attendance at this course. This instructional program, including all material provided herein, is supplied without any guarantees from Guru Labs L.C. Guru Labs L.C. assumes no liability for damages or legal action arising from Prohibited the use or misuse of contents or details contained herein. Photocopying any part of this manual without prior written consent of Guru Labs L.C. is a violation of federal law. This manual should not appear to be a photocopy. If you believe that Guru Labs training materials are being photocopied without permission, please email [email protected] or call 1-801-298-5227. Guru Labs L.C. accepts no liability for any claims, demands, losses, damages, costs or expenses suffered or incurred howsoever arising from or in connection with the use of this courseware. All trademarks are the property of their respective owners. Version: GL275S-R7S12-L04 EVALUATION COPY Unauthorized Reproduction or Distribution Prohibited Table of Contents Chapter 1 EVALUATIONChapter 3 COPY SECURING SERVICES 1 DNS CONCEPTS 1 Xinetd 2 Naming Services 2 Xinetd Connection Limiting and Access Control 4 DNS – A Better Way 3 Xinetd: Resource limits,Unauthorized redirection, logging 5 The Domain Name Space 4 TCP Wrappers 6 Delegation and Zones 6 The /etc/hosts.allow & /etc/hosts.deny Files 7 Server Roles 7 /etc/hosts.{allow,deny} Shortcuts 8 Resolving Names 8 Advanced TCP Wrappers 9 Resolving IP Addresses 10 SUSE Basic Firewall Configuration 11 Basic BIND Administration 12 FirewallD 12 Configuring the Resolver 13 Netfilter: Stateful Packet Filter Firewall 13 Testing Resolution 15 Netfilter Concepts 14 Lab Tasks 17 Using the iptables Command Reproduction 15 1. Configuring a Slave Name Server 18 Netfilter Rule Syntax 17 Targets 18 Chapter 4 Common match_specs 20 CONFIGURING BIND 1 Extended Packet Matching Modules 21 BIND Configuration Files 2 Connection Tracking 23 named.conf Syntax 3 Lab Tasks 24 named.conf Options Block 4 1. Securing xinetd Services 25 Creating a Site-Wide Cache 6 2. Enforcing Security Policy with xinetd 29 rndc Key Configuration 7 3. Securing Services with TCP Wrappers 32or Zones In named.conf 9 4. Securing Services with SuSEfirewall2 [S12] 36 DistributionZone Database File Syntax 11 5. Securing Services with Netfilter 40 SOA – Start of Authority 12 6. FirewallD [R7] 46 A, AAAA, & PTR – Address & Pointer Records 14 7. Troubleshooting Practice 53 NS – Name Server 16 TXT, CNAME, & MX – Text, Alias, & Mail Host 17 Chapter 2 SRV – SRV Service Records 19 SELINUX AND LSM 1 Abbreviations and Gotchas 21 AppArmor 2 $GENERATE, $ORIGIN, and $INCLUDE 23 SELinux Security Framework 3 Lab Tasks Prohibited 25 Choosing an SELinux Policy 5 1. Use rndc to Control named 26 SELinux Commands 7 2. Configuring BIND Zone Files 28 SELinux Booleans 8 SELinux Policy Tools 9 Chapter 5 Lab Tasks 11 CREATING DNS HIERARCHIES 1 1. Exploring AppArmor Modes [S12] 12 Subdomains and Delegation 2 2. SELinux File Contexts [R7] 16 Subdomains 3 Delegating Zones 4 in-addr.arpa. Delegation 5 ii Issues with in-addr.arpa. 6 3. Configuring Virtual Hosts 29 RFC2317 & in-addr.arpa. 7 Lab Tasks EVALUATION8 Chapter 8 COPY 1. Create a Subdomain in an Existing Domain 9 APACHE SECURITY 1 2. Subdomain Delegation 14 Virtual Hosting Security Implications 2 Unauthorized Delegating Administration 3 Chapter 6 Directory Protection 4 ADVANCED BIND DNS FEATURES 1 Directory Protection with AllowOverride 6 Address Match Lists & ACLs 2 Common Uses for .htaccess 7 Split Namespace with Views 3 Symmetric Encryption Algorithms 8 Restricting Queries 4 Asymmetric Encryption Algorithms 9 Restricting Zone Transfers 5 Digital Certificates 10 Running BIND in a chroot 6 TLS Using mod_ssl.so 11 Dynamic DNS Concepts 7 Lab Tasks 13 Allowing Dynamic DNS Updates Reproduction 8 1. Using .htaccess Files 14 DDNS Administration with nsupdate 9 2. Using TLS Certificates with Apache 19 Common Problems 10 3. Use SNI and TLS with Virtual Hosts 25 Common Problems 11 Securing DNS With TSIG 12 Chapter 9 Lab Tasks 14 APACHE SERVER-SIDE SCRIPTING ADMINISTRATION 1 1. Configuring Dynamic DNS 15 Dynamic HTTP Content 2 2. Securing BIND DNS 18 PHP: Hypertext Preprocessor 3 Developer Tools for PHP 4 Chapter 7 or Installing PHP 5 USING APACHE 1 Configuring PHP 7 HTTP Operation 2DistributionSecuring PHP 8 Apache Architecture 3 Security Related php.ini Configuration 9 Dynamic Shared Objects 5 Java Servlets and JSP 10 Adding Modules to Apache 6 Apache's Tomcat 11 Apache Configuration Files 8 Installing Java SDK 12 httpd.conf – Server Settings 10 Installing Tomcat Manually 14 httpd.conf – Main Configuration 12 Using Tomcat with Apache 15 HTTP Virtual Servers 13 Lab Tasks 16 Virtual Hosting DNS Implications 14 1. CGI ScriptsProhibited in Apache 17 httpd.conf – VirtualHost Configuration 15 2. Apache's Tomcat 24 Port and IP based Virtual Hosts 16 3. Using Tomcat with Apache 26 Name-based Virtual Host 17 4. Installing Applications with Apache and Tomcat 30 Apache Logging 18 Log Analysis 19 Chapter 10 The Webalizer 20 IMPLEMENTING AN FTP SERVER 1 Lab Tasks 21 The FTP Protocol 2 1. Apache Architecture 22 Active Mode FTP 3 2. Apache Content 27 Passive Mode FTP 4 iii ProFTPD 6 Chapter 13 Pure-FTPd 8 LDAP CONCEPTS AND CLIENTS 1 vsftpdEVALUATION 9 LDAP: History COPY and Uses 2 Configuring vsftpd 10 LDAP: Data Model Basics 3 Anonymous FTP with vsftpd 12 LDAP: Protocol Basics 5 Lab Tasks Unauthorized 13 LDAP: Applications 6 1. Configuring vsftpd 14 LDAP: Search Filters 7 LDIF: LDAP Data Interchange Format 8 Chapter 11 OpenLDAP Client Tools 10 THE SQUID PROXY SERVER 1 Alternative LDAP Tools 12 Squid Overview 2 Lab Tasks 13 Squid File Layout 3 1. Querying LDAP 14 Squid Access Control Lists 4 Applying Squid ACLs 5 Chapter 14 Tuning Squid & Configuring Cache HierarchiesReproduction 7 OPENLDAP SERVERS 1 Bandwidth Metering 8 Popular LDAP Server Implementations 2 Monitoring Squid 9 OpenLDAP: Server Architecture 3 Proxy Client Configuration 10 OpenLDAP: Backends 4 Lab Tasks 12 OpenLDAP: Replication 5 1. Installing and Configuring Squid 13 Managing slapd 6 2. Squid Cache Manager CGI 17 OpenLDAP: Configuration Options 7 3. Proxy Auto Configuration 19 OpenLDAP: Configuration Sections 8 4. Configure a Squid Proxy Cluster 21 OpenLDAP: Global Parameters 9 or OpenLDAP: Database Parameters 11 Chapter 12 OpenLDAP Server Tools 13 SQL FUNDAMENTALS AND MARIADB 1 DistributionNative LDAP Authentication and Migration 14 Popular SQL Databases 2 Enabling LDAP-based Login 15 SELECT Statements 3 System Security Services Daemon (SSSD) 17 INSERT Statements 4 Lab Tasks 19 UPDATE Statements 5 1. Building An OpenLDAP Server 20 DELETE Statements 6 2. Enabling TLS For An OpenLDAP Server 25 JOIN Clauses 7 3. Enabling LDAP-based Logins 28 MariaDB 9 MariaDB Installation and Security 10 Chapter 15 Prohibited MariaDB User Account Management 12 SAMBA CONCEPTS AND CONFIGURATION 1 MariaDB Replication 13 Introducing Samba 2 Lab Tasks 14 NetBIOS and NetBEUI 3 1. SQL with Sqlite3 15 Samba Daemons 4 2. Installing and Securing MariaDB 23 Accessing Windows/Samba Shares from Linux 5 3. Creating a Database in MariaDB 27 Samba Utilities 6 4. Create a Database Backed Application 36 Samba Configuration Files 8 The smb.conf File 10 Mapping Permissions and ACLs 12 iv Mapping Linux Concepts 13 Logfile Analysis 18 Mapping Users 15 Postfix, Relaying and SMTP AUTH 19 Sharing Home DirectoriesEVALUATION16 SMTP AUTHCOPYServer and Relay Control 22 Sharing Printers 17 SMTP AUTH Clients 23 Share Authentication 18 Postfix / TLS 24 Share-Level AccessUnauthorized 19 TLS Server Configuration 25 User-Level Access 20 Postfix Client Configuration for TLS 27 Samba Account Database 21 Other TLS Clients 28 User Share Restrictions 23 Ensuring TLS Security 29 Lab Tasks 24 Lab Tasks 30 1. Samba Share-Level Access 25 1. Configuring Postfix 31 2. Samba User-Level Access 32 2. Postfix Virtual Host Configuration 38 3. Samba Group Shares 37 3. Postfix Network Configuration 42 4. Handling Symbolic Links with Samba 44 4. Postfix SMTP AUTH Configuration 47 5. Samba Home Directory Shares Reproduction 49 5. Postfix STARTTLS Configuration 52 6. SUSE Postfix Configuration Cleanup [S12] 57 Chapter 16 SMTP THEORY 1 Chapter 18 SMTP 2 MAIL SERVICES AND RETRIEVAL 1 SMTP Terminology 3 Filtering Email 2 SMTP Architecture 4 Procmail 4 SMTP Commands 5 SpamAssassin 6 SMTP Extensions 6 Bogofilter 8 SMTP AUTH or 7 amavisd-new Mail Filtering 10 SMTP STARTTLS 8 Accessing Email 12 SMTP Session 9DistributionThe IMAP4 Protocol 13 Dovecot POP3/IMAP Server 14 Chapter 17 Cyrus IMAP/POP3 Server 16 POSTFIX 1 Cyrus IMAP MTA Integration 18 Postfix Features 2 Cyrus Mailbox Administration 20 Postfix Architecture 3 Fetchmail 22 Postfix Components 4 Roundcube Webmail 23 Postfix Configuration 5 Mailing Lists 24 master.cf 7 GNU MailmanProhibited 25 main.cf 8 Mailman Configuration 26 Postfix Map Types 9 Lab Tasks 28 Postfix Pattern Matching 10 1. Configuring Procmail & SpamAssassin 29 Advanced Postfix Options 11 2. Configuring Cyrus IMAP 36 Virtual Domains 12 3. Dovecot TLS Configuration 45 Postfix Mail Filtering 13 4. Configuring Roundcube 51 Configuration Commands 14 5. Base Mailman Configuration 57 Management Commands 16 6.