Category Archives: Network Security

Network Security Using TACACS – Part 2

Where to find TACACS+ server?

In the first part of this series, we had a brief introduction to the TACACS protocol and how it helps in centralizing and securing access to network devices.  This post will be a continuation and will be discussing the options we have available for implementing TACACS+ and will contain an example of how to use one of the free TACACS+ servers to implement the AAA functions we have talked about earlier.  In this post i will be using TACACS and TACACS+ interchangeably when referring to the protocol.

TACACS+ can be implemented using commercially available solutions such as Cisco’s widely deployed Access Control Server (ACS) or using freely available open-source implementations.  During my research, i found out that there are limited choices when it comes to TACACS+ software whether commercial or free as compared to other products.  Below i am posting the links to some of the sites i have come across for commercial solutions and open source or free implementations.

Commercial

Open Source/ Free

TACACS Demonstration

In this post, i have decided to try TACACS+ from TACACS.net installed on a Windows 7 machine for the simple reason of its simplicity and ease of installation and configuration.  The folks at TACACS.net have provided plenty of documentation on just about everything related to installation and configuration of their software.  I highly recommend reading the guides especially if advanced configurations are required.

For the client i have used a Cisco 1801 router since i have one at hand to play with.  The free open-source Cisco simulation software GNS or the virtual router Vyatta can also be used as a client if you can’t find a real router or switch for testing.  Below is a diagram showing the setup i have used for this post.

TACACS Implementation

The steps i have followed are downloading and installing the TACACS server on a windows 7 machine, configuring the TACACS server, configuring the Cisco 1801 router, testing authentication to the router via the TACACS server, and finally checking the accounting functionality of the TACACS server.  The TACACS users used for this test will be locally configured on the TACACS server again for the sake of simplicity.

TACACS Installation & Configuration

Installation

The installation of the TACACS server is a straight forward process made easy by an installation wizard.  Clicking through a few steps will get the software installed and ready for configuration.  During the installation, as shown below, we need to specify a pre-shared key that will be used between the TACACS server and the clients.  The purpose of this key is to encrypt the communication channel between the server and the client so that credentials are securely transmitted between the two.

Screenshot-2014-09-22_10.03.00

After the installation is complete, you can verify if the installation was correct in couple of ways. One way is by checking whether the TACACS service is installed and its status is running. The other way is to open a command prompt and use the ” netstat -abn” command to check if the server has opened a TCP port numbered 49 and is listening for connections.

Services-Tacacs

Netstat

Server Configuration

By default, the server is configured to use the localhost IP address 127.0.0.1 of the computer for accepting connections as shown above. We need to change this so that the server listens on the IP address required. Open the file “tacplus.xml” located in  %ALLUSERSPROFILE%\TACACS.net\config\ using notepad or wordpad and locate the “Local IP” section and change the IP to reflect the IP address of the real IP address of the server.  For sake of clarity, i recommend using Notepad++ which has so many added features to open the files mentioned here.  In my setup, the IP address of the server will be 192.168.244.124.  Besides the IP address, there are a number of other options that can be changed about the server configuration but for the purpose of this post i have kept all other options at their default.  After applying and saving the change, the TACACS service needs to be restarted to reflect the changes.  Once you verify the IP address you have assigned is listening on TCP port 49 by checking netstat, we can do further test by using Telnet to connect to that port from the same computer or a different machine.  If you are not able to connect then you will need to check if there is a firewall blocking the connection.

tacplus config file

Screenshot-2014-09-21_14.54.43

User Configuration

Now that the TACACS server is up and listening for TACACS requests on the IP address we have assigned, we need to configure the users who will be authenticated.  There are number of ways TACACS users credentials can be configured. The credentials can be locally configured using the configuration file provided by the installation or can be pulled from an Active Directory or LDAP Server. User accounts on the local system from where the users are connecting can also be used. The configuration file by default also enables users in the local administrators group access as a fallback option. This is when a user can not remember their password or the TACACS server becomes unavailable. For the purpose of this post, we will be using locally configured accounts in configuration file.  An example of each of user type is given within the configuration file.

Open the file named “authentication.xml” under the C:\ProgramData\TACACS.net\config\ directory and add the lines shown in the screenshot below. The easiest way for adding the user configuration is to copy the examples found in the file and editing the fields. In this example i copied the example group “Network Engineering” and it associated users and renamed the group to “Net Admins” and the two users accounts as “User1” and “User2” with a clear Login & Enable password of “P@ssw0rd”. We can insert a DES encrypted version of the password also in the password field for added security.  In the production environment, we need to harden the TACACS server, put it behind firewall to limit who can connect to it, and must ensure the sensitive files are protected and monitored.  If you decide to copy from the examples given, make sure you remove the comment section of the XML file which are denoted by “<!–” for beginning and “–>” for ending.

