Community写作与编辑github.com

microsoft/azure-kusto-irql-graph

将IRQL图函数应用于KQL或IRQL查询结果,用于Kusto Explorer可视化。生成Lift_To_Graph映射,并组合Graph_Render_View、Graph_Fold_By_Property、Extract_Node_*、Enrich_Node_*和Enrich_Graph_*调用。接受提供的查询或有限的自然语言源请求;这不是通用的自然语言转KQL/IRQL技能。适用场景:Lift_To_Graph、Graph_Render_View、Graph_Fold_By_Property、IRQL图增强、现有查询结果的图映射、带图标装饰的图、折叠图节点。对于原生的make-graph分析、graph-match、最短路径、连通分量或持久化图,请使用azure-kusto-graph。

azure-kusto-irql-graph 是什么?

这是一个AI智能体的专业技能,专为Kusto Explorer可视化设计,用于将Kusto查询语言(KQL)或IRQL查询的表格结果转换为交互式图形。它不是一个通用的自然语言转KQL/IRQL工具,而是专注于将现有查询结果通过IRQL图函数家族(如Lift_To_Graph和Graph_Render_View)转换为图可视化。该技能支持多种Kusto和IRQL环境,但建议先使用专门的查询生成技能创建复杂查询,然后再应用此技能进行图映射、折叠、节点提取和丰富的图增强。它也支持通过函数预检检查部署的图函数,并在必要时帮助用户部署缺失的函数,但会优先征求确认。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/microsoft/agent-skills/tree/main/.github/plugins/azure-kusto-graph-skills/skills/azure-kusto-irql-graph

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

IRQL 图函数 -- 查询结果到可视化

将IRQL图函数家族应用于表格结果。给定一个KQL或IRQL查询以及用户的图描述,生成一个Lift_To_Graph映射,并仅组合所需的存储图函数,以在Kusto Explorer中可视化、折叠、提取或增强图。源查询不需要使用IRQL。

范围与路由

请求使用场景
将提供的KQL/IRQL行转换为带图标装饰的可视化图此技能:Lift_To_Graph + Graph_Render_View
折叠节点或应用Extract_Node_*、Enrich_Node_*或Enrich_Graph_*此技能
使用make-graph、graph-match、最短路径、连通分量、图模型或快照azure-kusto-graph
从自然语言编写复杂的KQL/IRQL调查先使用Kusto或IRQL查询生成技能,再使用此技能

如果请求混合了可视化和原生图分析,请将此技能用于提升/渲染部分,将azure-kusto-graph用于运算符语义。除非用户明确要求使用原生图运算符,否则不要用自建的边优先图替换图提升函数。

输入契约

  • 首选输入:一个能生成表格结果的可工作KQL/IRQL查询,加上关于所需节点、边、标签、图标、提取、增强或折叠的自然语言描述。
  • 此技能不是自然语言转KQL或NL转IRQL转换器。它将现有查询结果转换为图可视化。对于一般的自然语言转KQL或NL转IRQL转换,请使用专用的查询生成技能(单独提供)。
  • 保留所提供查询的检索、连接、过滤和聚合。仅添加图映射所需的投影或合成ID。
  • 仅当源请求直接映射到一个已知表或IRQL Get_*选择器,且具有明确的列和简单过滤条件时,才支持基本的自然语言源请求。需说明假定的源,且不得发明连接、模式或调查逻辑。
  • 对于非平凡的查询构建,请先使用单独的Kusto/IRQL查询生成技能,然后将其输出应用于此技能。
  • 如果没有可用的查询或输出模式,且源不是简单的,请在生成映射前请求KQL查询或其结果列。

激活触发器

当用户执行以下操作时使用此技能:

  • 提供KQL/IRQL结果并请求IRQL图可视化或映射
  • 提及Lift_To_Graph、Graph_Render_View或Graph_Fold_By_Property
  • 请求在Kusto Explorer中为节点/边映射添加图标装饰
  • 希望按共享属性折叠/折叠节点
  • 通过Extract_Node_*、Enrich_Node_*或Enrich_Graph_*请求图提取或增强

