-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix VM creation and update when sshAccess
is disabled.
#80
Fix VM creation and update when sshAccess
is disabled.
#80
Conversation
@AleksandarSavchev could you mention why an SSH access disablement is required ? Any gardener issue , slack thread ? We would like to know the context , as this will affect all our mcm-providers. |
@himanshu-kun disabling SSH access is needed to make our clusters compliant with DISA STIGs rules 242393 and 242394. You can find the backlog issue for these changes here. For more information you can check the PR that added |
As per MicrosoftDocs/azure-docs#14447 it should be possible to block SSH access by configuring network security group. Have you already tried this out? |
@unmarshall there are 2 issues: |
But then the current solution of passing a fake ssh key also doesn't solve the problem as the sshd is still enabled. @AleksandarSavchev could you confirm if the requirement is to |
When a shoot is configured with The problem of disabling ssh access has already been solved by the upper mentioned functionality. The problem in |
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.
we already have a test for admin
name
machine-controller-manager-provider-azure/pkg/azure/core_test.go
Lines 409 to 422 in 1d20246
Entry("#15 Create machine without Admin Username in providerSpec", | |
&mock.AzureProviderSpecWithoutAdminUserName, | |
&driver.CreateMachineRequest{ | |
Machine: newMachine("dummy-machine"), | |
MachineClass: newAzureMachineClass(mock.AzureProviderSpecWithoutAdminUserName), | |
Secret: newSecret(azureProviderSecret), | |
}, | |
nil, | |
nil, | |
nil, | |
nil, | |
nil, | |
true, | |
fmt.Errorf(internalErrorPrefix, "properties.osProfile.adminUsername: Required value: AdminUsername is required").Error(), |
Similarly , pls also add the following test case:
- when
providerSpec.Properties.OsProfile.LinuxConfiguration.SSH.PublicKeys.KeyData
is not supplied , we get the following error
Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid." Target="linuxConfiguration.ssh.publicKeys.keyData"
thanks for the context and sorry for the delay. I tried this out myself ..
the error from provider was
I have reviewed the PR, kindly address , then we'll merge it. |
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.
/lgtm
Thnx , this looks better!
What this PR does / why we need it:
This PR fixes creation and update of azure VMs when
sshAccess
is disabled by adding a "fake"PublicKey
.Currently, creating an azure shoot with
sshAccess
disabled is not possible since the shoot would fail in reconciliation. It fails with the following cloud provider validation error:The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid.
since its value is "".After removing
SSH
fromLinuxConfiguration
it starts failing with this cloud provider error:Authentication using either SSH or by user name and password must be enabled in Linux profile.
, which would suggest we need to provide eitherSSH
or anadminPassword
. We do not include theadminPassword
and it is ill-advised to do so. The only option left would be to pass a "fake"PublicKey
.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: