ワークロードを移行する

このページでは、既存のプロジェクトを Assured Workloads フォルダに移行する前にコンプライアンス分析を行う方法について説明します。この分析では、ソース プロジェクトと移行先の Assured Workloads フォルダを比較して、移行を開始する前または後にどのような変更が必要になるかを判断します。たとえば、FedRAMP Moderate 用に構成された Assured Workloads フォルダに移行するプロジェクトがある場合、プロジェクトを移行する前に、発生する可能性のある潜在的なコンプライアンス違反に事前に対処することができます。

移行分析によって、次のタイプの検出結果が返されます。

  • ソース プロジェクトがサポートされていないプロダクトやサービスを使用しています。
  • ソース プロジェクトに、許可されていないロケーションにあるリソースが含まれています。
  • ソース プロジェクトが、移行先の Assured Workloads フォルダと互換性のない組織のポリシーの制約値で構成されています。

これらの検出結果は、移行を試みる前に発見することが重要です。デフォルトでは、Assured Workloads フォルダには、フォルダのコントロール パッケージによってサポートされているサービスのリソースタイプのみを含めることができます。フォルダのコントロール パッケージによってサポートされていないサービスのリソースがプロジェクトに含まれている場合は、それらのリソースを再デプロイまたは削除することが必要な可能性があります。

Assured Workloads フォルダでサポートされているサービスのデフォルト リストは、リソース使用量制限の組織のポリシーを変更することで変更できます。これにより、非準拠のサービスをデプロイできます。ただし、非準拠のサービスとそのリソースは、バックグラウンド コンプライアンス チェックで無視されます。したがって、サポートされていないサービスを有効にすると、ワークロードがコンプライアンス違反となるリスクを受け入れることを選択することになります。

準備

  • ソース プロジェクトと移行先 Assured Workloads フォルダの両方のリソース ID を収集します。
  • ソース プロジェクトと移行先の Assured Workloads フォルダの両方で IAM 権限を割り当てまたは検証して、呼び出し元が移行を実行する権限を持っていることを確認します。

必要な IAM 権限

移行の分析を実行するには、幅広い権限を含む事前定義ロールや、必要最小限の権限に制限されるカスタムロールを使用して、呼び出し元に IAM 権限を付与する必要があります。

次の権限が必要です。

  • 移行先ワークロードに対する assuredworkloads.workload.get
  • 移動元プロジェクトに対する cloudasset.assets.searchAllResources
  • ソース プロジェクトと移行先の Assured Workloads フォルダに対する orgpolicy.policy.get

移行分析を行う

ソース プロジェクトと移行先 Assured Workloads フォルダで分析を行う場合は、プロジェクトを移行先に移動する前に、検出結果に対処する必要があります。検出結果によりプロジェクトの移動が妨げられることはありませんが、移行先の Assured Workloads フォルダでコンプライアンス違反が発生する可能性があります。

この検出結果には、次の 2 種類があります。

  • 警告: 警告プロジェクトは、ソース プロジェクトが宛先と互換性がない可能性がある場合に発生し、コンプライアンス違反を引き起こす可能性があります。警告を調べて、非互換性が許容されるかどうかを確認するか、移行前に対処する必要があります。
  • ブロッカー: ブロッカーの結果は、ソース プロジェクトと宛先の間でコンプライアンス違反が検出されたときに発生します。阻害要因に対処してから移行を進める必要があります。

