GCP - Vertex AI Enum

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 Google Cloud का एक unified machine learning प्लेटफ़ॉर्म है जो बड़े पैमाने पर AI मॉडल बनाने, तैनात करने, और प्रबंधित करने के लिए बनाया गया है। यह विभिन्न AI और ML सेवाओं को एक एकीकृत प्लेटफ़ॉर्म में जोड़ता है, जिससे डेटा वैज्ञानिकों और ML इंजीनियरों को सक्षम बनाता है कि वे:

  • कस्टम मॉडल प्रशिक्षित करें AutoML या कस्टम प्रशिक्षण का उपयोग करके
  • मॉडल तैनात करें स्केलेबल endpoints पर अनुमान (predictions) के लिए
  • ML लाइफसाइकल प्रबंधित करें experimentation से लेकर production तक
  • Pre-trained मॉडल एक्सेस करें Model Garden से
  • मॉडल प्रदर्शन की निगरानी और अनुकूलन करें

Agent Engine / Reasoning Engine

Agent Engine / Reasoning Engine से संबंधित विशिष्ट enumeration और post-exploitation रास्तों के लिए जो metadata credential theft, P4SA abuse, और producer/tenant project pivoting को शामिल करते हैं, देखें:

GCP - Vertex AI Post Exploitation

Key Components

Models

Vertex AI के models प्रशिक्षित मशीन लर्निंग मॉडल का प्रतिनिधित्व करते हैं जिन्हें endpoints पर तैनात करके predictions परोसे जा सकते हैं। Models हो सकते हैं:

  • अपलोड किए गए कस्टम कंटेनरों या model artifacts से
  • AutoML प्रशिक्षण के माध्यम से बनाए गए
  • Model Garden (pre-trained models) से इम्पोर्ट किए गए
  • वर्ज़न्ड — प्रति मॉडल कई versions हो सकते हैं

प्रत्येक model के पास metadata होता है जिसमें उसका framework, container image URI, artifact location, और serving configuration शामिल होते हैं।

Endpoints

Endpoints वे संसाधन हैं जो तैनात किए गए models को होस्ट करते हैं और ऑनलाइन predictions सेवा प्रदान करते हैं। प्रमुख विशेषताएँ:

  • एक Endpoint पर कई deployed models हो सकते हैं (traffic splitting के साथ)
  • रीयल-टाइम predictions के लिए HTTPS endpoints प्रदान करते हैं
  • ट्रैफ़िक के आधार पर autoscaling समर्थित है
  • private या public access का विकल्प
  • traffic splitting के जरिए A/B testing का समर्थन

Custom Jobs

Custom jobs आपको अपने स्वयं के containers या Python पैकेज का उपयोग करके कस्टम प्रशिक्षण कोड चलाने देते हैं। विशेषताओं में शामिल हैं:

  • कई worker pools के साथ distributed training का समर्थन
  • कॉन्फ़िगर करने योग्य machine types और accelerators (GPUs/TPUs)
  • अन्य GCP संसाधनों तक पहुंच के लिए service account को अटैच करने का विकल्प
  • विज़ुअलाइज़ेशन के लिए Vertex AI Tensorboard के साथ एकीकरण
  • VPC connectivity विकल्प

Hyperparameter Tuning Jobs

ये जॉब्स स्वचालित रूप से optimal hyperparameters खोजते हैं, विभिन्न parameter combinations के साथ कई training trials चलाकर।

Model Garden

Model Garden से पहुँच उपलब्ध है:

  • Google के pre-trained models
  • Open-source models (including Hugging Face)
  • थर्ड-पार्टी models
  • एक-क्लिक deployment क्षमताएँ

Tensorboards

Tensorboards ML प्रयोगों के लिए विज़ुअलाइज़ेशन और मॉनिटरिंग प्रदान करते हैं, जिसमें metrics, model graphs, और training progress ट्रैक होते हैं।

Service Accounts & Permissions

डिफॉल्ट रूप से, Vertex AI सेवाएँ Compute Engine default service account (PROJECT_NUMBER-compute@developer.gserviceaccount.com) का उपयोग करती हैं, जिसे प्रोजेक्ट पर Editor permissions मिलते हैं। हालाँकि, आप कस्टम service accounts निर्दिष्ट कर सकते हैं जब आप:

  • custom jobs बना रहे हों
  • models अपलोड कर रहे हों
  • models को endpoints पर डिप्लॉय कर रहे हों

यह service account निम्न कार्यों के लिए इस्तेमाल होता है:

  • Cloud Storage में training data तक पहुंच
  • Cloud Logging में logs लिखना
  • Secret Manager से secrets तक पहुंच
  • अन्य GCP सेवाओं के साथ इंटरैक्ट करना

Data Storage

  • Model artifacts Cloud Storage buckets में संग्रहीत होते हैं
  • Training data आम तौर पर Cloud Storage या BigQuery में रहती है
  • Container images Artifact Registry या Container Registry में संग्रहीत होते हैं
  • Logs Cloud Logging को भेजे जाते हैं
  • Metrics Cloud Monitoring को भेजे जाते हैं

Encryption

डिफ़ॉल्ट रूप से, Vertex AI Google-managed encryption keys का उपयोग करता है। आप यह भी कॉन्फ़िगर कर सकते हैं:

  • Customer-managed encryption keys (CMEK) Cloud KMS से
  • एन्क्रिप्शन model artifacts, training data, और endpoints पर लागू होता है

Networking

Vertex AI संसाधनों को निम्न के लिए कॉन्फ़िगर किया जा सकता है:

  • Public internet access (डिफ़ॉल्ट)
  • VPC peering के साथ private access
  • Private Service Connect के जरिए सुरक्षित कनेक्टिविटी
  • Shared VPC समर्थन

Enumeration

# 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 का समर्थन करें