dcg

Splunk

monitoring.splunk

Protects against destructive Splunk CLI/API operations like index removal and REST API DELETE calls

  • 4blocking rules
  • 3safe patterns
  • 2Critical
  • 2High
~/.config/dcg/config.toml
[packs]
enabled = ["monitoring.splunk"]

Evaluated when a command contains splunk.

Blocking rules

Each rule ID is monitoring.splunk:<name>. Use it in allowlists and [policy.rules].

  1. splunk-clean-eventdata

    Critical

    splunk clean eventdata permanently deletes indexed data.

    Explanation
    Clean eventdata permanently removes all events from the specified index. This cannot be undone. Use this only when you're certain the data is no longer needed. Safer alternatives: - Set retention policies for automatic cleanup - Export data before cleaning - Use splunk search to verify what will be deleted
  2. splunk-remove-index

    Critical

    splunk remove index deletes an index and its data permanently.

    Explanation
    Removing a Splunk index permanently deletes all indexed data within it. Historical logs, events, and metrics are irretrievably lost. Any searches, dashboards, or alerts referencing this index will fail. Safer alternatives: - splunk list index: Review index before removal - Archive the data before deletion - Use retention policies instead of manual deletion
  3. splunk-api-delete

    High

    Splunk REST DELETE calls can permanently remove objects. Verify the endpoint.

    Explanation
    Direct API DELETE calls to Splunk services can remove indexes, saved searches, dashboards, alerts, and other objects without confirmation. Safer alternatives: - GET the resource first to verify the object - Use Splunk CLI or web UI for better feedback - Export configuration before deletion
  4. splunk-delete-user-role

    High

    splunk delete user/role removes access configurations. Verify before deleting.

    Explanation
    Deleting a user removes their access and any saved searches or dashboards owned by them. Deleting a role affects all users assigned to it, potentially breaking access controls. Safer alternatives: - splunk list user/role: Review before deletion - Disable the user instead of deleting - Reassign role capabilities before deletion

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • splunk-list
  • splunk-show
  • splunk-search