AGENT SKILL

IRQL网络安全调查查询

azure-kusto-irql

编写IRQL(Incident Response Query Language,事件响应查询语言)查询,用于Kusto网络安全调查。将自然语言狩猎问题转换为使用 Get_*、Extract_* 和 Enrich_* 函数的可组合IRQL管道。适用场景:IRQL查询、安全狩猎、威胁狩猎KQL、事件响应查询、编写狩猎管道、失败登录、钓鱼调查、横向移动、进程执行、文件创建事件。

License 许可
MIT
最近更新
2026-11-14
Stars
★ 264
Forks
225

01 前言 Front Matter

name
azure-kusto-irql
license
MIT
metadata
{ "author": "Microsoft", "version": "0.0.0-placeholder" }
description
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.

02 资源文件 3

03 SKILL.md 正文

IRQL -- Incident Response Query Language

Compose IRQL function pipelines from selector, extractor, and enricher building blocks. IRQL wraps raw KQL security tables behind intent-revealing, composable functions so analysts (and LLMs) can express hunts without memorizing schemas, cluster locations, or join keys.

Activation Triggers

Use this skill when the user:

  • Explicitly mentions IRQL, Get_*, Extract_*, or Enrich_* functions
  • Says "use IRQL" or "write an IRQL query"
  • Requests a composable hunting pipeline using known IRQL selectors

Do not activate for generic security queries (e.g. "find failed logins") unless the user explicitly asks for IRQL. Route those to azure-kusto instead.

Not a natural-language-to-IRQL converter. This skill composes IRQL function pipelines and may handle basic natural-language requests that map directly to known selectors and simple filters. For general NL-to-KQL or NL-to-IRQL conversion, use a dedicated query-generation skill (available separately).

IRQL Function Preflight

Before generating a pipeline, verify IRQL is available on the target database:

.show functions
| where Name startswith "Get_" or Name startswith "Extract_" or Name startswith "Enrich_"
| project Name

If no IRQL functions are found, inform the user that IRQL is not deployed on the target database and suggest using azure-kusto for raw KQL queries instead. IRQL functions are a prerequisite -- this skill does not deploy base IRQL selectors.

What IRQL Is

IRQL is a function-based dialect on top of KQL. It provides:

  1. Unified schema -- disparate security tables project into consistent column names regardless of the underlying data source
  2. Composability -- small functions chain via | invoke to build complex hunts from simple steps
  3. Portability -- the same IRQL pipeline works across different clusters/databases; only the Get_* primitives need re-pointing

IRQL is not a separate language. It's KQL functions you invoke. Any valid KQL works alongside IRQL functions.

Deploying IRQL

IRQL functions are stored KQL functions (.create-or-alter function). They must already be deployed to the target database before this skill can generate pipelines.

Public example cluster (functions pre-deployed):

  • Cluster: https://kc7001.eastus.kusto.windows.net
  • Databases: ValdyTimes, JoJosHospital

To port IRQL to a new cluster/database, create Get_* selectors that project your source tables into the unified schema (column names below), then deploy extractors and enrichers. The extractors and enrichers work unchanged as long as the input schema matches.

Function Catalog

1. Selectors -- Get_*

Return projected, schema-unified views of source tables. Use the minimal form by default; use _All when extra columns are needed.

Function Columns
Get_Event_Authentication EnvTime, Hostname, ClientIp, Username, Result
Get_Event_Authentication_All + Description, UserAgent, PasswordHash
Get_Email EnvTime, EmailSender, EmailRecipient, Subject, Url
Get_Email_All + ReplyTo, Verdict
Get_Employees Name, ClientIp, Email, Username, Hostname, Role
Get_Employees_All + HireDate, UserAgent, Domain
Get_Event_FileCreation EnvTime, Hostname, Filename, Path
Get_Event_FileCreation_All + Username, Sha256, ProcessName
Get_Event_NetworkInbound EnvTime, ClientIp, Url
Get_Event_NetworkInbound_All + Method, UserAgent, StatusCode
Get_Event_NetworkOutbound EnvTime, ClientIp, Url
Get_Event_NetworkOutbound_All + Method, UserAgent
Get_Dns_All EnvTime, Domain, ClientIp
Get_Event_Process EnvTime, ProcessCommandLine, ProcessName, Hostname, Username
Get_Event_Process_All + ParentProcessName, ParentProcessHash, ProcessHash
Get_SecurityAlerts_All EnvTime, AlertType, Severity, Description, Indicators
Get_Network_Connection_All EnvTime, SourceIp, SourcePort, DestinationIp, DestinationPort, Protocol, Bytes

2. Extractors -- Extract_*