不要仅为graph-match、图路径/组件、持久化图或通用的make-graph构建而激活此技能;这些属于azure-kusto-graph。

不是自然语言转KQL/IRQL转换器。 输入通常是一个需要图可视化的可工作KQL或IRQL查询。基本的自然语言源请求仅适用于简单的单表/选择器情况。对于一般的自然语言转KQL或NL转IRQL,请使用专用的查询生成技能(单独提供)。

环境

  • 集群:https://kc7001.eastus.kusto.windows.net
  • 数据库:ValdyTimes、JoJosHospital(图函数已预部署)
  • 渲染:Kusto Explorer桌面应用(make-graph可视化窗口)
  • 工具:kusto_query(通过Azure MCP服务器)

函数预检

Lift_To_Graph和Graph_Render_View是存储函数,不是Kusto内置运算符。在对目标数据库生成或运行提升管道之前,请检查已部署的内容:

.show functions
| where Name in~ ("Lift_To_Graph", "Graph_Render_View", "Graph_Fold_By_Property")
| project Name
  • Lift_To_Graph和Graph_Render_View是必需的。
  • 仅当请求折叠时才需要Graph_Fold_By_Property。
  • 在使用任何Extract_Node_*、Enrich_Node_*或Enrich_Graph_*函数之前先进行检查;如果用户未要求部署且函数不可用,则省略可选增强。
  • 如果缺少必需的函数并且您拥有更改数据库的权限,请在部署前征求用户确认。然后使用references/DEPLOY_IRQL_FUNCTIONS.md中的.create-or-alter function定义。运行相关的.create-or-alter块,然后重新运行预检以确认。
  • 如果您没有更改权限,请告知用户哪些函数缺失,并引导他们查看references/DEPLOY_IRQL_FUNCTIONS.md以手动部署。

IRQL 图函数家族

Lift_To_Graph(T, mappingJson)

将任何表格化的KQL结果转换为统一的节点+边表。

输入:任何表T + 一个JSON映射字符串。 输出:具有EntityType = "node"或"edge"的行,可用于make-graph。

Graph_Render_View(T)

接收Lift_To_Graph输出,拆分节点/边,并调用make-graph以打开Kusto Explorer的图窗口。

Graph_Fold_By_Property(T, NodeType, PropertyName)

将共享某个属性值的给定类型节点折叠为单个节点。自动重新连接边。

图提取和增强函数

这些是额外的存储函数,必须已部署在目标数据库上。它们未包含在references/DEPLOY_IRQL_FUNCTIONS.md中。在将其包含到管道之前,请使用.show functions验证可用性。

函数操作关键属性
Extract_Node_Email_Sender_Domain(T, displayName)向节点属性添加DomainEmailSender
Extract_Node_Employee_Firstname(T, displayName)向节点属性添加FirstnameName
Extract_Node_Event_Network_Domain(T, displayName)向节点属性添加DomainNameUrl
Enrich_Node_Ip_Employee(T, displayName)向IP节点添加员工信息ClientIp
Enrich_Node_Username_Employee(T, displayName)向用户节点添加员工信息Username
Enrich_Node_Event_Authentication_Username(T, displayName)添加认证上下文Username
Enrich_Node_Ip_Domain(T, displayName)添加DNS域ClientIp
Enrich_Node_Ip_Event_NetworkOutbound(T, displayName)添加出站事件ClientIp
Enrich_Graph_Ip_Employee(T, mappingJson)使用员工节点扩展图ClientIp
Enrich_Graph_Username_Employee(T, mappingJson)使用员工节点扩展图Username
Enrich_Graph_Event_Authentication_Username(T, mappingJson)使用认证节点扩展Username

映射JSON模式

JSON映射包含两个数组:node_types和edges。

node_types[]

字段必需描述
type是节点类型标签(例如"User"、"Host"、"IP")
id是节点ID的前缀;通常与类型相同
key是列名,其值成为节点的身份
props是要作为节点属性携带的列数组
defaults否空/空属性回退值的对象
defIcon否此节点类型的默认图标URL
displayName否用于显示标签的列(默认为id)
color否用于颜色的列
size否用于大小的列

