Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions data/templates/tacplus_nss.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ local_authorization
{% if tacacs_authorization %}
tacacs_authorization
{% endif %}
{% if tacacs_authorization and traceid_authorization %}

# traceid_authorization - If you want to send SSH TraceId in TACACS+ authorization, set it
# Default: on
# traceid_authorization
traceid_authorization
{% endif %}

# src_ip - set source address of TACACS+ protocol packets
# Default: None (auto source ip address)
Expand Down
9 changes: 7 additions & 2 deletions scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ LIMITS_CONF = "/etc/security/limits.conf"
TACPLUS_SERVER_PASSKEY_DEFAULT = ""
TACPLUS_SERVER_TIMEOUT_DEFAULT = "5"
TACPLUS_SERVER_AUTH_TYPE_DEFAULT = "pap"
TACPLUS_TRACEID_AUTHORIZATION_DEFAULT = True

# RADIUS
RADIUS_SERVER_AUTH_PORT_DEFAULT = "1812"
Expand Down Expand Up @@ -366,7 +367,8 @@ class AaaCfg(object):
self.tacplus_global_default = {
'auth_type': TACPLUS_SERVER_AUTH_TYPE_DEFAULT,
'timeout': TACPLUS_SERVER_TIMEOUT_DEFAULT,
'passkey': TACPLUS_SERVER_PASSKEY_DEFAULT
'passkey': TACPLUS_SERVER_PASSKEY_DEFAULT,
'traceid_authorization': TACPLUS_TRACEID_AUTHORIZATION_DEFAULT
}
self.tacplus_global = {}
self.tacplus_servers = {}
Expand Down Expand Up @@ -467,6 +469,8 @@ class AaaCfg(object):
def tacacs_global_update(self, key, data, modify_conf=True):
if key == 'global':
self.tacplus_global = data
if 'traceid_authorization' in self.tacplus_global:
self.tacplus_global['traceid_authorization'] = is_true(self.tacplus_global['traceid_authorization'])
if modify_conf:
self.modify_conf_file()

Expand Down Expand Up @@ -808,7 +812,8 @@ class AaaCfg(object):
local_accounting=local_accounting_conf,
tacacs_accounting=tacacs_accounting_conf,
local_authorization=local_authorization_conf,
tacacs_authorization=tacacs_authorization_conf)
tacacs_authorization=tacacs_authorization_conf,
traceid_authorization=tacplus_global['traceid_authorization'])
with open(NSS_TACPLUS_CONF, 'w') as f:
f.write(nss_tacplus_conf)

Expand Down
2 changes: 1 addition & 1 deletion tests/hostcfgd/hostcfgd_tacacs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestHostcfgdTACACS(TestCase):
Test hostcfd daemon - TACACS
"""
def run_diff(self, file1, file2):
_, output = getstatusoutput_noshell(['diff', '-uR', file1, file2])
_, output = getstatusoutput_noshell(['diff', '-ur', file1, file2])
return output

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ local_authorization
# tacacs_authorization
tacacs_authorization

# traceid_authorization - If you want to send SSH TraceId in TACACS+ authorization, set it
# Default: on
# traceid_authorization
traceid_authorization

# src_ip - set source address of TACACS+ protocol packets
# Default: None (auto source ip address)
# src_ip=2.2.2.2
Expand Down
6 changes: 4 additions & 2 deletions tests/hostcfgd/test_tacacs_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"auth_type": "chap",
"timeout": 5,
"passkey": "dellsonic",
"src_intf": "Ethernet0"
"src_intf": "Ethernet0",
"traceid_authorization": "false"
}
},
"TACPLUS_SERVER": {
Expand Down Expand Up @@ -109,7 +110,8 @@
"auth_type": "chap",
"timeout": 5,
"passkey": "dellsonic",
"src_intf": "Ethernet0"
"src_intf": "Ethernet0",
"traceid_authorization": "false"
}
},
"TACPLUS_SERVER": {
Expand Down
Loading