-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azure: Add support for dns=none #15627
Conversation
@@ -30,84 +30,6 @@ func TestPrecreateDNSNames(t *testing.T) { | |||
cluster *kops.Cluster | |||
expected []recordKey | |||
}{ | |||
{ |
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.
Azure doesn't do any DNS operations, so these test cases are useless.
@@ -1321,7 +1321,7 @@ func setupDNSTopology(opt *NewClusterOptions, cluster *api.Cluster) error { | |||
switch strings.ToLower(opt.DNSType) { | |||
case "": | |||
switch cluster.Spec.GetCloudProvider() { | |||
case api.CloudProviderHetzner, api.CloudProviderDO: | |||
case api.CloudProviderHetzner, api.CloudProviderDO, api.CloudProviderAzure: |
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 should move most, if not all cloud providers to dns=none
soon.
Gossip is a much worse choice and Public DNS is only available on a few cloud providers.
@@ -151,6 +179,7 @@ func (*LoadBalancer) RenderAzure(t *azure.AzureAPITarget, a, e, changes *LoadBal | |||
ID: to.StringPtr(fmt.Sprintf("/%s/virtualNetworks/%s/subnets/%s", idPrefix, *e.Subnet.VirtualNetwork.Name, *e.Subnet.Name)), | |||
} | |||
} | |||
// TODO: Move hardcoded values to the model |
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.
Almost everything about LB is hardcoded. We should move this to model soon. For now it is good enough.
@@ -24,7 +24,7 @@ import ( | |||
|
|||
// UseKopsControllerForNodeBootstrap is true if nodeup should use kops-controller for bootstrapping. | |||
func UseKopsControllerForNodeBootstrap(cloudProvider kops.CloudProviderID) bool { | |||
return cloudProvider != kops.CloudProviderAzure | |||
return true |
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.
👍 👍 👍
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'll take on removing the dead code this leaves behind.
}, nil | ||
} | ||
|
||
func (a azureVerifier) VerifyToken(ctx context.Context, rawRequest *http.Request, token string, body []byte, useInstanceIDForNodeName bool) (*bootstrap.VerifyResult, error) { |
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.
This doesn't validate that the VM should actually be allowed to join the cluster, it seems to accept a token from any VM in the resource group. For comparison, the AWS verifier checks that the assumed role in the GetCallerIdentity response matches an IAM role used by any of the cluster's instance groups.
Can we do something similar here?
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.
True. It checks at least to be in same resource group. Will check to see if I can lock down things more here.
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.
There may be a more secure solution by using the attested data, though will be something for the future.
For now I added the VM ID, which should be pretty hard to guess without access to the resource group.
https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=linux#attested-data
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.
Can we verify the VM's VMSS is of a known kOps InstanceGroup?
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.
That should be checked further along in the process. This is why we set result.InstanceGroupName
.
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.
It may be safer to take the IG name from the VMSS name, instead of the tag. WDYT?
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'm fine with the security improvements happening in a follow up |
/cc @justinsb
/assign @justinsb
/kind office-hours