TACACS Configuration in ACI

In this tutorial we will be going over TACACS configuration so that users can login to APICs and fabric switches with TACACS credentials. For this tutorial I will be using ACS 5.8 and ISE 2.0 as the TACACS server to authenticate against.

Note: All ACS and ISE configuration in this tutorial is built from the ground up. If you have existing ACS or ISE configuration in place already that you would like to reuse please feel free to do so.

Prerequisites:
* Fabric discovery completed
* In-Band/Out-of-Band connectivity to your APIC(s) and fabric switches
* In-Band/Out-of-Band contracts configured (need to allow ICMP protocol and default TACACS ports UDP 49 and TCP 49)
* Make sure you can ping your TACACS server from the APICs and fabric switches you are trying to authenticate from

My Setup:
* ACI fabric running 3.1(2m)
* ACS version 5.8.1.4
* ISE version 2.0

Topics:
* Configuring TACACS Policies in ACI
* Configuring TACACS Policies in ACS 5.8
* Configuring TACACS Policies in ISE 2.0


Configuring TACACS Policies in ACI:

Configuration Overview:
* Create TACACS Provider
* Create TACACS Provider Group
* Create Login Domain

The first step in the ACI TACACS configuration is to create a TACACS Provider. To create the TACACS Provider navigate to the following APIC web GUI path:
Admin -> AAA -> TACACS+ Management -> TACACS+ Providers
Screen Shot 2018-05-11 at 5.28.49 PM.png

Right click TACACS+ Providers and select Create TACACS+ Provider

Screen Shot 2018-05-11 at 5.45.19 PM.png

This is where we define all of the TACACS attributes used to connect to the TACACS server:
IP Address: This is the IP address of the TACACS server
Port: This is the port used to connect to the TACACS server. TACACS default is port 49
Authorization Protocol: This needs to match the configuration on the TACACS server which we will go over later in the ACS and ISE configuration
Key: This needs to match the configuration on the TACACS server which we will go over later in the ACS and ISE configuration
Timeout: The amount of time allowed for a login attempt to occur before giving up (measured in seconds)
Retries: The number of automatic re-try login attempts allowed for a single authentication submission
Management EPG: The management EPG used to connect to the TACACS server. You will want to use the Management EPG which has all the necessary contracts in place
Server Monitoring: Used to determine if the TACACS server is alive. This option uses the TACACS protocol login to check if the TACACS server is alive

The next step is to create the TACACS Provider Group and associate our newly created TACACS Provider. To create the TACACS Provider Group navigate to the following APIC web GUI path:
Admin -> AAA -> TACACS+ Management -> TACACS+ Provider Groups
Screen Shot 2018-05-12 at 12.09.08 PM.png

Right click TACACS+ Provider Groups and select Create TACACS+ Provider Group
Screen Shot 2018-05-12 at 12.21.20 PM.png

This is where we add the TACACS Provider we previously created. Since we only have one TACACS provider we can set the priority to 1.

The final ACI configuration step is to create the Login Domain and associate our newly created TACACS Provider Group. To create a Login Domain navigate to the following APIC web GUI path:
Admin -> AAA -> AAA Authentication -> Login Domains
Screen Shot 2018-05-12 at 12.25.13 PM.png

Right click Login Domains and select Create Login Domain
Screen Shot 2018-05-12 at 12.30.49 PM.png

Provide a name, realm, and select the newly created TACACS Provider Group.

It is recommended to create an additional Login Domain which has a Realm of Local. This local Login Domain will allow users to use local APIC credentials and will appear in the Domain drop down list in the APIC GUI login screen.

Let’s go ahead and take a look at our APIC login screen to see the reflected changes:
Screen Shot 2018-05-21 at 10.29.18 PM.png

From here we can see our newly created TACACS Login Domain, MyTACACSLoginDomain, as well as the Login Domain, LocalLoginDomain, which we created for local authentication. If a Login Domain is not selected, the built in DefaultAuth login domain will be used. The DefaultAuth login domain piggybacks off of the Default Authentication configuration see in the below AAA Authentication screenshot below. So what if we don’t always want to select our TACACS login domain every time we want to login with a TACACS user? We can change the default Login Domain behavior by navigating to the following APIC web GUI path:
Admin -> AAA -> AAA Authentication

From here we can see that the Default Authentication Realm is set to local.
Screen Shot 2018-05-12 at 12.48.46 PM.png

