Communityライティング&編集github.com

microsoft/azure-kusto-irql

IRQL(インシデント対応クエリ言語)クエリを作成し、Kustoを使用したサイバーセキュリティ調査を支援します。自然言語によるハンティングの質問を、Get_*、Extract_*、Enrich_*関数を使用した構成可能なIRQLパイプラインに変換します。

azure-kusto-irql とは?

IRQL(Incident Response Query Language)スキルは、Kusto関数ベースのクエリ言語を使用して、アナリストやAIエージェントがサイバーセキュリティ調査を効率的に実行できるようにします。このスキルは、選択子(Get_*)、抽出子(Extract_*)、エンリッチャー(Enrich_*)と呼ばれる構成可能な関数ブロックを連鎖させることで、複雑なハンティングパイプラインを構築します。主な利点は、統一スキーマによる異種セキュリティテーブルの操作、関数の連鎖による再利用性、そして異なるクラスタやデータベース間でのポータビリティです。ユーザーが「IRQL」「Get_*」「Extract_*」などを明示的に要求した場合にのみアクティブになり、汎用的なセキュリティクエリは専用のazure-kustoスキルにルーティングします。このスキルは、IRQL関数が事前にデプロイされたデータベースでのみ動作し、MCPツール(kusto_query、kusto_table_schema_getなど)を使用してクエリを実行します。

対応~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

Installed? Explore more ライティング&編集 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

IRQL -- インシデント対応クエリ言語

セレクター、抽出子、エンリッチャーのビルディングブロックからIRQL関数パイプラインを作成します。IRQLは、生のKQLセキュリティテーブルを、意図が明らかで構成可能な関数でラップすることで、アナリスト(およびLLM)がスキーマ、クラスタの場所、結合キーを覚えなくてもハントを記述できるようにします。

アクティベーション条件

このスキルは、ユーザーが次のことを行った場合に使用します。

  • IRQL、Get_*、Extract_*、Enrich_*関数を明示的に言及した場合
  • 「IRQLを使う」または「IRQLクエリを書く」と言った場合
  • 既知のIRQLセレクターを使用した構成可能なハンティングパイプラインを要求した場合

ユーザーが明示的にIRQLを要求しない限り、一般的なセキュリティクエリ(例:「失敗したログインを検索」)ではアクティブにしないでください。そのようなクエリはazure-kustoにルーティングしてください。

自然言語からIRQLへの変換機能ではありません。 このスキルはIRQL関数パイプラインを作成し、既知のセレクターと単純なフィルターに直接マッピングできる基本的な自然言語要求を処理する場合があります。一般的なNL-to-KQLまたはNL-to-IRQL変換には、専用のクエリ生成スキル(別途利用可能)を使用してください。

IRQL関数の事前確認

パイプラインを生成する前に、ターゲットデータベースでIRQLが利用可能であることを確認します。

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

IRQL関数が見つからない場合は、ターゲットデータベースにIRQLがデプロイされていないことをユーザーに通知し、代わりに生のKQLクエリにはazure-kustoを使用することを提案します。IRQL関数は前提条件です -- このスキルはベースIRQLセレクターをデプロイしません。

IRQLとは

IRQLはKQL上に構築された関数ベースの言語です。以下を提供します。

  1. 統一スキーマ -- 異種のセキュリティテーブルを、基盤となるデータソースに関係なく一貫した列名に投影します。
  2. 構成可能性 -- 小さな関数を| invokeで連鎖させて、簡単なステップから複雑なハントを構築します。
  3. 移植性 -- 同じIRQLパイプラインが異なるクラスタ/データベースで動作します。Get_*プリミティブのみ再ポイントする必要があります。

IRQLは別の言語ではありません。呼び出すKQL関数です。有効なKQLは、IRQL関数と一緒に使用できます。

IRQLのデプロイ

IRQL関数は、保存されたKQL関数(.create-or-alter function)です。このスキルがパイプラインを生成する前に、ターゲットデータベースにデプロイされている必要があります。

公開サンプルクラスタ(関数は事前デプロイ済み):

  • クラスタ: https://kc7001.eastus.kusto.windows.net
  • データベース: ValdyTimes、JoJosHospital

IRQLを新しいクラスタ/データベースに移植するには、ソーステーブルを統一スキーマ(以下の列名)に投影するGet_*セレクターを作成し、抽出子とエンリッチャーをデプロイします。入力スキーマが一致していれば、抽出子とエンリッチャーは変更せずに動作します。

関数カタログ

1. セレクター -- Get_*

ソーステーブルの投影された、スキーマ統一ビューを返します。デフォルトでは最小限の形式を使用し、追加の列が必要な場合は_Allを使用します。

関数列
Get_Event_AuthenticationEnvTime, Hostname, ClientIp, Username, Result
Get_Event_Authentication_All+ Description, UserAgent, PasswordHash
Get_EmailEnvTime, EmailSender, EmailRecipient, Subject, Url
Get_Email_All+ ReplyTo, Verdict
Get_EmployeesName, ClientIp, Email, Username, Hostname, Role
Get_Employees_All+ HireDate, UserAgent, Domain
Get_Event_FileCreationEnvTime, Hostname, Filename, Path
Get_Event_FileCreation_All+ Username, Sha256, ProcessName
Get_Event_NetworkInboundEnvTime, ClientIp, Url
Get_Event_NetworkInbound_All+ Method, UserAgent, StatusCode
Get_Event_NetworkOutboundEnvTime, ClientIp, Url
Get_Event_NetworkOutbound_All+ Method, UserAgent
Get_Dns_AllEnvTime, Domain, ClientIp
Get_Event_ProcessEnvTime, ProcessCommandLine, ProcessName, Hostname, Username
Get_Event_Process_All+ ParentProcessName, ParentProcessHash, ProcessHash
Get_SecurityAlerts_AllEnvTime, AlertType, Severity, Description, Indicators
Get_Network_Connection_AllEnvTime, SourceIp, SourcePort, DestinationIp, DestinationPort, Protocol, Bytes

