Back to Skills

security-generate-security-sample-data

Generate sample security events, attack scenarios, and synthetic alerts for Elastic Security. Use when demoing, populating dashboards, testing detection rules, or setting up a POC.

532stars41forksUpdated 7/16/2026

Security Assessment

Low Risk(85/100)

Detected risks:

Secret Exposure([SKILL.md] PASSWORD=)
Security Score85/100

About security-generate-security-sample-data

Security-generate-security-sample-data generates ECS-compliant sample security events, multi-step attack scenarios, and synthetic alert documents that populate Elastic Security dashboards, the Alerts tab, and Attack Discovery. It solves the problem of quickly seeding a realistic-looking Elastic Security environment for demos, dashboard population, detection-rule testing, or proof-of-concept setups without needing real telemetry.

The skill is driven by Node.js scripts. The zero-friction demo-walkthrough.js runner generates everything and opens Kibana, while sample-data.js provides granular control. Its workflow is: set environment variables, generate data, explore in Kibana, and clean up. Data spans five packages (system, endpoint, windows, aws, okta) and four attack scenarios: Windows credential theft, AWS cloud privilege escalation, Okta identity takeover, and a full ransomware kill chain. Synthetic alerts are indexed directly into .alerts-security.alerts-default with MITRE ATT&CK mappings, severity levels, and risk scores, and do not require detection rules to be installed or enabled. Key sample-data.js flags include --count/-n (events per package, default 50), --scenarios, --scenario NAME, --alerts, --cleanup, --continuous with --interval N for live streaming, --json/-j, and --yes/-y to skip confirmation prompts. In continuous mode every 5th batch includes an attack scenario and every 10th batch adds synthetic alerts. All generated documents are tagged with tags: ["elastic-security-sample-data"] so cleanup, which runs deleteByQuery across sample data indices, only removes marked documents, with a fallback that scans _source.tags for the last 14 days.

The skill targets security engineers and Elastic users setting up demos or testing. It requires Node.js 22+ and network access to Kibana and Elasticsearch, configured through environment variables: KIBANA_URL plus KIBANA_API_KEY or KIBANA_USERNAME/KIBANA_PASSWORD, and ELASTICSEARCH_URL or ELASTICSEARCH_CLOUD_ID plus ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/ELASTICSEARCH_PASSWORD. Attack Discovery additionally requires an LLM connector (such as OpenAI, Anthropic, or Google Gemini) configured in Kibana under Stack Management > Connectors, and the Complete project tier unlocks the feature. The skill warns against running against production clusters unless intentionally injecting synthetic data, prompts for confirmation on all write operations, and uses RFC 5737 / RFC 2606 safe addresses.

FAQ

What are the requirements to run this skill?

Node.js 22+ and network access to Kibana and Elasticsearch. Environment variables are needed: KIBANA_URL plus KIBANA_API_KEY or KIBANA_USERNAME/KIBANA_PASSWORD, and ELASTICSEARCH_URL or ELASTICSEARCH_CLOUD_ID plus ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/ELASTICSEARCH_PASSWORD (either an API key or username/password is required for Elasticsearch).

What data does it generate?

Sample data spans five packages (system, endpoint, windows, aws, okta) and four attack scenarios: Windows credential theft, AWS cloud privilege escalation, Okta identity takeover, and a full ransomware kill chain. It also generates synthetic alert documents indexed into .alerts-security.alerts-default with MITRE ATT&CK mappings, severity levels, and risk scores.

How do I clean up the generated data?

Run the script with --cleanup, which runs deleteByQuery across all sample data indices. All generated documents are tagged with tags: ["elastic-security-sample-data"], and cleanup only deletes documents with this marker (with a fallback that scans _source.tags for matching documents from the last 14 days).

Do I need detection rules or an LLM connector?

Synthetic alerts are indexed directly into .alerts-security.alerts-default and do not require detection rules to be installed or enabled. However, Attack Discovery requires an LLM connector (OpenAI, Anthropic, Google Gemini, or similar) configured in Kibana under Stack Management > Connectors, and the Complete project tier unlocks the feature.

Is it safe to run against a production cluster?

The skill warns against running against production clusters unless you intend to inject synthetic data alongside real alerts, since sample events and alerts appear in dashboards and the Alerts tab alongside real data. All write operations prompt for confirmation; pass --yes or -y to skip when called by an agent.

All Files

6 files
references/sample-data-reference.md3.6 KB
View
scripts/demo-walkthrough.js4.7 KB
View
scripts/es-client.js1.8 KB
View
scripts/kibana-client.js6.7 KB
View
scripts/sample-data.js89.5 KB
View
SKILL.md7.7 KB
View

Install security-generate-security-sample-data

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill