-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: remove group property from WindowsSessionUser (#102)
Summary: The design of the WindowsSessionUser is currently heavily influenced by the posix design in that it requires a Group for setting directory ACLs of the Session Working Directory. Windows has finer grained ACLs for controlling access to files and directories, so we should be exposing an interface that works better with that instead. Solution: We no longer accept a group in the WindowsSessionUser. The Session Working Directory's ACLS are now set to: 1. Process owner -- full control 2. Given user -- modify/read/write/execute **BREAKING CHANGE** The "group" property of WindowsSessionUser has been removed. Signed-off-by: Daniel Neilson <[email protected]>
- Loading branch information
Showing
10 changed files
with
188 additions
and
151 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -112,9 +112,16 @@ class WindowsSessionUser(SessionUser): | |
includes a logon session obtained by ssh-ing into the host), then you must instantiate this | ||
class with a username + logon_token; providing a password is not allowed in Session 0. To | ||
create a logon_token, you will want to look in to the LogonUser family of Win32 system APIs. | ||
The user provided in this class directly influences the Directory ACL of the Session Working | ||
Directory that is created. The created directory: | ||
1. Has Full Control by the owner of the calling process; and | ||
2. Has Modify access by the provided user. | ||
The Session working directory will also be set so that all child directories and files | ||
inherit these permissions. | ||
""" | ||
|
||
__slots__ = ("user", "group", "password", "logon_token") | ||
__slots__ = ("user", "password", "logon_token") | ||
|
||
user: str | ||
""" | ||
|
@@ -123,13 +130,6 @@ class with a username + logon_token; providing a password is not allowed in Sess | |
ex: localUser, domain\\domainUser | ||
""" | ||
|
||
group: str | ||
""" | ||
Group name of the identity to run the Session's subprocesses under. | ||
This can be just a group name for a local group, or a domain group in down-level logon form. | ||
ex: localGroup, domain\\domainGroup | ||
""" | ||
|
||
password: Optional[str] | ||
""" | ||
Password of the identity to run the Session's subprocess(es) under. | ||
|
@@ -146,7 +146,6 @@ def __init__( | |
self, | ||
user: str, | ||
*, | ||
group: Optional[str] = None, | ||
password: Optional[str] = None, | ||
logon_token: Optional[HANDLE] = None, | ||
) -> None: | ||
|
@@ -158,12 +157,6 @@ def __init__( | |
or a domain's UPN. | ||
ex: localUser, domain\\domainUser, [email protected] | ||
group (Optional[str]): | ||
Group name of the identity to run the Session's subprocesses under. | ||
This can be just a group name for a local group, or a domain group in down-level format. | ||
ex: localGroup, domain\\domainGroup | ||
Defaults to the username if not provided. | ||
password (Optional[str]): | ||
Password of the identity to run the Session's subprocess under. This argument is mutually-exclusive with the | ||
"logon_token" argument. | ||
|
@@ -184,7 +177,6 @@ def __init__( | |
) | ||
|
||
self.user = user | ||
self.group = group if group else user | ||
|
||
domain, username_without_domain = self._split_domain_and_username(user) | ||
|
||
|
This file contains 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 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 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 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 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
Oops, something went wrong.