Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Files Security: Harden SMB and NFS Shares…
Guide Cloud Security

Azure Files Security: Harden SMB and NFS Shares Against Misuse and Ransomware

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 15 min read
On this page

An Azure file share often holds the same department folders, user profiles and application data that used to live on a Windows file server, and it can be reached by anyone holding the storage account key. Azure Files supports identity based SMB access through Active Directory Domain Services, Microsoft Entra Domain Services or Microsoft Entra Kerberos, so access can follow users and groups rather than a shared secret. This guide covers how identity and share permissions fit together, SMB security settings, storage account key use, network isolation, Azure File Sync, logging, and the soft delete, snapshot and backup layers that let you recover from deletion or ransomware. It is written for infrastructure engineers, Azure administrators and security teams. Blob storage, SAS tokens and account wide settings are covered in the Azure Storage Security Guide; this page stays on file shares.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public Azure Files documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • Move users to identity based access. Enable one identity source per storage account, grant share-level RBAC roles to groups, and manage file and folder access with Windows ACLs.
  • Treat the storage account key as a master key. NTLMv2 with the account key bypasses every share and file permission; remove it from the SMB authentication methods once identity access works.
  • Use the Maximum security SMB profile where clients allow. Require encryption in transit, SMB 3.1.1, AES-256-GCM, Kerberos only and AES-256 Kerberos tickets.
  • Keep shares off the internet. Use private endpoints and disable public network access; NFS shares are network authenticated, so network controls are their main defence.
  • Layer recovery. Soft delete, share snapshots, Azure Backup and resource locks protect against different failures; ransomware recovery needs copies an attacker with share access cannot change.

How identity and access work in Azure Files

Access to an SMB share is decided by three things together: authentication (who you are), share-level permission (Azure RBAC on the share) and file or directory permission (Windows ACLs). Network access must also be in place. Identity based authentication is free of extra service charges and supports SMB shares; NFS shares use network based authentication instead.

Identity sourceBest fitIdentities and clientsKey requirement
On-premises AD DSExisting AD DS estates where clients can reach domain controllersHybrid identities (in AD DS and synced to Entra ID), Windows and Linux clientsStorage account joined to AD DS; line of sight to domain controllers
Microsoft Entra Domain ServicesOrganisations using a managed domain in AzureCloud-only or hybrid identities, Windows and Linux clientsClients joined to the managed domain
Microsoft Entra KerberosCloud-first or hybrid estates, Entra joined devices, FSLogix profiles, clients without domain controller accessHybrid or cloud-only identities on Windows; macOS in previewClients Entra joined or hybrid joined, with CloudKerberosTicketRetrievalEnabled set

Only one identity source can be enabled per storage account, and it applies to every share in it. Changing the source temporarily interrupts identity based access to all shares, so plan it as a change window. Kerberos must be enabled under Authentication methods in the account's SMB security settings for any of the three sources.

Microsoft Entra Kerberos specifics

  • Admin consent: Enabling it creates an app registration named [Storage Account] <account>.file.core.windows.net. Grant admin consent for openid, profile and User.Read, and do not change the service principal beyond the documented steps.
  • Conditional Access: SMB access through Entra Kerberos is authorised without an MFA prompt, so exclude the storage account app from Conditional Access policies that require MFA for all apps; otherwise net use fails with system error 1327. Compensate by protecting the device sign-in itself with strong authentication and device compliance.
  • Ticket encryption: Kerberos tickets from Entra Kerberos always use AES-256.
  • Group limits: A Kerberos ticket holds at most 1,010 group SIDs across on-premises and cloud groups; users over the limit cannot get tickets.
  • Cloud-only users: Supported on current Windows 11 and Windows Server 2025 builds in Azure public cloud, with a mandatory group SID limit tag added to the app manifest. File and folder permissions for cloud-only identities are managed in the Azure portal or with RestSetAcls.

Kerberos fundamentals are covered in the Kerberos Security Guide.

Admin roles and privileged access

Azure Files share-level roles grant data access over SMB. Some are ordinary user roles and some override Windows ACLs entirely, which makes them privileged.