Screenshot-2014-09-18_10.22.16

Testing

TACACS.NET provides two tools for testing your configuration called Tacverify & Tactest.  Tacverify is used for checking errors in the server configuration files while Tactest checks to see if you can connect to the TACACAS server using credentials. They are both found under the TACACS installation folder which in our example is located at C:\Program Files (x86)\TACACS.net. To list the available options relating to the tools we can issue -? with the commands.

Screenshot-2014-09-18_10.37.23

Screenshot-2014-09-18_10.42.05
As shown from the results of the commands above, Tacverify shows our server configuration is okay and the authentication test done by Tactest was successful.  We now should be ready to configure our clients to use the TACACS server for authentication, authorization, and accounting.

Client Configuration

TACASCS configuration on clients is different from one client to another depending on the manufacturer.  For the purposes of this demonstration, we are using Cisco 1801 router as a client. The commands required for enabling TACACS are shown in the screen shots below.  A TACACS authentication list called “use-tacacs” is configured and applied on the VTY lines of the router.  Also as mentioned above, we need to specify the TACACS pre-shared key entered at the server.

Screenshot-2014-09-18_11.10.39

Screenshot-2014-09-18_11.10.15

Screenshot-2014-09-18_11.09.36

Authentication Test

Once the configuration of the Cisco router is ready, we are now ready for testing TACACS authentication. Using the users that we have configured above when we try to connect to the terminal line of the router using Putty,  we are asked to provide for TACACS username. After pressing enter, we will be asked for the password of the username just entered. If the username exists in the configuration and the password supplied is valid, the user is granted access to the operational mode of the router. Typing enable command and entering the enable password earlier configured in the configuration file will allow access to the privilege mode of the router.

Screenshot-2014-09-18_11.26.17 Screenshot-2014-09-18_11.26.27 Screenshot-2014-09-18_11.26.38 Screenshot-2014-09-18_11.26.49

Screenshot-2014-09-18_11.27.09

 Accounting Test

From the previous post we have learned that the accounting module of TACACS takes care of documenting about the TACACS session and what the TACACS users have done.  To test this functionality, a few commands were entered in the configration mode after logging into the client router using the credential for User1.  As shown below, User1 went into the loopback interface configuration, removed the IP address and shutdown the interface.  If no log archiving is configured on the router, then these commands entered by User1 cannot be recalled back.  But thanks to the Accounting module of the TACACS server all commands are captured as we shall see below.

Screenshot-2014-09-22_12.41.17

The logs for the TACACS.net server are kept C:\ProgramData\TACACS.net\Logs folder.  By opening the latest log file for accounting we see that the commands entered above have been recorded along with who the user was, the IP address of the User, the IP address of the network device, and the time stamp.  This kind of information becomes very important when troubleshooting an issue or investigating an incident.

Screenshot-2014-09-22_12.43.09

As we have seen from this post, it is relatively easy to install and configure a free TACACS+ server and use it for securing your network devices.  In addition to authenticating users, we have seen also how all commands executed on network devices can be recorded for later investigative purposes.  Furthermore, we can also implement an Authorization module which restricts what users can or can not do once they are authenticated.

Update 1

I have noticed on a couple of occasions after the installation of Tacacs.net is done, the service installed is not started by default and clicking on the start services will start and stop the service immediately.  After some investigation, i checked the logs in the event viewer and noticed that the service did not start because it encountered some XML errors.  I checked the tacplus.xml file and found there were improperly placed statements.  I fixed the statements and the service started properly.  I found this issue occurs if previous configuration files are existing when installing the software.  Just check the error message which most of the time tells you the line number to go and check where the problem is.

 

Screenshot-2015-02-15_11.33.29Screenshot-2015-02-15_11.06.25

Advertisements

Network Security Using TACACS – Part 1

What is TACACS?

TACACS usually pronounced as tack-axe is the acronym for Termnial Access Controller/Access Control System.  As the name implies, it is a protocol used as an access control mechanism for accessing networking devices via terminal connections.  In other words, it is used to regulate the access to routers, switches, wireless access controllers, network security devices, and any other network device that supports it.  It regulates this access by determining who can connect to the devices, what time they can connect, and once they are connected it determines what they can see and do.  In addition, it also records the activity of each authenticated user and information about the TACACS session.

