CommunityPesquisa e Análise de Dadosgithub.com

siem-operations

Operate a SIEM such as Wazuh or OpenSearch safely — health and capacity, retention, snapshots and restore drills, upgrades with rollback, ingestion monitoring, tamper protection. Use when sizing, changing, or upgrading a SIEM, or ingestion lags.

O que é siem-operations?

siem-operations is a Claude Code agent skill that operate a SIEM such as Wazuh or OpenSearch safely — health and capacity, retention, snapshots and restore drills, upgrades with rollback, ingestion monitoring, tamper protection. Use when sizing, changing, or upgrading a SIEM, or ingestion lags.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ifundeasy/claude-crew/tree/HEAD/skills/siem-operations

Installed? Explore more Pesquisa e Análise de Dados skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

SIEM operations

Rules

  • Change configuration in the working tree and test it on a disposable instance. Every change to a production SIEM (settings, templates, pipelines, lifecycle and snapshot policies, repositories, roles, restarts, upgrades) is a reviewed change the orchestrator applies, with verification and rollback.
  • Never delete indices, data streams, documents, snapshots, repositories, or log files; never shorten retention, detach a lifecycle policy, or disable a log source, agent, or audit log. A reduction goes to the control owner as a decision with options (non-negotiable N7 in change-security-review).
  • Read production through read-only credentials the orchestrator provides: health, stats, and _cat APIs; every search has a time window and a size limit (log-analysis).
  • Retention comes from a documented requirement with its owner (data-retention, regulatory-mapping); never invent a period. CIS Controls v8.1 safeguard 8.10, "Retain audit logs across enterprise assets for a minimum of 90 days" (cisecurity.org, Controls Navigator v8.1, accessed 2026-11-28), is a floor, not a requirement. The cloud audit-log archive and its immutability belong to logging-architecture; state which copy (SIEM hot store, snapshot, archive) meets which requirement.
  • Snapshots are the backup. "You cannot back up an Elasticsearch cluster by making copies of the data directories of its nodes" (elastic.co/docs, Snapshot and restore, accessed 2026-11-28). A snapshot is proven only by a timed restore drill (backup-restore).
  • No downgrade. Elasticsearch: "After you start to upgrade your Elasticsearch cluster, you cannot downgrade any of its nodes"; rollback is a restore of the snapshot taken before the upgrade (elastic.co/docs, Prepare to upgrade, accessed 2026-11-28). OpenSearch nodes cannot be downgraded either (docs.opensearch.org, Rolling upgrade, accessed 2026-11-28).
  • Monitor the platform from outside itself: a SIEM that is down cannot raise its own alert.

Health and capacity

CheckCommand (Elasticsearch, OpenSearch, Wazuh indexer)Threshold and sourceFirst action
Cluster statusGET _cluster/healthGreen; yellow = replicas unassigned; red = primaries unassignedGET _cluster/allocation/explain
DiskGET _cat/allocation?vDefaults low 85 %, high 90 %, flood stage 95 %; at flood stage every index with a shard on the node gets index.blocks.read_only_allow_delete, lifted when usage drops below high (Elasticsearch and OpenSearch cluster settings docs, accessed 2026-11-28)Capacity change; never delete data to free space
Single data nodecluster.routing.allocation.disk.watermark.enable_for_single_data_node (OpenSearch, static, default false)Watermark checks are off on single-data-node clusters by default (docs.opensearch.org, accessed 2026-11-28)Alert on disk usage independently of watermarks
Shard sizeGET _cat/shards?v&h=index,shard,prirep,store,docs&s=store:descGuidance: 10–50 GB and fewer than 200 million documents per shard (elastic.co/docs, Size your shards, accessed 2026-11-28)Adjust rollover size or age in the template
Shard countGET _cluster/health (active_shards), GET _cat/nodes?vElasticsearch prevents more than 1,000 non-frozen shards per node; fewer than 3,000 indices per GB of heap on master nodes (same source)Fewer, larger indices; never raise the limit to hide oversharding
Heap and pressureGET _nodes/stats/jvm,breakerSustained old-generation pressure, circuit-breaker tripsSize with system-sizing
IngestGET _nodes/stats/ingestPipeline failures per interval above baselineParser fix (log-source-onboarding)