edges[]

字段必需描述
type是边类型标签(例如"AuthenticatesTo"、"SentEmail")
source是{"id": "<prefix>", "type": "<NodeType>"}
target是{"id": "<prefix>", "type": "<NodeType>"}
props否要作为边属性携带的列数组
displayName否边标签的列
color否边颜色的列

图标库

使用来自https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/的图标:

  • IP:Public-IP-Addresses-(Classic).svg
  • 主机/虚拟机:Virtual-Machine.svg
  • 用户:Users.svg
  • 电子邮件:Mailbox.svg(或azure-cds/command-1070-Mail.svg)
  • 进程:App-Services.svg
  • 文件:Storage-Accounts.svg
  • 警报:Activity-Log.svg
  • 域:DNS-Zones.svg

映射生成规则

根据提供的查询列和用户的图描述,按以下步骤生成映射JSON:

  1. 识别实体 -> 每个不同的名词成为一个node_type
  2. 识别关系 -> 每个动词/介词成为一条edge
  3. 映射到列 -> 使用所提供查询生成的实际列;切勿假设不可用的列
  4. 设置方向 -> 源是执行者,目标是承受者
  5. 添加属性 -> 包含与调查相关的列(时间戳、结果、哈希值)
  6. 分配图标 -> 根据实体类型从上述图标集中选择

列参考(IRQL统一模式)

实体关键列可用属性
用户UsernameUsername、Name、Role、Email
主机HostnameHostname
IPClientIpClientIp
电子邮件消息SubjectEnvTime、Subject、Verdict、Url
发件人EmailSenderEmailSender、Domain
收件人EmailRecipientEmailRecipient
进程ProcessNameEnvTime、ProcessName、ProcessCommandLine、ProcessHash
文件FilenameEnvTime、Filename、Path、Sha256
域DomainNameDomainName
认证事件(合成ID)EnvTime、UserAgent、Result、Description

函数选择

  1. 从提供的KQL/IRQL表格管道开始。
  2. 使用Lift_To_Graph(mapping)创建图实体。
  3. 仅当请求且与映射键兼容时,添加Extract_Node_*、Enrich_Node_*或Enrich_Graph_*。
  4. 仅当请求分组/折叠时添加Graph_Fold_By_Property()。
  5. 以Graph_Render_View()结束可视输出。
  6. 对所选管道选用的确切存储函数进行预检。

管道模式

// 1. 保留提供的KQL或IRQL查询
<input query>
// 2. 提升为图
| invoke Lift_To_Graph(<mapping_json>)
// 3. 可选:提取或增强图实体
| invoke <Extract_Node_* | Enrich_Node_* | Enrich_Graph_*>()
// 4. 可选:按请求折叠节点
| invoke Graph_Fold_By_Property("<NodeType>", "<PropertyName>")
// 5. 渲染
| invoke Graph_Render_View()

示例

更多提示和完整示例,请参见references/EXAMPLES.md。

认证图:IP -> AuthEvent -> User -> Host

输入查询:Get_Event_Authentication_All | where Result == "Failed Login" | take 200

图请求:“显示IP、认证事件、用户和主机;按结果折叠事件。”