So let’s change that to TACACS and select our newly created TACACS Provider Group:
Screen Shot 2018-05-12 at 12.51.50 PM.png
This will enable default TACACS authentication for the APIC GUI and SSH sessions to APICs and fabric switches. However, in order to enable TACACS authentication for console sessions to fabric switches you will also need to enable the TACACS+ Realm for Console Authentication.

Note: Make sure to leave/set the Fallback Check property to false. Setting the Fallback Check property to true may cause local logins to fail.

So what happens if you set your default Login Domain to TACACS, you did not create an additional Login Domain for local authentication, and you forgot your TACACS credentials? In ACI there is a Login Domain which is known as fallback. The fallback Login Domain cannot be deleted and is set to use local authentication by default (though this can be changed for some reason). In order to login to the fallback Login Domain you must use a specific syntax:
APIC GUI: apic:LOGIN_DOMAIN_HERE\\LOCAL_USERNAME_HERE
APIC CLI: apic#LOGIN_DOMAIN_HERE\\LOCAL_USERNAME_HERE

To login to the local admin account you would use the following APIC GUI and CLI syntax’s:
APIC GUI: apic:fallback\\admin
APIC CLI: apic#fallback\\admin

This concludes all the necessary ACI configuration for TACACS. Now let’s move onto the ACS 5.8 TACACS configuration.

Configuring TACACS Policies in ACS 5.8:

Configuration Overview:
* Create Network Device Location
* Create Network Device Type
* Create Network Devices and AAA Clients
* Create Identity Group
* Create local user on the ACS server
* Create Shell Profile with AVPair
* Create Device Administration Authorization Policy

The first step in the ACS TACACS configuration process is to create the Network Device Location and Device Types to group all of our ACI APICs and fabric switches which will be acting as TACACS clients. To do this navigate to the following ACS web GUI path:
Network Resources -> Network Device Groups -> Location -> Create
Screen Shot 2018-05-12 at 1.08.49 PM.png

From here we can go ahead and assign a name to our Device Location and leave the Parent set to All Locations. For our purposes we will use the following configuration:
Screen Shot 2018-05-12 at 1.12.38 PM.png

After submitting our changes the next step is to create the Device Type. To do this navigate to the following ACS web GUI path:
Network Resources -> Network Device Groups -> Device Type -> Create
Screen Shot 2018-05-12 at 1.14.12 PM.png

From here we can go ahead and assign a name to our Device Type and leave the Parent set to All Device Types. For our purposes we will use the following configuration:
Screen Shot 2018-05-12 at 1.51.36 PM.png

After submitting our changes the next step is to create our Network Devices and AAA Clients and assign the IP addresses of all the APICs and fabric switches we want to use TACACS with. To do this navigate to the following ACS web GUI path:
Network Resources -> Network Devices and AAA Clients -> Create
Screen Shot 2018-05-12 at 1.55.54 PM.png

From here we can go ahead and assign a name to our network device group, assign the Location and Device Type, enable TACACS+ authentication using the same Shared Secret as you did when creating the ACI TACACS Provider, and assign the IP addresses of the APICs and fabric switches. For demo purposes I am just going to assign the IP of my APIC-1 which has an Out-of-Band IP address of 10.122.143.30. Our configuration will look like such:
Screen Shot 2018-05-12 at 2.07.01 PM.png

After submitting the changes the next step is to create a Identity Group to assign the local users to, which we will be creating after. To create the Identity Group navigate to the following ACS web GUI path:
Users and Identity Stores -> Identity Groups -> Create
Screen Shot 2018-05-12 at 2.13.01 PM.png

From here we can go ahead and assign a name to our Identity Group. For our purposes we will create two Identity Groups, ACI Admin and ACI Read-Only. Our configuration for ACI Admin will look like such:
Screen Shot 2018-05-12 at 2.21.04 PM.png

After submitting the changes the next step is to create a local user account to authenticate TACACS against. This user will be associated to the newly created Identity Group. Of course you can associate ACS to an external identity store, such as LDAP so that local users on ACS are not required, however for demo simplicity we will create a local ACS user. To create a local user account navigate to the following ACS web GUI path:
Users and Identity Stores -> Internal Identity Stores -> Users -> Create
Screen Shot 2018-05-12 at 2.25.12 PM.png

From here we can go ahead and assign a username, password, and Identity Group to our user. For our purposes we will create two users, aci_admin and aci_readonly. Each will be assigned to their respective newly created Identity Group. Our configuration for the aci_admin user will look like such:
Screen Shot 2018-05-12 at 2.32.21 PM.png