RoleGrantsTreat as
Storage File Data SMB Share ReaderRead files and directoriesStandard user
Storage File Data SMB Share ContributorRead, write and deleteStandard user
Storage File Data SMB Share Elevated ContributorRead, write, delete and modify ACLsFolder owner or data steward
Storage File Data Privileged ReaderRead, overriding existing ACLsPrivileged: backup, audit or migration tools only
Storage File Data Privileged ContributorRead, write, delete and modify ACLs, overriding existing ACLsPrivileged: administrators and sync identities only
Storage File Data SMB AdminAdmin access equivalent to a storage account key for SMB usersHighly privileged
Storage File Data SMB Take OwnershipTake ownership of files and directoriesPrivileged: recovery tasks only

Control plane roles matter as much. Owner, Contributor and Storage Account Contributor include listKeys, which returns the storage account keys and therefore full data access. Keep these roles for a small platform group, make them eligible rather than permanent, and see the Azure RBAC and Service Principals Guide.

Default share-level permission

The default share-level permission starts as None. You can enable a permission for all authenticated users and groups, which applies the chosen role to every share in the account. Microsoft recommends specific user and group assignments for most deployments. The default is the right tool in narrower cases: identities in AD DS that are not synced to Entra ID, such as gMSAs, sMSAs and computer accounts (which cannot hold Azure RBAC assignments), an AD DS synced to a different Entra tenant, or a decision to enforce access only through Windows ACLs. When both apply, a user gets the higher of the two permissions, so a generous default quietly overrides narrow assignments.

Integrations, API tokens and service accounts

  • Storage account keys: Mounting with the account key uses NTLMv2 and grants full access regardless of ACLs. Once users and applications use identity access, remove NTLMv2 from the SMB authentication methods, which blocks key based mounting.
  • Disallowing Shared Key: Setting AllowSharedKeyAccess to false rejects Shared Key requests with 403 and also denies service and account SAS. Microsoft cautions that the Azure portal uses Shared Key by default for file shares and that Storage Explorer connects to File storage with keys, and suggests moving file workloads to a separate account before disallowing Shared Key on mixed accounts. Assign data roles first, test, then disable. The built-in Azure Policy definition "Storage accounts should prevent shared key access" can audit before it denies.
  • Service accounts and gMSAs: Application servers that use group managed service accounts reach shares through Kerberos with AD DS. Because gMSAs cannot hold Azure RBAC roles, they rely on the default share-level permission plus tight Windows ACLs.
  • Azure File Sync: The agent talks to the Storage Sync Service and the share over HTTPS on port 443 only, never SMB, and never sends unencrypted requests. Registration needs the Azure File Sync Administrator, Owner or Contributor role on the Storage Sync Service. Prefer the managed identity deployment, where the File Sync identity holds roles such as Storage File Data Privileged Contributor, over key based access. When assigning Azure File Sync Administrator, use a role assignment condition that limits which roles that person can delegate. Use a separate Storage Sync Service per group that needs strict isolation, and keep everything in one Entra tenant.
  • Customer-managed keys: Data is encrypted at rest with Microsoft-managed keys by default, and classic file shares can use customer-managed keys. Revoking key access makes the share unreachable over SMB and FileREST, so protect the key vault as carefully as the data. See the Azure Key Vault Security Guide.
  • Endpoint protection on sync servers: Antivirus scans that read tiered files trigger recalls and egress charges. Microsoft Defender skips tiered files only during on-demand scans, so confirm your endpoint product is compatible with tiering.

SMB security settings and network isolation

SMB security settings on the storage account offer Maximum compatibility (the default), Maximum security and Custom profiles. Stricter settings can block older clients, which then receive STATUS_ACCESS_DENIED.