2. 抽出子 -- Extract_*

既存の列から新しい列を導出します。セレクターの後に呼び出します。

関数入力列追加される列
Extract_Email_Sender_Domain(T)EmailSenderDomain
Extract_Employee_Firstname(T)NameFirstname
Extract_Event_Network_Domain(T)UrlDomainName

3. エンリッチャー -- Enrich_*

関連テーブルからコンテキストを付加する左外部結合ヘルパー。

関数キー列エンリッチ対象
Enrich_Event_Authentication_Username(T)Usernameユーザーの認証イベント
Enrich_Ip_Employee(T)ClientIpIPからの従業員情報
Enrich_Username_Employee(T)Usernameユーザー名からの従業員情報
Enrich_Ip_Domain(T)ClientIpIPに解決されたDNSドメイン
Enrich_Ip_Event_NetworkOutbound(T)ClientIpIPからの送信ネットワーク
Enrich_Ip_Network_Connection(T)ClientIpIPからのネットワークフロー

4. 外部エンリッチメント

関数ソース要件
Enrich_Sha256_VirusTotal(T)VirusTotalファイルレポートAPIキー + コールアウトポリシー
Get_CISA_KEV() / Enrich_CISA_KEV(T)CISA KEVカタログコールアウトポリシー

構成ルール

セレクター -> 抽出 -> フィルター -> エンリッチ -> 集計/射影
  1. セレクターから開始: Get_Event_Authentication、Get_Emailなど。
  2. 導出フィールドを抽出: | invoke Extract_Email_Sender_Domain()
  3. シグナルにフィルター: | where Result == "Failed Login"
  4. コンテキストでエンリッチ: | invoke Enrich_Username_Employee()
  5. 回答を集計/射影

常にパイプ(|)でステップを接続します。抽出子とエンリッチャーは| invoke FunctionName()を使用します。

クエリ生成ガイドライン

  • 追加の列が必要な場合を除き最小限のセレクターを使用 -> 必要に応じて_All
  • 抽出子をエンリッチャーの前に連鎖させる(抽出子はエンリッチャーがキーとする可能性のある列を追加します)
  • whereフィルターは可能な限り早い段階に配置
  • 集計にはsummarize、最終的な列選択にはprojectを使用
  • order by + takeで出力を制限して終了

例

追加のプロンプトと詳細な例については、references/EXAMPLES.mdを参照してください。

ブルートフォース検出

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

受信者の役職に基づくフィッシングトリアージ

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

侵害指標からのポストエクスプロイテーションピボット

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

ID情報でエンリッチした不審な送信トラフィック

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

外部IP認証の異常

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ツール

ツール目的
kusto_queryKustoデータベースに対してIRQLパイプラインを実行
kusto_table_schema_get利用可能なテーブルと列を発見
kusto_cluster_list利用可能なADXクラスタを一覧表示
kusto_database_listクラスタ内のデータベースを一覧表示

Kusto Explorerでクエリを開く(Windowsのみ)

オプションの便利機能です。 デフォルトのワークフローは、チャットに完全なKQLを出力し、ユーザーが手動でKusto ExplorerまたはVS Code Kusto拡張機能にコピーできるようにすることです。自動起動はオプトインのみです。

常にチャット応答で完全なKQLクエリを出力し、ステップ1(接続)とステップ2(クエリ)を明確にラベル付けします。

// ステップ1: クラスタに接続(既に接続済みの場合はスキップ)
// 例: KC7トレーニングクラスタに接続するにはコメントを解除
// #connect cluster('kc7001.eastus.kusto.windows.net').database('ValdyTimes')
// または独自のクラスタに置き換え:
// #connect cluster('<YOUR_CLUSTER>').database('<YOUR_DATABASE>')

// ステップ2: 以下のクエリを実行
<KQL_QUERY>

ユーザーがKusto Explorerに保存または開くように要求した場合は、references/KUSTO_EXPLORER_LAUNCH.mdの手順に従います。主要なルール:

  • ファイルを書き込んだり実行可能ファイルを起動する前にask_userを使用して確認します
  • ファイルの内容をチャットに表示して、ユーザーが開く前に確認できるようにします
  • シェル補間やヒアドキュメントは使用しないでください -- ファイルはSet-Content/Add-Contentで書き込みます
  • クエリをブラウザのURLにエンコードしないでください
  • macOS/Linuxでは、.kqlファイルを保存し、VS Code Kusto拡張機能またはADX Web Explorerを提案します
  • IRQLデータからのグラフ可視化については、azure-kusto-graphおよびazure-kusto-irql-graphを参照してください

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-graph

Apply IRQL graph functions to KQL or IRQL query results for Kusto Explorer visualization. Generates Lift_To_Graph mappings and composes Graph_Render_View, Graph_Fold_By_Property, Extract_Node_*, Enrich_Node_*, and Enrich_Graph_* calls. Accepts a supplied query or limited basic natural-language source request; it is not a general natural-language-to-KQL/IRQL skill. WHEN: Lift_To_Graph, Graph_Render_View, Graph_Fold_By_Property, IRQL graph enrichment, graph mapping for existing query results, icon-decorated graph, fold graph nodes. Use azure-kusto-graph for native make-graph analysis, graph-match, shortest paths, components, or persistent graphs.

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.

関連スキル