【问题标题】:Microsoft Advanced Hunting Query API works for some tables but not others in power BIMicrosoft Advanced Hunting Query API 适用于 Power BI 中的某些表,但不适用于其他表
【发布时间】:2021-12-26 09:07:03
【问题描述】:

我在 Power BI 中使用以下 API 调用从 365 访问高级狩猎数据。

https://api.securitycenter.windows.com/api/advancedqueries

使用此 API 适用于 Power BI 中的某些表,但不适用于其他表。

例如:

DeviceEvents | limit 10 将返回 10 个结果。

AlertInfo | limit 10 返回 400 错误请求。

上述两个查询都在 365 自身内的 advanced hunting tool 中成功运行。

我发现Advanced Hunting Schema 中的许多其他表也是如此,例如 IdentityInfo 和 EmailEvents 等等。

我有什么明显的遗漏吗?我想也许是退回的物品数量,因此限制为 10,但这也没有解决问题。

这是一个围绕 Power BI 特定查询方法的 Microsofts Documentation 示例,但没有帮助解决问题。

    let
    AdvancedHuntingQuery = "DeviceEvents | where ActionType contains 'Anti' | limit 20",

    HuntingUrl = "https://api.securitycenter.microsoft.com/api/advancedqueries",

    Response = Json.Document(Web.Contents(HuntingUrl, [Query=[key=AdvancedHuntingQuery]])),

    TypeMap = #table(
        { "Type", "PowerBiType" },
        {
            { "Double",   Double.Type },
            { "Int64",    Int64.Type },
            { "Int32",    Int32.Type },
            { "Int16",    Int16.Type },
            { "UInt64",   Number.Type },
            { "UInt32",   Number.Type },
            { "UInt16",   Number.Type },
            { "Byte",     Byte.Type },
            { "Single",   Single.Type },
            { "Decimal",  Decimal.Type },
            { "TimeSpan", Duration.Type },
            { "DateTime", DateTimeZone.Type },
            { "String",   Text.Type },
            { "Boolean",  Logical.Type },
            { "SByte",    Logical.Type },
            { "Guid",     Text.Type }
        }),

    Schema = Table.FromRecords(Response[Schema]),
    TypedSchema = Table.Join(Table.SelectColumns(Schema, {"Name", "Type"}), {"Type"}, TypeMap , {"Type"}),
    Results = Response[Results],
    Rows = Table.FromRecords(Results, Schema[Name]),
    Table = Table.TransformColumnTypes(Rows, Table.ToList(TypedSchema, (c) => {c{0}, c{2}}))

in Table

谢谢

【问题讨论】:

    标签: powerbi securitycenter advanced-threat-protection


    【解决方案1】:

    我与 Microsoft 取得了联系,他们确认只有一些表可以通过我帖子中链接的文档中的 API 访问。他们提供了一个解决方法,即使用我在旅行中没有遇到的稍微不同的 API。响应摘录如下:

    因此,我将 Power BI 高级编辑器中的高级搜索 URL 从 https://api.securitycenter.microsoft.com/api/advancedqueries 更改为 https://api.security.microsoft.com/api/advancedhunting。 (这可能需要您在组织帐户中从 Power BI 重新登录)

    我可以确认,在 Power BI 中使用第二个 API 让我能够访问我所追求的其他表。

    【讨论】:

      猜你喜欢
      • 2019-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-28
      • 2011-12-12
      相关资源
      最近更新 更多