Derive a new column from an existing one. Invoke after a selector.

Function Input Column Adds
Extract_Email_Sender_Domain(T) EmailSender Domain
Extract_Employee_Firstname(T) Name Firstname
Extract_Event_Network_Domain(T) Url DomainName

3. Enrichers -- Enrich_*

Left-join helpers that attach context from a related table.

Function Key Column Enriches With
Enrich_Event_Authentication_Username(T) Username Auth events for user
Enrich_Ip_Employee(T) ClientIp Employee identity from IP
Enrich_Username_Employee(T) Username Employee identity from username
Enrich_Ip_Domain(T) ClientIp DNS domains resolved to IP
Enrich_Ip_Event_NetworkOutbound(T) ClientIp Outbound network from IP
Enrich_Ip_Network_Connection(T) ClientIp Network flows from IP

4. External Enrichment

Function Source Requirement
Enrich_Sha256_VirusTotal(T) VirusTotal file report API key + callout policy
Get_CISA_KEV() / Enrich_CISA_KEV(T) CISA KEV catalog Callout policy

Composition Rules

Selector -> Extract -> Filter -> Enrich -> Summarize/Project
  1. Start with a Selector: Get_Event_Authentication, Get_Email, etc.
  2. Extract derived fields: | invoke Extract_Email_Sender_Domain()
  3. Filter to the signal: | where Result == "Failed Login"
  4. Enrich with context: | invoke Enrich_Username_Employee()
  5. Summarize / project the answer

Always pipe (|) between steps. Extractors and Enrichers use | invoke FunctionName().

Query Generation Guidelines

  • Use the minimal selector unless extra columns are needed -> then _All
  • Chain extractors before enrichers (extractors add columns enrichers may key on)
  • Place where filters as early as possible
  • Use summarize for aggregations, project for final column selection
  • End with order by + take to limit output

Examples

For additional prompts and worked examples, see references/EXAMPLES.md.

Brute-force detection

Get_Event_Authentication
| where Result == "Failed Login"
| summarize FailedCount = count() by Username
| where FailedCount > 19
| invoke Enrich_Username_Employee()
| project Username, Name, Role, Email, FailedCount
| order by FailedCount desc

Phishing triage by recipient seniority

Get_Email
| invoke Extract_Email_Sender_Domain()
| project EnvTime, EmailSender, Domain, Username = EmailRecipient, Subject, Url
| invoke Enrich_Username_Employee()
| extend Seniority = case(
    Role has_any ("CEO", "Chief", "Director", "VP", "President"), 3,
    Role has_any ("Manager", "Lead", "Senior"), 2,
    1)
| summarize
    TotalEmails = count(),
    SeniorityScore = sum(Seniority),
    Recipients = make_set(Name, 50),
    DistinctRecipients = dcount(Username)
  by Domain
| where DistinctRecipients >= 2
| order by SeniorityScore desc
| take 20

Post-exploitation pivot from an indicator

let victims =
    Get_Event_FileCreation_All
    | where Filename has "<INDICATOR>"
    | distinct Hostname;
Get_Event_Process
| where Hostname in (victims)
| where ProcessCommandLine has_any ("rundll32", "regsvr32", "powershell", "systeminfo")
| project EnvTime, Hostname, Username, ProcessName, ProcessCommandLine
| order by EnvTime asc

Suspicious outbound traffic enriched with identity

Get_Event_NetworkOutbound
| invoke Extract_Event_Network_Domain()
| where DomainName has_any ("<SUSPICIOUS_DOMAIN_1>", "<SUSPICIOUS_DOMAIN_2>")
| invoke Enrich_Ip_Employee()
| project EnvTime, Name, Role, DomainName, Url, ClientIp
| order by EnvTime desc

External IP authentication anomaly

Get_Event_Authentication_All
| where not(ClientIp startswith "10.") and not(ClientIp startswith "192.168.")
| summarize
    Attempts = count(),
    Failures = countif(Result == "Failed Login"),
    Users = make_set(Username)
  by ClientIp
| order by Failures desc
| take 20

MCP Tools Used

Tool Purpose
kusto_query Execute IRQL pipelines against a Kusto database
kusto_table_schema_get Discover available tables and columns
kusto_cluster_list List available ADX clusters
kusto_database_list List databases in a cluster

Opening Queries in Kusto Explorer (Windows Only)

Optional convenience feature. The default workflow is to output the KQL in chat and let the user copy it into Kusto Explorer or the VS Code Kusto extension manually. Auto-launch is opt-in only.

Always output the complete KQL query in the chat response with Step 1 (connect) and Step 2 (query) clearly labeled:

// Step 1: Connect to your cluster (skip if already connected)
// Example: uncomment to connect to the KC7 training cluster
// #connect cluster('kc7001.eastus.kusto.windows.net').database('ValdyTimes')
// Or replace with your own cluster:
// #connect cluster('<YOUR_CLUSTER>').database('<YOUR_DATABASE>')

// Step 2: Run the query below
<KQL_QUERY>

If the user asks to save or open in Kusto Explorer, follow the procedure in references/KUSTO_EXPLORER_LAUNCH.md. Key rules:

  • Use ask_user to confirm before writing files or launching executables
  • Display file contents in chat so the user can review before opening
  • Never use shell interpolation or here-strings — write files via Set-Content/Add-Content
  • Never encode queries into browser URLs
  • On macOS/Linux, save the .kql file and suggest the VS Code Kusto extension or ADX Web Explorer
  • For graph visualization from IRQL data, see azure-kusto-graph and azure-kusto-irql-graph

04 同仓库更多 Skills

microsoft
microsoft/GitHub-Copilot-for-Azure

azure-advisor-cost-optimization

Analyze Azure Advisor Cost/IdleResources findings and prevalidate deletion safety, including Service Groups. WHEN: "find unused Azure resources", "what resources am I paying for but no longer using", "idle-resource savings", "historical idle-resource savings", "are these idle resources safe to delete". Generic Cost, other subcategories, and cross-category requests use azure-advisor.

★ 264
microsoft
microsoft/GitHub-Copilot-for-Azure

Foundry IQ 知识库管理

foundry-iq

Foundry IQ 知识库。适用时机:让本地或 Blob 文档可被搜索;创建/诊断知识库;对不支持的连接器或多源知识库的创建/重新配置进行分类处理;将现有知识库连接到智能体(包括多源知识库);创建/复用 Search 服务;从现有知识库检索带引用的内容;无需品牌词。在查询/目标类问题前先阅读其流程说明。不适用:其他知识库提供商、存储库文件搜索、不涉及 Foundry IQ 知识库或连接器请求的经典 Azure AI Search 索引/查询/应用类工作、通用智能体创建。

AI 工程师知识管理与沉淀
★ 264
microsoft
microsoft/GitHub-Copilot-for-Azure

Python 应用 Azure 部署

python-appservice-deploy

将 Python(Flask/Django/FastAPI)代码部署到 Azure App Service Linux。触发条件:"Flask App Service"、"Django App Service"、"FastAPI App Service"、"将 Python 部署到 App Service"。不适用:Container Apps、Functions、非 Python、Terraform/Bicep/IaC、完整基础设施——请使用 azure-prepare。

云架构师部署与发布管理
★ 264
microsoft
microsoft/GitHub-Copilot-for-Azure

Azure OpenAI 快速部署

preset

通过分析所有可用区域的容量,智能地将 Azure OpenAI 模型部署到最优区域。自动优先检查当前区域,并在需要时显示备选方案。适用于:快速部署、最优区域、最佳区域、自动区域选择、快速配置、多区域容量检查、高可用部署、部署到最佳位置。不适用于:自定义 SKU 选择(使用 customize)、特定版本选择(使用 customize)、自定义容量配置(使用 customize)、PTU 部署(使用 customize)。

AI 工程师AI 平台资源管理
★ 264
microsoft
microsoft/GitHub-Copilot-for-Azure

Azure OpenAI 自定义部署

customize

具有完全自定义控制能力的 Azure OpenAI 模型交互式引导部署流程。逐步选择模型版本、SKU(GlobalStandard/Standard/ProvisionedManaged)、容量、RAI 策略(内容过滤器)以及高级选项(动态配额、优先处理、溢出)。适用于:自定义部署、定制模型部署、选择版本、选择 SKU、设置容量、配置内容过滤器、RAI 策略、部署选项、详细部署、高级部署、PTU 部署、预置吞吐量。不适用于:快速部署到最优区域(使用 preset)。

AI 工程师AI 平台资源管理
★ 264
microsoft
microsoft/GitHub-Copilot-for-Azure

Azure OpenAI 模型容量查询

capacity

跨区域和跨项目发现可用的 Azure OpenAI 模型容量。分析配额限制、比较可用性,并根据容量需求推荐最佳部署位置。适用场景:查找容量、检查配额、可以在哪里部署、容量发现、容量最佳区域、多项目容量搜索、配额分析、模型可用性、区域比较、检查 TPM 可用性。不适用场景:实际部署(发现后转交给预设或自定义技能)、配额提升申请(引导用户前往 Azure 门户)、列出现有部署。

AI 工程师AI 平台资源管理
★ 264