Repeat the process for any additional users you want to add.

The next step is to create the shell profile for our users. The shell profile consists of a value known as an AVPair which determines what access is give to ACI users such as full administrative privileges or read-only privileges. To create the shell profile navigate to the following ACS web GUI path:
Policy Elements -> Authorization and Permissions -> Device Administration -> Shell Profiles -> Create
Screen Shot 2018-05-12 at 2.46.39 PM.png

From here we can go ahead and assign a name to our shell profile. For our purposes we will create two different shell profiles, Read-Write-All and ReadOnly-All. Other than a Name, we also need to assign a Custom Attribute to each shell profile. This Custom Attribute will be what contains our AVPair. The only section of the Custom Attribute we care about is seen below in the screenshot with the red border:
Screen Shot 2018-05-12 at 2.55.10 PM.png

Right now we are creating our Read-Write-All shell profile, so we will want to assign an attribute which will allow read and write access to all of ACI. The custom attribute we need to assign has two important values, Attribute and Attribute Value. All Attributes need to have a value of cisco-av-pair. That value must not be different. The Attribute Value, known as the AVPair, is what actually determines user permissions. AVPairs have the below syntax’s depending if you want to assign read of write privileges:

Write Privileges: shell:domains=ACI_SECURITY_DOMAIN_HERE/ACI_USER_ROLE_HERE/

Read Privileges: shell:domains=ACI_SECURITY_DOMAIN_HERE//ACI_USER_ROLE_HERE

The ACI_SECURITY_DOMAIN_HERE value is that of the Security Domain local to ACI. ACI Security Domains are tied to specific objects such as tenants. All Security Domains and their associated objects can be located in the following APIC web GUI path:
Admin -> AAA -> Security Management -> Security Domains
Screen Shot 2018-05-12 at 3.16.26 PM.png

From here you can select a specific security domain to see all the associated objects. Below is a screenshot of the all security domain which is tied to the default common, infra, mgmt, and my custom acozzett tenants:
Screen Shot 2018-05-12 at 3.25.06 PM.png

The ACI_USER_ROLE_HERE value is that of a role on ACI. Ultimately the role determines the privileges given to a security domain. All ACI roles can be found at the following ACI web GUI path:
Admin -> AAA -> Security Management -> Roles
Screen Shot 2018-05-12 at 3.24.20 PM.png

For more information on ACI Security Domains and Roles visit here:

For our Read-Write-All shell profile we want to assign admin privileges to all objects. To do this we will use the following AVPair:

shell:domains=all/admin/

all refers to the all ACI Security Domain, and admin refers to the admin role in ACI.

Our shell profile configuration for Read-Write-All will look like such:
Screen Shot 2018-05-12 at 3.40.01 PM.png

Make sure to click Add and Submit for the changes to be applied.

For our aci_readonly shell profile we will use AVPair shell:domains=all//read-all

Our shell profile configuration for ReadOnly-All will look like such:
Screen Shot 2019-04-13 at 12.00.16 PM.png

This will give read only access to any objects in the all ACI Security Domain using the read-all role.

For more information on AVPair syntax and including users in more than one domain visit here.

Note: You will see a lot of ACI TACACS and RADIUS documentation with a UNIX ID defined in the AVPair, such as:
shell:domains=all/read-all(16001)

You do NOT want to define the UNIX ID. Doing so can cause permission issues and usernames to be mismatched. A UNIX ID will be dynamically assigned by ACI and verified that a UNIX ID is not already in use by another user.

The final step in the ACS configuration is to create the Device Administration Authorization Policy to tie together all the ACS policies we previously created. The first step in tying all our policies together is to create the Access Service. To create the Access Service navigate to the following ACS web GUI path:
Access Policies -> Access Services -> Create
Screen Shot 2018-05-20 at 9.28.42 PM.png

For our purposes we will call our Access Service ACI Access Service and select User Selected Service Type and set it to Device Administration:
Screen Shot 2019-04-13 at 12.03.49 PM.png

Next we need to select the Allowed Protocols. In our prior ACI configuration we selected to use PAP authentication, so we will select that here. You will want to choose the same Access Service Authentication Protocol as you did earlier in the ACI TACACS Provider Configuration. Our Allowed Protocols configuration will look like such:
Screen Shot 2018-05-20 at 9.38.50 PM.png

