-
Notifications
You must be signed in to change notification settings - Fork 603
Add rules for Azure Activity Logs/GCP Audit ML jobs #5191
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
Open
jmcarlock
wants to merge
5
commits into
main
Choose a base branch
from
adding_azure_and_gcp_ml_job_rules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+603
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0f83534
rules for Azure/GCP jobs
jmcarlock bfe9393
Add GCP Audit Logs tag
jmcarlock 9cab720
add `min_stack_version`
jmcarlock dd4491d
add `min_stack_comments`
jmcarlock b4c9b0c
Merge branch 'main' into adding_azure_and_gcp_ml_job_rules
shashank-elastic 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
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,59 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["azure"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 50 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected a significant spike in the rate of a particular failure in the Azure Activity Logs messages. Spikes | ||
in failed messages may accompany attempts at privilege escalation, lateral movement, or discovery. | ||
""" | ||
false_positives = [ | ||
""" | ||
Spikes in failures can also be due to bugs in cloud automation scripts or workflows; changes to cloud | ||
automation scripts or workflows; adoption of new services; changes in the way services are used; or changes to IAM | ||
privileges. | ||
""", | ||
] | ||
from = "now-60m" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "azure_activitylogs_high_distinct_count_event_action_on_failure" | ||
name = "Spike in Azure Activity Logs Failed Messages" | ||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### Azure Activity Logs Integration Setup | ||
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it. | ||
- Click “Add Azure Activity Logs”. | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "1eb74889-18c5-4f78-8010-d8aceb7a9ef4" | ||
severity = "low" | ||
tags = [ | ||
jmcarlock marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
] | ||
type = "machine_learning" | ||
|
59 changes: 59 additions & 0 deletions
59
rules/integrations/azure/ml_azure_rare_event_failures.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,59 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["azure"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 50 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected an unusual failure in an Azure Activity Logs message. These can be byproducts of attempted or | ||
successful persistence, privilege escalation, defense evasion, discovery, lateral movement, or collection. | ||
""" | ||
false_positives = [ | ||
""" | ||
Rare and unusual failures may indicate an impending service failure state. Rare and unusual user failure activity can | ||
also be due to manual troubleshooting or reconfiguration attempts by insufficiently privileged users, bugs in cloud | ||
automation scripts or workflows, or changes to IAM privileges. | ||
""", | ||
] | ||
from = "now-2h" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "azure_activitylogs_rare_event_action_on_failure" | ||
name = "Rare Azure Activity Logs Event Failures" | ||
jmcarlock marked this conversation as resolved.
Show resolved
Hide resolved
|
||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### Azure Activity Logs Integration Setup | ||
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it. | ||
- Click “Add Azure Activity Logs”. | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "c17ffbf9-595a-4c0b-a126-aacedb6dd179" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
] | ||
type = "machine_learning" | ||
|
60 changes: 60 additions & 0 deletions
60
rules/integrations/azure/ml_azure_rare_method_by_city.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,60 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["azure"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 50 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from | ||
a geolocation (city) that is unusual for the event action. This can be the result of compromised credentials or keys being | ||
used by a threat actor in a different geography than the authorized user(s). | ||
""" | ||
false_positives = [ | ||
""" | ||
New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration; | ||
changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased | ||
adoption of work from home policies; or users who travel frequently. | ||
""", | ||
] | ||
from = "now-2h" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "azure_activitylogs_rare_event_action_for_a_city" | ||
name = "Unusual City for an Azure Activity Logs Event" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should definitely have these for Entra ID Sign-In Logs. Happy to talk and discuss more! |
||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### Azure Activity Logs Integration Setup | ||
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it. | ||
- Click “Add Azure Activity Logs”. | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "ce08cdb8-e6cb-46bb-a7cc-16d17547323f" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
] | ||
type = "machine_learning" | ||
|
59 changes: 59 additions & 0 deletions
59
rules/integrations/azure/ml_azure_rare_method_by_country.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,59 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["azure"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 50 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from | ||
a geolocation (country) that is unusual for the event action. This can be the result of compromised credentials or keys being | ||
used by a threat actor in a different geography than the authorized user(s). | ||
""" | ||
false_positives = [ | ||
""" | ||
New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration; | ||
changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased | ||
adoption of work from home policies; or users who travel frequently. | ||
""", | ||
] | ||
from = "now-2h" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "azure_activitylogs_rare_event_action_for_a_country" | ||
name = "Unusual Country for an Azure Activity Logs Event" | ||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### Azure Activity Logs Integration Setup | ||
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it. | ||
- Click “Add Azure Activity Logs”. | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "76de17b9-af25-49a0-9378-02888b6bb3a2" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
] | ||
type = "machine_learning" |
59 changes: 59 additions & 0 deletions
59
rules/integrations/azure/ml_azure_rare_method_by_user.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,59 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["azure"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 75 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from | ||
user context that does not normally use the event action. This can be the result of compromised credentials or keys as | ||
someone uses a valid account to persist, move laterally, or exfiltrate data. | ||
""" | ||
false_positives = [ | ||
""" | ||
New or unusual user event activity can be due to manual troubleshooting or reconfiguration; changes in cloud | ||
automation scripts or workflows; adoption of new services; or changes in the way services are used. | ||
""", | ||
] | ||
from = "now-2h" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "azure_activitylogs_rare_event_action_for_a_username" | ||
name = "Unusual Azure Activity Logs Event for a User" | ||
jmcarlock marked this conversation as resolved.
Show resolved
Hide resolved
|
||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### Azure Activity Logs Integration Setup | ||
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it. | ||
- Click “Add Azure Activity Logs”. | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "81892f44-4946-4b27-95d3-1d8929b114a7" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: Azure", | ||
"Data Source: Azure Activity Logs", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
] | ||
type = "machine_learning" | ||
|
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,61 @@ | ||
[metadata] | ||
creation_date = "2025/10/06" | ||
integration = ["gcp"] | ||
maturity = "production" | ||
min_stack_comments = "New job added" | ||
min_stack_version = "9.3.0" | ||
updated_date = "2025/10/06" | ||
|
||
[rule] | ||
anomaly_threshold = 50 | ||
author = ["Elastic"] | ||
description = """ | ||
A machine learning job detected a significant spike in the rate of a particular failure in the GCP Audit messages. Spikes | ||
in failed messages may accompany attempts at privilege escalation, lateral movement, or discovery. | ||
""" | ||
false_positives = [ | ||
""" | ||
Spikes in failures can also be due to bugs in cloud automation scripts or workflows; changes to cloud | ||
automation scripts or workflows; adoption of new services; changes in the way services are used; or changes to IAM | ||
privileges. | ||
""", | ||
] | ||
from = "now-60m" | ||
interval = "15m" | ||
license = "Elastic License v2" | ||
machine_learning_job_id = "gcp_audit_high_distinct_count_error_message" | ||
name = "Spike in GCP Audit Failed Messages" | ||
setup = """## Setup | ||
|
||
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from GCP Audit. | ||
|
||
### Anomaly Detection Setup | ||
|
||
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html). | ||
|
||
### GCP Audit logs Integration Setup | ||
The Google Cloud Platform (GCP) Audit logs integration allows you to collect logs and metrics from Google Cloud Platform (GCP) with Elastic Agent. | ||
|
||
#### The following steps should be executed in order to add the Elastic Agent System "Google Cloud Platform (GCP) Audit logs" integration to your system: | ||
- Go to the Kibana home page and click “Add integrations”. | ||
- In the query bar, search for “Google Cloud Platform (GCP) Audit logs” and select the integration to see more details about it. | ||
- Click “Add Google Cloud Platform (GCP) Audit logs". | ||
- Configure the integration. | ||
- Click “Save and Continue”. | ||
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/current/integrations/gcp). | ||
""" | ||
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"] | ||
risk_score = 21 | ||
rule_id = "a4b740e4-be17-4048-9aa4-1e6f42b455b1" | ||
severity = "low" | ||
tags = [ | ||
"Domain: Cloud", | ||
"Data Source: GCP", | ||
"Data Source: GCP Audit Logs", | ||
"Data Source: Google Cloud Platform", | ||
"Rule Type: ML", | ||
"Rule Type: Machine Learning", | ||
"Resources: Investigation Guide", | ||
] | ||
type = "machine_learning" | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.