let auth_mapping = '{"node_types":[{"type":"SrcIp","id":"SrcIp","key":"ClientIp","props":["ClientIp"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Public-IP-Addresses-(Classic).svg"},{"type":"Host","id":"Host","key":"Hostname","props":["Hostname"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Virtual-Machine.svg"},{"type":"User","id":"User","key":"Username","props":["Username"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Users.svg"},{"type":"AuthEvent","id":"AuthEvent","key":"AuthEventId","props":["AuthEventId","EnvTime","UserAgent","Result","Description"],"defaults":{"Result":"unknown"},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Activity-Log.svg"}],"edges":[{"type":"RequestsAuth","source":{"id":"SrcIp","type":"SrcIp"},"target":{"id":"AuthEvent","type":"AuthEvent"},"props":["EnvTime"]},{"type":"TargetsUser","source":{"id":"AuthEvent","type":"AuthEvent"},"target":{"id":"User","type":"User"},"props":["EnvTime"]},{"type":"AgainstHost","source":{"id":"AuthEvent","type":"AuthEvent"},"target":{"id":"Host","type":"Host"},"props":["EnvTime"]}]}';
Get_Event_Authentication_All
| extend AuthEventId = strcat(Username, "_", Hostname, "_", EnvTime)
| where Result == "Failed Login"
| take 200
| invoke Lift_To_Graph(auth_mapping)
| invoke Graph_Fold_By_Property("AuthEvent", "Result")
| invoke Graph_Render_View()

电子邮件图:发件人 -> 消息 -> 收件人

输入查询:Get_Email_All | take 400

图请求:“可视化发件人到消息到收件人的流程,并按判定折叠消息。”

let mail_mapping = '{"node_types":[{"type":"EmailMessage","id":"Message","key":"Subject","props":["EnvTime","Subject","Verdict"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Media-File.svg"},{"type":"Sender","id":"Email","key":"EmailSender","props":["EmailSender"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-cds/command-1070-Mail.svg"},{"type":"Recipient","id":"Email","key":"EmailRecipient","props":["EmailRecipient"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-cds/command-1070-Mail.svg"}],"edges":[{"type":"SentBy","source":{"id":"Message","type":"EmailMessage"},"target":{"id":"Email","type":"Sender"},"props":["EnvTime","Verdict"]},{"type":"DeliveredTo","source":{"id":"Message","type":"EmailMessage"},"target":{"id":"Email","type":"Recipient"},"props":["EnvTime","Verdict"]}]}';
Get_Email_All
| take 400
| invoke Lift_To_Graph(mail_mapping)
| invoke Graph_Fold_By_Property("EmailMessage", "Verdict")
| invoke Graph_Render_View()

可疑域调查(端到端)

基本源请求:“使用这些可疑域的出站网络事件,并以员工姓名增强的IP到域连接图。”

这是有限的回退:一个已知的选择器、一个提取器和一个直接过滤器。

let suspicious_domain_mapping = '{"node_types":[{"type":"IP","id":"IP","key":"ClientIp","props":["ClientIp"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/Public-IP-Addresses-(Classic).svg"},{"type":"Domain","id":"Domain","key":"DomainName","props":["DomainName"],"defaults":{},"defIcon":"https://raw.githubusercontent.com/benc-uk/icon-collection/master/azure-icons/DNS-Zones.svg"}],"edges":[{"type":"RequestsDomain","source":{"id":"IP","type":"IP"},"target":{"id":"Domain","type":"Domain"},"props":["EnvTime"]}]}';
Get_Event_Network_Outbound_All
| where DomainName in ("suspicious.xyz", "malware.example.com")
| take 100
| invoke Lift_To_Graph(suspicious_domain_mapping)
| invoke Enrich_Graph_Ip_Employee('{"ip_to_label":"ClientIp","employee_to_label":"Name"}')
| invoke Graph_Render_View()

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

microsoft/azure-ai-agents-persistent-dotnet

Azure AI Agents Persistent SDK for .NET. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Use for agent CRUD, conversation threads, streaming responses, function calling, file search, and code interpreter. Triggers: "PersistentAgentsClient", "persistent agents", "agent threads", "agent runs", "streaming agents", "function calling agents .NET".

microsoft/azure-ai-document-intelligence-dotnet

Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: "Document Intelligence", "DocumentIntelligenceClient", "form recognizer", "invoice extraction", "receipt OCR", "document analysis .NET".

microsoft/azure-ai-openai-dotnet

Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: "Azure OpenAI", "AzureOpenAIClient", "ChatClient", "chat completions .NET", "GPT-4", "embeddings", "DALL-E", "Whisper", "OpenAI .NET".

microsoft/azure-ai-projects-dotnet