次の種類の検出結果が報告されます。

  • リソース ロケーション: 多くのコントロール パッケージでは、コンプライアンス要件を遵守するためにリソースにロケーション制限を適用しています(ソース プロジェクトに、許可されていないロケーションにあるリソースが含まれている場合など)。

    この問題を解決するには、影響を受けるリソースを許可されたロケーションに移動するか、削除します。または、ターゲットの gcp.resourceLocations 組織ポリシー制約の設定を変更します。

  • サポートされていないプロダクト / サービス: 各コントロール パッケージは、Google Cloud のプロダクトとサービスの特定のリストをサポートしています。プロジェクトで、移行先の Assured Workloads フォルダのコントロール パッケージによってサポートされていないサービスが使用されている場合、これは検出結果の一覧に表示されます。

  • 組織のポリシーの制約: ソース プロジェクトは、移行先の Assured Workloads フォルダの有効なポリシーとは異なる、またはターゲット コントロール パッケージに準拠しない組織ポリシーの制約値で構成されている場合があります。この分析は、移行先の Assured Workloads フォルダのコントロール パッケージに関連する制約に対してのみ実行されます。プロジェクトのすべての制約値が評価されるわけではありません。次の問題のような結果がいくつか得られます。

    • プロジェクトと移行先の有効なポリシーに互換性がありません。
    • プロジェクトには、移行先フォルダで設定されていない組織ポリシー制約値があります(またはその逆)。
    • プロジェクトには、ターゲット コントロール パッケージに準拠していない組織ポリシー制約値があります。

    組織ポリシーの制約に対するブロッカーが見つかった場合、レスポンスには、ターゲット コントロール パッケージに準拠する期待値が含まれます。これらの期待値を使用して、移行を実行する前にプロジェクトに変更を加えることができます。

この問題を解決するには、変更が必要な組織のポリシーの制約を特定し、必要な変更を行います。

サポートされていない検出結果のタイプ

移行分析では、次の種類の検出結果はサポートされていません。

  • gcp.resourceLocations 以外の組織のポリシーの制約に対するリソースレベルの非互換性。たとえば、一部のコントロール パッケージは、グローバル gcp.restrictCmekCryptoKeyProjects 制約または Compute Engine 固有の compute.disableNestedVirtualization 制約で構成されています。ソースと宛先の間でこれらの制約との非互換性は分析も報告もされません。
  • 特定のコントロール パッケージで無効になっている可能性があるサービス固有の機能。たとえば、IL4 フォルダでは Cloud Monitoring の稼働時間チェックが無効になり、ITAR フォルダでは BigQuery のリモート関数が無効になります。ソース プロジェクトでそのような無効になっている機能を使用している場合、これらの非互換性は分析または報告されません。

Assured Workloads フォルダへのプロジェクトの移動の分析

analyzeWorkloadMove メソッドは、ソース プロジェクトを宛先の Assured Workloads フォルダに移動する分析を行います。

