-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
WIP: Add user group membership check to decide upstream host - yaml plugin #425
base: master
Are you sure you want to change the base?
Conversation
…he upstream If a username is not given in the yaml config file it parses the groupname and checks if user is part of that group and routes them accordinly to the associated host defined in the config file for the yaml plugin
Hi @tg123 Looking for some feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am ok with group look up
will it introduce some security concerns like timing attack
?
@@ -220,20 +223,30 @@ func (p *plugin) createUpstream(conn libplugin.ConnMetadata, to pipeConfigTo, or | |||
|
|||
func (p *plugin) findAndCreateUpstream(conn libplugin.ConnMetadata, password string, publicKey []byte) (*libplugin.Upstream, error) { | |||
user := conn.User() | |||
userGroups, err := getUserGroups(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read group only when from.Groupname
is not empty?
so, any group err will not block the original process
rebase plz |
I will rebase. I will also fix test cases so they pass the checks for unit tests and E2E. |
We are using the sshpiper yaml plugin for our use case, where we are trying to upgrade our parallel filesystem and migrate users from the older version to the newer version. We want to control which login nodes in the cluster the user can SSH to, based on their data migration status. Doing this for each user is not feasible.
A user-facing proxy VM installed with sshpiper is dedicated to deciding the user's target host to log in.
Our idea was to assign users special Unix groups, (for example group_A and group_B based on their migration status), and route their SSH connections to different login nodes according to their group membership. If they are in
group_A
they are routed to thelogin_node_A
and if they are ingroup_B
they are routed to thelogin_node_B
To achieve this, we added functionality to the sshpiper yaml plugin so that there is also an option to route users based on group membership.
This PR lets us define a groupname in place of a username in the config file (sshpiperd.yaml) for the yaml plugin to route users based on a Unix group membeship
If the username is not defined in the config file, it checks for groupname and decides their target host upstream.
If the username is defined it goes with the target host upstream, defined for the user. So the original functionality is still intact and we have an additional feature to add groupname in place of username to the config file, if we are dealing with large number of users.
Example sshpiperd.yaml