Azure AI Projects SDK for .NET. High-level client for Azure AI Foundry projects including agents, connections, datasets, deployments, evaluations, and indexes. Use for AI Foundry project management, versioned agents, and orchestration. Triggers: "AI Projects", "AIProjectClient", "Foundry project", "versioned agents", "evaluations", "datasets", "connections", "deployments .NET".

microsoft/azure-ai-voicelive-dotnet

Azure AI Voice Live SDK for .NET. Build real-time voice AI applications with bidirectional WebSocket communication. Use for voice assistants, conversational AI, real-time speech-to-speech, and voice-enabled chatbots. Triggers: "voice live", "real-time voice", "VoiceLiveClient", "VoiceLiveSession", "voice assistant .NET", "bidirectional audio", "speech-to-speech".

microsoft/azure-eventgrid-dotnet

Azure Event Grid SDK for .NET. Client library for publishing and consuming events with Azure Event Grid. Use for event-driven architectures, pub/sub messaging, CloudEvents, and EventGridEvents. Triggers: "Event Grid", "EventGridPublisherClient", "CloudEvent", "EventGridEvent", "publish events .NET", "event-driven", "pub/sub".

microsoft/azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming", "EventHubProducerClient", "EventProcessorClient", "send events", "receive events", "checkpointing", "partition".

microsoft/azure-identity-dotnet

Azure Identity library for .NET. Authentication library for Azure SDK clients using Microsoft Entra ID. Use for DefaultAzureCredential, managed identity, service principals, and developer credentials. Triggers: "Azure Identity", "DefaultAzureCredential", "ManagedIdentityCredential", "ClientSecretCredential", "authentication .NET", "Azure auth", "credential chain".

microsoft/azure-kusto-graph

Build and query Kusto graphs from natural language. Covers transient graphs (make-graph), persistent graph models/snapshots, pattern matching (graph-match), shortest paths, connected components, and graph-to-table export. Generates the edges-first thinking: define edges, define node lookups, union, make-graph. WHEN: make-graph, graph-match, graph-shortest-paths, graph-to-table, graph-mark-components, persistent graph, graph model, graph snapshot, build a graph from data, find paths between nodes, pattern matching in graph, connected components, transient graph, Kusto graph, KQL graph.

microsoft/azure-kusto-irql

Compose IRQL (Incident Response Query Language) queries for Kusto cybersecurity investigations. Translates natural language hunting questions into composable IRQL pipelines using Get_*, Extract_*, and Enrich_* functions. WHEN: IRQL query, security hunt, threat hunting KQL, incident response query, compose hunting pipeline, failed logins, phishing investigation, lateral movement, process execution, file creation events.

microsoft/azure-local

Plan, deploy, operate, and troubleshoot Azure Local (formerly Azure Stack HCI): sizing and prerequisites, Arc registration, lifecycle updates, workloads (Azure Local VMs, AKS on Azure Local, images, disks, logical networks), SDN and network security, and failure triage — starting read-only and confirming before risky changes. WHEN: Azure Local, Azure Stack HCI, Arc resource bridge, custom location, Azure Local VM, Arc VM, AKS on Azure Local, AKS hybrid, SDN, Lifecycle Manager, Azure Local update, disconnected site.

microsoft/azure-local-multi-rack

Plan, deploy, operate, and troubleshoot multi-rack (rack scale) deployments of Azure Local — preintegrated racks scaling to hundreds of machines, built on Network Fabric Controller, Cluster Manager, SAN storage, and managed network fabric. Use for the Microsoft.NetworkCloud and Microsoft.ManagedNetworkFabric control plane. NOT for standard 1-16 node Azure Local, and NOT for rack-aware clusters (two racks as availability zones, up to 8 nodes, synchronous replication) — those are standard scale. WHEN: multi-rack, rack scale Azure Local, aggregation rack, compute rack, Network Fabric Controller, NFC, Cluster Manager, network fabric, isolation domain, az networkcloud, az networkfabric, multi-rack logical network, multi-rack Arc VM.

相关技能