I have the following recommendation from Microsoft Defender for Cloud
File integrity monitoring should be enabled on machines
I did go through the article - https://learn.microsoft.com/en-us/azure/defender-for-cloud/file-integrity-monitoring-enable-ama#enable-file-integrity-monitoring-with-ama and understood
I want to enable this through Terraform rather than manually. I'm not sure where to begin.
I tried to reproduce the scenario in my environment:
Code:
Some prerequisites to enable File Integrity management
code:
Log analytics workspace & Microsoft monitoring Agent connected to Log analytics workspace
code:
Add Updates workspace solution to log analytics if enable_change_tracking is set to true. # Adding this enables Change Tracking and Inventory.
For FIM enabled , Change Tracking resource of type Solution. If the Change Tracking resource is disabled , the File Integrity Monitoring feature in Defender for Cloud also is disabled.
For MMA:
Create Data collection rule that defines files and registries that should be monitored. The fix attaches the DCR to all machines in the subscription that have AMA installed and FIM enabled.
Upon terraform plan
terraform apply
Below resources are created:
Then I checked file integrity monitoring
File integrity monitoring is enabled for my windows defender
There is a disable option to disable when needed
References: