-
Notifications
You must be signed in to change notification settings - Fork 587
[Rule Tuning] Azure Key Vault Modified #4896
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 6 commits into
main
from
4895-rule-tuning-azure-key-vault-modified
Jul 17, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
291f53a
tuning rule Azure Key Vault Modified
terrancedejesus 1ae29a8
Update rules/integrations/azure/impact_azure_key_vault_modified.toml
Aegrah 55c3c8f
adjusted description
terrancedejesus 7fc4f1d
Merge branch 'main' into 4895-rule-tuning-azure-key-vault-modified
terrancedejesus 87c41ae
Update rules/integrations/azure/impact_azure_key_vault_modified.toml
terrancedejesus db7c426
Merge branch 'main' into 4895-rule-tuning-azure-key-vault-modified
terrancedejesus 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
98 changes: 0 additions & 98 deletions
98
rules/integrations/azure/credential_access_key_vault_modified.toml
This file was deleted.
Oops, something went wrong.
95 changes: 95 additions & 0 deletions
95
rules/integrations/azure/impact_azure_key_vault_modified.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,95 @@ | ||
[metadata] | ||
creation_date = "2020/08/31" | ||
integration = ["azure"] | ||
maturity = "production" | ||
updated_date = "2025/07/09" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
Identifies modifications to a Key Vault in Azure. The Key Vault is a service that safeguards encryption keys and secrets | ||
like certificates, connection strings, and passwords. Because this data is sensitive and business critical, access to | ||
key vaults should be secured to allow only authorized applications and users. This is a New Terms rule that detects when this activity hasn't been seen by the user in a specified time frame. | ||
""" | ||
false_positives = [ | ||
""" | ||
Key vault modifications may be done by a system or network administrator. Verify whether the username, hostname, | ||
and/or resource name should be making changes in your environment. Key vault modifications from unfamiliar users or | ||
hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule. | ||
""", | ||
] | ||
from = "now-9m" | ||
index = ["filebeat-*", "logs-azure.activitylogs-*"] | ||
language = "kuery" | ||
license = "Elastic License v2" | ||
name = "Azure Key Vault Modified" | ||
note = """## Triage and analysis | ||
|
||
### Investigating Azure Key Vault Modified | ||
|
||
Azure Key Vault is a cloud service that safeguards encryption keys and secrets like certificates, connection strings, and passwords. It is crucial for managing sensitive data in Azure environments. Unauthorized modifications to Key Vaults can lead to data breaches or service disruptions. This rule detects modifications to Key Vaults, which may indicate potential security incidents or misconfigurations. | ||
|
||
### Possible investigation steps | ||
- Review the `azure.activitylogs.operation_name` field to identify the specific operation performed on the Key Vault. Common operations include `Microsoft.KeyVault/vaults/write` for modifications and `Microsoft.KeyVault/vaults/delete` for deletions. | ||
- Check the `event.outcome` field to confirm the success of the operation. A successful outcome indicates that the modification or deletion was completed. | ||
- Investigate the `azure.activitylogs.identity.principal_id` or `azure.activitylogs.identity.principal_name` fields to determine the user or service principal that performed the operation. This can help identify whether the action was authorized or potentially malicious. | ||
- Analyze the `azure.activitylogs.resource_id` field to identify the specific Key Vault that was modified. This can help assess the impact of the change and whether it affects critical resources or applications. | ||
- Cross-reference the time of the modification with other security events or alerts in the environment to identify any patterns or related activities that may indicate a coordinated attack or misconfiguration. | ||
- Consult with relevant stakeholders or system owners to verify if the modification was planned or expected, and gather additional context if necessary. | ||
|
||
### False positive analysis | ||
- Routine maintenance activities by administrators can trigger alerts when they modify or delete Key Vaults. To manage this, create exceptions for known maintenance windows or specific administrator accounts. | ||
- Automated scripts or tools used for Key Vault management might perform frequent updates or deletions, leading to false positives. Identify these scripts and exclude their operations from triggering alerts by using specific identifiers or tags. | ||
- Changes made by authorized third-party services or integrations that manage Key Vault configurations can also result in false positives. Review and whitelist these services to prevent unnecessary alerts. | ||
- Regular updates or deployments in a development or testing environment may cause alerts. Consider excluding these environments from monitoring or adjusting the rule to focus on production environments only. | ||
- Temporary changes for troubleshooting or testing purposes might be flagged. Document these activities and use temporary exceptions to avoid false positives during these periods. | ||
|
||
### Response and remediation | ||
- Immediately isolate the affected Key Vault to prevent further unauthorized access or changes. | ||
- Review the Azure activity logs to identify the specific operations performed on the Key Vault and their outcomes. | ||
- Collaborate with security teams to assess the impact of the modifications and determine if any sensitive data was compromised. | ||
- If unauthorized changes are confirmed, initiate incident response procedures, including notifying affected parties and conducting a thorough investigation. | ||
- Implement additional monitoring and alerting for the affected Key Vault to detect any further suspicious activity. | ||
""" | ||
references = [ | ||
"https://docs.microsoft.com/en-us/azure/key-vault/general/basic-concepts", | ||
"https://docs.microsoft.com/en-us/azure/key-vault/general/secure-your-key-vault", | ||
"https://learn.microsoft.com/en-us/azure/key-vault/general/security-features" | ||
] | ||
risk_score = 21 | ||
rule_id = "792dd7a6-7e00-4a0a-8a9a-a7c24720b5ec" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Domain: Identity", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Tactic: Impact", | ||
"Use Case: Configuration Audit", | ||
"Resources: Investigation Guide" | ||
] | ||
timestamp_override = "event.ingested" | ||
type = "new_terms" | ||
|
||
query = ''' | ||
event.dataset: "azure.activitylogs" | ||
and azure.activitylogs.operation_name: MICROSOFT.KEYVAULT/VAULTS/* | ||
and event.outcome:(Success or success) | ||
''' | ||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
|
||
[rule.threat.tactic] | ||
id = "TA0040" | ||
name = "Impact" | ||
reference = "https://attack.mitre.org/tactics/TA0040/" | ||
|
||
[rule.new_terms] | ||
field = "new_terms_fields" | ||
value = ["azure.activitylogs.identity.claims_initiated_by_user.name"] | ||
|
||
[[rule.new_terms.history_window_start]] | ||
field = "history_window_start" | ||
value = "now-14d" |
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.
maybe add Credential Access tactic as well ?
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.
I removed credential access tactic because this is technically not accessing the vault, but making modifications to the settings and configurations. Whereas #4900 and #4898 cover the credential retrieval behavior specific through Key Vault diagnostic logs.