Running audits on a file share within file server is a challenging task, especially when you do not have a budget for sophisticated file auditing tools from a third-party vendor. These tools can not only be costly but can lead to tool sprawl.
Auditing challenges that IT managers face:
Any organization who has their workloads in Azure should leverage the Microsoft SIEM tool, Azure Sentinel. Azure Sentinel is an easy and cost-effective way to collect, analyze, and act on security events that occur in your IT environment.
In this article, we will walk through creating a simple but effective way to use the audit file server features and stream the audit log to Azure Sentinel.
Prerequisites:
On Windows Server, auditing file and folder access consist of two parts:
To enable auditing through GPO, follow these steps:
Figure 3&4: GPO management editor
Figure 5: Audit policies
Figure 6: Configure Audit object access.
gpupdate /force
After the policy has been applied, you can configure audit settings for files and folders.
To select specific folders and define users, follow these steps.
Figure 7: Properties of a folder
Stream windows server security log to Azure Sentinel.
Figure 8: Click the Auditing tab
Figure 9: Auditing Entry for Documents dialog box
Figure 10: Select User for auditing
Figure 11: Auditing Entry for Documents settings
There are 2 main parts for this setup:
Open Azure Sentinel and go to the “Data connectors” blade under “Configuration.” Type “Security Events” in the search box and select “Security Events,” then click the “Open connector page”.
Follow steps 1 and 2 in the “Configuration” steps for setup of the security event connector.
Under the Azure Sentinel blade, choose “Workbooks” then click on “Add workbook.”
In the New workbook, click “Edit.” Remove the sample analytics query by clicking on the “…” and choosing “Remove”. Click “Yes” to confirm the removal.
Once all sample analytic queries are removed, click “+ Add,” then “Add query” to add a Log Analytics query.
Copy and paste this query below to query the necessary info for your file audit. Replace “File Server Name” with the name of your file server.
SecurityEvent
| where Computer contains <"File Server Name"> and EventID == 4663
| where AccountType =~ "user"
| extend eventData = tostring(parse_xml(EventData))
| extend FileName = extractjson("$['EventData']['Data'][6]['#text']", eventData )
| extend UserName = extractjson("$['EventData']['Data'][1]['#text']", eventData )
| extend ProcessName = extractjson("$['EventData']['Data'][11]['#text']", eventData )
| project TimeGenerated, UserName, Computer, FileName, ProcessName, EventID, Activity,TenantId, eventData
Click “Run Query” and confirm that you received all the information needed.
Click “Done Editing” when done and Click “Save” or “Save as” and give it a new name.
Note: Private workbooks are deprecated by June 30, 2021. You can follow this KB to convert them to a shared workbook to continue using them.
We are done.
Now you can go to your “File Share Audit” workbook under My workbooks and look for the file audit there.
Happy Auditing!