-
Notifications
You must be signed in to change notification settings - Fork 571
[New Rule] BloodHound Suite User-Agents Detected #4769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
terrancedejesus
merged 3 commits into
main
from
new-rule-azurehound-invocation-user-agent-detection
Jun 4, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
171 changes: 171 additions & 0 deletions
171
rules/integrations/azure/discovery_bloodhound_user_agents_detected.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
[metadata] | ||
creation_date = "2025/06/03" | ||
integration = ["azure", "o365"] | ||
maturity = "production" | ||
updated_date = "2025/06/03" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
Identifies potential enumeration activity using AzureHound, SharpHound, or BloodHound across Microsoft cloud services. | ||
These tools are often used by red teamers and adversaries to map users, groups, roles, applications, and access | ||
relationships within Microsoft Entra ID (Azure AD) and Microsoft 365. | ||
""" | ||
false_positives = [ | ||
""" | ||
Legitimate administrative or security assessment activities may use these user-agents, especially in environments | ||
where BloodHound is employed for authorized audits. If this is expected behavior, consider adjusting the rule or | ||
adding exceptions for specific user-agents or IP addresses. | ||
""", | ||
""" | ||
Expected red team assessments or penetration tests may utilize BloodHound tools to evaluate the security posture of | ||
Azure or Microsoft 365 environments. If this is expected behavior, consider adjusting the rule or adding exceptions | ||
for specific IP addresses, registered applications, JWT tokens, PRTs or user principal names (UPNs). | ||
""", | ||
] | ||
from = "now-9m" | ||
index = ["filebeat-*", "logs-azure.*", "logs-o365.audit-*"] | ||
language = "eql" | ||
license = "Elastic License v2" | ||
name = "BloodHound Suite User-Agents Detected" | ||
note = """## Triage and analysis | ||
|
||
This rule identifies potential enumeration activity using AzureHound, SharpHound, or BloodHound across Microsoft cloud services. These tools are often used by red teamers and adversaries to map users, groups, roles, applications, and access relationships within Microsoft Entra ID (Azure AD) and Microsoft 365. | ||
|
||
The detection is based on known enumeration patterns, particularly the presence of suspicious user agent strings (e.g., `azurehound/`, `sharphound/`, `bloodhound/`) in various Azure and M365 logs. The rule monitors multiple log sources, including: | ||
|
||
- Azure Graph API Activity Logs | ||
- Microsoft 365 Audit Logs | ||
- Entra ID Sign-in Logs | ||
- Entra ID Audit Logs | ||
- Azure Activity Logs | ||
|
||
This ensures broader detection of credential abuse, token misuse, or unauthorized identity discovery activity from both interactive and non-interactive (API) sessions. | ||
|
||
### Possible investigation steps | ||
|
||
- Confirm the tool used via `user_agent.original`. Look for: | ||
- `azurehound/x.y.z` | ||
- `bloodhound/1.0` | ||
- `sharphound/1.0` | ||
- Examine `url.original` or `url.path` to determine which APIs were accessed if Graph API activity logs. For example: | ||
- `/v1.0/organization`, `/v1.0/users`, `/v1.0/groups` may indicate user/group/tenant discovery. | ||
- Identify the `user.id`, `user.name`, or `azure.auditlogs.properties.initiated_by.user.user_principal_name` fields to determine which identity executed the API request. | ||
- Review `app_id`, `app_display_name`, or `client_id` to identify the application context (e.g., Azure CLI, Graph Explorer, unauthorized app). | ||
- Check `http.request.method`, `http.response.status_code`, and `event.action` for enumeration patterns (many successful GETs in a short period) if Graph API activity logs. | ||
- Investigate correlated sign-ins (`azure.signinlogs`) by the same user, IP, or app immediately preceding the API calls. Was MFA used? Is the location suspicious? | ||
- Review `source.ip`, `client.geo.*`, and `network.*` fields to determine the origin of the requests. Flag unexpected IPs or ISPs. | ||
- If the event originates in M365 Audit Logs, investigate cross-service activity: Exchange Online, Teams, SharePoint, or role escalations via Unified Audit. | ||
|
||
### False positive analysis | ||
|
||
- This activity may be benign if performed by red teams, internal security auditors, or known security tools under authorization. | ||
- Automated monitoring solutions, cloud posture scanners, or legitimate Azure/M365 integrations may generate similar traffic. Review the `app_id` and user context. | ||
- Developer activity in test tenants may include tool usage for learning or validation purposes. | ||
|
||
### Response and remediation | ||
|
||
- If confirmed malicious: | ||
- Revoke active sessions or tokens associated with the identified user/app. | ||
- Disable the account or rotate credentials immediately. | ||
- Review the role assignments (`Directory.Read.All`, `AuditLog.Read.All`, `Directory.AccessAsUser.All`) and remove excessive privileges. | ||
- Conduct historical analysis to determine how long enumeration has been occurring and what objects were queried. | ||
- Enable Conditional Access policies to require MFA for API and CLI-based access. | ||
- Validate audit logging and alerting is enabled across Microsoft Graph, Azure Activity Logs, and M365 workloads. | ||
|
||
- If legitimate: | ||
- Document the source (e.g., red team operation, security tool). | ||
- Add appropriate allowlist conditions for service principal, user, source address or device if policy allows. | ||
|
||
""" | ||
references = [ | ||
"https://specterops.io/bloodhound-overview/", | ||
"https://github.com/SpecterOps/AzureHound", | ||
"https://www.microsoft.com/en-us/security/blog/2025/05/27/new-russia-affiliated-actor-void-blizzard-targets-critical-sectors-for-espionage/", | ||
] | ||
risk_score = 47 | ||
rule_id = "c28750fa-4092-11f0-aca6-f661ea17fbcd" | ||
severity = "medium" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Data Source: Graph API", | ||
"Data Source: Graph API Activity Logs", | ||
"Data Source: Microsoft 365", | ||
"Data Source: Microsoft 365 Audit Logs", | ||
"Data Source: Microsoft Entra ID", | ||
"Data Source: Microsoft Entra ID Audit Logs", | ||
"Data Source: Microsoft Entra ID Sign-in Logs", | ||
"Use Case: Identity and Access Audit", | ||
"Use Case: Threat Detection", | ||
"Tactic: Discovery", | ||
"Resources: Investigation Guide", | ||
] | ||
timestamp_override = "event.ingested" | ||
type = "eql" | ||
|
||
query = ''' | ||
any where event.dataset : ( | ||
"azure.activitylogs", | ||
"azure.graphactivitylogs", | ||
"azure.auditlogs", | ||
"azure.signinlogs", | ||
"o365.audit" | ||
) and user_agent.original regex~ "(azure|sharp|blood)(hound)/.*" | ||
''' | ||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
[[rule.threat.technique]] | ||
id = "T1069" | ||
name = "Permission Groups Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1069/" | ||
[[rule.threat.technique.subtechnique]] | ||
id = "T1069.003" | ||
name = "Cloud Groups" | ||
reference = "https://attack.mitre.org/techniques/T1069/003/" | ||
|
||
|
||
[[rule.threat.technique]] | ||
id = "T1082" | ||
name = "System Information Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1082/" | ||
|
||
[[rule.threat.technique]] | ||
id = "T1087" | ||
name = "Account Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1087/" | ||
[[rule.threat.technique.subtechnique]] | ||
id = "T1087.004" | ||
name = "Cloud Account" | ||
reference = "https://attack.mitre.org/techniques/T1087/004/" | ||
|
||
|
||
[[rule.threat.technique]] | ||
id = "T1201" | ||
name = "Password Policy Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1201/" | ||
|
||
[[rule.threat.technique]] | ||
id = "T1526" | ||
name = "Cloud Service Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1526/" | ||
|
||
[[rule.threat.technique]] | ||
id = "T1580" | ||
name = "Cloud Infrastructure Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1580/" | ||
|
||
[[rule.threat.technique]] | ||
id = "T1673" | ||
name = "Virtual Machine Discovery" | ||
reference = "https://attack.mitre.org/techniques/T1673/" | ||
|
||
|
||
[rule.threat.tactic] | ||
id = "TA0007" | ||
name = "Discovery" | ||
reference = "https://attack.mitre.org/tactics/TA0007/" | ||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this solely interesting for azure, not for AWS/GCP?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Bloodhound suite is specific to AD and/or Azure. However, regarding data sources in Azure & M365 these are the most common and should catch the activity, especially Graph API activity logs since the suite makes calls there for discovery and enum.