Size storage as daily volume × (1 + replicas) × retention days × index overhead, measured on a sample, with headroom for the high watermark and for losing one node (system-sizing).

Retention and lifecycle

Log classRequirement (source, owner)Hot searchableLater tiersSnapshot or archive copyDelete triggerLegal hold
  • Elasticsearch ILM phases: hot, warm, cold, frozen, delete; the delete action "Permanently removes the index"; min_age counts from rollover; wait_for_snapshot holds deletion until an SLM policy has run (elastic.co/docs, Index lifecycle, accessed 2026-11-28).
  • OpenSearch and the Wazuh indexer use Index State Management: "An ism_template applies only to indexes created after it"; existing indices need the policy applied explicitly; the job runs every 5 minutes by default (docs.opensearch.org, ISM, accessed 2026-11-28). Wazuh's example deletes wazuh-alerts-* at min_index_age 90d only as an example (documentation.wazuh.com, Index life management, accessed 2026-11-28).
  • Lengthening retention needs a capacity check; shortening it, an earlier delete phase, or a detached policy is a reviewed change with the record owner's decision. A legal hold overrides every delete phase for the indices it covers.

Snapshot and restore

  • Repository off the cluster (object storage), in another account or with delete rights outside the SIEM administrators, encrypted, immutable where the requirement demands it.
  • Register one repository bucket for writing on one cluster only; every other cluster registers it with readonly: true, otherwise the repository can be corrupted (elastic.co/docs, Create or update a snapshot repository API, accessed 2026-11-28).
  • Schedule with Elasticsearch SLM or OpenSearch Snapshot Management (_plugins/_sm/policies; deletion conditions max_age, max_count, min_count; docs.opensearch.org, accessed 2026-11-28). Snapshots are deduplicated by segment; deleting one removes only segments no other snapshot uses.
  • Restore only to the same or a newer version. Indexed data alone does not rebuild the platform: Wazuh's migration guide lists manager files such as ossec.conf, local_rules.xml, local_decoder.xml, client.keys, and authd.pass (documentation.wazuh.com, accessed 2026-11-28); keys and passwords among them are secrets, backed up by the owner and never read.
  • Drill on a disposable cluster with restricted access: restore with rename_pattern, time each phase, verify document counts per index against counts recorded at snapshot time, newest @timestamp, mappings, lifecycle attachment, and security configuration; record achieved RPO and RTO; dispose of the copy through the owner. Restores on real clusters are runbooks (runbook-writing).

Upgrades

  1. Path. Read release notes and breaking changes for every version crossed. Elasticsearch 8.x to 9.x requires 8.19.x first; OpenSearch 3.x requires 2.19.0, one major version at a time; the Wazuh manager must be the same version as or newer than its agents (vendor upgrade guides, accessed 2026-11-28).
  2. Rehearse on a disposable clone restored from snapshot, with the deprecation log or Upgrade Assistant output reviewed.
  3. Snapshot and verify it immediately before the window; back up configuration files.
  4. Rolling order: health green, cluster.routing.allocation.enable: primaries, flush, one node at a time, data nodes first and cluster-manager-eligible nodes last, allocation back to all, green before the next node. Wazuh: indexer, then server (master node first), then dashboard, then agents.
  5. Rollback: fresh install of the previous version plus restore of the pre-upgrade snapshot; state the events lost after the snapshot and how agent or queue buffers cover them.