Briefly to go into the history of the protocol, TACACS was originally developed in 1984 for the US department of defense by MILNET as a way to secure and automate access to network resources.  Since then, it has undergone several changes and three versions of it have been deployed over time.  The first version of the protocol to be adopted by the wider public was facilitated by Cisco’s adaption of the protocol at the end of 1984.  This version was in use for some time until Cisco began adding more features and extensions to the original protocol.  In 1990 these extensions on top of TACACS became Cisco’s proprietary protocol and were called Extended TACACS or XTACACS and gave us the second version of TACACS.   The protocol continued to evolve over the following years and eventually a third version of the protocol called TACACS+ was developed by Cisco in 1996.  Although TACACS+ is developed by Cisco and has not been accepted as an open standard, it is considered the most widely deployed protocol nowadays.  Most networking vendors now support the use of TACACS+ in their products.

What does TACACS do?

TACACS is a protocol that implements Authentication, Authorization, and Accounting (AAA) modules to achieve access control for network devices.  The Authentication module determines which users can connect to network devices.  It does that by checking the credentials against a list of users locally configured in the TACACS server or by checking against external user data stores such LDAP or Microsoft Active Directory.  Once users are authenticated, the Authorization module is responsible for determining what the users are allowed to see and do.  In other words, this module puts boundaries around what commands can be seen and executed by network administrators on the network devices they have been granted access.  Finally the Accounting module tracks information on the activity of the users and the TACACS session itself.  This information includes among other things, the commands that were executed, the length of the session, the user credentials, and the network device accessed.

So what does all of this really mean?  To demonstrate what TACACS can do, we will use an example in which a company has 200 network devices and 3 network administrators.  Without TACACS, each of the 200 network devices have to be configured with 3 separate user accounts representing the three administrators.  Each of the three administrators have to remember the username and password of the 200 network devices unless they decide to have the same credentials on all the devices.  If one administrator leaves, then the other admins need to reconfigure all of the 200 devices to remove the credential of the admin who has left.  In order to audit what a particular admin has done, all 200 network devices have to be configured for logging and checked individually.  Furthermore, if you want to limit what your administrates can see and do, then again you have to configure all the 200 devices one by one.  As you can see, without central mechanism, it quickly becomes clear that this is going to be an operational nightmare and most likely will lead to an insecure implementation.  TACACS solves the operational and security issues related to managing network devices by centralizing the AAA functions.

In the above example, the credentials for the three admins can be configured on the TACACS server or can be pulled from an LDAP or AD server.  Once the credentials are configured, then TACACS gets into action by allowing the admins access to all 200 devices using only one credential.  Furthermore, each admin can be assigned a different authorization profile centrally on the TACACS server thus restricting what they can see and do on each router.  Finally all of the actions of the three admins are tracked centrally.  If any of the admins leave, then it is just a smiple matter of deleting one credential from the TACACS configuration instead of doing it 200 times.  So in a nutshell, TACACS allows you to centrally manage your network devices allowing you to drastically reduce your operational and security risks.

 How does it work?

So now that we know a little about TACACS and what it is capable of doing, the next question will be how does it work.

02fig02

As shown in the diagram, there are three components in a TACACS implementation.  A user, a client and a TACACS server.  The user is either an administrator or a program requesting access to a network device (client), and the client is any network device that is configured to be accessed via the TACACS protocol.  The TACACS server sometimes referred as to nework authentication server or NAS is the server running software components containing the AAA modules we mentioned above.  Without going into detail, the following are the main steps involved when a user or program is requesting access to a network device (client) configured with TACACS protocol.

Step 1

A user or a program requests access to the terminal connection of a network client such a router using Telnet or SSH protocol.  Also most networking equipment today include web based management access which can also be integrated with TACACS.

Step 2

The request is then passed onto the TACACS server which in turn asks the client (router) for a username.

Step 3

The client router then responds with the username supplied by the user or program trying to connect to it.

Step 4

Once the TACACS server receives the username, it responds back with a request for a password from the client.

Step 5

The client router then responds with the password supplied by the user or program.

Step 6

The TACACS server then responds to the client router whether the supplied credentials were valid or not after which the session is established if valid credentials were entered or otherwise it is ended.

 Summary

As we have seen, TACACS is a protocol that was invented to centralize and secure the access to network resources.  Since it was first introduced in 1984,  it was adopted by the networking giant Cisco which have added several options to it.  Today the version widely deployed is Cisco’s version of the protocol called TACACS+ or TACACS Plus.  TACACS is used to implement authentication, authorization, and accounting for networking devices and can be used to minimize the operational complexity and security related risks.

In conclusion, i strongly advice network administrators and security professionals tasked with securing networks to look into  implementing centralized AAA environment for managing network resources either through TACACS or Radius.  There are free TACACS servers available as open source implementation as well as commercially available products that should meet the requirements of most enterprise networks.  In the second part of this series, I will be posting  about the options available and configuration details.

Network Security Using TACACS – Part 2