SettingOptionsHardened choice
Require Encryption in Transit for SMBOn by default for accounts created in the portal; not selected for accounts created with PowerShell, CLI or FileRESTOn (blocks SMB 2.1, which cannot encrypt)
SMB protocol versionsSMB 3.1.1, 3.0, 2.1 (SMB 1 is not offered)SMB 3.1.1 only where clients allow
SMB channel encryptionAES-256-GCM, AES-128-GCM, AES-128-CCMAES-256-GCM (Windows 11 and Windows Server 2022 or later)
Authentication methodsKerberos, NTLMv2 (account key only)Kerberos only
Kerberos ticket encryptionAES-256, RC4-HMACAES-256 only
Secure transfer requiredNow governs REST and HTTPS trafficOn, with minimum TLS 1.2

If you allow only AES-256-GCM, configure clients to match, for example with Set-SmbClientConfiguration -EncryptionCiphers "AES_256_GCM". RC4 retirement in Kerberos is covered in the Kerberos RC4 Deprecation guide.

SMB uses TCP 445, which many ISPs block, so on-premises access normally runs over VPN or ExpressRoute to a private endpoint. A private endpoint gives the share a private IP in your virtual network and creates a CNAME to privatelink.file.core.windows.net; on-premises clients need DNS forwarding, for example through Azure DNS Private Resolver. The public endpoint stays reachable until you disable public network access. ExpressRoute private peering does not encrypt traffic by default, so keep SMB encryption on. NFS shares cannot be reached from the internet, use network rather than user authentication, and can use the AzNFS mount helper to tunnel traffic through TLS 1.2 or 1.3. For NFS, the network boundary is the access control: limit it to the subnets that need it. See the Azure Virtual Network Security Guide.

Ransomware protection and recovery

Ransomware against file shares usually arrives through a compromised client or account that already has write access, so the share's own recovery features must sit outside what that identity can change.

