Add Azure Bastion brute force detection query#548
Merged
Conversation
This query detects brute force attacks on Azure Bastion by monitoring failed login attempts from the same source IP. It includes parameters for tuning the detection sensitivity.
Added details on detecting Bastion brute force attempts and contribution guidelines.
Updated the contributing guidelines and added a note about the Microsoft Open Source Code of Conduct.
shabaz-github
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new KQL detection for Azure Bastion brute force / credential-guessing attacks under the Azure Bastion product folder. This is the first detection contributed for Azure Bastion (the product folder previously contained only Azure Policy content).
What it detects
Multiple failed Bastion session logins (
Message == "Login Failed") originating from the same source IP against Bastion-fronted VMs within a short time window. Failures are grouped by source IP, and a result is raised when the count meets a configurable threshold. The query also surfaces the targeted OS accounts, initiating Entra identities, and target VMs, and adds heuristic flags (LikelyPasswordSpray,HighVolume) to aid triage.Data source
MicrosoftAzureBastionAuditLogs(resource-specific Bastion Audit Logs)Tuning
Configurable via
lookbackandthresholdparameters. Default (recommended): 5 failed logins in 15 minutes. An optionalAllowlistedSourceIPsparameter suppresses trusted IPs.Validation
Validated end-to-end against a live Azure Bastion (Premium) + private VM test environment, confirming the query fires correctly on real failed-login audit records.
Files added
Azure Bastion/Alerts - Queries and Alerts/Detection - Bastion Brute Force/Detection - Bastion Brute Force.jsonAzure Bastion/Alerts - Queries and Alerts/Detection - Bastion Brute Force/README.mdStructure
Follows the existing repo convention (mirrors
Azure Firewall/Alerts - Queries and Alerts/Detection - ...).