Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yang] Restrict AAA authorization with TACPLUS passkey #18155

Merged
merged 3 commits into from
Feb 27, 2024
Merged
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
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"AAA_AUTHORIZATION_TEST": {
"desc": "Configure an authorization type in AAA table."
},
"AAA_AUTHORIZATION_TEST_TACACS_WITHOUT_TACPLUS": {
"desc": "Configure tacacs in authorization type in AAA table without TACPLUS table.",
"eStr": ["Authorization with 'tacacs+' is not allowed when passkey not exists."]
},
"AAA_ACCOUNTING_TEST": {
"desc": "Configure an accounting type in AAA table."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@
},

"AAA_AUTHORIZATION_TEST": {
"sonic-system-aaa:sonic-system-aaa": {
"sonic-system-aaa:AAA": {
"AAA_LIST": [{
"type": "authorization",
"login": "tacacs+"
}]
}
},
"sonic-system-tacacs:sonic-system-tacacs": {
"sonic-system-tacacs:TACPLUS": {
"global": {
"timeout": 5,
"passkey": "aabb"
}
}
}
},

"AAA_AUTHORIZATION_TEST_TACACS_WITHOUT_TACPLUS": {
"sonic-system-aaa:sonic-system-aaa": {
"sonic-system-aaa:AAA": {
"AAA_LIST": [{
Expand Down
8 changes: 8 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-system-aaa.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module sonic-system-aaa {
prefix stypes;
}

import sonic-system-tacacs{
prefix tacacs;
}

revision 2021-10-12 {
description "Add AAA authorization/accounting support.";
}
Expand Down Expand Up @@ -39,6 +43,10 @@ module sonic-system-aaa {
default "local";
}

must 'not(./type = "authorization" and contains(./login, "tacacs+") and not(/tacacs:sonic-system-tacacs/tacacs:TACPLUS/tacacs:global/tacacs:passkey))' {
error-message "Authorization with 'tacacs+' is not allowed when passkey not exists.";
}

leaf failthrough {
type stypes:boolean_type;
description "When set to true, authentication is attempted on next configured server/local in the list upon failure.";
Expand Down
Loading