关于 dd-audit-ai-activity
用于审查 Bits AI SRE MCP 工具调用所生成 Datadog Audit Trail 事件的技能,帮助安全、合规和治理团队查看用户、操作、受影响资源及潜在异常。
主要功能
- 01按时间范围查询 MCP 活动
- 02按用户汇总工具调用
- 03识别变更资源及操作
- 04生成每周活动摘要
- 05标记治理风险信号
适用场景
- 01核查 AI 操作是否获授权
- 02为审计整理可追溯的 AI 活动记录
- 03发现异常或高频 AI 工具使用
MCP 相关
它查询 Datadog Audit Trail 中 `Bits AI SRE` 类别的事件,包括 MCP Server 工具调用、用户、操作和受影响资源。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ datadog-labs/ agent-skills --skill dd-audit-ai-activity安装后在 Claude Code 中输入/dd-audit-ai-activity确认已加载。
详细介绍
审计跟踪:AI 活动审计
每次 Datadog MCP 工具调用都会记录在 Bits AI SRE 类别下的审计跟踪中。此技能会呈现 AI 助手在组织中执行的操作,包括哪些用户调用了它、调用了哪些工具,以及影响了哪些资源。
前提条件
pup auth login # OAuth2 (recommended)
# or set DD_API_KEY + DD_APP_KEY with audit_logs_read scope
查询
时间范围内的所有 MCP 工具活动
pup audit-logs search --query "@evt.name:\"MCP Server\"" --from 7d --limit 500 -o json \
| jq '[.data[] | {
timestamp: .attributes.timestamp,
user: .attributes.attributes.usr.email,
actor_type: .attributes.attributes.evt.actor.type,
action: .attributes.attributes.action,
resource_type: .attributes.attributes.asset.type,
resource_id: .attributes.attributes.asset.id,
ip: .attributes.attributes.network.client.ip,
country: .attributes.attributes.network.client.geoip.country.name
}]'
按用户查看活动(谁最常使用 AI 助手?)
pup audit-logs search --query "@evt.name:\"MCP Server\"" --from 30d --limit 1000 -o json \
| jq '[.data[] | .attributes.attributes.usr.email]
| group_by(.)
| map({user: .[0], tool_calls: length})
| sort_by(-.tool_calls)'
AI 工具调用修改的资源
pup audit-logs search \
--query "@evt.name:\"MCP Server\" @action:(created OR modified OR deleted)" \
--from 7d --limit 500 -o json \
| jq '[.data[] | {
timestamp: .attributes.timestamp,
user: .attributes.attributes.usr.email,
action: .attributes.attributes.action,
resource_type: .attributes.attributes.asset.type,
resource_id: .attributes.attributes.asset.id
}]'
特定用户的 AI 活动
pup audit-logs search \
--query "@evt.name:\"MCP Server\" @usr.email:[email protected]" \
--from 30d --limit 500 -o json \
| jq '[.data[] | {
timestamp: .attributes.timestamp,
action: .attributes.attributes.action,
resource_type: .attributes.attributes.asset.type,
resource_id: .attributes.attributes.asset.id
}]'
每周摘要报告
pup audit-logs search --query "@evt.name:\"MCP Server\"" --from 7d --limit 1000 -o json \
| jq '{
total_tool_calls: (.data | length),
unique_users: ([.data[] | .attributes.attributes.usr.email] | unique | length),
top_users: (
[.data[] | .attributes.attributes.usr.email]
| group_by(.)
| map({user: .[0], calls: length})
| sort_by(-.calls)
| .[:5]
),
actions_breakdown: (
[.data[] | .attributes.attributes.action]
| group_by(.)
| map({action: .[0], count: length})
| sort_by(-.count)
),
resource_types: (
[.data[] | .attributes.attributes.asset.type]
| group_by(.)
| map({type: .[0], count: length})
| sort_by(-.count)
)
}'
异常标记
| 信号 | 治理方面的关注点 |
|---|---|
AI 对监视器或仪表板执行 deleted 操作 | 检查是否符合预期,是否应允许 AI 执行破坏性操作 |
AI 以 SUPPORT_USER 身份操作 | Datadog 支持人员代表组织使用 AI |
| 用户首次调用 AI 工具 | 新用户正在使用 AI 助手 |
| 短时间内大量调用工具 | 自动化/批量 AI 使用 |
| AI 访问用户常规权限范围之外的资源 | AI 会话可能拥有过多权限 |
输出格式
AI Activity Audit — [Org] — [Date Range]
Total MCP tool calls: [N]
Unique users: [N]
Top users:
[[email protected]]: [N] calls
Actions breakdown:
accessed: [N]
modified: [N]
created: [N]
deleted: [N]
Resource types affected:
dashboard: [N]
monitor: [N]
Anomalies:
[List any flagged events with timestamp, user, action, resource]
背景
此技能最适用于:
- 安全审查: 验证 AI 操作已获授权且在预期范围内
- 合规审计: 证明 AI 活动已记录,且可追溯到具体用户
- 治理报告: 了解组织内 AI 助手的采用情况及风险面
其他可观测性供应商都无法如此详细地审计其 AI 助手的操作。
参考资料
评论
支持 Markdown