Algumas consultas KQL que usamos para o Log Analytics e Resource Graph são simples mas nos fornecem todos os dados que precisamos para uma decisão ou servir de base para hunting.
Alem de algumas consultas "curiosas" que já precisei montar, tambem tenho as que uso em treinamento do Microsoft Defender for Cloud como exemplo de diferentes tipos de consultas.
Decidi juntar todas elas em um repositório no GitHub para ficar fácil a consulta e deixar disponivel para a comunidade.
msincic/scripts-KQL: Public KQL Scripts (github.com)
Nome do Script |
Tipo |
Proposito |
Agents_Last_Comm |
Log Analytics |
List type of agent (MMA or AMA) and last communication of all computers monitored |
Array-Text-Extract |
Log Analytics |
Examples of extract data in arrays or text columns |
Attack-Examples |
Log Analytics |
Example of detect attacks in logs (SQL Injection) |
Emails-Threat-Intel |
Log Analytics |
Detect malicious IPs and domains in email, URL or sender |
Events_Chart_ByDay |
Log Analytics |
Example of chat to detect anomolous events registered |
Graph_examples |
Log Analytics |
Examples of graph (bar, time, pie) |
List_CWPP |
Resource Graph |
List workload protections in all subscriptions to map a coverage protection in your environment |
List-Deployments-and-Details |
Log Analytics |
List all deploymentos to audit object creations and details about dependant objects in the same deploy |
M365_Operations |
Log Analytics |
List operations in M365 and IP/DLP actions |
More-Changed-Computers |
Log Analytics |
List top 10 computers and users with changed configs |
PIM_Included |
Log Analytics |
List activities of include users in PIM |
PoliciesAssigned-State |
Resource Graph |
List policies applied and compliance states. You can filter for compliance or non-compliance to addresses actions |
Policies-List |
Resource Graph |
List policies and details to export and use for determine assigments in your enviromnent |
Purview-IP-Events |
Log Analytics |
List all activities in Purview (IP, DLP, IRM, etc) |
Tables-Ingest-Day-by-Day |
Log Analytics |
List ingest data in all tables by day with indicator of billied or non-billed |
ThreatIntel-Examples |
Log Analytics |
Samples to use Microsoft Defender Threat Intel table to detect malicious IP in sign-ins and consult tables |
Usage_Tables |
Log Analytics |
Graph to identify and understand tables growing |
VM_Process_Comm |
Log Analytics |
List of process communicated in all computers with IP and Port, source, destination, bytes send and received |
VMs+Scale Set User Identity |
Resource Graph |
List VMs and Scale Sets using User Identity to mapped permissions |