agentleFS
vinayaklatthevinayaklatthe/microsoft-security-skills/skills/defender-for-storage/SKILL.md

defender-for-storage

Skill179 starsChanged 5 months agoMITView on GitHub

Guidance for Microsoft Defender for Storage — threat protection for Azure Storage accounts (Blob, Files, Data Lake Gen2). Covers the v2 (per-storage-account) plan, on-upload malware scanning powered by Defender Antivirus, sensitive data threat detection (integrated with Purview classification), activity-based threat detection, override per storage account, exclusion of high-volume accounts, Event Grid integration for scan results, and cost controls (per-GB scan cap). WHEN: Defender for Storage, Azure Storage malware scan, Blob malware scanning, sensitive data threat detection, on-upload scan, Defender for Storage v2, Storage account threat protection, scan results Event Grid, Purview classification storage, malicious blob upload, exfiltration alert storage, untrusted upload scan. DO NOT USE for SQL/Cosmos DB protection (use defender-for-cloud-hardening), VM disk malware (use defender-for-servers agentless scan), or M365 SharePoint/OneDrive (use defender-for-office-365).

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Malware scan is asynchronous: Do not architect a "scan-then-let-the-app-read" flow on the assumption of <1s latency.

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Microsoft Defender for Storage

Defender for Storage protects Azure Blob Storage, Azure Files, and Azure Data Lake Storage Gen2 against malicious uploads, sensitive data exfiltration, and suspicious access patterns. The current generation is Defender for Storage v2, billed per storage account, with optional add-ons for on-upload malware scanning and sensitive data threat detection.

When to use

Protecting Azure Storage accounts that receive uploads from untrusted or partner sources, host application content (web apps, ML datasets), or contain sensitive data classified by Purview. Use this skill for plan rollout, malware-scan tuning, and incident response on storage alerts.

Do not use this skill for SQL/Cosmos data plane protection (defender-for-cloud-hardening), VM disk-level malware (defender-for-servers), or M365 file workloads (defender-for-office-365).

Plan and add-ons

ComponentWhat it doesCost model
Defender for Storage v2 (base)Activity monitoring: anomalous access, suspicious extraction, unusual deletionPer storage account / month
On-upload malware scanningDefender AV scans every uploaded blob up to 2 GB; result tag + Event Grid eventPer GB scanned (capped per-account configurable)
Sensitive data threat detectionIntegrates with Purview sensitive-info-types; alerts when sensitive blobs are accessed by suspicious principalsIncluded in v2 (no extra fee)

v1 (per-transaction) is deprecated. Migrate any v1-enabled accounts to v2 — it's cheaper and predictable.

Approach

  1. Enable Defender for Storage v2 at subscription scope with malware scanning on and a per-account monthly GB cap (default 5,000 GB). Cap prevents runaway costs on high-throughput accounts. Verify: Defender for Cloud → Environment settings → Subscription → Storage shows v2 plan On with malware scanning enabled.
  2. Override per storage account for outliers:
    • Disable malware scan on append-only logging accounts, large telemetry sinks, or accounts already scanning at the application layer.
    • Disable plan entirely on tenant-scoped diagnostic accounts (Activity Logs export, NSG flow logs) where threat detection adds no value.
  3. Wire scan results to Event Grid. Set up an Event Grid system topic per protected account; subscribe a Function/Logic App that:
    • Moves malicious blobs to a quarantine container (or deletes).
    • Writes the verdict to the blob's index tag (Malware-Scanning-scan-result-tag).
    • Notifies the SOC. Verify: upload an EICAR test file; within 2 minutes the blob is tagged Malicious and the quarantine workflow fires.
  4. Sensitive data threat detection — turn on after Purview classifies the accounts. Without classification, this just runs on file extensions/header heuristics. Pair with Purview Data Map for full value (see purview-data-map).
  5. Tune alerts. Baseline 7 days then suppress noisy ones (e.g., expected SAS-token use from CDN edge IPs). Send remaining alerts into Sentinel via the Defender for Cloud connector.
  6. Block public anonymous access at the storage account. Defender alerts on suspicious anonymous reads, but the right control is allowBlobPublicAccess = false and Azure Policy to enforce. Defender is detection, not prevention.
  7. Response runbook for "Malicious blob uploaded" alert:
    1. Confirm the verdict tag on the blob.
    2. Move to quarantine container; revoke any SAS/keys for the upload identity.
    3. Hunt sibling uploads from same principal in the past 24h via KQL on StorageBlobLogs.
    4. Notify owner; close the alert with evidence.

Guardrails

  • Always set a per-account GB cap on malware scanning. Without it, a misbehaving client uploading the same 50 GB file 1,000 times can produce a six-figure scan bill.
  • Files > 2 GB are not scanned. Compensate with application-layer scanning or block uploads above 2 GB on untrusted endpoints.
  • Malware scan is asynchronous. Do not architect a "scan-then-let-the-app-read" flow on the assumption of <1s latency; scans typically take seconds to minutes. Use Event Grid to gate downstream processing.
  • Don't enable on diagnostic-export accounts. They're append-only system telemetry; scanning is wasteful and noisy.
  • Sensitive data alerts depend on Purview. Without Purview classification, you'll get weak heuristic-only signal.
  • Public anonymous access is a configuration problem, not a Defender problem. Block it at the platform layer.

Common anti-patterns

  • "Enabled on every storage account in the subscription, no exclusions" — diagnostic and log accounts blow up cost. Override.
  • "Relied on the malware verdict tag without Event Grid" — the bad blob still exists and is readable until something acts on the tag.
  • "Application reads blob immediately after upload" — race with async scan. Gate on the scan-complete event.
  • "Scan cap left at unlimited" — bill shock incident in week one.
  • "Migrated from v1 by re-enabling alongside v1" — disable v1 first; double-billing.
  • "Used Defender for Storage instead of Purview DLP for SharePoint/OneDrive" — wrong workload. SharePoint is M365, not Azure Storage.

Example prompts

  • Enable Defender for Storage v2 across 50 subscriptions with malware scanning capped at 3 TB/account/month.
  • Wire the malware scan Event Grid event to a Logic App that quarantines malicious blobs.
  • Exclude diagnostic-export storage accounts from Defender for Storage via Azure Policy.
  • Alert on sensitive data threat detection and route to Sentinel — what's needed from Purview first?
  • Build the IR runbook for "Malicious file uploaded to blob" alerts.
  • Estimate monthly cost for 200 storage accounts averaging 500 GB ingest each.

Microsoft Learn

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.