-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add securitySettings to the backendService #5003
Add securitySettings to the backendService #5003
Conversation
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @slevenick, please review this PR or find an appropriate assignee. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 2 files changed, 124 insertions(+)) |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccAssuredWorkloadsWorkload_basic|TestAccAssuredWorkloadsWorkload_full|TestAccBigqueryDataTransferConfig|TestAccBigqueryReservationReservation_bigqueryReservationBasicExample|TestAccBillingBudget_budgetFilterProjectsOrdering|TestAccBillingBudget_billingBudgetUpdate|TestAccCloudBuildTrigger_pubsub_config|TestAccCloudBuildTrigger_webhook_config|TestAccComposerEnvironment_withMaintenanceWindow|TestAccComputeBackendService_withBackend|TestAccComputeBackendService_withBackendAndMaxUtilization|TestAccComputeBackendService_withBackendAndIAP|TestAccComputeBackendService_withMaxConnections|TestAccComputeBackendService_withMaxConnectionsPerInstance|TestAccComputeBackendService_withMaxRatePerEndpoint|TestAccComputeBackendService_withMaxConnectionsPerEndpoint|TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccComputeHaVpnGateway_computeHaVpnGatewayEncryptedInterconnectExample|TestAccComputeInstanceGroup_rename|TestAccComputeRouter_computeRouterEncryptedInterconnectExample|TestAccContainerCluster_backend|TestAccContainerNodePool_withGPU|TestAccDataLossPreventionDeidentifyTemplate_dlpDeidentifyTemplateBasicExample|TestAccDataLossPreventionDeidentifyTemplate_dlpDeidentifyTemplateUpdate|TestAccDialogflowCXFlow_dialogflowcxFlowFullExample|TestAccDialogflowCXVersion_dialogflowcxVersionFullExample|TestAccDialogflowCXFlow_update|TestAccDialogflowCXVersion_update|TestAccGKEHubMembership_gkehubMembershipBasicExample|TestAccGKEHubMembership_gkehubMembershipIssuerExample|TestAccNetworkServicesEdgeCacheKeyset_networkServicesEdgeCacheKeysetBasicExample|TestAccNetworkServicesEdgeCacheOrigin_networkServicesEdgeCacheOriginBasicExample|TestAccNetworkServicesEdgeCacheOrigin_networkServicesEdgeCacheOriginAdvancedExample|TestAccNetworkServicesEdgeCacheOrigin_updateAndImport|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceBasicExample|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceAdvancedExample|TestAccNetworkServicesEdgeCacheService_updateAndImport|TestAccPrivatecaCertificate_privatecaCertificateCsrExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificate_privatecaCertificateConfigExample|TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample|TestAccSecurityCenterNotificationConfig_sccNotificationConfigBasicExample You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=198580 |
Tests failed during RECORDING mode: TestAccDataLossPreventionDeidentifyTemplate_dlpDeidentifyTemplateBasicExample|TestAccGKEHubMembership_gkehubMembershipBasicExample|TestAccGKEHubMembership_gkehubMembershipIssuerExample|TestAccPrivatecaCertificate_privatecaCertificateCsrExample|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceAdvancedExample Please fix these to complete your PR |
Where can I see the test failure output? Also regarding this:
Should I open a PR for these other repos once this PR is merged? CC @rileykarson |
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.
None of those failures are related, you can ignore them. We're testing most of GCP and over nearly 2000 tests hitting multiple APIs, flakes happen most of the time. And nope, no PRs required- the @modular-magician account makes them automatically after merging.
Can you add or modify a test to exercise this field? We'll want to set value(s) and test updating it- either turning it on, off, or both are great candidates for updates to test. There should be examples of writing them internally in go/terraform-contribution-guide.
I looked at the guide and I figured out that a test will need to be added to github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_compute_backend_service_generated_test.go and/or github.com/hashicorp/terraform-provider-google/google/resource_compute_backend_service_generated_test.go . Can you please confirm? If that's true then I have a couple of questions:
Just want to know how it's going to work. Or if I got the location wrong please let me know where the tests should reside. |
You create test config templates in https://github.com/GoogleCloudPlatform/magic-modules/tree/master/mmv1/templates/terraform/examples and register them in the |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
5fef874
to
adf341c
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
adf341c
to
79110aa
Compare
@rileykarson I think there is a problem: so the new field securitySettings is a nested-object containing a |
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.
If subjectAltNames
can be set while clientTlsPolicy
isn't set, let's do that. I'll test manually that clientTlsPolicy
works as intended before merging.
For clientTlsPolicy
are we able to make it the ResourceRef
type while specifying an invalid resource
value? I forget if that's possible or not, but Terraform shouldn't actually use the value and will apply some useful rules we will need to specify manually otherwise.
I just talked to the dev who implemented this stuff and he says
I see 2 reasons for not making it a
|
Terraform doesn't actually check the If the field is a raw string, equivalent fields will be see as different. For example: if the user sends |
Good point. I will make it a ResourceRef then in my next commit. |
What does it take to make
But I get errors while building:
|
I would just point to the |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
251dba1
to
3279b0e
Compare
57fdce3
to
503cc85
Compare
I am not able to see the 2 failures because of perms (for Project cloudbuild.builds.get ?)
|
@rileykarson pls do let me know what else is needed for this PR |
Because of changes as part of the fixit our CI environment has been spotty, I am waiting for that to get fixed. |
Thanks for letting me know. |
/gcbrun |
Can you rebase? Our CI has mostly calmed down after the fixit, and the fix for the |
503cc85
to
bae4416
Compare
Just rebased. Hopefully this is ready to go now. Pls let me know if there are any issues. |
Error trying to cancel build () |
Do you have a valid gcloud yaml kicking around? I'm trying to provision a ClientTLSPolicy one-off to test this, and:
I checked multiple user guides and found no examples, either. To be clear, testing this manually is a requirement for me to merge it. |
Sure, actually there is a UG https://cloud.google.com/traffic-director/docs/security-proxyless-setup#configuring_mtls_on_the_client_side which has steps for:
That should answer your questions? If not, let me know |
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.
Alright, tested manually. Details included below, for my own sake.
See my comment inline - the description of the field suggests you may have missed that Terraform mirrors the API structure, and this change only affects the Global BackendService resource. Please ack whether this was intended or not.
Base config:
resource "google_compute_backend_service" "default" {
provider = google-beta
name = "backend-service"
health_checks = [google_compute_health_check.health_check.id]
protocol = "GRPC"
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
security_settings {
client_tls_policy = "my-client-tls-policy2"
subject_alt_names = [
"spiffe://my-project.svc.id.goog/ns/default/sa/example-grpc-server", "spiffe://my-project.svc.id.goog/ns/default/sa/example-grpc-server2"
]
#subject_alt_names = []
}
}
resource "google_compute_health_check" "health_check" {
provider = google-beta
name = "health-check"
grpc_health_check {
port = 80
}
}
gcloud config to set up the policy out of band was:
name: "client_mtls_policy"
clientCertificate:
certificateProviderInstance:
pluginInstance: google_cloud_private_spiffe
serverValidationCa:
- certificateProviderInstance:
pluginInstance: google_cloud_private_spiffe
w/ command
gcloud beta network-security client-tls-policies import my-client-tls-policy2 --source=my-client-tls-policy.yaml --location=global
I tested the following:
- Provisioning the config above
- Adding and removing the feature entirely from config
- Changing the ClientTLSPolicy to one that did not exist
- Note that this had unusual behaviour, as the request was accepted and the following returned after waiting on an operation:
Error: Error waiting for Updating BackendService: Invalid value for field 'global_network_security_resources.client_tls_policy_resource.client_tls_policy.name': ''. Cannot delete ClientTlsPolicy resource which is in use by BackendService resource BACKEND_SERVICE/1234567890.backend-service
- Note that this had unusual behaviour, as the request was accepted and the following returned after waiting on an operation:
- Changing the ClientTLSPolicy to one that did exist
- Adding 1 entry to alt names
- Removing 1 entry from alt names
- Adding 2 entries to alt names
- Removing 2 entries from alt names
min_version: beta | ||
description: | | ||
The security settings that apply to this backend service. This field is applicable to either | ||
a regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and |
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.
Note: you have only added this to global backend service- is that intentional?
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.
Yes, because we need support for global BES urgently (as requested by the user/customer). We can add support for regional BES later once there is need for it (and we confirm the feature works with those)
Thanks.
yes.
yes I have seen this error as well and it seems to be a bug in the gcloud API since it doesn't make sense. I will file an internal bug.
Looks good. Thanks a lot! |
Thanks a lot ! |
Fixes: hashicorp/terraform-provider-google#9545
Need the new securitySettings field in backendService in Compute.
If this PR is for Terraform, I acknowledge that I have: (not applicable for draft PR)
Release Note Template for Downstream PRs (will be copied)