GCP - Vertex AI 列挙

Tip

学んで実践する AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
学んで実践する GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
学んで実践する Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks をサポートする

Vertex AI

Vertex AI は、スケールに応じて AI モデルを構築、デプロイ、管理するための Google Cloud の統合された機械学習プラットフォームです。さまざまな AI および ML サービスを単一の統合プラットフォームにまとめ、データサイエンティストや ML エンジニアが以下を実行できるようにします:

  • AutoML またはカスタムトレーニングを使用してカスタムモデルを学習する
  • 予測のためにスケーラブルなエンドポイントへモデルをデプロイする
  • 実験から本番までの ML ライフサイクルを管理する
  • Model Garden から事前学習済みモデルにアクセスする
  • モデルの性能を監視および最適化する

Agent Engine / Reasoning Engine

Agent Engine / Reasoning Engine に関する特定の列挙やポストエクスプロイト経路(metadata credential theft、P4SA abuse、producer/tenant project pivoting を含む)については、次を参照してください:

GCP - Vertex AI Post Exploitation

主なコンポーネント

Models

Vertex AI の models は、予測を提供するためにエンドポイントへデプロイできる学習済み機械学習モデルを表します。モデルは次の方法で扱えます:

  • カスタムコンテナやモデルアーティファクトからの アップロード
  • AutoML による作成
  • Model Garden からのインポート(事前学習済みモデル)
  • モデルごとに複数の バージョン管理

各モデルにはフレームワーク、コンテナイメージ URI、アーティファクトの場所、サービング設定などのメタデータがあります。

Endpoints

Endpoints はデプロイされたモデルをホスティングし、オンライン予測を提供するリソースです。主な特徴:

  • 複数のデプロイ済みモデル をホスト可能(トラフィックスプリッティング対応)
  • リアルタイム予測のための HTTPS endpoints
  • トラフィックに基づく オートスケーリング をサポート
  • プライベート または パブリック アクセスを使用可能
  • トラフィックスプリッティングによる A/B testing をサポート

Custom Jobs

Custom jobs を使うと、独自のコンテナや Python パッケージを用いてカスタムトレーニングコードを実行できます。特徴:

  • 複数の worker pool による 分散トレーニング をサポート
  • 設定可能な マシンタイプアクセラレータ(GPU/TPU)
  • 他の GCP リソースへアクセスするための service account のアタッチ
  • 可視化のための Vertex AI Tensorboard との統合
  • VPC 接続 オプション

Hyperparameter Tuning Jobs

これらのジョブは、異なるパラメータ組み合わせで複数のトレーニングトライアルを実行して、最適なハイパーパラメータを自動的に検索します。

Model Garden

Model Garden は次へのアクセスを提供します:

  • Google の事前学習済みモデル
  • オープンソースモデル(Hugging Face を含む)
  • サードパーティモデル
  • ワンクリックでのデプロイ機能

Tensorboards

Tensorboards は ML 実験の可視化と監視を提供し、メトリクス、モデルグラフ、トレーニング進捗を追跡します。

Service Accounts & Permissions

デフォルトでは、Vertex AI サービスはプロジェクト上で Editor 権限を持つ Compute Engine default service accountPROJECT_NUMBER-compute@developer.gserviceaccount.com)を使用します。ただし、以下の場合にカスタム service accounts を指定できます:

  • custom jobs の作成時
  • モデルのアップロード時
  • モデルをエンドポイントへデプロイする際

この service account は以下の用途で使用されます:

  • Cloud Storage のトレーニングデータへのアクセス
  • Cloud Logging へのログ書き込み
  • Secret Manager からのシークレットアクセス
  • 他の GCP サービスとの連携

Data Storage

  • Model artifactsCloud Storage バケットに保存される
  • Training data は通常 Cloud Storage や BigQuery に存在する
  • Container imagesArtifact Registry または Container Registry に保存される
  • LogsCloud Logging に送られる
  • MetricsCloud Monitoring に送られる

Encryption

デフォルトでは、Vertex AI は Google-managed encryption keys を使用します。次のような設定も可能です:

  • Cloud KMS の Customer-managed encryption keys (CMEK)
  • 暗号化はモデルアーティファクト、トレーニングデータ、エンドポイントに適用されます

Networking

Vertex AI リソースは次のように構成できます:

  • Public internet access(デフォルト)
  • VPC peering によるプライベートアクセス
  • Private Service Connect によるセキュアな接続
  • Shared VPC のサポート

列挙

# List models
gcloud ai models list --region=<region>
gcloud ai models describe <model-id> --region=<region>
gcloud ai models list-version <model-id> --region=<region>

# List endpoints
gcloud ai endpoints list --region=<region>
gcloud ai endpoints describe <endpoint-id> --region=<region>
gcloud ai endpoints list --list-model-garden-endpoints-only --region=<region>

