Repository navigation
Support for AuthorizedKeysCommand and AuthorizedPrincipal - #399
Thomas Meckel (tmeckel) wants to merge 7 commits into
Conversation
…sCommand (spawing subprocess from SSHD)
…ions if _DEBUG is defined (debug build)
…dows automatically
… destination directory and Start-OpenSSHPackage will now append the configuration name to the created zip files if different from Release
|
Before I consider diving into this, is there any spots where you could change your implementation to reduce the amount of changes outside of "contrib\win32"? That makes assimilating the upstream changes simpler and increases the likelihood this port could be merged into the upstream branch (which I imagine is still a goal). |
| convertToBackslash(exePathPtr); | ||
|
|
||
| /* | ||
| * check if av[0] starts with 'C:\Program Files\PowerShell' or 'C:\Windows\System32\WindowsPowerShell' |
There was a problem hiding this comment.
Why check specific paths? Windows Powershell is one thing but pwsh could be installed to another drive, this needs to check PATH for the pwsh executable and in implementing that, would be easier to use it for Windows Powershell too.
Hi Bryan Berns (@NoMoreFood) thanks for willing to review my PR and bringing up the vital So coming back to you initial question about if I see any possibilities to auth.cThe All other changes in servconf.cI had to change the tests for absolute paths because in the original source this sshfileperm.hI added the forward declaration of the newly introduced method |
|
I would consider changes made outside of contrib/win32 to be contributed upstream if they are best implemented in those files. In that case, you'll need to test or get assistance from those who can test platforms that don't support |
|
Superceded by #409 so this one can be closed. |
|
If Manoj Ampalam (@manojampalam) profited from my work a short notice would've been nice at least. Anyway ... nice that finally we have support for spawning processes. |
|
Thomas Meckel (@tmeckel) - I feel retarded I was not aware there is a PR pending for this work. I based my changes off a POC I did last year. I took a quick look at your changes and they are pretty much inline of what I have done, it double validates the underlying approach. Thanks for putting it together. |
|
Manoj Ampalam (@manojampalam) It's a bit funny that you say that you weren't aware of my PR, because you were mentioned explicitly in the description, because I know that you are a maintainer of this repository. Whatever, I'm happy that we finally have support for this feature on Windows. I'll start migrating the installations that are running with my code currently at a customer cloud environment next week. |
|
I know. Working on a tight schedule here. Haven’t gotten time to pay attention on this repo recently. |
Support for AuthorizedKeysCommand and AuthorizedPrincipal
This PR implements the support for spawning child processes from the SSH Daemon
(Service), so that the configuration items
AuthorizedKeysCommandandAuthorizedPrincipalCommandcan be utilized under Windows as well.The implementation not only supports standard Windows executables but is capable
of spawning PowerShell Skripts. Under all Unix derivates a special handling of
shell scripts isnt't necessary because those platforms support the start of
script as (normal) executables via the Shebang notation. This technique isn't
available under Windows, so the pull request supports using Powershell scripts
with a special handling (treatment).
The following excerpt from the sshd.log file depicts this implementation
With the support of
AuthorizedKeysCommandand PowerShell scripts, it ispossible to store the approved SSH Public-Keys for a user in an Azure KeyVault
or Storage Account and to transfer the keys to the SSH service via the Az
Powershell Modules, which itself uitilize an authentication via the Managed
Indentity of the virtual machine to access the information in the KeyVault or
Storage Account.
I explicitly mention Bryan Berns (@NoMoreFood) and Manoj Ampalam (@manojampalam) to request a review on this PR.