How the attack works
Azure Bastion gives browser-based RDP and SSH access to virtual machines that have no public IP address, normally for users who are signed in to Azure. Its Shareable Link feature removes that requirement. Microsoft documents that the feature lets users connect to a virtual machine or scale set through Bastion without accessing the Azure portal, and that when a user without Azure credentials opens a shareable link, a web page prompts for a sign-in to the target over RDP or SSH. The link holds no credentials: the person still needs a user name and a password or private key that the machine accepts. The feature needs the Standard SKU and has to be enabled on the Bastion host first.
For an attacker with rights on the Bastion host a shareable link is a durable way back in from outside. Microsoft's Azure Threat Research Matrix lists it as a persistence technique (AZT509) and says Bastion can be abused to allow persistent network access to a virtual machine over the public internet. The link keeps working after the attacker's Azure identity is disabled, because using it involves no Azure sign-in. Together with a local account on the machine, which an attacker with rights on the virtual machine can obtain separately, it is complete remote access. Creating a link is the action Microsoft.Network/bastionHosts/createShareableLinks/action, recorded in the Azure Activity log with its caller. Sessions through a link are not in the Activity log. They appear in the audit resource log of the Bastion host, where a diagnostic setting collects it.
What an attacker needs
- A role with
Microsoft.Network/bastionHosts/createShareableLinks/actionon the Bastion host, such as Owner, Contributor or Network Contributor. Microsoft notes that by default users have only read access to shared links and cannot create or delete them. - A Bastion host on the Standard SKU with the Shareable Link feature enabled, or the right to update the host and enable it.
- To use the link: credentials of a local or domain account that the target machine accepts.
Impact
A URL on the public internet that leads to the RDP or SSH sign-in of an internal virtual machine, outside Conditional Access and outside the network controls that Bastion was deployed to replace. It lasts until the link expires or is deleted. With valid credentials for the machine it is interactive access to a server inside the virtual network.
Detection rules
Azure Bastion Shareable Link Created
Detects a successful creation of shareable links on an Azure Bastion host (Microsoft.Network/bastionHosts/createShareableLinks/action). A shareable link lets a person without Azure credentials open the RDP or SSH sign-in of a virtual machine through Bastion from the internet. It holds no credentials for the machine, but it works without an Azure sign-in until it expires or is deleted, so it can outlast the access of whoever created it. The feature is off until it is enabled on the host, and creating links is rare in most environments, so review each event.
title: Azure Bastion Shareable Link Created
id: 94e7b3fc-a67a-44d0-b980-dfd317d21bcd
status: experimental
description: >-
Detects a successful creation of shareable links on an Azure Bastion host
(Microsoft.Network/bastionHosts/createShareableLinks/action). A shareable
link lets a person without Azure credentials open the RDP or SSH sign-in of
a virtual machine through Bastion from the internet. It holds no
credentials for the machine, but it works without an Azure sign-in until it
expires or is deleted, so it can outlast the access of whoever created it.
The feature is off until it is enabled on the host, and creating links is
rare in most environments, so review each event.
references:
- https://attack.mitre.org/techniques/T1133/
- https://learn.microsoft.com/en-us/azure/bastion/shareable-link
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/networking
- https://microsoft.github.io/Azure-Threat-Research-Matrix/Persistence/AZT509/AZT509/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.initial-access
- attack.t1133
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.NETWORK/BASTIONHOSTS/CREATESHAREABLELINKS/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Administrators who give a vendor or a support engineer temporary access to a machine through a shareable link. Match each event to a request and check that the link has an expiry.
level: medium
False positives
- Administrators who give a vendor or a support engineer temporary access to a machine through a shareable link. Match each event to a request and check that the link has an expiry.
Azure Bastion Shareable Links Retrieved
Detects a successful retrieval of the shareable links of an Azure Bastion host (Microsoft.Network/bastionHosts/getShareableLinks/action), which Microsoft describes as returning the shareable URLs for the specified virtual machines. A caller who reads the links can use a URL that somebody else created, without creating one and without an Azure sign-in at the time of use. Reviewing the links of a host makes the same call, so use the rule for a baseline of expected callers and not as an alert on its own.
title: Azure Bastion Shareable Links Retrieved
id: 17ba3f19-2620-488b-ae72-091398cb7228
status: experimental
description: >-
Detects a successful retrieval of the shareable links of an Azure Bastion
host (Microsoft.Network/bastionHosts/getShareableLinks/action), which
Microsoft describes as returning the shareable URLs for the specified
virtual machines. A caller who reads the links can use a URL that somebody
else created, without creating one and without an Azure sign-in at the time
of use. Reviewing the links of a host makes the same call, so use the rule
for a baseline of expected callers and not as an alert on its own.
references:
- https://attack.mitre.org/techniques/T1133/
- https://learn.microsoft.com/en-us/azure/bastion/shareable-link
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/networking
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.initial-access
- attack.t1133
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.NETWORK/BASTIONHOSTS/GETSHAREABLELINKS/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Administrators who open the list of shareable links of a Bastion host, and tools that inventory Bastion configuration. Exclude their identities in a filter_ selection by Caller once confirmed.
level: low
False positives
- Administrators who open the list of shareable links of a Bastion host, and tools that inventory Bastion configuration. Exclude their identities in a filter_ selection by Caller once confirmed.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Bastion host updated and a shareable link created by the same caller shortly after
The feature is disabled until somebody enables it on the host, and enabling it is an update of the Bastion host. A caller that updates a Bastion host and creates a shareable link a few minutes later may have switched the feature on for that one link.
- In the Azure Activity log, a Bastion host is updated with status Success:
MICROSOFT.NETWORK/BASTIONHOSTS/WRITE. Keep theCallerand the resource ID of the host. - Within 60 minutes the same
CallerrunsMICROSOFT.NETWORK/BASTIONHOSTS/CREATESHAREABLELINKS/ACTIONon the same host. - Read the configuration of the host to confirm that the Shareable Link feature is enabled, because the write event does not say which property changed, and list the links.
EventsMICROSOFT.NETWORK/BASTIONHOSTS/WRITEMICROSOFT.NETWORK/BASTIONHOSTS/CREATESHAREABLELINKS/ACTION
LimitsAn administrator who enables the feature for a vendor and creates the first link in the same session looks the same, so the change has to be matched with a request. The 60 minutes are a starting point. A host where the feature was already enabled does not produce the first event.
Shareable link created and the target machine's local access changed by the same caller
A link is only useful with credentials for the machine. A caller that creates a link and, around the same time, changes how the machine can be signed in to, through an extension or Run command, is assembling both halves of remote access on its own.
- In the Azure Activity log, a link is created:
MICROSOFT.NETWORK/BASTIONHOSTS/CREATESHAREABLELINKS/ACTIONwith status Success. Keep theCallerand the time, and list the target machines of the links on the host. - Within 24 hours before or after, the same
Callerwrites an extension or runs a command on one of those machines:MICROSOFT.COMPUTE/VIRTUALMACHINES/EXTENSIONS/WRITEorMICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION. - Check on the machine whether a local account was added or a password or SSH key was reset at that time.
EventsMICROSOFT.NETWORK/BASTIONHOSTS/CREATESHAREABLELINKS/ACTIONMICROSOFT.COMPUTE/VIRTUALMACHINES/EXTENSIONS/WRITEMICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION
LimitsMicrosoft does not document that the Activity log event of the link names the target machine, so the join needs the list of links from the host. Administrators who prepare vendor access may reset a password and create a link on purpose. The 24 hours are a starting point, and an attacker who already knows working credentials does not match.
Triage
- Identify the Caller, the caller's IP address and the Bastion host, and whether this identity manages remote access for a vendor or a support case.
- List the shareable links on the Bastion host and note the target machines, the creation times and the expiry of each link.
- Check whether the Shareable Link feature was enabled on the host shortly before, which shows as an update of the Bastion host in the Activity log.
- Look for changes to the target machines by the same caller, such as a password reset through the VM access extension, a new local user created through Run command or a changed network security group.
- Review the Bastion audit log and the Sessions page of the host for connections to the target machines after the link was created.
Response
Once the attack is confirmed:
- Delete the shareable links that are not approved, and disable the Shareable Link feature on the host if it is not needed.
- Disconnect active Bastion sessions to the target machines that you cannot attribute.
- Reset the passwords and remove the SSH keys of the local accounts on the target machines, and remove local accounts that were created around the time of the link.
- Contain the caller. Revoke its sessions, rotate its credentials and remove its role on the Bastion host until the link is explained.
- Investigate the target machines for what was done in sessions that came through the link.
Mitigation
- Leave the Shareable Link feature disabled on Bastion hosts that do not need it, and use Azure Policy to audit or deny hosts that have it enabled.
- Limit Owner, Contributor and Network Contributor on Bastion hosts, and grant the shareable link actions only through a custom role where the feature is really used.
- Set an expiry on every link that is created, and review the list of links on each Bastion host regularly.
- Create a diagnostic setting on every Bastion host that collects the audit log, so that sessions can be attributed.
- Do not leave local accounts with long-lived passwords or keys on machines that a Bastion host can reach. Rotate local administrator credentials, so that a link without current credentials leads nowhere.
Frequently asked questions
Does a shareable link contain credentials for the virtual machine?
No. Microsoft documents that the link doesn't contain any credentials and that the user authenticates with a user name and password or a private key, depending on the target. The link removes the need for an Azure account and for network access to the machine. An attacker who also controls a local account on the machine has everything needed.
Does disabling the attacker's Azure account stop the link?
No. Opening a shareable link involves no Azure sign-in, which is the purpose of the feature. The link works until it expires or somebody deletes it, or until the feature is disabled on the Bastion host. Delete the links you cannot account for and reset the credentials of the accounts on the target machines.
Are connections through a shareable link visible in the Activity log?
No. The Activity log records the Azure Resource Manager actions that create, list and delete links, with their callers. Connections are sessions on the Bastion host. They are shown on the Sessions page of the host and written to its audit resource log, and only when a diagnostic setting collects that log.
Why does the rule on retrieving links have a low level?
Retrieving the links returns the URLs that already exist, so a caller who reads them can use a link that somebody else created. The same operation is what an administrator triggers when reviewing the links of a host. Use the rule for a baseline of callers, and treat a first-time caller on a host with active links as worth a look.