Thursday, 8 January 2015

Linux Domain Controller - Free IPA Server configuration in RHEL 7.0

FreeIPA stands for Free Identity Policy Audit. We can call it as a Linux Domain Controller.
FreeIPA is an integrated security information management solution combining Linux , 389 Directory Server, MIT Kerberos, NTP, DNS, Dogtag (Certificate System). It consists of a web interface and command-line administration tools.

FreeIPA is an integrated Identity and Authentication solution for Linux/UNIX networked environments. A FreeIPA server provides centralized authentication, authorization and account information by storing data about user, groups, hosts and other objects necessary to manage the security aspects of a network of computers.

IPA Provide the following Services:

Serves as Domain Controller for Linux
Create Identity Stores
Centralized Authentication
Domain Controller for Kerberos and DNS services
Authorization Policies
NTP and Certificate Server

Think about the old scenario where you have to configure all the above services. it took lot of time to configure each and every service. Now RedHat come up with a solution for this issue by using IPA server.
Let us not go to more details as there are well written documents are available in web for your referral. I am going to show you how i configure the IPA-Server in my environment as a Domain Controller.
I am using RedHat Enterprise Linux 7.0 for configuring IPA-Server and IPA-Client.
First we need to configure static IP address for IPA-Server . You can directly edit the network configuration file or you can use nmcli command to perform the same. Here is my IP configuration.

ip add show

network configuration file
Update the /etc/hosts file for name resolution.

/etc/hosts
Now Let us install the packages required to configure IPA-Server. I am using YUM command to install the packages. IPA server has dependencies with ntp, kerberos, dogtag and Bind.We are configuring this server as a DNS server also. so we need to install the bind package and bind dynamic update which is required for directory server. 
#yum install -y ipa-server bind bind-dyndb-ldap

yum install ipa-server

There are lot of dependencies for these packages its almost 292 package will get installed.

ipa-server installation
Once the packages installed then we need to run # ipa-server-install command to configure the IPA-server. This command will configure NTP, DNS, Directory Server ,Kerberos and Dogtag for us with minimal user inputs. Let us run the command and see what its does. 
The log file for this installation can be found in /var/log/ipaserver-install.log
Lets run # ipa-server-install . look at the screen it tell us what it is going to configure.
Here is the full session capture.
[root@ipa ~]# ipa-server-install

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)


To accept the default shown in brackets, press the Enter key.

Do you want to configure integrated DNS (BIND)? [no]: yes

Existing BIND configuration detected, overwrite? [no]: yes
Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.


Server host name [ipa.vinzlinux.com]:

Warning: skipping DNS resolution of host ipa.vinzlinux.com
The domain name has been determined based on the host name.

Please confirm the domain name [vinzlinux.com]:

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [VINZLINUX.COM]:
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

Directory Manager password:
Password (confirm):


The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

IPA admin password:
Password (confirm):


Do you want to configure DNS forwarders? [yes]: no
No DNS forwarders configured
Do you want to configure the reverse zone? [yes]:yes
Please specify the reverse zone name [1.168.192.in-addr.arpa.]:
Using reverse zone 1.168.192.in-addr.arpa.

The IPA Master Server will be configured with:
Hostname:      ipa.vinzlinux.com
IP address:    192.168.1.21
Domain name:   vinzlinux.com
Realm name:    VINZLINUX.COM

BIND DNS server will be configured to serve IPA domain with:
Forwarders:    No forwarders
Reverse zone:  1.168.192.in-addr.arpa.


Continue to configure the system with these values? [no]: yes

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring NTP daemon (ntpd)
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv): Estimated time 31 minutes
  [1/38]: creating directory server user
  [2/38]: creating directory server instance
  [3/38]: adding default schema
  [4/38]: enabling memberof plugin
  [5/38]: enabling winsync plugin
  [6/38]: configuring replication version plugin
  [7/38]: enabling IPA enrollment plugin
  [8/38]: enabling ldapi
  [9/38]: configuring uniqueness plugin
  [10/38]: configuring uuid plugin
  [11/38]: configuring modrdn plugin
  [12/38]: configuring DNS plugin
  [13/38]: enabling entryUSN plugin
  [14/38]: configuring lockout plugin
  [15/38]: creating indices
  [16/38]: enabling referential integrity plugin
  [17/38]: configuring certmap.conf
  [18/38]: configure autobind for root
  [19/38]: configure new location for managed entries
  [20/38]: configure dirsrv ccache
  [21/38]: enable SASL mapping fallback
  [22/38]: restarting directory server
  [23/38]: adding default layout
  [24/38]: adding delegation layout
  [25/38]: creating container for managed entries
  [26/38]: configuring user private groups
  [27/38]: configuring netgroups from hostgroups
  [28/38]: creating default Sudo bind user
  [29/38]: creating default Auto Member layout
  [30/38]: adding range check plugin
  [31/38]: creating default HBAC rule allow_all
  [32/38]: initializing group membership
  [33/38]: adding master entry
  [34/38]: configuring Posix uid/gid generation
  [35/38]: adding replication acis
  [36/38]: enabling compatibility plugin
  [37/38]: tuning directory server
  [38/38]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring certificate server (pki-tomcatd): Estimated time 33 minutes 30 seconds
  [1/22]: creating certificate server user
  [2/22]: configuring certificate server instance
  [3/22]: stopping certificate server instance to update CS.cfg
  [4/22]: disabling nonces
  [5/22]: set up CRL publishing
  [6/22]: starting certificate server instance
  [7/22]: creating RA agent certificate database
  [8/22]: importing CA chain to RA certificate database
  [9/22]: fixing RA database permissions
  [10/22]: setting up signing cert profile
  [11/22]: set certificate subject base
  [12/22]: enabling Subject Key Identifier
  [13/22]: enabling CRL and OCSP extensions for certificates
  [14/22]: setting audit signing renewal to 2 years
  [15/22]: configuring certificate server to start on boot
  [16/22]: restarting certificate server
  [17/22]: requesting RA certificate from CA
  [18/22]: issuing RA agent certificate
  [19/22]: adding RA agent as a trusted user
  [20/22]: configure certificate renewals
  [21/22]: configure Server-Cert certificate renewal
  [22/22]: Configure HTTP to proxy connections