LayerProtects againstKey facts
Share soft deleteDeletion of a whole shareOn by default for new accounts; retention 1 to 365 days (default 7); restores the share with its snapshots
Share snapshotsEncryption or deletion of files and foldersRead-only, incremental; up to 200 per share; restore through Previous Versions, the portal or copy
Azure Backup for Azure FilesLonger retention and managed restore pointsManaged snapshots with policy; protect the vault with its own security settings (for NFS shares, confirm current Azure Backup coverage in Microsoft's documentation and use share snapshots where needed)
Resource Manager locksDeletion or change of the storage accountSnapshots do not stop account deletion; a lock does
Least privilege and Kerberos-only accessMass encryption by a stolen keyRemoves the master key path that bypasses ACLs

Snapshots are deleted with their share, and soft delete works only at share level, so you need both, plus a lock on the account. An identity with write rights on the storage account can delete snapshots and disable soft delete, and an Owner or User Access Administrator (or any role with Microsoft.Authorization/locks/* rights) can remove locks, which is why control plane roles must be guarded. With Azure File Sync, do not back up a server endpoint that has cloud tiering enabled: tiered files are skipped or recalled. Back up the Azure file share directly instead. Vault protections are covered in the Azure Backup and Recovery Services Vault Security Guide and wider cloud patterns in the Cloud Ransomware Guide.

Logging and detection

Logs are not sent anywhere by default. Create a diagnostic setting on the file service of each storage account and send the StorageRead, StorageWrite and StorageDelete categories to a Log Analytics workspace, where they land in the StorageFileLogs table. Logs cover authenticated requests using Kerberos, NTLM or SAS.

  • Key based access: Use the Transactions metric filtered by Authentication equal to Account Key and SAS to find clients still using keys before you disable them.
  • Mass change: Alert on spikes in write, rename and delete operations from one caller, a common sign of encryption in progress, and on unusual Egress (Microsoft's sample alert uses more than 500 GiB in a day).
  • Control plane: Alert in the Activity Log on listKeys and key regeneration, changes to SMB security settings, soft delete being disabled, lock removal, snapshot deletion and new private endpoint or network rule changes.
  • Identity: Monitor changes to the storage account app registration and share-level role assignments.

Metrics that show the controls are working:

  • Percentage of SMB transactions authenticated with Kerberos rather than the account key.
  • Storage accounts with NTLMv2 removed and the Maximum security or equivalent Custom profile applied.
  • Shares with soft delete on, at least daily snapshots and a backup policy.
  • Storage accounts with public network access disabled.
  • Time from a mass change alert to client isolation.

See the Azure Monitor, Activity Log and Diagnostic Settings Guide for collection at scale.

Hardening baseline

  1. Inventory: List storage accounts with file shares, their protocols, identity source, SMB profile, network settings and current key usage from metrics.
  2. Enable identity access: Choose the identity source, assign share-level roles to groups, keep the default share-level permission at None unless a documented case needs it, and set Windows ACLs.
  3. Pilot: Move one share and a pilot group of users and applications to Kerberos access; confirm Previous Versions restores work.
  4. Tighten SMB: Apply the Maximum security profile or a Custom profile with Kerberos only, AES-256 tickets and encryption required. Test older clients first.
  5. Retire keys: Remove NTLMv2 once metrics show no key use; consider disallowing Shared Key where file workloads allow, auditing with Azure Policy first. Rotate both account keys afterwards.
  6. Isolate: Add private endpoints and DNS, then disable public network access.
  7. Protect recovery: Confirm soft delete retention, schedule snapshots or Azure Backup, and apply a CanNotDelete lock to the account.
  8. Roll back: SMB settings and authentication methods can be reverted in minutes if a critical client breaks; keep a record of the previous profile and re-tighten after the client is fixed.

Common misconfigurations

  • Account key mounts left in scripts: Mapped drives and scripts with the storage key give full access and survive staff changes. Replace them with identity based mounts and remove NTLMv2.
  • Default share-level permission set to Elevated Contributor: Every authenticated user can then change ACLs on every share. Use group assignments.
  • Privileged roles given to users: Privileged Contributor and SMB Admin override ACLs. Keep them for sync identities and break glass administrators.
  • Snapshots treated as backup: Snapshots disappear with the share and can be deleted by an account administrator. Add soft delete, a lock and Azure Backup.
  • Public endpoint left open: Disabling public network access is a separate step after creating a private endpoint. Complete it.
  • Accounts created by script with encryption not required: Accounts created with PowerShell or CLI do not select Require Encryption in Transit for SMB. Set it explicitly in templates.

Framework mapping

Control areaNIST SP 800-53 Rev 5NIST CSF 2.0ISO/IEC 27001:2022 Annex A
Share-level RBAC and Windows ACLsAC-3, AC-6PR.AA-05A.5.15 Access control, A.8.3 Information access restriction
Kerberos identity access, key retirementIA-2, IA-5PR.AA-05A.8.5 Secure authentication
SMB encryption and TLSSC-8, SC-13PR.DS-02A.8.24 Use of cryptography
Private endpoints and network rulesSC-7PR.IR-01A.8.20 Networks security
Soft delete, snapshots and backupCP-9PR.DS-11A.8.13 Information backup
File logs and activity alertsAU-2, SI-4DE.CM-09A.8.15 Logging, A.8.16 Monitoring activities

Practitioner checklist

  • Enable one identity source per account and assign share-level roles to groups, not users.
  • Keep the default share-level permission at None unless gMSAs or unsynced identities need it, and document why.
  • Restrict Privileged Contributor, SMB Admin and key-listing control plane roles to a small, eligible group.
  • Apply Maximum security or a Custom SMB profile with Kerberos only, AES-256 tickets and encryption required.
  • Find key based clients with metrics, migrate them, remove NTLMv2 and rotate both keys.
  • Use private endpoints with private DNS and disable public network access.
  • Keep soft delete on with a retention that matches detection time, schedule snapshots or Azure Backup, and lock the account.
  • Use the Azure File Sync managed identity deployment and back up the cloud share, not tiered server endpoints.
  • Send StorageFileLogs to Log Analytics and alert on mass changes, key listing and protection changes.
  • Apply vendor security updates to clients and sync agents promptly, and keep sync agents within their support window.

Standards and references

Related NHI Mgmt Group resources: Azure Storage Security Guide · SMB Protocol Security and Signing Guide · Azure Backup and Recovery Services Vault Security Guide · Cloud Ransomware Guide · Kerberos Security Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org