Condividi tramite


Plug-in KQL in Microsoft Copilot per la sicurezza

Creare plug-in potenti usando query Linguaggio di query Kusto (KQL) per esplorare i dati e individuare i modelli.

Impostazioni delle competenze di KQL

Impostazioni comuni

Queste impostazioni sono comuni a tutte le competenze KQL.

Settings:
  # What type of KQL endpoint to connect to.
  # One of { Defender, Sentinel, LogAnalytics, Kusto }
  Target: Sentinel
  # A URL to download the KQL query template from.
  # Specify either TemplatUrl or Template but not both.
  TemplateUrl: https://gist.githubusercontent.com/NitinKumarGoel/c862ba63878dd2624acb1b0e260f409a/raw/3a527014757b4ee1f00302a1b34a13e7b83ff77a/gistfile1.txt
  # An inline KQL query template.
  # Specify either TemplatUrl or Template but not both.
  Template: |-
    SigninLogs
    | where UserDisplayName == '{{user}}' or UserPrincipalName == '{{user}}'
    | project TimeGenerated, OperationName, UserDisplayName, UserPrincipalName, Location, ResourceDisplayName, ConditionalAccessStatus, IsInteractive
    | top 100 by TimeGenerated desc

La tabella seguente illustra che settings può essere configurato per qualsiasi destinazione di competenza KQL:

Nome impostazione Tipo Descrizione Obbligatorio
Template stringa Modello di richiesta di KQL. Supporta fino a 80.000 caratteri. Sì, se TemplateUrl non è specificato.
TemplateUrl stringa URL pubblico da cui scaricare il modello di richiesta KQL (fino a 80.000 caratteri). Sì. Specificare TemplateUrl o Template, ma non entrambi.
PackageUrl stringa URL pubblico per il file ZIP con il modello di richiesta di KQL. Nota: questo viene specificato nell'esempio a livello di SkillGroup. Simile a GPT skill packageurl, ad esempio. Sì, se Template o TemplateUrl non sono specificati.
TemplateFile stringa Percorso relativo del modello di richiesta di KQL (fino a 80.000 caratteri) all'interno del file ZIP PackageUrl. Sì, se viene specificato PackageUrl.

Impostazioni specifiche della destinazione

Destinazione: Sentinel

Queste impostazioni sono valide per le competenze KQL in cui Target è Sentinel.

Descrittore: Name: DisplayName: Description: Settings: - Name: TenantId Required: true - Name: WorkspaceName Required: true - Name: SubscriptionId Required: true - Name: ResourceGroupName Required: true SupportedAuthTypes: - None

SkillGroups:

  - Format: KQL
    Skills:
      - Name: 
        DisplayName: 
        Description: 
        Settings:
          Target: Sentinel
          # The ID of the AAD Organization that the Sentinel workspace is in.
          TenantId: '{{TenantId}}'
          # The id of the Azure Subscription that the Sentinel workspace is in.
          SubscriptionId: '{{SubscriptionId}}'
          # The name of the Resource Group that the Sentinel workspace is in.
          ResourceGroupName: '{{ResourceGroupName}}'
          # The name of the Sentinel workspace.
          WorkspaceName: '{{WorkspaceName}}'

Destinazione: Kusto

Queste impostazioni sono valide per le competenze KQL in cui Target è Kusto.

Settings:
  # The Kusto cluster URL.
  Cluster: 
  # The Kusto database name.
  Database: 

Esempio

Descriptor:
  Name: SampleDefenderKQL
  DisplayName: My Sample Defender KQL Plugin
  Description: Skills to query email logs in M365 Advanced Hunting

SkillGroups:
  - Format: KQL
    Skills:
      - Name: GetLatestEmailsByRecipient
        DisplayName: Get Latest Emails By Recipient
        Description: Fetches the latest emails received by the user with the specified email address
        Inputs:
          - Name: email
            Description: The email address of the recipient
            Required: true
        Settings:
          Target: Defender
          Template: |-
            EmailEvents
            | where RecipientEmailAddress =~ '{{email}}'
            | project Timestamp, NetworkMessageId, SenderFromAddress, SenderDisplayName, Subject, DeliveryLocation
            | top 100 by Timestamp desc