.. _splunk.es.splunk_response_plan_module: ****************************** splunk.es.splunk_response_plan ****************************** **Manage Splunk Enterprise Security response plans** Version added: 5.1.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module allows for creation, update, and deletion of Splunk Enterprise Security response plans (response templates). - Response plan names are unique in Splunk ES, so ``name`` is used as the identifier. - When ``state=present``, the module creates or updates the response plan. - When ``state=absent``, the module deletes the response plan. - Phases and tasks are matched by name for updates - existing IDs are preserved for items with matching names, and new IDs are generated for new items. - **IMPORTANT - Declarative Approach:** This module uses a declarative approach where the playbook defines the complete desired state. Whatever you define is exactly what will exist after the module runs. Any existing phases, tasks, or searches that are NOT included in your playbook will be REMOVED. This is not a merge operation - it is a full replacement of the response plan structure. - For example, if a response plan has phases A, B, C and you only define phase A in your playbook, phases B and C will be deleted. The same applies to tasks within phases and searches within tasks. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
api_app
string
Default:
"missioncontrol"
The app portion of the Splunk API path for the response templates endpoint.
Override this if your environment uses a different app name.
api_namespace
string
Default:
"servicesNS"
The namespace portion of the Splunk API path.
Override this if your environment uses a different namespace.
api_user
string
Default:
"nobody"
The user portion of the Splunk API path.
Override this if your environment requires a different user context.
description
string
The description of the response plan.
name
string / required
The name of the response plan.
This is the unique identifier and is always required.
Used to look up existing response plans for update or delete operations.
phases
list / elements=dictionary
List of phases in the response plan.
Required when state=present.
Phases are matched by name for updates.
Note: Only phases defined here will exist after update. Any existing phases not included in this list will be removed from the response plan.
name
string / required
The name of the phase.
Used as identifier for matching during updates.
tasks
list / elements=dictionary
List of tasks in the phase.
Tasks are matched by name within their parent phase for updates.
Note: Only tasks defined here will exist in the phase after update. Any existing tasks not included in this list will be removed.
description
string
The description of the task.
is_note_required
boolean
    Choices:
  • no ←
  • yes
Whether a note is required when completing the task.
name
string / required
The name of the task.
Used as identifier for matching during updates.
owner
string
Default:
"unassigned"
The owner of the task.
Use admin for the administrator user.
Use unassigned to leave the task unassigned.
searches
list / elements=dictionary
List of saved searches to attach to the task.
Searches are replaced entirely on update (not merged).
description
string
The description of the search.
name
string / required
The name of the search.
spl
string / required
The SPL (Search Processing Language) query.
state
string
    Choices:
  • present ←
  • absent
The desired state of the response plan.
Use present to create or update the response plan.
Use absent to delete the response plan.
template_status
string
    Choices:
  • published
  • draft ←
The status of the response plan template.
Use draft for work-in-progress plans.
Use published for plans ready for use.

Examples -------- .. code-block:: yaml # Create a new response plan with phases and tasks - name: Create incident response plan splunk.es.splunk_response_plan: name: "Incident Response Plan" description: "Standard incident response procedure" template_status: published phases: - name: "Investigation" tasks: - name: "Initial Triage" description: "Perform initial assessment of the incident" is_note_required: true owner: admin searches: - name: "Access Over Time" description: "Check access patterns" spl: "| tstats count from datamodel=Authentication by _time span=10m" - name: "Gather Evidence" description: "Collect relevant logs and artifacts" is_note_required: false - name: "Containment" tasks: - name: "Isolate Affected Systems" description: "Isolate compromised hosts from network" is_note_required: true # Create a draft response plan - name: Create draft response plan splunk.es.splunk_response_plan: name: "New Response Workflow" description: "Work in progress response plan" template_status: draft phases: - name: "Phase 1" tasks: - name: "Task 1" description: "First task" # Update an existing response plan (adds new task, updates existing) - name: Update response plan splunk.es.splunk_response_plan: name: "Incident Response Plan" description: "Updated incident response procedure" template_status: published phases: - name: "Investigation" tasks: - name: "Initial Triage" description: "Updated: Perform thorough initial assessment" is_note_required: true - name: "New Analysis Task" description: "This task will be created" is_note_required: false - name: "Containment" tasks: - name: "Isolate Affected Systems" description: "Isolate compromised hosts from network" # Delete a response plan by name - name: Delete response plan splunk.es.splunk_response_plan: name: "Incident Response Plan" state: absent # Example: Declarative update - removes phases/tasks not defined # If the response plan currently has phases "Investigation", "Containment", "Recovery" # but this playbook only defines "Investigation" and "Containment", then the # "Recovery" phase will be DELETED. Same applies to tasks within phases. - name: Update response plan (removes Recovery phase if it existed) splunk.es.splunk_response_plan: name: "Incident Response Plan" description: "Updated procedure - Recovery phase removed" template_status: published phases: - name: "Investigation" tasks: - name: "Initial Triage" description: "Perform initial assessment" - name: "Containment" tasks: - name: "Isolate Systems" description: "Isolate affected systems" # Create response plan with custom API path (for non-standard environments) - name: Create response plan with custom API path splunk.es.splunk_response_plan: name: "Custom Response Plan" description: "Response plan with custom API configuration" template_status: published api_namespace: "{{ es_namespace | default('servicesNS') }}" api_user: "{{ es_user | default('nobody') }}" api_app: "{{ es_app | default('missioncontrol') }}" phases: - name: "Phase 1" tasks: - name: "Task 1" description: "First task" Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
changed
boolean
always
Whether any changes were made.

Sample:
True
msg
string
always
Message describing the result.

Sample:
Response plan created successfully
response_plan
dictionary
always
The response plan result containing before/after states.

Sample:
{'before': None, 'after': {'name': 'Incident Response Plan', 'description': 'Standard incident response procedure', 'template_status': 'published', 'phases': [{'name': 'Investigation', 'tasks': [{'name': 'Initial Triage', 'description': 'Perform initial assessment', 'is_note_required': True, 'owner': 'admin', 'searches': [{'name': 'Access Over Time', 'description': 'Check access patterns', 'spl': '| tstats count from datamodel=Authentication'}]}]}]}}
 
after
dictionary
always
The response plan state after module execution (null if deleted).

 
before
dictionary
when response plan existed
The response plan state before module execution (null if creating).



Status ------ Authors ~~~~~~~ - Ron Gershburg (@rgershbu)