# List custom jobs
gcloud ai custom-jobs list --region=<region>
gcloud ai custom-jobs describe <job-id> --region=<region>

# Stream logs from a running job
gcloud ai custom-jobs stream-logs <job-id> --region=<region>

# List hyperparameter tuning jobs
gcloud ai hp-tuning-jobs list --region=<region>
gcloud ai hp-tuning-jobs describe <job-id> --region=<region>

# List model monitoring jobs
gcloud ai model-monitoring-jobs list --region=<region>
gcloud ai model-monitoring-jobs describe <job-id> --region=<region>

# List Tensorboards
gcloud ai tensorboards list --region=<region>
gcloud ai tensorboards describe <tensorboard-id> --region=<region>

# List indexes (for vector search)
gcloud ai indexes list --region=<region>
gcloud ai indexes describe <index-id> --region=<region>

# List index endpoints
gcloud ai index-endpoints list --region=<region>
gcloud ai index-endpoints describe <index-endpoint-id> --region=<region>

# Get operations (long-running operations status)
gcloud ai operations describe <operation-id> --region=<region>

# Test endpoint predictions (if you have access)
gcloud ai endpoints predict <endpoint-id> \
--region=<region> \
--json-request=request.json

# Make direct predictions (newer API)
gcloud ai endpoints direct-predict <endpoint-id> \
--region=<region> \
--json-request=request.json

モデル情報収集

# Get detailed model information including versions
gcloud ai models describe <model-id> --region=<region>

# Check specific model version
gcloud ai models describe <model-id>@<version> --region=<region>

# List all versions of a model
gcloud ai models list-version <model-id> --region=<region>

# Get model artifact location (usually a GCS bucket)
gcloud ai models describe <model-id> --region=<region> --format="value(artifactUri)"

# Get container image URI
gcloud ai models describe <model-id> --region=<region> --format="value(containerSpec.imageUri)"

エンドポイントの詳細

# Get endpoint details including deployed models
gcloud ai endpoints describe <endpoint-id> --region=<region>

# Get endpoint URL
gcloud ai endpoints describe <endpoint-id> --region=<region> --format="value(deployedModels[0].displayName)"

# Get service account used by endpoint
gcloud ai endpoints describe <endpoint-id> --region=<region> --format="value(deployedModels[0].serviceAccount)"

# Check traffic split between models
gcloud ai endpoints describe <endpoint-id> --region=<region> --format="value(trafficSplit)"

カスタムジョブ情報

# Get job details including command, args, and service account
gcloud ai custom-jobs describe <job-id> --region=<region>

# Get service account used by job
gcloud ai custom-jobs describe <job-id> --region=<region> --format="value(jobSpec.workerPoolSpecs[0].serviceAccount)"

# Get container image used
gcloud ai custom-jobs describe <job-id> --region=<region> --format="value(jobSpec.workerPoolSpecs[0].containerSpec.imageUri)"

# Check environment variables (may contain secrets)
gcloud ai custom-jobs describe <job-id> --region=<region> --format="value(jobSpec.workerPoolSpecs[0].containerSpec.env)"

# Get network configuration
gcloud ai custom-jobs describe <job-id> --region=<region> --format="value(jobSpec.network)"

アクセス制御

# Note: IAM policies for individual Vertex AI resources are managed at the project level
# Check project-level permissions
gcloud projects get-iam-policy <project-id>

# Check service account permissions
gcloud iam service-accounts get-iam-policy <service-account-email>

# Check if endpoints allow unauthenticated access
# This is controlled by IAM bindings on the endpoint
gcloud projects get-iam-policy <project-id> \
--flatten="bindings[].members" \
--filter="bindings.role:aiplatform.user"

ストレージとアーティファクト

# Models and training jobs often store artifacts in GCS
# List buckets that might contain model artifacts
gsutil ls

# Common artifact locations:
# gs://<project>-aiplatform-<region>/
# gs://<project>-vertex-ai/
# gs://<custom-bucket>/vertex-ai/

# Download model artifacts if accessible
gsutil -m cp -r gs://<bucket>/path/to/artifacts ./artifacts/

# Check for notebooks in AI Platform Notebooks
gcloud notebooks instances list --location=<location>
gcloud notebooks instances describe <instance-name> --location=<location>

モデルガーデン

# List Model Garden endpoints
gcloud ai endpoints list --list-model-garden-endpoints-only --region=<region>

# Model Garden models are often deployed with default configurations
# Check for publicly accessible endpoints

Privilege Escalation

以下のページで、abuse Vertex AI permissions to escalate privilegesの方法を確認できます。

GCP - Vertex AI Privesc

Post Exploitation

GCP - Vertex AI Post Exploitation

参考資料

Tip

学んで実践する AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
学んで実践する GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
学んで実践する Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks をサポートする