After clicking Finish you will be prompted to modify the Service Selection policy:
Screen Shot 2018-05-20 at 9.39.43 PM.png
You will want to select Yes. After selecting Yes you will need to actually create the Service Selection Rule. You should be automatically redirected to the area in the GUI where the Service Selection Rule is created, however if not, below is the ACS web GUI path to create the Service Selection Rule:
Access Policies -> Access Services -> Service Selection Rules -> Create
Screen Shot 2018-05-20 at 9.42.55 PM.png

For our purposes we will call our Service Selection Rule ACI Service Selection. From here we will want to set the status to Enabled, the Protocol to Tacacs and set the Service to our recently created Access Service ACI Access Service. Our configuration will look like the following:
Screen Shot 2019-04-13 at 12.06.36 PM.png

Select OK and Save Changes to commit the configuration. You should see your newly created Service Selection Rule in the list:
Screen Shot 2018-05-20 at 10.13.43 PM.png

We will need to move ACI Service Selection up to the very top of the the Rule List, since we need our specific rule to be hit first. If we do not move it to the top, it will hit Rule-2 which will cause a failed login. To move ACI Service Selection to the top, check the box and use the arrow to move it to the very top:
Screen Shot 2019-04-13 at 12.07.57 PM.png

Select Save Changes to commit the configuration.

Next we need to configure our new Access Service ACI Service Selection to use our local user internal Identity Source. To set the correct Identity Source navigate to the following ACS web GUI path:
Access Policies -> Access Services -> YOUR_ACCESS_SERVICE_HERE -> Identity
Screen Shot 2019-04-13 at 12.25.30 PM.png

From here set the Identity Source to Internal Users:
Screen Shot 2019-04-13 at 12.28.27 PM.png

Select Save Changes to commit the configuration.

The last ACS configuration is to create an Authorization Policy for our ACI Access Service policy. The purpose of these Authorization Rules is to apply a specific Shell Profile to a specific Identity Group consisting of users. To create the Authorization Policy navigate to the following ACS web GUI path:
Access Policies -> Access Services -> YOUR_ACCESS_SERVICE_HERE -> Authorization -> Create
Screen Shot 2018-05-20 at 10.20.00 PM.png

Here we will create two rules, Read-Write-All-Rule and ReadOnly-All-Rule.

Below is the following configuration for Read-Write-All-Rule:
Screen Shot 2019-04-13 at 12.33.50 PM.png

Below is the following configuration for ReadOnly-All-Rule:
Screen Shot 2019-04-13 at 12.35.36 PM.png

Select OK to submit your configuration and select Save Changes to commit the configuration.

You should now be able to login with users and verify that the correct permissions are given from the configured Shell Profile.

Configuring TACACS Policies in ISE 2.0:

Configuration Overview:
* Create Network Device Location
* Create Network Device Type
* Create Network Device
* Create Identity Group
* Create Local Identities
* Create TACACS Profile with AVPair
* Create TACACS Admin Policy Set

The first step in the ISE TACACS configuration is to create the Network Device Location to help categorize where our devices are located. To create the Network Device Location navigate to the following ISE web GUI path:
Administration -> Network Resources -> Network Device Groups -> Groups -> All Locations -> Add
Screen Shot 2018-05-29 at 7.06.53 PM.png

From here we can go ahead and assign a name to our Device Location.
Screen Shot 2018-05-29 at 7.08.41 PM.png

After submitting our changes, the next step is to create the Network Device Type. To do this navigate to the following ISE web GUI path:
Administration -> Network Resources -> Network Device Groups -> Groups -> All Device Types -> Add
Screen Shot 2018-05-29 at 7.11.57 PM.png

From here we can go ahead and assign a name to our Device Type. For our purposes we will use the following configuration:

Screen Shot 2018-05-29 at 7.23.38 PM.png

After submitting our changes the next step is to create our Network Devices, where we will define what APICs and fabric switches we want to use TACACS with. To do this navigate to the following ISE web GUI path:
Administration -> Network Resources -> Network Devices -> Add
Screen Shot 2018-05-29 at 7.28.14 PM.png

From here we can go ahead and assign a name to our Network Device, assign the Location and Device Type, enable TACACS+ authentication using the same Shared Secret as you did when creating the ACI TACACS Provider, and assign the IP addresses of the APICs and fabric switches. For demo purposes I am just going to assign the IP of my APIC-1 which has an Out-of-Band IP address of 10.122.143.30. Our configuration will look like such:
Screen Shot 2018-05-29 at 7.32.16 PM.png

