Forum Discussion

SergioT1228's avatar
SergioT1228
Brass Contributor
May 17, 2023

KQL that shows an Exemptions description and Created by within Exemption policy

We have several exemptions that were initiated by a former employee that we need to evaluate.  We have over 4K and some are implemented at the subscription level and others at the resource.  I have been able to create a query that shows all exemptions with a Cause "exempt" but I'm unable to find the "Description" and "Created by" columns.

 

securityresources
| where type == "microsoft.security/assessments"
| extend source = trim(' ', tolower(tostring(properties.resourceDetails.Source)))
| extend resourceId = trim(' ', tolower(tostring(case(source =~ "azure", properties.resourceDetails.Id,extract('^(.+)/providers/Microsoft.Security/assessments/.+$',1,id)))))
| extend status = trim(" ", tostring(properties.status.code))
| extend cause = trim(" ", tostring(properties.status.cause))
| extend assessmentKey = tostring(name)
| where cause == "Exempt"

 

This query is a work in progress, my hope is to create a similar query that looks like the "Download report" from the Regulatory compliance section.  But until I'm able to get the Description and created by, the report is not much of use.

 

Please advise on the location/table for these missing fields.

 

Cheers,

4 Replies