dd-audit

作者: datadog-labs

稽核軌跡調查——誰變更了什麼、金鑰遭入侵、成本飆升的根本原因、合規證據(SOC 2/PCI),以及AI活動稽核。

npx skills add https://github.com/datadog-labs/agent-skills --skill dd-audit

Datadog Audit Trail

Investigate user activity, configuration changes, access patterns, and compliance evidence using pup audit-logs.

Sub-Skills

Sub-skillUse when
security-investigation"Who changed X?", "What did this user do?", "Show me deletions in the last 24h"
key-compromise"Was this API key compromised?", "What did key XYZ do?", "Investigate suspicious key activity"
cost-spike-investigation"Why did my bill go up?", "What caused this usage spike?", "Investigate LLM cost increase"
compliance-report"Generate SOC 2 evidence", "PCI audit log", "User provisioning report for auditor"
ai-activity-audit"What did the AI assistant do?", "Audit MCP tool calls", "AI governance report"

Prerequisites

pup auth login   # OAuth2 (recommended)
# or set DD_API_KEY + DD_APP_KEY with audit_logs_read scope

Commands

# List recent events
pup audit-logs list --from 1h --limit 100

# Search with a query
pup audit-logs search --query "@action:deleted" --from 24h

# JSON output for piping to jq
pup audit-logs search --query "@usr.email:alice@example.com" --from 7d -o json | jq '.data[].attributes'

Event Schema Quick Reference

FieldDescriptionExample values
@usr.emailActor emailalice@example.com
@evt.actor.typeHow action was takenUSER, API_KEY, SUPPORT_USER
@actionVerbcreated, modified, deleted, accessed, login
@evt.nameEvent categoryDashboard, Monitor, Authentication, Access Management
@asset.typeResource typedashboard, monitor, api_key, role, user
@asset.idResource identifierabc-123
@metadata.api_key.idAPI key used (if applicable)key_abc123
@metadata.app_key.idApp key used (if applicable)app_abc123
@network.client.ipClient IP address1.2.3.4
@network.client.geoip.country.nameCountryUnited States
@network.client.geoip.as.nameASN nameAmazon.com
@http.url_details.pathAPI endpoint path/api/v1/dashboard/xyz

Search Syntax

Same Lucene-style syntax as Log Explorer:

QueryMeaning
@evt.name:DashboardExact field match
@action:deletedAction filter
@usr.email:alice@example.comSpecific user
@evt.name:Monitor AND @action:modifiedCompound
-@action:deletedNegation
@usr.email:*Field exists
@network.client.ip:1.2.3.4IP filter

Retention

Default retention is 90 days. If querying beyond 90 days, archive to S3/GCS/Azure Blob must be configured. Always check whether the requested time window falls within retention before running a query.

Troubleshooting

ProblemCauseFix
403 ForbiddenMissing audit_logs_read scopeAdd scope to app key in Datadog UI
Empty resultsTime window outside retentionCheck archive config; default max is 90 days
TimeoutQuery too broadNarrow time window or add more filters
No IP dataInternal action or pre-enrichment eventNot all events have geo data

References

來自 datadog-labs 的更多技能

agent-install
datadog-labs
Install the Datadog Agent on Kubernetes using the Datadog Operator — required before enabling Single Step Instrumentation (SSI), which automatically…
official
agent-observability-auto-experiment
datadog-labs
針對真實的 Datadog LLM-Obs 資料執行迭代式程式碼改進爬山演算法,以 Claude Code 作為代理程式在本機端運行。建立基準評估,逐步進行…
official
agent-observability-eval-bootstrap
datadog-labs
Bootstrap evaluators from production traces — by default propose online LLM-judge evaluators and, after you confirm, create them in Datadog as disabled drafts…
official
agent-observability-eval-pipeline
datadog-labs
為已儀器化的 ml_app 設計的端到端 Agent Observability 管線 — 分類生產追蹤、根因分析故障、啟動評估器,然後(可選地)…
official
agent-observability-experiment-analyzer
datadog-labs
分析LLM實驗結果。處理單一或對比實驗,探索性或問答模式。當使用者說「分析實驗」、「比較…」時使用。
official
agent-observability-replay-trace
datadog-labs
當開發者想要針對某一個特定的 Agent Observability / LLM Obs trace(其輸出結果不盡理想)進行迭代時使用——將該 trace 重新對其……
official
agent-observability-trace-rca
datadog-labs
Root cause analysis on production LLM traces. Diagnoses why an LLM application is failing — works from eval judge verdicts, runtime errors, or structural…
official
agent-skills
datadog-labs
Datadog skills for AI agents. Essential monitoring, logging, tracing and observability.
official