カスタムの組織のポリシー制約

このページでは、組織ポリシー サービスのカスタム制約を使用して、次の Google Cloud リソースに対する特定のオペレーションを制限する方法について説明します。

  • storagetransfer.googleapis.com/TransferJob

組織のポリシーの詳細については、カスタムの組織のポリシーをご覧ください。

組織のポリシーと制約について

Google Cloud の組織のポリシー サービスを使用すると、組織のリソースをプログラムで一元管理できます。組織のポリシー管理者は組織のポリシーを定義できます。組織のポリシーは、Google Cloud のリソース階層内の Google Cloud リソースやそれらのリソースの子孫に適用される、制約と呼ばれる一連の制限です。組織のポリシーは、組織レベル、フォルダレベル、またはプロジェクト レベルで適用できます。

組織のポリシーを利用することで、あらかじめ用意されたマネージド制約をさまざまな Google Cloud サービスに適用できます。ただし、組織のポリシーで制限されている特定のフィールドをカスタマイズ可能な方法でよりきめ細かく制御する必要がある場合は、カスタム制約を作成して、組織のポリシーでそれらのカスタム制約を使用することもできます。

ポリシーの継承

デフォルトでは、組織のポリシーは、そのポリシーを適用したリソースの子孫に継承されます。たとえば、フォルダにポリシーを適用した場合、そのフォルダ内のすべてのプロジェクトにそのポリシーが適用されます。この動作の詳細と変更方法については、階層評価ルールをご覧ください。

利点

  • セキュリティとガバナンス: データ転送オペレーションに対する一元管理を適用して、広範なユーザー権限に関連するセキュリティ リスクを軽減します。
  • きめ細かい制御: 転送ジョブを特定の許可されたソースバケットまたは宛先バケットに制限したり、転送を特定のサービスペア(Cloud Storage から Cloud Storage への転送のみなど)に制限したりします。

始める前に

  1. Google Cloud アカウントにログインします。Google Cloud を初めて使用する場合は、アカウントを作成して、実際のシナリオでの Google プロダクトのパフォーマンスを評価してください。新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Google Cloud CLI をインストールします。

  5. 外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。

  6. gcloud CLI を初期化するには、次のコマンドを実行します。

    gcloud init
  7. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  8. Verify that billing is enabled for your Google Cloud project.

  9. Google Cloud CLI をインストールします。

  10. 外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。

  11. gcloud CLI を初期化するには、次のコマンドを実行します。

    gcloud init
  12. 組織 ID を確認します。

必要なロール

カスタムの組織のポリシーを管理するために必要な権限を取得するには、組織のリソースに対する組織のポリシー管理者 roles/orgpolicy.policyAdmin)の IAM ロールを付与するよう管理者に依頼してください。ロールの付与については、プロジェクト、フォルダ、組織に対するアクセス権の管理をご覧ください。

必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。

Storage Transfer Service でサポートされているリソース

次の表に、カスタム制約で参照できる Storage Transfer Service リソースを示します。

