Advertisement
Guest User

Untitled

a guest
Oct 28th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. sudo apt-get update && sudo apt-get upgrade
  2. sudo apt-get install build-essential libnet-ldap-perl
  3. cd ~
  4. wget http://www.pro-bono-publico.de/projects/src/DEVEL.tar.bz2
  5. bzip2 -dc DEVEL.tar.bz2 | tar xvfp -
  6. cd PROJECTS
  7. sudo make
  8. sudo make install
  9. sudo mkdir /var/log/tac_plus/access
  10. sudo mkdir /var/log/tac_plus/accounting
  11. sudo mkdir /var/log/tac_plus/authentication
  12.  
  13. /usr/local/lib/mavis/mavis_tacplus_ldap.pl < /dev/null
  14. Default server type is 'tacacs_schema'. You *may* need to change that to 'generic' or 'microsoft'.
  15. LDAP_HOSTS not defined at /usr/local/lib/mavis/mavis_tacplus_ldap.pl line 277, <DATA> line 755.
  16.  
  17. cd /usr/local/etc
  18. sudo touch tac_plus.cfg
  19. sudo chmod 755 tac_plus.cfg
  20. sudo nano tac_plus.cfg
  21.  
  22. #!/usr/local/sbin/tac_plus
  23. id = spawnd {
  24. listen = { address = 0.0.0.0 port = 49 }
  25. #Uncomment the line below for IPv6 support
  26. #listen = { address = :: port = 49 }
  27. spawn = {
  28. instances min = 1
  29. instances max = 10
  30. }
  31. background = yes
  32. }
  33.  
  34. id = tac_plus {
  35. access log = /var/log/tac_plus/access/access-%Y%m%d.txt
  36. accounting log = /var/log/tac_plus/accounting/acct-%Y%m%d.txt
  37. authentication log = /var/log/tac_plus/authentication/auth-%Y%m%d.txt
  38.  
  39. mavis module = external {
  40. setenv LDAP_SERVER_TYPE = "microsoft"
  41. #If you are using Microsoft Global Catalog with LDAP SSL
  42. #setenv LDAP_HOSTS = "ldaps://10.0.0.100:3269"
  43. #If you are using Microsoft Global Catalog with LDAP (non-SSL)
  44. setenv LDAP_HOSTS = "10.0.0.100:3268"
  45. setenv LDAP_BASE = "DC=domain,DC=name"
  46. setenv LDAP_SCOPE = sub
  47. setenv LDAP_FILTER = "(&(objectClass=user)(objectClass=person)(sAMAccountName=%s))"
  48. setenv LDAP_USER = "svc_tacplus@domain.name"
  49. setenv LDAP_PASSWD = "ServiceAccountPassword"
  50. #Setting UNLIMIT_AD_GROUP_MEMBERSHIP to 0 will cause a NACK response if the AD account is a member of more than one security group
  51. setenv UNLIMIT_AD_GROUP_MEMBERSHIP = 1
  52. #I'm not 100% sure what EXPAND_AD_GROUP_MEMBERSHIP does
  53. setenv EXPAND_AD_GROUP_MEMBERSHIP = 0
  54. #Clear default setting of tacplus for AD_GROUP_PREFIX
  55. setenv AD_GROUP_PREFIX = ""
  56. #Setting REQUIRE_TACACS_GROUP_PREFIX to 1 will cause a NACK response if the AD account is not a member of a security group with the required prefix
  57. setenv REQUIRE_TACACS_GROUP_PREFIX = 0
  58. #Set USE_TLS to 1 if you are using port 636 or 3269, set to 0 for port 389 or 3268
  59. setenv USE_TLS = 0
  60. exec = /usr/local/lib/mavis/mavis_tacplus_ldap.pl
  61. }
  62.  
  63. login backend = mavis
  64. user backend = mavis
  65. pap backend = mavis
  66.  
  67. host = world {
  68. address = 0.0.0.0/0
  69. #Uncomment the line below for IPv6 support
  70. #address = ::/0
  71. prompt = "Welcomen"
  72. enable 15 = clear secret
  73. key = "cisco"
  74. }
  75.  
  76. #Example group that grants admin on Cisco IOS/XE/XR and NX-OS
  77. group = admin {
  78. default service = permit
  79. service = shell {
  80. default command = permit
  81. default attribute = permit
  82. set priv-lvl = 15
  83. }
  84. service = exec {
  85. set task = "#root-system"
  86. set priv-lvl = 15
  87. set shell:roles=""network-admin vdc-admin""
  88. }
  89. }
  90.  
  91. #Example AD user mapping
  92. user = jsmith {
  93. password = mavis
  94. member = admin
  95. }
  96. }
  97.  
  98. /usr/local/sbin/tac_plus -P /usr/local/etc/tac_plus.cfg
  99.  
  100. /usr/local/bin/mavistest -d -1 /usr/local/etc/tac_plus.cfg tac_plus TACPLUS SomeUserName SomeUserPassword
  101.  
  102. {mavistest debug output omitted}
  103.  
  104. Input attribute-value-pairs:
  105. TYPE TACPLUS
  106. TIMESTAMP mavistest-2501-1509172787-0
  107. USER SomeUserName
  108. PASSWORD SomeUserPassword
  109. TACTYPE AUTH
  110.  
  111.  
  112. Output attribute-value-pairs:
  113. TYPE TACPLUS
  114. TIMESTAMP mavistest-2501-1509172787-0
  115. USER SomeUserName
  116. RESULT ACK
  117. PASSWORD SomeUserPassword
  118. SERIAL QrWVmlId0OZADDRU/hy/pw=
  119. DBPASSWORD SomeUserPassword
  120. TACMEMBER [List of Active Directory security groups]
  121. TACTYPE AUTH
  122.  
  123. cd /etc/init.d
  124. sudo cp ~/PROJECTS/tac_plus/extra/etc_init.d_tac_plus /etc/init.d/tac_plus
  125. sudo chmod 755 /etc/init.d/tac_plus
  126. sudo chown root:root /etc/init.d/tac_plus
  127. sudo update-rc.d tac_plus defaults
  128. sudo service tac_plus start
  129.  
  130. sudo netstat -tulpen
  131.  
  132. Active Internet connections (only servers)
  133. Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
  134. tcp 0 0 0.0.0.0:49 0.0.0.0:* LISTEN 0 25680 1911/tac_plus: 0 co
  135. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 16105 1023/sshd
  136. tcp6 0 0 :::22 :::* LISTEN 0 16113 1023/sshd
  137.  
  138. sudo nano /usr/local/etc/tac_plus.cfg
  139. sudo service tac_plus stop
  140. sudo service tac_plus start
  141.  
  142. Environment variables from mavis_tacplus_ldap.pl:
  143.  
  144. LDAP_SERVER_TYPE
  145. One of: generic tacacs_schema microsoft
  146. Default: tacacs_schema
  147.  
  148. LDAP_HOST
  149. Space-separated list of LDAP URLs or IP addresses or hostnames
  150. Examples: "ldap01 ldap02", "ldaps://ads01:636 ldaps://ads02:636"
  151.  
  152. LDAP_SCOPE
  153. LDAP search scope (base, one, sub)
  154. Default: sub
  155.  
  156. LDAP_BASE
  157. Base DN of your LDAP server
  158. Example: "dc=example,dc=com"
  159.  
  160. LDAP_FILTER
  161. LDAP search filter
  162. Defaults depend on LDAP_SERVER_TYPE:
  163. - generic: "(uid=%s)"
  164. - tacacs_schema: "(&(uid=%s)(objectClass=tacacsAccount))"
  165. - microsoft: "(&(objectclass=user)(sAMAccountName=%s))"
  166.  
  167. LDAP_FILTER_CHPW
  168. LDAP search filter for password changes
  169. Defaults depend on LDAP_SERVER_TYPE:
  170. - generic: "(uid=%s)"
  171. - tacacs_schema: "(&(uid=%s)(objectClass=tacacsAccount)(!(tacacsFlag=staticpasswd))"
  172. - microsoft: "(&(objectclass=user)(sAMAccountName=%s))"
  173.  
  174. LDAP_USER
  175. User to use for LDAP bind if server doesn't permit anonymous searches.
  176. Default: unset
  177.  
  178. LDAP_PASSWD
  179. Password for LDAP_USER
  180. Default: unset
  181.  
  182. AD_GROUP_PREFIX
  183. An AD group starting with this prefix will be used for tacacs group membership.
  184. Default: tacacs
  185.  
  186. REQUIRE_AD_GROUP_PREFIX
  187. If set, user needs to be in one of the AD_GROUP_PREFIX groups.
  188. Default: unset
  189.  
  190. UNLIMIT_AD_GROUP_MEMBERSHIP
  191. If unset, the number of groups a user can be member of is limited to one.
  192. Default: unset
  193.  
  194. EXPAND_AD_GROUP_MEMBERSHIP
  195. If set, AD group memberships will be expanded.
  196. Default: unset
  197.  
  198. USE_TLS
  199. If set, the server is required to support start_tls.
  200. Default: unset
  201.  
  202. FLAG_CHPW
  203. Permit password changes via this backend.
  204. Default: unset
  205.  
  206. FLAG_PWPOLICY
  207. Enforce a simplicistic password policy.
  208. Default: unset
  209.  
  210. FLAG_CACHE_CONNECTION
  211. Keep connection to LDAP server open.
  212. Default: unset
  213.  
  214. FLAG_FALLTHROUGH
  215. If LDAP search fails, try next module (if any).
  216. Default: unset
  217.  
  218. FLAG_USE_MEMBEROF
  219. Use the memberof attribute for determining group membership.
  220. Default: unset
  221.  
  222. FLAG_AUTHORIZE_ONLY
  223. Don't attempt to authenticate users.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement