Skip to content
OpenSmartRoute
Skillv1.0.0

dd-audit-security-investigation

Answer "who did what" security questions from Audit Trail — deletions, config changes, login activity, permission changes, actions from a specific user or IP.

by datadog-labs(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from datadog-labs/agent-skills (dd-audit/security-investigation/SKILL.md) via skills.sh. Install upstream with npx skills add datadog-labs/agent-skills --skill security-investigation. Copyright stays with the author.

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

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/datadog-labs-agent-skills-security-investigation/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

datadog-labs-agent-skills-security-investigation.ocm.jsonjson
{
  "ocm": "1",
  "id": "datadog-labs-agent-skills-security-investigation",
  "kind": "skill",
  "name": "dd-audit-security-investigation",
  "description": "Answer \"who did what\" security questions from Audit Trail — deletions, config changes, login activity, permission changes, actions from a specific user or IP.",
  "publisher": "datadog-labs",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "datadog",
      "audit",
      "security",
      "investigation",
      "dd-audit",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Answer \"who did what\" security questions from Audit Trail — deletions, config changes, login activity, permission changes, actions from a specific user or IP."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/datadog-labs/agent-skills",
      "path": "dd-audit/security-investigation/SKILL.md",
      "ref": "HEAD",
      "url": "https://www.skills.sh/datadog-labs/agent-skills/dd-audit-security-investigation",
      "key": "datadog-labs/agent-skills/dd-audit/security-investigation/SKILL.md"
    }
  },
  "instructions": "# Audit Trail: Security Investigation\n\nAnswer common security investigation questions using `pup audit-logs`.\n\n## Prerequisites\n\n```bash\npup auth login   # OAuth2 (recommended)\n# or set DD_API_KEY + DD_APP_KEY with audit_logs_read scope\n```\n\n## Command Execution Order\n\n1. Clarify the investigation scope: who, what resource type, what time window.\n2. Run the most specific query first; broaden only if results are empty.\n3. If results are large, pipe to `jq` to group or summarize.\n4. Highlight anomalies: bulk operations, unusual geo, off-hours activity, support user actions.\n\n## Common Investigat",
  "cost": {
    "context_tokens": 1443
  }
}

Fetch it by URL: GET /api/v1/registry/datadog-labs-agent-skills-security-investigation/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.