Az - AI Foundry, AI Hubs, Azure OpenAI & AI Search
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।
Why These Services Matter
Azure AI Foundry माइक्रोसॉफ्ट का GenAI एप्लिकेशन बनाने के लिए umbrella प्लेटफ़ॉर्म है। एक hub AI प्रोजेक्ट्स, Azure ML workspaces, compute, data stores, registries, prompt flow assets, और downstream सेवाओं जैसे Azure OpenAI और Azure AI Search के कनेक्शन को aggregate करता है। हर कंपोनेंट आम तौर पर निम्न को उजागर करता है:
- Long-lived API keys (OpenAI, Search, data connectors) जो Azure Key Vault या workspace connection objects के अंदर replicate होते हैं।
- Managed Identities (MI) जो deployments, vector indexing jobs, model evaluation pipelines, और Git/GitHub Enterprise operations को कंट्रोल करती हैं।
- Cross-service links (storage accounts, container registries, Application Insights, Log Analytics) जो hub/project permissions inherit करते हैं।
- Multi-tenant connectors (Hugging Face, Azure Data Lake, Event Hubs) जो upstream credentials या tokens को leak कर सकते हैं।
एक single hub/project के compromise का मतलब आम तौर पर downstream managed identities, compute clusters, online endpoints, और किसी भी search indexes या OpenAI deployments पर नियंत्रण होना है जिनका reference prompt flows द्वारा किया गया हो।
Core Components & Security Surface
- AI Hub (
Microsoft.MachineLearningServices/hubs): Top-level object जो region, managed network, system datastores, default Key Vault, Container Registry, Log Analytics, और hub-level identities को परिभाषित करता है। एक compromised hub attacker को नए projects, registries, या user-assigned identities inject करने की अनुमति देता है। - AI Projects (
Microsoft.MachineLearningServices/workspaces): Host करते हैं prompt flows, data assets, environments, component pipelines, और online/batch endpoints। Projects hub resources को inherit करते हैं और अपने storage, kv, और MI के साथ override भी कर सकते हैं। हर workspace secrets को/connectionsऔर/datastoresके अंतर्गत store करता है। - Managed Compute & Endpoints: इसमें managed online endpoints, batch endpoints, serverless endpoints, AKS/ACI deployments, और on-demand inference servers शामिल हैं। इन runtimes के अंदर Azure Instance Metadata Service (IMDS) से fetched tokens आम तौर पर workspace/project MI role assignments (आम तौर पर
ContributorयाOwner) carry करते हैं। - AI Registries & Model Catalog: models, environments, components, data, और evaluation results के region-scoped sharing की अनुमति देते हैं। Registries स्वतः GitHub/Azure DevOps से sync कर सकते हैं, जिसका मतलब है कि PATs connection definitions के अंदर embedded हो सकते हैं।
- Azure OpenAI (
Microsoft.CognitiveServices/accountswithkind=OpenAI): GPT family models प्रदान करता है। Access role assignments + admin/query keys के जरिए नियंत्रित होता है। कई Foundry prompt flows generated keys को secrets या environment variables के रूप में compute jobs से accessible रखते हैं। - Azure AI Search (
Microsoft.Search/searchServices): Vector/index storage आम तौर पर एक Search admin key के जरिए project connection से connected होती है। Index data में संवेदनशील embeddings, retrieved documents, या raw training corpora हो सकते हैं।
Security-Relevant Architecture
Managed Identities & Role Assignments
- AI hubs/projects system-assigned या user-assigned identities enable कर सकते हैं। ये identities आमतौर पर storage accounts, key vaults, container registries, Azure OpenAI resources, Azure AI Search services, Event Hubs, Cosmos DB, या custom APIs पर roles रखती हैं।
- Online endpoints project MI को inherit करते हैं या per deployment एक dedicated user-assigned MI के साथ override कर सकते हैं।
- Prompt Flow connections और Automated Agents
DefaultAzureCredentialके माध्यम से tokens request कर सकते हैं; compute से metadata endpoint capture करने पर lateral movement के लिए tokens मिलते हैं।
Network Boundaries
- Hubs/projects
publicNetworkAccess, private endpoints, Managed VNet और **managedOutbound** rules support करते हैं। गलत configuredallowInternetOutbound` या open scoring endpoints सीधे exfiltration की अनुमति दे सकते हैं। - Azure OpenAI और AI Search firewall rules, Private Endpoint Connections (PEC), shared private link resources, और
trustedClientCertificatesको support करते हैं। जब public access enabled होता है तो ये सेवाएँ उस source IP के साथ भी requests स्वीकार कर लेती हैं जिसे key पता हो।
Data & Secret Stores
- Default hub/project deployments एक storage account, Azure Container Registry, Key Vault, Application Insights, और Log Analytics workspace एक hidden managed resource group के अंदर बनाते हैं (pattern:
mlw-<workspace>-rg)। - Workspace datastores blob/data lake containers को reference करते हैं और SAS tokens, service principal secrets, या storage access keys embed कर सकते हैं।
- Workspace connections (Azure OpenAI, AI Search, Cognitive Services, Git, Hugging Face, आदि के लिए) credentials को workspace Key Vault में रखते हैं और management plane पर connection list करने पर इन्हें surface करते हैं (values base64-encoded JSON होती हैं)।
- AI Search admin keys indexes, skillsets, data sources पर full read/write access देती हैं, और RAG systems को feed करने वाले documents retrieve कर सकती हैं।
Monitoring & Supply Chain
- AI Foundry GitHub/Azure DevOps integration को support करता है code और prompt flow assets के लिए। OAuth tokens या PATs Key Vault + connection metadata में मौजूद रहते हैं।
- Model Catalog Hugging Face artifacts को mirror कर सकता है। अगर
trust_remote_code=trueहै तो deployment के दौरान arbitrary Python execute हो सकता है। - Data/feature pipelines Application Insights या Log Analytics में log करते हैं, जो connection strings को expose कर सकते हैं।
Enumeration with az
# Install the Azure ML / AI CLI extension (if missing)
az extension add --name ml
# Enumerate AI Hubs (workspaces with kind=hub) and inspect properties
az ml workspace list --filtered-kinds hub --resource-group <RG> --query "[].{name:name, location:location, rg:resourceGroup}" -o table
az resource show --name <HUB> --resource-group <RG> \
--resource-type Microsoft.MachineLearningServices/workspaces \
--query "{location:location, publicNetworkAccess:properties.publicNetworkAccess, identity:identity, managedResourceGroup:properties.managedResourceGroup}" -o jsonc
# Enumerate AI Projects (kind=project) under a hub or RG
az resource list --resource-type Microsoft.MachineLearningServices/workspaces --query "[].{name:name, rg:resourceGroup, location:location}" -o table
az ml workspace list --filtered-kinds project --resource-group <RG> \
--query "[?contains(properties.hubArmId, '/workspaces/<HUB>')].{name:name, rg:resourceGroup, location:location}"
# Show workspace level settings (managed identity, storage, key vault, container registry)
az ml workspace show --name <WS> --resource-group <RG> \
--query "{managedNetwork:properties.managedNetwork, storageAccount:properties.storageAccount, containerRegistry:properties.containerRegistry, keyVault:properties.keyVault, identity:identity}"
# List workspace connections (OpenAI, AI Search, Git, data sources)
az ml connection list --workspace-name <WS> --resource-group <RG> --populate-secrets -o table
az ml connection show --workspace-name <WS> --resource-group <RG> --name <CONNECTION>
# For REST (returns base64 encoded secrets)
az rest --method GET \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.MachineLearningServices/workspaces/<WS>/connections/<CONN>?api-version=2024-04-01"
# Enumerate datastores and extract credentials/SAS
az ml datastore list --workspace-name <WS> --resource-group <RG>
az ml datastore show --name <DATASTORE> --workspace-name <WS> --resource-group <RG>
# List managed online/batch endpoints and deployments (capture identity per deployment)
az ml online-endpoint list --workspace-name <WS> --resource-group <RG>
az ml online-endpoint show --name <ENDPOINT> --workspace-name <WS> --resource-group <RG>
az ml online-deployment show --name <DEPLOYMENT> --endpoint-name <ENDPOINT> --workspace-name <WS> --resource-group <RG> \
--query "{identity:identity, environment:properties.environmentId, codeConfiguration:properties.codeConfiguration}"
# Discover prompt flows, components, environments, data assets
az ml component list --workspace-name <WS> --resource-group <RG>
az ml data list --workspace-name <WS> --resource-group <RG> --type uri_folder
az ml environment list --workspace-name <WS> --resource-group <RG>
az ml job list --workspace-name <WS> --resource-group <RG> --type pipeline
# List hub/project managed identities and their role assignments
az identity list --resource-group <RG>
az role assignment list --assignee <MI-PRINCIPAL-ID> --all
# Azure OpenAI resources (filter kind==OpenAI)
az resource list --resource-type Microsoft.CognitiveServices/accounts \
--query "[?kind=='OpenAI'].{name:name, rg:resourceGroup, location:location}" -o table
az cognitiveservices account list --resource-group <RG> \
--query "[?kind=='OpenAI'].{name:name, location:location}" -o table
az cognitiveservices account show --name <AOAI-NAME> --resource-group <RG>
az cognitiveservices account keys list --name <AOAI-NAME> --resource-group <RG>
az cognitiveservices account deployment list --name <AOAI-NAME> --resource-group <RG>
az cognitiveservices account network-rule list --name <AOAI-NAME> --resource-group <RG>
# Azure AI Search services
az search service list --resource-group <RG>
az search service show --name <SEARCH-NAME> --resource-group <RG> \
--query "{sku:sku.name, publicNetworkAccess:properties.publicNetworkAccess, privateEndpoints:properties.privateEndpointConnections}"
az search admin-key show --service-name <SEARCH-NAME> --resource-group <RG>
az search query-key list --service-name <SEARCH-NAME> --resource-group <RG>
az search shared-private-link-resource list --service-name <SEARCH-NAME> --resource-group <RG>
# AI Search data-plane (requires admin key in header)
az rest --method GET \
--url "https://<SEARCH-NAME>.search.windows.net/indexes?api-version=2024-07-01" \
--headers "api-key=<ADMIN-KEY>"
az rest --method GET \
--url "https://<SEARCH-NAME>.search.windows.net/datasources?api-version=2024-07-01" \
--headers "api-key=<ADMIN-KEY>"
az rest --method GET \
--url "https://<SEARCH-NAME>.search.windows.net/indexers?api-version=2024-07-01" \
--headers "api-key=<ADMIN-KEY>"
# Linkage between workspaces and search / openAI (REST helper)
az rest --method GET \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.MachineLearningServices/workspaces/<WS>/connections?api-version=2024-04-01" \
--query "value[?properties.target=='AzureAiSearch' || properties.target=='AzureOpenAI']"
मूल्यांकन के दौरान किन बातों पर ध्यान दें
- Identity scope: प्रोजेक्ट अक्सर एक शक्तिशाली user-assigned identity को कई सेवाओं के साथ reuse करते हैं। किसी भी managed compute से IMDS tokens पकड़ने पर वे privileges inherit हो जाते हैं।
- Connection objects: Base64 payload में secret और metadata (endpoint URL, API version) शामिल होते हैं। कई टीमें OpenAI + Search के admin keys यहाँ छोड़ देती हैं और बार-बार rotate नहीं करतीं।
- Git & external source connectors: PATs या OAuth refresh tokens से उन कोड पर push access मिल सकती है जो pipelines/prompt flows को परिभाषित करते हैं।
- Datastores & data assets: अक्सर SAS tokens महीनों के लिए वैध होते हैं; data assets customer PII, embeddings, या training corpora की ओर इशारा कर सकते हैं।
- Managed Network overrides:
allowInternetOutbound=trueयाpublicNetworkAccess=Enabledहोने पर jobs/endpoints से secrets exfiltrate करना trivial हो जाता है। - Hub-managed resource group: इसमें storage account (
<workspace>storage), container registry, KV, और Log Analytics शामिल होते हैं। उस RG तक पहुँच अक्सर full takeover का मतलब होता है, भले ही portal इसे छुपाए।
संदर्भ
- Azure AI Foundry architecture
- Azure Machine Learning CLI v2
- Azure OpenAI security controls
- Azure AI Search security
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।
HackTricks Cloud