After submitting the changes the next step is to create a Identity Group to assign the local users to, which we will be creating after. To create the Identity Group navigate to the following ISE web GUI path:
Work Centers -> Device Administration -> User Identity Groups -> User Identity Group -> Add
Screen Shot 2018-05-29 at 7.35.00 PM.png

From here we can go ahead and assign a name to our Identity Group. For our purposes we will create two Identity Groups, ACI Admin and ACI Read-Only.

After submitting the changes the next step is to create a local user account to authenticate TACACS against. This user will be associated to the newly created Identity Group. Of course you can associate ISE to an external identity store, such as LDAP so that local users on ISE are not required, however for demo simplicity we will create a local ISE user. To create a local user account navigate to the following ISE web GUI path:
Work Centers -> Device Administration -> Identities -> Add
Screen Shot 2018-05-29 at 7.39.28 PM.png

From here we can go ahead and assign a username, password, and Identity Group to our user. For our purposes we will create two users, aci_admin and aci_readonly. Each will be assigned to their respective newly created Identity Group. Our configuration for the aci_admin user will look like such:
Screen Shot 2018-05-31 at 11.41.46 AM.png

Note that we will NOT be adding our AVPair here. We will come back to configuring the AVPair later.

The next step is to create our TACACS Profiles which will contain our AVPairs. To help understand the purpose of AVPairs and their syntax, read the above ACS section titled Create Shell Profile with AVPair. To create our TACACS Profiles navigate to the following ISE web GUI path:
Work Centers -> Device Administration -> Policy Results -> TACACS Profiles -> Add
Screen Shot 2018-05-31 at 11.51.06 AM.png

From here we can go ahead and assign a name to our TACACS Profile. For our purposes we will create two different TACACS Profiles, Read-Write-All and ReadOnly-All. Other than a Name, we also need to assign a Custom Attribute to each shell profile. This Custom Attribute will be what contains our AVPair. Directly below is our Read-Write-All TACACS Profile:
Screen Shot 2018-05-31 at 11.56.37 AM.png

The next and final step is to create a TACACS Admin Policy Set to tie together all of our ISE policies. To create the TACACS Admin Policy Set navigate to the following ISE web GUI path:
Work Centers -> Device Administration -> Device Admin Policy Sets
Screen Shot 2018-05-31 at 1.00.41 PM.png

We will then need to create our new Policy Set by selecting the green arrow in the upper left and selecting Create Above:
Screen Shot 2018-05-31 at 1.04.30 PM.png

This will place our custom Policy Set above the already existing Default policy set so that our more specific rule is hit first.

The first step in creating our new Policy Set is to assign a Name and Condition. For our purposes we will call our Policy Set ACI-TACACS-Pol-Set. For our Condition we will want to create a new one, so from the Condition drop down list select Create New Condition
Screen Shot 2018-05-31 at 1.08.43 PM.png

From here we will want to filter on the following conditions and values:
Screen Shot 2018-05-31 at 1.38.03 PM.png
The San Jose CA and ACI Fabric Devices attributes were what we created earlier in this tutorial. These values will allow our policy set to be hit given only given the specific conditions.

The next step in creating our policy set is to define the Authentication Policy. For our purposes we will use the Default Rule and apply further configuration to it. We will want to configure both the Allowed Protocols and Identity Source. From the Allowed Protocols list we have the ability to create a new protocol:
Screen Shot 2018-05-31 at 1.58.49 PM.png

This protocol attribute will allow us to define what authentication protocols (PAP, CHAP, MS-CHAP, etc) are allowed. For our purposes we will need to enable Allow PAP/ASCII since our ACI TACACS configuration is set to use PAP. Our configuration will look like such:
Screen Shot 2018-05-31 at 2.01.32 PM.png

For our Identity Source we will want to select Internal Users since the identities we created earlier were local to ISE.

The next and final step in creating our policy set is to define the Authentication Policy is to configure the Authorization Policy. We will need to create a new rule which we need to place above the Default rule:
Screen Shot 2018-05-31 at 2.10.12 PM.png
The only fields we will need to specify are the NameIdentity Group, and Shell Profile. For our purposes since we have two Identity Groups, ACI Admin and ACI Read-Only, we will want to assign the correct Shell Profiles to each. OurAuthorization Policy configuration will look like such:
Screen Shot 2018-05-31 at 2.23.45 PM.png

Our entire Policy Set looks like such:
Screen Shot 2018-05-31 at 2.24.50 PM.png

You should now be able to login with users and verify that the correct permissions are given from the configured Shell Profile.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s