1

I have setup my GCP organization using the CFT Terraform "Example foundation" scripts. After creating my own restricted share vpc project using the template provided, I created a private cluster within that project on the restricted shared VPC that has "Private Google access" enabled. I also "deny" traffic to the internet but allow access to Google services using the restricted VIP, including gcr.io. For some reason, I am unable to pull GCR images from within the cluster with a VPC Service perimeter in place for my shared vpc host and service projects. As soon as I remove the perimeter, everything begins working. I have tried adding the SA of the GKE nodes to the "Access Level" of the perimeter, as well as change the scopes of the GKE SA, without success. Any ideas to fix this issue would be greatly appreciated.

Here are the two important snippets. From the GKE project log:

"Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: d8a2eabceb3adcbd"

and from the shared VPC project log:

egressViolations: [
0: {
servicePerimeter: "accessPolicies/904160256446/servicePerimeters/sp_d_shared_restricted_default_perimeter_5493"
source: "projects/956779411422"
sourceType: "Network"
targetResource: "projects/720423819480/buckets/artifacts.google-samples.appspot.com"
}
]
@type: "type.googleapis.com/google.cloud.audit.VpcServiceControlAuditMetadata"
violationReason: "NETWORK_NOT_IN_SAME_SERVICE_PERIMETER"
}

My question is I know the public image I am trying to access is not on a network within the service perimeter because I don't own that project, so how do I add a public container repository project to the perimeter to allow access?

  • 1
    What errors are you getting from the logs? Please include it on your post and other information that can help. You can also check [Binary Authorization](https://cloud.google.com/binary-authorization/docs/overview#features) as it may be the possible root cause of the issue. – Alex G Dec 17 '20 at 06:08
  • I have edit the post with the pertinent log data. Thanks. – Kevin Ansberry Dec 17 '20 at 12:58
  • You can allow access to it instead if you are unable to [add it](https://cloud.google.com/vpc-service-controls/docs/create-service-perimeters). You can check this [documentation](https://cloud.google.com/vpc-service-controls/docs/use-access-levels) on how to. – Alex G Jan 05 '21 at 03:11

0 Answers0