次のリクエストの例では、次のパラメータを独自のパラメータに置き換えます。

  • ENDPOINT_URI: Assured Workloads のサービス エンドポイント URI。この URI は、宛先ワークロードのロケーションと一致するエンドポイントである必要があります(us-west1 リージョンのリージョン化されたワークロードの場合は https://us-west1-assuredworkloads.googleapis.com、米国のマルチリージョン ワークロードの場合は https://us-assuredworkloads.googleapis.com
  • DESTINATION_ORGANIZATION_ID: ソース プロジェクトの移動先となる移行先ワークロードの組織 ID。例: 919698201234
  • DESTINATION_LOCATION_ID: 移行先ワークロードのロケーション。たとえば、us-west1us。 これは、ワークロードの data region 値に対応します。
  • DESTINATION_WORKLOAD_ID: ソース プロジェクトを移行する移行先の Assured Workloads フォルダの ID。例: 00-701ea036-7152-4780-a867-9f5
  • SOURCE_PROJECT_ID: 移行するソース プロジェクトの ID のクエリ パラメータ。例: my-project-123
  • ASSET_TYPES: 省略可。指定された 1 つのタイプにのみ検出結果をフィルタリングする、クエリ パラメータごとに 1 つのアセットタイプ。次に例を示します。 cloudresourcemanager.googleapis.com/Project
  • PAGE_SIZE: 省略可。ページごとに返される結果の数のクエリ パラメータ。例: 5
  • PAGE_TOKEN: 省略可。トークンのクエリを継続するパラメータ。ページ分けされた結果を続行します。例: CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

HTTP メソッド、URL、クエリ パラメータ:

GET https://[ENDPOINT_URI]/v1/organizations/[DESTINATION_ORGANIZATION_ID]/locations/[DESTINATION_LOCATION_ID]/workloads/[DESTINATION_WORKLOAD_ID]:analyzeWorkloadMove?project=projects/SOURCE_PROJECT_ID&page_size=PAGE_SIZE&page_token=PAGE_TOKEN

例:

GET https://us-west1-assuredworkloads.googleapis.com/v1/organizations/919698298765/locations/us-west1/workloads/00-701ea036-7152-4781-a867-9f5:analyzeWorkloadMove?project=projects/my-project-123&page_size=5&page_token=CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

次のような JSON レスポンスが返されます。

{
  "assetMoveAnalyses": [
    {
      "asset": "//orgpolicy.googleapis.com/projects/130536381852/policies/container.restrictNoncompliantDiagnosticDataAccess",
      "assetType": "orgpolicy.googleapis.com/Policy"
    },
    {
      "asset": "//compute.googleapis.com/projects/my-project-123/global/routes/default-route-9ca6e6b0ab7326f0",
      "assetType": "compute.googleapis.com/Route",
      "analysisGroups": [
        {
          "displayName": "RESOURCE_LOCATIONS",
          "analysisResult": {
            "warnings": [
              {
                "detail": "The asset's location 'global' is incompatible with the gcp.resourceLocations org policy effective at the target. In case of 'global only' assets, this may be ignored."
              }
            ]
          }
        }
      ]
    },
    {
      "asset": "//compute.googleapis.com/projects/my-project-123/regions/europe-west10/subnetworks/default",
      "assetType": "compute.googleapis.com/Subnetwork",
      "analysisGroups": [
        {
          "displayName": "RESOURCE_LOCATIONS",
          "analysisResult": {
            "blockers": [
              {
                "detail": "The asset's location 'europe-west10' is incompatible with the gcp.resourceLocations org policy effective at the target."
              }
            ]
          }
        }
      ]
    },
    {
      "asset": "//serviceusage.googleapis.com/projects/130536381852/services/servicemanagement.googleapis.com",
      "assetType": "serviceusage.googleapis.com/Service"
    },
    {
      "asset": "//serviceusage.googleapis.com/projects/130536381852/services/monitoring.googleapis.com",
      "assetType": "serviceusage.googleapis.com/Service"
    },
    {
      "asset": "//serviceusage.googleapis.com/projects/130536381852/services/bigquerymigration.googleapis.com",
      "assetType": "serviceusage.googleapis.com/Service",
      "analysisGroups": [
        {
          "displayName": "DISALLOWED_SERVICES",
          "analysisResult": {
            "warnings": [
              {
                "detail": "This service is not allowed by the gcp.restrictServiceUsage org policy effective at the target"
              }
            ]
          }
        }
      ]
    },
    {
      "asset": "//cloudresourcemanager.googleapis.com/projects/my-project-123",
      "assetType": "cloudresourcemanager.googleapis.com/Project",
      "analysisGroups": [
        {
          "displayName": "ORG_POLICIES",
          "analysisResult": {
            "warnings": [
              {
                "detail": "constraints/gcp.resourceLocations: Target applies/inherits this custom policy and it is not applied by the source. Upon moving, this policy will get inherited from the target."
              },
              {
                "detail": "constraints/compute.disableInstanceDataAccessApis: Source applies this custom policy and it is not applied by the target."
              },
              {
                "detail": "constraints/cloudkms.allowedProtectionLevels: Source and target set different values for this policy."
              },
              {
                "detail": "constraints/container.restrictNoncompliantDiagnosticDataAccess: Source and target set different values for this policy."
              },
              {
                "detail": "constraints/gcp.restrictServiceUsage: Target applies/inherits this custom policy and it is not applied by the source. Upon moving, this policy will get inherited from the target."
              }
            ],
            "blockers": [
              {
                "detail": "constraints/gcp.resourceLocations: The value applied at the source is not compliant with the target compliance program. The expected allowed values are [us-west4, us-west1, us-west2, us-west3, us-central1, us-east1, us-east4, us-south1, us-central2, us-east5]."
              },
              {
                "detail": "constraints/container.restrictNoncompliantDiagnosticDataAccess: The value applied at the source is not compliant with the target compliance program. The expected value is [true]."
              },
              {
                "detail": "constraints/container.restrictTLSVersion: The value applied at the source is not compliant with the target compliance program. The expected denied values are [TLS_VERSION_1, TLS_VERSION_1_1]."
              }
            ]
          }
        }
      ]
    }
  ],
  "nextPageToken": "Ch8wLDc0MzY3NTExNCwzMzg4ODM1NTM2NDQ0NTg4MDMy"
}

検出結果を特定のアセットタイプでフィルタするには、asset_types クエリ パラメータを使用します。

GET https://assuredworkloads.googleapis.com/v1/organizations/919698298765/locations/us-west1/workloads/00-701ea036-7152-4781-a867-9f5:analyzeWorkloadMove?project=projects/my-project-123&asset_types=cloudresourcemanager.googleapis.com/Project&page_size=5&page_token=CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

結果には、指定したタイプ(cloudresourcemanager.googleapis.com/Project)の知見のみが含まれます。

{
  "assetMoveAnalyses": [
    {
      "asset": "//cloudresourcemanager.googleapis.com/projects/my-project-123",
      "assetType": "cloudresourcemanager.googleapis.com/Project",
      "analysisGroups": [
        {
          "displayName": "ORG_POLICIES",
          "analysisResult": {
            "warnings": [
              {
                "detail": "constraints/gcp.resourceLocations: Target applies/inherits this custom policy and it is not applied by the source. Upon moving, this policy will get inherited from the target."
              },
              {
                "detail": "constraints/compute.disableInstanceDataAccessApis: Source applies this custom policy and it is not applied by the target."
              }
            ],
            "blockers": [
              {
                "detail": "constraints/gcp.resourceLocations: The value applied at the source is not compliant with the target compliance program. The expected allowed values are [us-west4, us-west1, us-west2, us-west3, us-central1, us-east1, us-east4, us-south1, us-central2, us-east5]."
              }
            ]
          }
        }
      ]
    }
  ],
  "nextPageToken": "Ch8wLDc0MzY3NTExNCwzMzg4ODM1NTM2NDQ0NTg4MDMy"
}

検出結果を複数のアセットタイプでフィルタするには、それぞれを追加のクエリ パラメータとして追加します。

GET https://assuredworkloads.googleapis.com/v1/organizations/919698298765/locations/us-west1/workloads/00-701ea036-7152-4781-a867-9f5:analyzeWorkloadMove?project=projects/my-project-123&asset_types=cloudresourcemanager.googleapis.com/Project&asset_types=serviceusage.googleapis.com/Service&page_size=5&page_token=CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

結果には、指定したタイプ(cloudresourcemanager.googleapis.com/Projectserviceusage.googleapis.com/Service)の知見のみが含まれます。

{
  "assetMoveAnalyses": [
    {
      "asset": "//serviceusage.googleapis.com/projects/130536381852/services/bigquerymigration.googleapis.com",
      "assetType": "serviceusage.googleapis.com/Service",
      "analysisGroups": [
        {
          "displayName": "DISALLOWED_SERVICES",
          "analysisResult": {
            "warnings": [
              {
                "detail": "This service is not allowed by the gcp.restrictServiceUsage org policy effective at the target"
              }
            ]
          }
        }
      ]
    },
    {
      "asset": "//cloudresourcemanager.googleapis.com/projects/my-project-123",
      "assetType": "cloudresourcemanager.googleapis.com/Project",
      "analysisGroups": [
        {
          "displayName": "ORG_POLICIES",
          "analysisResult": {
            "warnings": [
              {
                "detail": "constraints/gcp.resourceLocations: Target applies/inherits this custom policy and it is not applied by the source. Upon moving, this policy will get inherited from the target."
              },
              {
                "detail": "constraints/compute.disableInstanceDataAccessApis: Source applies this custom policy and it is not applied by the target."
              }
            ],
            "blockers": [
              {
                "detail": "constraints/gcp.resourceLocations: The value applied at the source is not compliant with the target compliance program. The expected allowed values are [us-west4, us-west1, us-west2, us-west3, us-central1, us-east1, us-east4, us-south1, us-central2, us-east5]."
              }
            ]
          }
        }
      ]
    }
  ],
  "nextPageToken": "Ch8wLDc0MzY3NTExNCwzMzg4ODM1NTM2NDQ0NTg4MDMy"
}

移行分析を行った後、警告または阻害要因を確認して解決し、分析を再度実行して対処されていることを確認します。これで、プロジェクトの移動に進むことができます。

次のステップ