Done configuring certificate server (pki-tomcatd).
Configuring Kerberos KDC (krb5kdc): Estimated time 30 minutes 30 seconds
  [1/10]: adding sasl mappings to the directory
  [2/10]: adding kerberos container to the directory
  [3/10]: configuring KDC
  [4/10]: initialize kerberos container
  [5/10]: adding default ACIs
  [6/10]: creating a keytab for the directory
  [7/10]: creating a keytab for the machine
  [8/10]: adding the password extension to the directory
  [9/10]: starting the KDC
  [10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
  [1/2]: starting kadmin
  [2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring ipa_memcached
  [1/2]: starting ipa_memcached
  [2/2]: configuring ipa_memcached to start on boot
Done configuring ipa_memcached.
Configuring ipa-otpd
  [1/2]: starting ipa-otpd
  [2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Configuring the web interface (httpd): Estimated time 31 minutes
  [1/14]: setting mod_nss port to 443
  [2/14]: setting mod_nss password file
  [3/14]: enabling mod_nss renegotiate
  [4/14]: adding URL rewriting rules
  [5/14]: configuring httpd
  [6/14]: setting up ssl
  [7/14]: setting up browser autoconfig
  [8/14]: publish CA cert
  [9/14]: creating a keytab for httpd
  [10/14]: clean up any existing httpd ccache
  [11/14]: configuring SELinux for httpd
  [12/14]: configure httpd ccache
  [13/14]: restarting httpd
  [14/14]: configuring httpd to start on boot
Done configuring the web interface (httpd).
Applying LDAP updates
Restarting the directory server
Restarting the KDC
Restarting the certificate server
Configuring DNS (named)
  [1/11]: adding DNS container
  [2/11]: setting up our zone
  [3/11]: setting up reverse zone
  [4/11]: setting up our own record
  [5/11]: setting up records for other masters
  [6/11]: setting up CA record
  [7/11]: setting up kerberos principal
  [8/11]: setting up named.conf
  [9/11]: restarting named
  [10/11]: configuring named to start on boot
  [11/11]: changing resolv.conf to point to ourselves
Done configuring DNS (named).

Global DNS configuration in LDAP server is empty
You can use 'dnsconfig-mod' command to set global DNS options that
would override settings in local named.conf files

Restarting the web server
==============================================================================
Setup complete

Next steps:
        1. You must make sure these network ports are open:
                TCP Ports:
                  * 80, 443: HTTP/HTTPS
                  * 389, 636: LDAP/LDAPS
                  * 88, 464: kerberos
                  * 53: bind
                UDP Ports:
                  * 88, 464: kerberos
                  * 53: bind
                  * 123: ntp

        2. You can now obtain a kerberos ticket using the command: 'kinit admin'
           This ticket will allow you to use the IPA tools (e.g., ipa user-add)
           and the web user interface.

Be sure to back up the CA certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password
Once the installation is finished then we need to update the firewall rules for the access.Run the following commands to configure the firewall for the IPA-Server.
# firewall-cmd --add-port=80/tcp --permanent
# firewall-cmd --add-port=443/tcp --permanent
# firewall-cmd --add-port=389/tcp --permanent
# firewall-cmd --add-port=636/tcp --permanent
# firewall-cmd --add-port=88/tcp --permanent
# firewall-cmd --add-port=464/tcp --permanent
# firewall-cmd --add-port=53/tcp --permanent
# firewall-cmd --add-port=88/udp --permanent
# firewall-cmd --add-port=464/udp --permanent
# firewall-cmd --add-port=53/udp --permanent
# firewall-cmd --add-port=123/udp --permanent
# firewall-cmd --reload



firewall rules list
Lets us take reboot after configuration and updating the firewall rules.
Once the server is up check the IPA service status to also check the naming resolution.
 #systemctl status ipa
service status ipa
#nslookup ipa
 nslookup ipa
 It looks Perfect ! Server is ready now.
Now open a firefox or any other browser and access the IDENTITY MANAGEMENT url to configure users,services etc.
https://ipa.vinzlinux.com
login to ipa web
Now you will see a login prompt. where you need to put the credentials of "admin" which we have entered during the ipa-server-install.

 identity management login screen
 Once you are logged in then you could see the following screen where you have 3 tabs.
Identity , Policy and IPA Server . This screen is used to create users , policies ,DNS, certificates etc.
identity management screen


There are many options available in this Web GUI. I would recommend to go thru each tab and understand the settings/functionalities.
I will be discussing the IPA Server Administration and IPA-Client Configuration and in RHEL 7  in the next post.
That's all about the IPA-Server configuration. Hope you found this article useful to you !


3 comments:

  1. Nice Post, thank you very much for sharing.

    ReplyDelete
  2. Thank you for the course content On Servicenow Administration Online Training it will be Most usefull for Beginners

    ReplyDelete
  3. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating Hadoop Administration Online Training

    ReplyDelete