-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Added ssh configurations to YANG model #13338
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
Merged
liat-grozovik
merged 21 commits into
sonic-net:master
from
ycoheNvidia:sonic-buildimage-ssh_config
Jul 10, 2023
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
43525e5
Implemented ssh configurations
ycoheNvidia 7b0ec56
modified sonic host services pointer
ycoheNvidia fdc96bd
Merge branch 'sonic-net:master' into sonic-buildimage-ycoheNvidia-ssh…
ycoheNvidia cb4bed9
removed debug link
ycoheNvidia bf95354
added ssh-server yang model tests
ycoheNvidia 3c3738a
minor yang model fix
ycoheNvidia 890b367
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia 8a8ce2a
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia 2856e65
added ssh yang to setup
ycoheNvidia a4422b2
Update sonic-ssh-server.yang
ycoheNvidia 50691a3
Added ssh-server table to Configurations.md
ycoheNvidia 03be592
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia 1741ccc
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia daf7c4a
Update Configuration.md
ycoheNvidia 1c0a946
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia 7afff88
Fixing Configuration.md line ending
ycoheNvidia 9d368c9
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia 9318bf4
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia 51c1370
Fixed minor issues raised in review
ycoheNvidia 2a0c0c4
fixed tab issues
ycoheNvidia fe60125
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/sonic-yang-models/tests/yang_model_tests/tests/ssh-server.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "SSH_SERVER_VALID": { | ||
| "desc": "Configure default SSH_SERVER." | ||
| }, | ||
| "SSH_SERVER_VALID_MODIFIED": { | ||
| "desc": "Configure modified SSH_SERVER." | ||
| }, | ||
| "SSH_SERVER_INVALID_AUTH_RETRIES": { | ||
| "desc": "Configure invalid number of authentication retries in SSH_SERVER.", | ||
| "eStrKey" : "Pattern", | ||
| "eStr": ["1..100"] | ||
| }, | ||
| "SSH_SERVER_INVALID_LOGIN_TIMEOUT": { | ||
| "desc": "Configure invalid login timeout value in SSH_SERVER.", | ||
| "eStrKey" : "Pattern", | ||
| "eStr": ["1..600"] | ||
| }, | ||
| "SSH_SERVER_INVALID_PORTS_1": { | ||
| "desc": "Configure invalid port value in SSH_SERVER.", | ||
| "eStr": "Invalid port numbers value" | ||
| }, | ||
| "SSH_SERVER_INVALID_PORTS_2": { | ||
| "desc": "Configure invalid port value in SSH_SERVER.", | ||
| "eStr": "Invalid port numbers value" | ||
| } | ||
| } |
60 changes: 60 additions & 0 deletions
60
src/sonic-yang-models/tests/yang_model_tests/tests_config/ssh-server.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| { | ||
| "SSH_SERVER_VALID": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "authentication_retries": "6", | ||
| "login_timeout": "120", | ||
| "ports": "22" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "SSH_SERVER_VALID_MODIFIED": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "authentication_retries": "16", | ||
| "login_timeout": "140", | ||
| "ports": "22,222" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "SSH_SERVER_INVALID_AUTH_RETRIES": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "authentication_retries": "200" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "SSH_SERVER_INVALID_LOGIN_TIMEOUT": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "login_timeout": "606" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "SSH_SERVER_INVALID_PORTS_1": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "ports": "port22" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "SSH_SERVER_INVALID_PORTS_2": { | ||
| "sonic-ssh-server:sonic-ssh-server": { | ||
| "sonic-ssh-server:SSH_SERVER": { | ||
| "POLICIES":{ | ||
| "ports": "22.222" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
|
|
||
| //filename: sonic-ssh-server.yang | ||
| module sonic-ssh-server { | ||
| yang-version 1.1; | ||
| namespace "http://github.com/sonic-net/sonic-ssh-server"; | ||
| prefix sshg; | ||
|
|
||
| description "SSH SERVER CONFIG YANG Module for SONiC OS"; | ||
|
|
||
| revision 2022-08-29 { | ||
| description | ||
| "First Revision"; | ||
| } | ||
|
|
||
| container sonic-ssh-server { | ||
| container SSH_SERVER { | ||
| description "SSH SERVER CONFIG part of config_db.json"; | ||
| container POLICIES { | ||
| leaf authentication_retries { | ||
| description "number of login attepmts"; | ||
| default 6; | ||
| type uint32 { | ||
| range 1..100; | ||
| } | ||
| } | ||
| leaf login_timeout { | ||
| description "login timeout (secs unit)"; | ||
| default 120; | ||
| type uint32 { | ||
| range 1..600; | ||
| } | ||
| } | ||
| leaf ports { | ||
| description "ssh port numbers"; | ||
| default "22"; | ||
| type string { | ||
| pattern '([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-6])(,([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-6]))*' { | ||
| error-message "Invalid port numbers value"; | ||
| error-app-tag ssh-server-ports-invalid-value; | ||
| } | ||
| } | ||
| } | ||
| }/*container policies */ | ||
| } /* container SSH_SERVER */ | ||
| }/* container sonic-ssh-server */ | ||
| }/* end of module sonic-ssh-server */ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.