OCPBUGS-57603: Disallow cross subscription encryption sets#10335
OCPBUGS-57603: Disallow cross subscription encryption sets#10335rna-afk wants to merge 1 commit intoopenshift:mainfrom
Conversation
Since CAPZ does not support using encryption sets in a subscription not in the current subscription, adding a validation to return error if the subscriptions don't match.
|
@rna-afk: This pull request references Jira Issue OCPBUGS-57603, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@rna-afk: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/jira refresh |
|
@rna-afk: This pull request references Jira Issue OCPBUGS-57603, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by jima |
|
@jinyunma: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
patrickdillon
left a comment
There was a problem hiding this comment.
Nice work figuring this out!
To summarize what we discussed: cross-subscription Disk Encryption Sets are not supported, but users can use a key vault from another subscription to create the DES.
Can you update the bug to indicate that as the recommended path for the bug reporter? It seems like that should immediately unblock them (although we will probably still need to deal with the managed key used to encrypt bootstrap ignition, but that is a separate bug).
I think there are a few more things we should do to improve the experience surrounding this API:
- I don't think we should deprecate the field (although I could be convinced), but we should generally discourage users from using it. Can you update the field doc text to indicate: "Azure does not support cross-subscription disk-encryption sets. By default, the subscription from the installer credentials will be used. Therefore, setting this field is unnecessary."
- Then we need to follow up on this promise of setting the defaults. We're already doing it in one place (more on that in a moment), but not in the machine manifests. Can you follow this pattern so that the default is set in the install config itself, and will be used everywhere:
Basically you just need to create an Azure finish function wherfe if disk encryption is set, and subscription is empty, add the subscription from the creds.
- Finally we can simplify the one code instance where the default is set, because it will be redundant:
installer/pkg/asset/manifests/clustercsidriver.go
Lines 75 to 82 in 435db5e
| // GetDiskEncryptionSet retrieves the specified disk encryption set. | ||
| func (c *Client) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName, diskEncryptionSetName string) (*azenc.DiskEncryptionSet, error) { | ||
| if c.ssn.Credentials.SubscriptionID != subscriptionID { | ||
| return nil, fmt.Errorf("different subscription from resource group subscription. CAPZ does not support cross subscription encryption sets") |
There was a problem hiding this comment.
CAPZ is an implementation detail here, so we wouldn't want to mention it by name. Also the restriction is in Azure
| return nil, fmt.Errorf("different subscription from resource group subscription. CAPZ does not support cross subscription encryption sets") | |
| return nil, fmt.Errorf("different subscription from resource group subscription. Azure does not support cross subscription encryption sets") |
@patrickdillon I tested with az command, this is also disallowed in Azure. What I tested:
So look like that Azure doc is misleading, that's not TRUE! |
Since CAPZ does not support using encryption sets in a subscription not in the current subscription, adding a validation to return error if the subscriptions don't match.