リソース フィールド
storagetransfer.googleapis.com/TransferJob resource.description
resource.eventStream.eventStreamExpirationTime
resource.eventStream.eventStreamStartTime
resource.eventStream.name
resource.latestOperationName
resource.loggingConfig.enableOnpremGcsTransferLogs
resource.loggingConfig.logActions
resource.loggingConfig.logActionStates
resource.name
resource.notificationConfig.eventTypes
resource.notificationConfig.payloadFormat
resource.notificationConfig.pubsubTopic
resource.projectId
resource.replicationSpec.gcsDataSink.bucketName
resource.replicationSpec.gcsDataSink.managedFolderTransferEnabled
resource.replicationSpec.gcsDataSink.path
resource.replicationSpec.gcsDataSource.bucketName
resource.replicationSpec.gcsDataSource.managedFolderTransferEnabled
resource.replicationSpec.gcsDataSource.path
resource.replicationSpec.objectConditions.excludePrefixes
resource.replicationSpec.objectConditions.includePrefixes
resource.replicationSpec.objectConditions.lastModifiedBefore
resource.replicationSpec.objectConditions.lastModifiedSince
resource.replicationSpec.objectConditions.matchGlob
resource.replicationSpec.objectConditions.maxTimeElapsedSinceLastModification
resource.replicationSpec.objectConditions.minTimeElapsedSinceLastModification
resource.replicationSpec.transferOptions.deleteObjectsFromSourceAfterTransfer
resource.replicationSpec.transferOptions.deleteObjectsUniqueInSink
resource.replicationSpec.transferOptions.metadataOptions.acl
resource.replicationSpec.transferOptions.metadataOptions.gid
resource.replicationSpec.transferOptions.metadataOptions.kmsKey
resource.replicationSpec.transferOptions.metadataOptions.mode
resource.replicationSpec.transferOptions.metadataOptions.storageClass
resource.replicationSpec.transferOptions.metadataOptions.symlink
resource.replicationSpec.transferOptions.metadataOptions.temporaryHold
resource.replicationSpec.transferOptions.metadataOptions.timeCreated
resource.replicationSpec.transferOptions.metadataOptions.uid
resource.replicationSpec.transferOptions.overwriteObjectsAlreadyExistingInSink
resource.replicationSpec.transferOptions.overwriteWhen
resource.schedule.endTimeOfDay
resource.schedule.repeatInterval
resource.schedule.scheduleEndDate
resource.schedule.scheduleStartDate
resource.schedule.startTimeOfDay
resource.serviceAccount
resource.status
resource.transferSpec.awsS3CompatibleDataSource.bucketName
resource.transferSpec.awsS3CompatibleDataSource.endpoint
resource.transferSpec.awsS3CompatibleDataSource.path
resource.transferSpec.awsS3CompatibleDataSource.region
resource.transferSpec.awsS3CompatibleDataSource.s3Metadata.authMethod
resource.transferSpec.awsS3CompatibleDataSource.s3Metadata.listApi
resource.transferSpec.awsS3CompatibleDataSource.s3Metadata.protocol
resource.transferSpec.awsS3CompatibleDataSource.s3Metadata.requestModel
resource.transferSpec.awsS3DataSource.bucketName
resource.transferSpec.awsS3DataSource.cloudfrontDomain
resource.transferSpec.awsS3DataSource.managedPrivateNetwork
resource.transferSpec.awsS3DataSource.path
resource.transferSpec.awsS3DataSource.privateNetworkService
resource.transferSpec.awsS3DataSource.roleArn
resource.transferSpec.azureBlobStorageDataSource.container
resource.transferSpec.azureBlobStorageDataSource.federatedIdentityConfig.clientId
resource.transferSpec.azureBlobStorageDataSource.federatedIdentityConfig.tenantId
resource.transferSpec.azureBlobStorageDataSource.path
resource.transferSpec.azureBlobStorageDataSource.privateNetworkService
resource.transferSpec.azureBlobStorageDataSource.storageAccount
resource.transferSpec.gcsDataSink.bucketName
resource.transferSpec.gcsDataSink.managedFolderTransferEnabled
resource.transferSpec.gcsDataSink.path
resource.transferSpec.gcsDataSource.bucketName
resource.transferSpec.gcsDataSource.managedFolderTransferEnabled
resource.transferSpec.gcsDataSource.path
resource.transferSpec.gcsIntermediateDataLocation.bucketName
resource.transferSpec.gcsIntermediateDataLocation.managedFolderTransferEnabled
resource.transferSpec.gcsIntermediateDataLocation.path
resource.transferSpec.hdfsDataSource.path
resource.transferSpec.httpDataSource.listUrl
resource.transferSpec.objectConditions.excludePrefixes
resource.transferSpec.objectConditions.includePrefixes
resource.transferSpec.objectConditions.lastModifiedBefore
resource.transferSpec.objectConditions.lastModifiedSince
resource.transferSpec.objectConditions.matchGlob
resource.transferSpec.objectConditions.maxTimeElapsedSinceLastModification
resource.transferSpec.objectConditions.minTimeElapsedSinceLastModification
resource.transferSpec.posixDataSink.rootDirectory
resource.transferSpec.posixDataSource.rootDirectory
resource.transferSpec.sinkAgentPoolName
resource.transferSpec.sourceAgentPoolName
resource.transferSpec.transferManifest.location
resource.transferSpec.transferOptions.deleteObjectsFromSourceAfterTransfer
resource.transferSpec.transferOptions.deleteObjectsUniqueInSink
resource.transferSpec.transferOptions.metadataOptions.acl
resource.transferSpec.transferOptions.metadataOptions.gid
resource.transferSpec.transferOptions.metadataOptions.kmsKey
resource.transferSpec.transferOptions.metadataOptions.mode
resource.transferSpec.transferOptions.metadataOptions.storageClass
resource.transferSpec.transferOptions.metadataOptions.symlink
resource.transferSpec.transferOptions.metadataOptions.temporaryHold
resource.transferSpec.transferOptions.metadataOptions.timeCreated
resource.transferSpec.transferOptions.metadataOptions.uid
resource.transferSpec.transferOptions.overwriteObjectsAlreadyExistingInSink
resource.transferSpec.transferOptions.overwriteWhen

カスタム制約を設定する

カスタム制約は、組織のポリシーを適用しているサービスでサポートされるリソース、メソッド、条件、アクションを使用して YAML ファイルで定義されます。カスタム制約の条件は、Common Expression Language(CEL)を使用して定義されます。CEL を使用してカスタム制約で条件を作成する方法については、カスタム制約の作成と管理の CEL セクションをご覧ください。

コンソール

カスタム制約を作成する手順は次のとおりです。

  1. Google Cloud コンソールで [組織のポリシー] ページに移動します。

    [組織のポリシー] に移動

  2. プロジェクト選択ツールで、組織のポリシーを設定するプロジェクトを選択します。
  3. [ カスタム制約] をクリックします。