Ingestion lag and drops

  • Lag per source from ECS timestamps: @timestamp (event occurred), event.created (agent first read it), event.ingested (arrived in the store); in normal conditions @timestamp < event.created < event.ingested (elastic.co/docs/reference/ecs, ECS 9.5.0, accessed 2026-11-28). Track p50, p95, and max per source; a reversed order means clock skew or tampering. Feed p95 to the rule lookback in detection-rule-authoring and the Latency column in detection-coverage-mapping.
  • Wazuh agent buffer (client_buffer defaults queue_size 5000, events_per_second 500): rule 202 at the 90 % warning level, 203 when full and new events are dropped, 204 flooding, 205 back to normal at 70 % (documentation.wazuh.com, anti-flooding, accessed 2026-11-28). Treat 203 and 204 as data loss.
  • Elasticsearch failure store (8.19 and 9.1; on by default for new logs-*-* data streams from 9.2) keeps documents that failed a pipeline or mapping, read with GET <data-stream>::failures/_search; pipeline failures keep the original source, so data a pipeline would redact stays visible there (elastic.co/docs, Failure store, accessed 2026-11-28). Restrict access to it like raw logs.
  • Volume per source per interval against a same-hours baseline band; a drop is a finding until explained.

Tamper protection and access separation

RoleMayMust not
Agent or collector identityWrite to its own indices or data streamsRead, delete, or change settings, templates, or policies
Analyst and detection engineerSearch; write alerts and casesChange lifecycle, pipelines, roles, or audit settings
Platform administratorChange configuration through reviewed codeDelete within retention; disable the audit log; act without a logged reason
Snapshot repository ownerManage repository storage and keysBe the same identity as the SIEM administrator
  • Enable the platform audit log and ship it to a store the SIEM administrators cannot delete: Elasticsearch xpack.security.audit.enabled (off by default, subscription-dependent, dynamic from 9.5), with emit_request_body kept false (ESA-2025-18: with it on and authentication_success audited, reindex requests put sensitive data in audit logs; discuss.elastic.co); OpenSearch plugins.security.audit.type (elastic.co/docs and docs.opensearch.org, accessed 2026-11-28).
  • Name the tamper events for the detection engineer: index, data stream, or snapshot deletion; lifecycle, pipeline, template, or repository change; role, user, or API key change; audit logging disabled; agent stopped, uninstalled, or reconfigured. Agent uninstall protection where available (Elastic Agent tamper protection uses per-policy uninstall tokens, which are secrets).

Self-monitoring

  • Heartbeat per source and per agent: newest event time against the expected interval. Wazuh agents check in every notify_time (default 20 s) and are marked disconnected after agents_disconnection_time (default 15m) (documentation.wazuh.com, accessed 2026-11-28).
  • A synthetic canary event per collection path at a fixed interval, searched for end to end; missing after interval + lag target means the path is broken.
  • An external dead man's switch for the platform and its alert path (alert-routing delivery checks).
  • Also watch: snapshot success and age of the last good snapshot, lifecycle errors, certificate expiry, license expiry, and disk trend.

Procedure

  1. Requirements. Sources, volumes, retention per log class with owner, RPO and RTO, residency, access roles.
  2. Inventory the cluster read-only: version, nodes and roles, indices and shards, lifecycle and snapshot policies, repositories, roles, audit settings, monitoring.
  3. Assess with the tables above; each gap gets a severity and fix, decisions get options and one Recommendation.
  4. Change templates, policies, pipelines, and monitoring as code; test on a disposable single-node or small cluster.
  5. Hand over each change with files and SHA-256, test output, verification, rollback, and change window; snapshot restores and upgrades as runbooks.

Output

AreaCurrent (evidence, time (local, UTC))Target or requirement (source)GapSeverityChange (files, SHA-256)VerificationRollback

Then the retention table, the last drill result (achieved RPO and RTO, date), the lag and drop table per source, and the self-monitoring checks with their alert routes.

Quality checklist

  • Every retention period cites a requirement and owner; no change shortens retention or deletes data.
  • Disk, shard, and heap figures come from live output with date, against stated thresholds and sources.
  • The last restore drill is dated and timed; snapshots without one are reported unproven.
  • Upgrade plans name the version path, component order, pre-upgrade snapshot, and rollback by restore.
  • Lag, drops, and silence are monitored per source, from outside the platform.
  • Audit logging is on and writers, analysts, administrators, and repository owners are separated.

Pitfalls

  • Freeing disk at flood stage by deleting indices, destroying evidence within retention, instead of adding capacity or moving shards.
  • Treating snapshots as proven because SLM reports success, while no restore has ever been timed.
  • An ISM template added for retention that never touches the indices that already exist.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

Habilidades Relacionadas