LoginSignup
0
0

More than 3 years have passed since last update.

VPCSC で GCSにIP制限かけて Service Transfer Service を実行すると Request is prohibited by organization's policy. エラー

Posted at

背景

あるプロジェクトをVPCSCでGCSにIP制限をかけた。
そのGCSでService Transfer Service (S3 -> GCS)を実行しようとしたら以下のエラーがでた。

VPC Service Controls
Cloud Storage
testIamPermissions
project-xxxx@storage-transfer-service.iam.gserviceaccount.com
Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: xxx

監査ログでは以下のようなログ

requestMetadata: {
   callerIp: "private"    
   destinationAttributes: {
   }
   requestAttributes: {
   }
  }
  resourceName: "projects/xxx"   
  serviceName: "storage.googleapis.com" 

解決方法

Access Context Managerに project-${project_number}@storage-transfer-service.iam.gserviceaccount.com のアカウントを追加したら動いた。

自分のプロジェクトでは、Access Context Managerはyaml管理されているのでyamlに上記アカウント追加して access context manager の updateコマンドを実行した。

gcloud access-context-manager levels update accessPolicies/xxx/accessLevels/gdp --basic-level-spec=sample.yaml --combine-function=or
sample.yaml

- ipSubnetworks:
  - xxx.xxx.xxx.xxx/32
  - xxx.xxx.xxx.xxx/32
- members:
  - project-${project_number}@storage-transfer-service.iam.gserviceaccount.com

参考

Storage Transfer Service を VPC Service Controls とともに使用する

Access Context Manager_アクセスレベルの作成

アクセスレベルの YAML の例

gcloud access-context-manager levels update

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0