Skip to content

Commit 0bfc30d

Browse files
authored
Merge pull request #203685 from ElazarK/simulate-alerts
simulate alerts
2 parents f9c8808 + bc1cd0b commit 0bfc30d

File tree

1 file changed

+65
-10
lines changed

1 file changed

+65
-10
lines changed

articles/defender-for-cloud/alert-validation.md

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
title: Alert validation in Microsoft Defender for Cloud | Microsoft Docs
33
description: Learn how to validate that your security alerts are correctly configured in Microsoft Defender for Cloud
44
ms.topic: how-to
5-
ms.author: benmansheim
6-
author: bmansheim
7-
ms.date: 12/12/2021
5+
ms.date: 07/04/2022
86

97
---
108
# Alert validation in Microsoft Defender for Cloud
@@ -18,7 +16,7 @@ For more information, see [Security alerts in Defender for Cloud](alerts-overvie
1816

1917
## Generate sample security alerts
2018

21-
If you're using the new, preview alerts experience as described in [Manage and respond to security alerts in Microsoft Defender for Cloud](managing-and-responding-alerts.md), you can create sample alerts in a few clicks from the security alerts page in the Azure portal.
19+
If you're using the new, preview alerts experience as described in [Manage and respond to security alerts in Microsoft Defender for Cloud](managing-and-responding-alerts.md), you can create sample alerts from the security alerts page in the Azure portal.
2220

2321
Use sample alerts to:
2422

@@ -74,15 +72,72 @@ After the Log Analytics agent is installed on your machine, follow these steps f
7472

7573
## Simulate alerts on Kubernetes <a name="validate-kubernetes"></a>
7674

77-
If you've integrated Azure Kubernetes Service with Defender for Cloud, you can test that your alerts are working with the following kubectl command:
75+
Defender for Containers provides security alerts for both your clusters and underlying cluster nodes. Defender for Containers accomplishes this by monitoring both the control plane (API server) and the containerized workload.
7876

79-
`kubectl get pods --namespace=asc-alerttest-662jfi039n`
77+
You can tell if your alert is related to the control plan or the containerized workload based on its prefix. Control plane security alerts have a prefix of `K8S_`, while security alerts for runtime workload in the clusters have a prefix of `K8S.NODE_`.
8078

81-
For more information about defending your Kubernetes nodes and clusters, see [Overview of Microsoft Defender for Containers](defender-for-containers-introduction.md)
79+
You can simulate alerts for both of the control plane, and workload alerts with the following steps.
80+
81+
### Simulate control plane alerts (K8S_ prefix)
82+
83+
**Prerequisites**
84+
85+
- Ensure the Defender for Containers plan is enabled.
86+
- **ARC only** - Ensure the defender extension is installed.
87+
- **EKS or GKE only** - Ensure the default audit log collection auto-provisioning options are enabled.
88+
89+
**To simulate a Kubernetes control plane security alert**:
90+
91+
1. Run the following command from the cluster:
92+
93+
```bash
94+
kubectl get pods --namespace=asc-alerttest-662jfi039n
95+
```
96+
97+
You'll get the following response: `No resource found`.
98+
99+
1. Wait 30 minutes.
100+
101+
1. In the Azure portal, navigate to the Defender for Cloud's alerts page.
102+
103+
1. On the relevant Kubernetes cluster, locate the following alert `Microsoft Defender for Cloud test alert for K8S (not a threat)`
104+
105+
### Simulate workload alerts (K8S.NODE_ prefix)
106+
107+
**Prerequisites**
108+
109+
- Ensure the Defender for Containers plan is enabled.
110+
- Ensure the Defender profile\extension is installed
111+
112+
**To simulate a a Kubernetes workload security alert**:
113+
114+
1. Access one of the `azuredefender-publisher-<XXX>` pods deployed in your Kubernetes cluster.
115+
116+
1. Run the following command from the cluster:
117+
118+
```bash
119+
kubectl exec -it azuredefender-publisher-xx-xxxxx -n <namespace> -- bash
120+
```
121+
122+
For AKS - `<namespace>` = `kube-system`<br>
123+
For ARC - `<namespace>` = `mdc`
124+
125+
1. Select an executable, copy it to a convenient location and rename it to `./asc_alerttest_662jfi039n`. For example:
126+
`cp /bin/echo ./asc_alerttest_662jfi039n`.
127+
128+
1. Execute the file `./asc_alerttest_662jfi039n testing eicar pipe`.
129+
130+
1. Wait 10 minutes.
131+
132+
1. In the Azure portal, navigate to the Defender for Cloud's alerts page.
133+
134+
1. On the relevant AKS cluster, locate the following alert `Microsoft Defender for Cloud test alert (not a threat)`.
135+
136+
You can also learn more about defending your Kubernetes nodes and clusters with [Microsoft Defender for Containers](defender-for-containers-introduction.md).
82137
83138
## Next steps
84139
This article introduced you to the alerts validation process. Now that you're familiar with this validation, try the following articles:
85140

86-
* [Validating Azure Key Vault threat detection in Microsoft Defender for Cloud](https://techcommunity.microsoft.com/t5/azure-security-center/validating-azure-key-vault-threat-detection-in-azure-security/ba-p/1220336)
87-
* [Managing and responding to security alerts in Microsoft Defender for Cloud](managing-and-responding-alerts.md) - Learn how to manage alerts, and respond to security incidents in Defender for Cloud.
88-
* [Understanding security alerts in Microsoft Defender for Cloud](./alerts-overview.md) - Learn about the different types of security alerts.
141+
- [Validating Azure Key Vault threat detection in Microsoft Defender for Cloud](https://techcommunity.microsoft.com/t5/azure-security-center/validating-azure-key-vault-threat-detection-in-azure-security/ba-p/1220336)
142+
- [Managing and responding to security alerts in Microsoft Defender for Cloud](managing-and-responding-alerts.md) - Learn how to manage alerts, and respond to security incidents in Defender for Cloud.
143+
- [Understanding security alerts in Microsoft Defender for Cloud](./alerts-overview.md)

0 commit comments

Comments
 (0)