All skills
datadog-labs avatar

/dd-audit

@0d12930 official

Audit Trail investigations - who changed what, key compromise, cost spike root cause, compliance evidence (SOC 2/PCI), and AI activity auditing.

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-audit

This session only. Nothing lands on disk.

security-investigationSKILL.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Audit Trail: Security Investigation

Answer common security investigation questions using pup audit-logs.

Prerequisites

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

Command Execution Order

  1. Clarify the investigation scope: who, what resource type, what time window.
  2. Run the most specific query first; broaden only if results are empty.
  3. If results are large, pipe to jq to group or summarize.
  4. Highlight anomalies: bulk operations, unusual geo, off-hours activity, support user actions.

Common Investigation Queries

Who deleted resources in a time window?

pup audit-logs search --query "@action:deleted" --from 24h -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      actor_type: .attributes.attributes.evt.actor.type,
      resource_type: .attributes.attributes.asset.type,
      resource_id: .attributes.attributes.asset.id,
      country: .attributes.attributes.network.client.geoip.country.name
    }]'

Who modified a specific resource (by ID)?

pup audit-logs search --query "@asset.id:RESOURCE_ID" --from 7d -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      action: .attributes.attributes.action,
      event: .attributes.attributes.evt.name
    }]'

What did a specific user do?

pup audit-logs search --query "@usr.email:user@example.com" --from 7d --limit 200 -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      action: .attributes.attributes.action,
      event: .attributes.attributes.evt.name,
      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
    }]'

Login activity — all logins with geo

pup audit-logs search --query "@evt.name:Authentication @action:login" --from 7d --limit 200 -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      status: .attributes.attributes.status,
      ip: .attributes.attributes.network.client.ip,
      city: .attributes.attributes.network.client.geoip.city.name,
      country: .attributes.attributes.network.client.geoip.country.name,
      asn: .attributes.attributes.network.client.geoip.as.name
    }]'

Failed logins only

pup audit-logs search --query "@evt.name:Authentication @action:login @status:error" --from 7d --limit 200 -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      ip: .attributes.attributes.network.client.ip,
      country: .attributes.attributes.network.client.geoip.country.name
    }]'

Who changed roles or permissions?

pup audit-logs search --query "@evt.name:\"Access Management\"" --from 30d --limit 200 -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
    }]'

What actions came from a specific IP?

pup audit-logs search --query "@network.client.ip:1.2.3.4" --from 30d --limit 200 -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      actor_type: .attributes.attributes.evt.actor.type,
      action: .attributes.attributes.action,
      event: .attributes.attributes.evt.name,
      resource_type: .attributes.attributes.asset.type
    }]'

Who created or deleted API keys?

pup audit-logs search --query "@evt.name:Authentication @asset.type:api_key" --from 90d --limit 200 -o json \
  | jq '[.data[] | {
      timestamp: .attributes.timestamp,
      user: .attributes.attributes.usr.email,
      action: .attributes.attributes.action,
      key_id: .attributes.attributes.asset.id,
      ip: .attributes.attributes.network.client.ip,
      country: .attributes.attributes.network.client.geoip.country.name
    }]'

Event Category Reference

Category (@evt.name) What it covers
Authentication Logins, API key create/delete/modify
Access Management Roles, user add/remove, restriction policies
Dashboard Create, modify, delete, share
Monitor Create, modify, delete, resolve
Log Management Pipelines, indexes, archives, exclusion filters
Integration Add/modify/delete integrations
Metrics Custom metric create/modify/delete
Organization Management Child org creation, org settings
Notebook Create, modify, delete
APM Retention filters, sampling config
Cloud Security Platform CWS rules, security signal state changes
Bits AI SRE MCP tool calls, AI investigations

Anomaly Flags to Surface

When presenting investigation results, call out:

  • Actor type SUPPORT_USER — Datadog support accessed the org
  • Bulk deletions — same user, same action, many resources in a short window
  • Unexpected geography — country not seen in prior logins for this user
  • Off-hours activity — actions at unusual times for the user's typical timezone
  • First-time ASN — action from a cloud provider or VPN not seen before (@network.client.geoip.as.name)

References

Source: SKILL.md on GitHub

No alerts14d3 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    The skill provides a set of tools and templates for auditing Datadog environments, including compliance reporting, security investigations, and API key compromise analysis. It utilizes the official Datadog CLI tool ('pup') and APIs for data retrieval and processing. No malicious patterns or security vulnerabilities were identified.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: LOW · No issues

Signed by skilld at 0d12930. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 5 months ago
Other metadata
metadata
{
  "version": "0.1.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,audit,audit-trail,security,compliance,dd-audit",
  "alwaysApply": "false"
}
  • Security
  • API
  • datadog
  • audit
  • audit-trail
  • compliance
  • investigation
  • logging

README badge

README badge for datadog-labs/agent-skills/dd-audit

Queries Datadog Audit Trail to investigate user activity, configuration changes, and compliance events using the pup audit-logs command. Covers security investigations (who changed what), key compromise auditing, cost spike root cause analysis, SOC 2/PCI compliance reporting, and AI assistant activity tracking.

Generated from the current SKILL.md.

What time window can I query?
Default retention is 90 days. Queries beyond 90 days require archive configuration to S3/GCS/Azure Blob. Always verify the requested time window falls within retention before running a query.
What permissions do I need?
The API key or app key must have the `audit_logs_read` scope. Use OAuth2 login with `pup auth login` or set DD_API_KEY and DD_APP_KEY with the appropriate scope.
Can I audit AI assistant activity?
Yes. The skill includes an ai-activity-audit sub-skill for auditing MCP tool calls and generating AI governance reports.
What fields can I search on?
You can filter by user email, actor type, action verb, event category, resource type, API/app key ID, client IP, geolocation, and HTTP path using Lucene-style syntax matching the Log Explorer syntax.
What should I do if a query times out?
Narrow the time window or add more filters to reduce the result set scope.

Generated from the current SKILL.md. These answers refresh after source changes.