1 | % Security workshop |
---|
2 | % Tacacs lab |
---|
3 | |
---|
4 | \pagebreak |
---|
5 | |
---|
6 | # getting tacacs configured |
---|
7 | |
---|
8 | |
---|
9 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
10 | $ sudo apt-get install tacacs+ |
---|
11 | $ sudo groupadd -r cisco |
---|
12 | $ sudo vi /etc/tacacs+/tac_plus.conf |
---|
13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
14 | |
---|
15 | ### change the following settings |
---|
16 | |
---|
17 | 1. we want to set the password for routers who want to use our service to TacacsPassword |
---|
18 | 1. We also want to limit access for users based on groups. For this example we will use settings in tac_plus.conf |
---|
19 | |
---|
20 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
21 | # change this line |
---|
22 | |
---|
23 | key = TacacsPassword |
---|
24 | |
---|
25 | # ... then at the end of the file .... add: |
---|
26 | |
---|
27 | group = netops { |
---|
28 | default service = permit |
---|
29 | login = file /etc/passwd |
---|
30 | enable = file /etc/passwd |
---|
31 | service = exec { |
---|
32 | priv-lvl = 15 |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | # |
---|
37 | # "level 2" users who cannot "debug" or "config" |
---|
38 | # |
---|
39 | group = l2_tacacs_users { |
---|
40 | default service = permit |
---|
41 | login = file /etc/passwd |
---|
42 | enable = file /etc/passwd |
---|
43 | service = exec { |
---|
44 | priv-lvl = 15 |
---|
45 | } |
---|
46 | cmd = configure { |
---|
47 | deny "." |
---|
48 | } |
---|
49 | cmd = debug { |
---|
50 | deny "." |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | user = sysadm { |
---|
55 | member = netops |
---|
56 | } |
---|
57 | |
---|
58 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
59 | |
---|
60 | ### restart tacacs_plus to pick up the new settings |
---|
61 | |
---|
62 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
63 | $ sudo service tacacs_plus restart |
---|
64 | |
---|
65 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
66 | |
---|
67 | # getting a cisco device to talk to your tacas |
---|
68 | |
---|
69 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
70 | aaa new-model |
---|
71 | aaa authentication login default group tacacs+ local |
---|
72 | aaa authorization console |
---|
73 | aaa authorization exec default group tacacs+ if-authenticated |
---|
74 | aaa session-id common |
---|
75 | |
---|
76 | aaa accounting delay-start |
---|
77 | aaa accounting exec default start-stop group tacacs+ |
---|
78 | aaa accounting commands 15 default start-stop group tacacs+ |
---|
79 | |
---|
80 | |
---|
81 | tacacs-server host 10.10.9.1 |
---|
82 | tacacs-server key TacacsPassword |
---|
83 | |
---|
84 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
85 | |
---|
86 | ### Now you can verify accounting |
---|
87 | |
---|
88 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
89 | Router#show accounting |
---|
90 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|