Azure Storage Accounts Microsoft Azure में ऐसी मौलिक सेवाएँ हैं जो स्केलेबल, सुरक्षित, और उच्च उपलब्ध क्लाउड विभिन्न डेटा प्रकारों के लिए storage प्रदान करती हैं, जिनमें blobs (binary large objects), files, queues, और tables शामिल हैं। ये अलग-अलग storage सेवाओं को एक ही namespace के अंतर्गत समूहित करने वाले containers के रूप में कार्य करती हैं ताकि प्रबंधन सरल हो।
मुख्य कॉन्फ़िगरेशन विकल्प:
प्रत्येक storage account का नाम Azure में यूनिक होना चाहिए।
प्रत्येक storage account किसी region या Azure extended zone में डिप्लॉय किया जाता है।
बेहतर प्रदर्शन के लिए storage account का premium संस्करण चुनना संभव है।
rack, drive और datacenter failures से बचाव के लिए 4 प्रकार की redundancy में से चयन संभव है।
सुरक्षा कॉन्फ़िगरेशन विकल्प:
Require secure transfer for REST API operations: storage के साथ किसी भी संचार में TLS आवश्यक करें
Allows enabling anonymous access on individual containers: यदि सक्षम नहीं किया गया तो भविष्य में anonymous access सक्षम करना संभव नहीं होगा
Enable storage account key access: यदि सक्षम नहीं, तो Shared Keys से access निषिद्ध होगा
Minimum TLS version
Permitted scope for copy operations: किसी भी storage account से, उसी Entra tenant के किसी भी storage account से, या उसी virtual network में private endpoints वाले storage accounts से अनुमति देना
Blob Storage विकल्प:
Allow cross-tenant replication
Access tier: Hot (अक्सर पहुंचा जाने वाला डेटा), Cool और Cold (दुर्लभ रूप से एक्सेस किया जाने वाला डेटा)
नेटवर्किंग विकल्प:
Network access:
सभी नेटवर्क से अनुमति दें
चयनित virtual networks और IP addresses से अनुमति दें
सार्वजनिक एक्सेस अक्षम करें और private access का उपयोग करें
Private endpoints: यह virtual network से storage account के लिए private कनेक्शन की अनुमति देता है
डेटा प्रोटेक्शन विकल्प:
Point-in-time restore for containers: containers को पहले की स्थिति पर restore करने की अनुमति देता है
इसके लिए versioning, change feed, और blob soft delete सक्षम होने चाहिए।
Enable soft delete for blobs: deleted blobs (यहाँ तक कि overwritten) के लिए दिनों में retention अवधि सक्षम करता है
Enable soft delete for containers: deleted containers के लिए retention अवधि दिनों में सक्षम करता है
Enable soft delete for file shares: deleted file shares के लिए retention अवधि दिनों में सक्षम करता है
Enable versioning for blobs: आपके blobs के पिछले संस्करण बनाए रखता है
Enable blob change feed: blobs पर create, modification, और delete परिवर्तनों के लॉग रखता है
Enable version-level immutability support: खाते-स्तर पर समय-आधारित retention policy सेट करने की अनुमति देता है जो सभी blob versions पर लागू होगा।
Version-level immutability support और point-in-time restore for containers को एक साथ सक्षम नहीं किया जा सकता।
एन्क्रिप्शन कॉन्फ़िगरेशन विकल्प:
Encryption type: Microsoft-managed keys (MMK) या Customer-managed keys (CMK) का उपयोग करना संभव है
Enable infrastructure encryption: डेटा को “अधिक सुरक्षा” के लिए डबल एन्क्रिप्ट करने की अनुमति देता है
Static websites विशेष $web container से region-specific endpoint के माध्यम से परोसे जाते हैं जैसे https://<account>.z13.web.core.windows.net/।
$web container blob API के माध्यम से publicAccess: null रिपोर्ट कर सकता है, फिर भी फ़ाइलें static site endpoint के माध्यम से पहुँच योग्य रहती हैं, इसलिए वहां config/IaC artifacts छोड़ने से secrets leak हो सकते हैं।
Quick audit workflow:
# Identify storage accounts with static website hosting enabled
az storage blob service-properties show --account-name <acc-name> --auth-mode login
# Enumerate containers (including $web) and their public flags
az storage container list --account-name <acc-name> --auth-mode login
# List files served by the static site even when publicAccess is null
az storage blob list --container-name '$web' --account-name <acc-name> --auth-mode login
# Pull suspicious files directly (e.g., IaC tfvars containing secrets/SAS)
az storage blob download -c '$web' --name iac/terraform.tfvars --file /dev/stdout --account-name <acc-name> --auth-mode login
Locate storage accounts जो डेटा एक्सपोज़ कर सकते हैं: az storage account list | jq -r '.[] | select(.properties.allowBlobPublicAccess==true) | .name'. यदि allowBlobPublicAccessfalse है तो आप containers को public नहीं कर सकते।
Inspect risky accounts फ़्लैग और अन्य कमजोर सेटिंग्स की पुष्टि करने के लिए: az storage account show --name <acc> --query '{allow:properties.allowBlobPublicAccess, minTls:properties.minimumTlsVersion}'.
Enumerate container-level exposure जहाँ यह फ्लैग सक्षम है:
az storage container list --account-name <acc> \
--query '[].{name:name, access:properties.publicAccess}'
"Blob": अनाम पढ़ने की अनुमति है केवल जब blob नाम ज्ञात हो (कोई सूची नहीं).
"Container": प्रत्येक blob के लिए अनाम list + read.
null: निजी; प्रमाणीकरण आवश्यक.
क्रेडेंशियल्स के बिना पहुँच साबित करें:
यदि publicAccessContainer है, तो अनाम सूचीकरण काम करेगा: curl "https://<acc>.blob.core.windows.net/<container>?restype=container&comp=list".
दोनों Blob और Container के लिए, जब नाम ज्ञात हो तो अनाम blob डाउनलोड संभव है:
az storage blob download -c <container> -n <blob> --account-name <acc> --file /dev/stdout
# or via raw HTTP
curl "https://<acc>.blob.core.windows.net/<container>/<blob>"
यह संभव है कि access keys के साथ साइन किए गए Shared Keys को generate किया जाए ताकि signed URL के माध्यम से कुछ resources तक access authorize किया जा सके।
Note
ध्यान दें कि CanonicalizedResource हिस्सा storage services resource (URI) का प्रतिनिधित्व करता है। और यदि URL में कोई भाग encoded है, तो उसे CanonicalizedResource के अंदर भी encode किया जाना चाहिए।
Note
यह used by default by az cli है requests को authenticate करने के लिए। इसे Entra ID principal credentials का उपयोग करने के लिए, param --auth-mode login निर्दिष्ट करें।
यह संभव है कि blob, queue और file services के लिए shared key generate किया जाए, निम्नलिखित जानकारी को sign करके:
Shared Access Signatures (SAS) सुरक्षित, समय-सीमित URLs हैं जो Azure Storage अकाउंट में resources तक पहुँचने के लिए specific permissions देती हैं बिना अकाउंट के access keys को उजागर किए। जबकि access keys सभी resources के लिए पूर्ण administrative access देती हैं, SAS granular control देती है — permissions (जैसे read या write) निर्दिष्ट करके और expiration time निर्धारित करके।
User delegation SAS: इसे एक Entra ID principal से बनाया जाता है जो SAS पर साइन करेगा और उपयोगकर्ता से SAS को permissions delegate करेगा। इसे केवल blob and data lake storage के साथ उपयोग किया जा सकता है (docs). सभी जनरेट किए गए user delegated SAS को revoke करना संभव है।
यह संभव है कि delegation SAS को उपयोगकर्ता के पास मौजूद permissions से “अधिक” permissions के साथ जनरेट किया जाए। हालांकि, अगर principal के पास वे permissions नहीं हैं, तो यह काम नहीं करेगा (no privesc).
Service SAS: यह storage account के किसी एक access key का उपयोग करके साइन किया जाता है। इसे single storage service के specific resources के लिए access देने में उपयोग किया जा सकता है। यदि key को renew किया जाता है, तो SAS काम करना बंद कर देगा।
Account SAS: यह भी storage account के किसी एक access key के साथ साइन होता है। यह storage account services (Blob, Queue, Table, File) में across resources तक access प्रदान करता है और service-level operations शामिल कर सकता है।
A SAS URL signed by an access key looks like this:
जब SAS जनरेट किया जा रहा होता है, तो यह निर्दिष्ट करना आवश्यक होता है कि इसे कौन‑सी permissions देनी चाहिए। जिस object पर SAS जनरेट किया जा रहा है उसके अनुसार अलग‑अलग permissions शामिल हो सकती हैं। उदाहरण के लिए:
Azure Blob Storage अब SSH File Transfer Protocol (SFTP) को सपोर्ट करता है, जो Blob Storage पर सीधे secure file transfer और management को सक्षम बनाता है बिना custom solutions या third-party products की आवश्यकता के।
Protocol Support: SFTP उन Blob Storage accounts के साथ काम करता है जिनमें hierarchical namespace (HNS) कॉन्फ़िगर किया गया है। यह blobs को directories और subdirectories में व्यवस्थित करता है ताकि navigation आसान हो।
Security: SFTP local user identities का उपयोग authentication के लिए करता है और RBAC या ABAC के साथ एकीकृत नहीं होता। प्रत्येक local user निम्न तरीकों से authenticate कर सकता है:
Azure-generated passwords
Public-private SSH key pairs
Granular Permissions: Read, Write, Delete, और List जैसी permissions local users को 100 containers तक असाइन की जा सकती हैं।
Networking Considerations: SFTP connections port 22 के माध्यम से बनाई जाती हैं। Azure ऐसे नेटवर्क कॉन्फ़िगरेशन्स (firewalls, private endpoints, या virtual networks) को सपोर्ट करता है ताकि SFTP ट्रैफ़िक सुरक्षित रहे।
Hierarchical Namespace: HNS को storage account बनाते समय सक्षम किया जाना चाहिए।
Supported Encryption: इसके लिए Microsoft Security Development Lifecycle (SDL)-approved cryptographic algorithms (उदा., rsa-sha2-256, ecdsa-sha2-nistp256) की आवश्यकता होती है।
SFTP Configuration:
storage account पर SFTP को सक्षम करें।
उपयुक्त permissions के साथ local user identities बनाएं।
उपयोगकर्ताओं के लिए home directories कॉन्फ़िगर करें ताकि container के अंदर उनकी starting location निर्धारित हो सके।
az storage blob show –account-name –container-name –sas-token ‘se=2024-12-31T23%3A59%3A00Z&sp=racwdxyltfmei&sv=2022-11-02&sr=c&sig=ym%2Bu%2BQp5qqrPotIK5/rrm7EMMxZRwF/hMWLfK1VWy6E%3D’ –name ‘asd.txt’