Lpic3 Slide
Lpic3 Slide
Highest Level
Contents
▪ LPIC-3 Introduction
▪ Mixed Environments
▪ OpenLDAP
▪ SAMBA
▪ FreeIPA
▪ Security in Linux
▪ Security concepts, principles, and guidelines
▪ Account security
▪ Network security
▪ File System security
Contents
▪ Linux Virtualization
▪ KVM Virtualization
▪ libvirt and ovirt for Virtual Machine Management
▪ Linux High Availability Clustering
▪ High Availability Clustering and Its Architecture
▪ Configuring Storage
▪ Understanding Pacemaker Architecture and Management
LPIC-3 Introduction
Linux Mixed Environment
Open LDAP
History of LDAP
• Accepted standard for Directory services embraced by all the “big” players
• uid=jheiss,ou=people,dc=example,dc=com
• cn=users,ou=group,dc=example,dc=com
• Notice that the DNS name is example.com (specified by DC=Domain Component entries) for the
domain
• OU is organizational unit
• Branched by agency
• Agencies in this example have branches containing:
• Groups which contain people
• People in the organization
• Resources such as printers and conference
rooms.
• Applications (where application specific info
could be maintained)
Sample User Object
• Objects contain attributes, e.g.,
• uid (user ID)
• cn (common name)
• sn (surname)
• mail (e-mail address)
• Attributes can be multivalued, e.g., givenname of both James, Jim
• This object contains
• white-pages information
• X.509 certificate for PKI
ObjectClass
• A commonly used attribute is "objectClass".
• Examples of objectClass:
• Delete an entry
• Modify an entry
# smbstatus
NFS Configuration File
• Path: /etc/exports
• /etc/hosts.allow
portmap:192.168.1.1
• /etc/hosts.deny
portmap:ALL
FreeIPA
What is FreeIPA ?
• Acronym: Free Identity, Policy, Audit
• Purpose: Make it simpler to manage a complex problem
• Means: Use standard protocols and components
Why should I care?
• Organizations and companies need to manage their users and
resources
• So far IdM has been the realm of proprietary vendors
• That means the keys of our organizations are in their hands
• We can't have a fully free environment if the Identity space can't be
managed through Free Software
• Security + Freedom
The Identity Management Problem
• Needs:
• Single source for Identities (duplication = confusion)
• Single-Sign-On / Single-Password
• Single data store for auditing/reporting (compliance)
• Single point of Management (comprehensive view)
• Implementation problems:
• Synchronization and/or Integration
• Distribution of data/credentials
• Single points of failure
• Integrated Management Interfaces
FreeIPA Components
Why a Directory ?
• We need a storage mechanism to:
• store identity information
• perform fine grained access control
• organize Identities and allow group relationships
• distribute Information across all clients
• replicate Information on multiple servers
• Yes, but why LDAP ?
• Standard
• Extensible
• Flexible
FreeIPA Components
Why Kerberos ?
• We need an authentication system that:
• provides Single Sing On authentication
• allows administrators and users alike to carry on their identity while they
access various services
• is a tested standard and is a validated secure solution
• is extensible/extended to use new authentication technologies like Smart
Cards and new encryption algorithms as need arises.
• Is kerberos the only way within FreeIPA?
• Predominant
• Ldap binds as an alternative for some services
FreeIPA Components
FreeIPA (v1) components
Directory structure
The Kerberos/directory integration
Management Interfaces in v.1
Web Interface
Command Line Interface
• More than 20 distinct command line tools
• Examples:
• Ipa-adduser[group/service/delegation]
• ipa-deluser[group/service/delegation]
• ipa-finduser[group/service/delegation]
• ipa-moduser[group/service/delegation]
• ipa-passwd
• ipa-pwpolicy
• ipa-defaultoptions
• Ipa-change-master-key
• ...
Making it simpler ...
• Example: initial configuration made very simple
• Install packages
• Run ipa-server-install
• Answer a few questions:
• DNS Domain and Realm name (defaults suggested)
• Directory Manager password (required)
• Admin User Password (required)
• Done!
• The installation program configures all necessary components: NTP,
Directory Server, Kerberos, apache, ipa-kpasswd, ipa-gui, client side
bits
Basic IPA v1 network diagram
A little more complex: multiple servers.
Simplified IPA v2 network diagram
Client diagram
Linux Security
Section 1: Security concepts, principles, and
guidelines
Security concepts, principles, and guidelines
Security concepts, principles, and guidelines
Is Linux Secure?
Risk Assessment
Linux is only as secure as you make it!
Linux is only as secure as you make it!
What Makes Linux Secure?
Advantages to a Multiuser System
Advantages to a Multiuser System
Linux is Open Source
Centralized Software Management
Security Guidelines
Minimize Software and Services
Run Services on Separate Systems
Encrypt Data Transmissions
Avoid Shared Accounts
Avoid Direct root Logins
Maintain Accounts
Use Multifactor Authentication
The Principle of Least Privilege
Monitor System Activity
Use a Firewall
Encrypt Your Data
Section 2: Physical Security
Physical Security Is Linux Security
Physical Security Guidelines
Systems Under Your Control
Visitors
Systems Not Under Your Control
Data Centers
Cloud
Protecting Linux
Against Physical Attacks
Gaining Access to a Linux System
Single User Mode
and Blank Root Passwords
Securing the Boot Loader
Disk Encryption
Encryption
OS Needs Unencrypted Access
Disk Encryption for Linux
LUKS
Encrypt During Install
Setting up LUKS
on a New Device
Setting up LUKS on a New Device
Converting a
Device to LUKS
Converting a Device to LUKS
Disabling Ctrl+Alt+Del
Disabling Ctrl+Alt+Del (Systemd)
Section 3: Account security
What You Will Learn
What You Will Learn
Linux Account Security
PAM
Pluggable Authentication Modules
PAM Configuration files
PAM Module Interfaces
PAM Control Flags
PAM Configuration
Example
Linux Account Types
root, the superuser
Password Security
Use Shadow Passwords
Use Shadow Passwords
Converting Passwords
/etc/shadow format
Display user account expiry info with chage
Change user account expiry info with chage
/etc/login.defs
Password History
Controlling Account Access
Locking and Unlocking accounts
Locking with nologin as the Shell
Locking with nologin as the Shell
Centralized Authentication
Disable Logins
Monitoring Authentication Logs
Monitoring Authentication Logs
Intrusion Prevention with fail2ban
Multifactor Authentication
Multifactor Authentication
Security by Account Type
Account Security - root
Disabling root Logins
Disabling SSH root Logins
System / Application Accounts
User Accounts
Deleting Accounts
Using and Configuring Sudo
sudo vs su
Sudo
Sudo configuration
Sudoers Format
Sudo Authentication
NOPASSWD & PASSWD
Sudo Aliases
Sudo Aliases
Sudo Aliases
Sudo Aliases
Sudo Aliases
Sudo Aliases
Displaying the Sudo Configuration
Running Commands with sudo
Section 4: Network security
What You Will Learn
Network Services
Securing Network Services
Securing Network Services
Securing Network Services
Information Leakage
Web Server Information Leakage
Information Leakage
Displaying Services with systemctl
Stop and Disable Services
List Listening Programs with netstat
Port Scanning
Testing a Specific Port
Xinetd Controlled Services
Securing SSH
Securing SSH
Creating SSH Keys
Add the Public Key to the Remote Host
Force Key Authentication
Controlling Root Logins
Only Allow Certain Users SSH Access
Only Allow Certain Groups SSH Access
Deny Certain Users SSH Access
SSH Port Forwarding
SSH Port Forwarding
Reverse Port Forwarding
Disable TCP Port Forwarding
Use SSHv2 instead of SSHv1
Bind SSH to a Specific Address
Change the Default Port
Add the New Port to SELinux
Disable the Banner
Reload the Configuration
For More Information
Linux Firewall
Netfilter and IPTables
Linux Firewall
Default Tables
Default Tables
Default Chains
Rules
Rules
Targets
iptables / ip6tables
List / View
Chain Policy / Default Target
Appending, Inserting, and Deleting Rules
Flushing rules
Rule Specification Options
Rule Specification Options
Target / Jump
TCP Wrappers
TCP Wrappers
TCP Wrappers
TCP Wrappers
Configuring TCP Wrappers
Access Rules
TCP Wrapper Examples
Deny All
Section 5: File system security
What You Will Learn
Setuid
Octal Permissions
Adding the Setuid Attribute
Removing the Setuid Attribute
Finding Setuid Files
Only the Owner Should Edit Setuid Files
Setgid
Finding Setgid Files
Adding the Setgid Attribute
Removing the Setgid Attribute
Setgid on Directories
Use an Integrity Checker
The Sticky Bit
Adding the Sticky Bit
Removing the Sticky Bit
File Attributes
File Attributes (xattr)
Attribute: i immutable
Attribute: a append
Viewing Attributes
Modifying Attributes
Examples
Access Control Lists
ACLs
ACLs
Types of ACLs
Creating ACLs
User ACLs / Rules
Group ACLs / Rules
Mask ACLs / Rules
Other ACLs / Rules
Creating Multiple ACLs at Once
Default ACLs
Setting ACLs Recursively (-R)
Removing ACLs
Viewing ACLs
Detecting Files with ACLs
Linux Virtualization
What you will learn!
• KVM Virtualization
• libvirt and ovirt for Virtual Machine Management
Section 1: KVM Virtualization
Understanding Linux Virtualization
• Types of virtualization
• Desktop virtualization (Virtual Desktop Infrastructuree (VDI)
• Server virtualization
• Application virtualization
• Network virtualization: Software-Defined Networking (SDN)
• Storage virtualization: Software-Defined Storage (SDS)
Type 1 and type 2 hypervisors
oVirt
Starting a virtual machine using QEMU and
libvirt
Libvirt Networking
• Virtual networking
• Bridge: Layer 2 interface for (virtual machine) networking
• Bond: For combining network interfaces to a single interface (for balancing and
failover reasons) into one logical interface.
• Team: Different to bonding, teaming doesn't create one logical interface, but can still
do balancing and failover
• MACVLAN: Creates multiple MAC addresses on a single physical interface (creates
sub-interfaces) on Layer 2.
• IPVLAN: Unlike MACVLAN, IPVLAN uses the same MAC address and multiplexes on
Layer 3.
• MACVTAP/IPVTAP: Newer drivers that should simplify virtual networking by
combining TUN, TAP, and bridge as a single module.
• VXLAN: A commonly used cloud overlay network
• VETH: A virtual Ethernet interface that can be used in a variety of ways for local
tunneling.
Libvirt Networking
vi /etc/iscsi/initiatorname.iscsi file
iSCSI and SAN storage
The end result look like:
Storage Cluster
• GlusterFS
Storage Cluster
• Ceph
Virtual Machines Installation, Configuration,
and Life Cycle Management
Contents
• Creating a new VM using virt-manager, using virt commands
• Creating a new VM using oVirt
• Configuring your VM
• Adding and removing virtual hardware from your VM
• Migrating VMs
Creating a new VM using virt-manager
Using virt commands
Creating a new VM using oVirt
Configuring your VM
Migrating VMs
Offline migration
Migrating VMs
Live or online migration
Linux High Availability Clustering
High Availability Clustering and Its
Architecture
Different Kinds of Clustering
• High performance: Different computers work together to host one or
more tasks that require lots of computing resources
• Load balancing: A load balancer serves as a front end and receives
requests from end users. The load balancer distributes the request to
different servers.
• High availability: Different servers work together to make sure that
the downtime of critical resources is reduced to a minimum
High Performance
Load Balancing Cluster
High Availability Cluster
The Components That Build a High Availability
Cluster
• Shared storage
• Different networks
• Bonded network devices
• Multipathing
• Fencing/STONITH devices
Configuring Storage
Configuring Storage - SAN
Understanding iSCSI
Active – Active Cluster
Active – Passive Cluster
Example
Openstack Cluster
Example
Galera Cluster
Example
Ceph Cluster
Pacemaker Architect
Pacemaker Components
Pacemaker Scenarios
Pacemaker Scenarios
Pacemaker Scenarios