| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright 2026 Red Hat Inc. |
| 5 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
|
| 8 |
DOCUMENTATION = """ |
| 9 |
--- |
| 10 |
module: splunk_response_plan_execution_info |
| 11 |
short_description: Gather information about applied response plans on an investigation |
| 12 |
description: |
| 13 |
- This module retrieves information about response plans applied to a Splunk Enterprise Security investigation. |
| 14 |
- Returns the complete structure of applied response plans including phases and task statuses. |
| 15 |
- Use this module to query the current state of response plan execution without making changes. |
| 16 |
version_added: "5.1.0" |
| 17 |
options: |
| 18 |
investigation_ref_id: |
| 19 |
description: |
| 20 |
- The investigation UUID to query for applied response plans. |
| 21 |
- This is the unique identifier of the investigation (incident). |
| 22 |
type: str |
| 23 |
required: true |
| 24 |
api_namespace: |
| 25 |
description: |
| 26 |
- The namespace portion of the Splunk API path. |
| 27 |
- Override this if your environment uses a different namespace. |
| 28 |
type: str |
| 29 |
default: servicesNS |
| 30 |
api_user: |
| 31 |
description: |
| 32 |
- The user portion of the Splunk API path. |
| 33 |
- Override this if your environment requires a different user context. |
| 34 |
type: str |
| 35 |
default: nobody |
| 36 |
api_app: |
| 37 |
description: |
| 38 |
- The app portion of the Splunk API path. |
| 39 |
- Override this if your environment uses a different app name. |
| 40 |
type: str |
| 41 |
default: missioncontrol |
| 42 |
|
| 43 |
author: Ron Gershburg (@rgershbu) |
| 44 |
""" |
| 45 |
|
| 46 |
EXAMPLES = """ |
| 47 |
- name: Get applied response plans for an investigation |
| 48 |
splunk.es.splunk_response_plan_execution_info: |
| 49 |
investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1" |
| 50 |
register: result |
| 51 |
|
| 52 |
- name: Display applied response plans |
| 53 |
debug: |
| 54 |
var: result.applied_response_plans |
| 55 |
|
| 56 |
- name: Query with custom API path |
| 57 |
splunk.es.splunk_response_plan_execution_info: |
| 58 |
investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1" |
| 59 |
api_namespace: "{{ es_namespace | default('servicesNS') }}" |
| 60 |
api_user: "{{ es_user | default('nobody') }}" |
| 61 |
api_app: "{{ es_app | default('missioncontrol') }}" |
| 62 |
register: custom_result |
| 63 |
""" |
| 64 |
|
| 65 |
RETURN = """ |
| 66 |
applied_response_plans: |
| 67 |
description: List of response plans applied to the investigation |
| 68 |
returned: always |
| 69 |
type: list |
| 70 |
elements: dict |
| 71 |
contains: |
| 72 |
id: |
| 73 |
description: The unique ID of the applied response plan instance |
| 74 |
type: str |
| 75 |
name: |
| 76 |
description: Name of the response plan |
| 77 |
type: str |
| 78 |
description: |
| 79 |
description: Description of the response plan |
| 80 |
type: str |
| 81 |
source_template_id: |
| 82 |
description: The ID of the response plan template this was created from |
| 83 |
type: str |
| 84 |
phases: |
| 85 |
description: List of phases in the applied response plan |
| 86 |
type: list |
| 87 |
elements: dict |
| 88 |
contains: |
| 89 |
id: |
| 90 |
description: The unique ID of the phase |
| 91 |
type: str |
| 92 |
name: |
| 93 |
description: Name of the phase |
| 94 |
type: str |
| 95 |
tasks: |
| 96 |
description: List of tasks in the phase |
| 97 |
type: list |
| 98 |
elements: dict |
| 99 |
contains: |
| 100 |
id: |
| 101 |
description: The unique ID of the task |
| 102 |
type: str |
| 103 |
name: |
| 104 |
description: Name of the task |
| 105 |
type: str |
| 106 |
description: |
| 107 |
description: Description of the task |
| 108 |
type: str |
| 109 |
status: |
| 110 |
description: > |
| 111 |
Current status of the task. |
| 112 |
Values are C(pending), C(started), or C(ended). |
| 113 |
type: str |
| 114 |
owner: |
| 115 |
description: > |
| 116 |
Owner/assignee of the task. |
| 117 |
Use C(admin) for the administrator user. |
| 118 |
Use C(unassigned) when no owner is assigned. |
| 119 |
type: str |
| 120 |
is_note_required: |
| 121 |
description: Whether a note is required when completing the task |
| 122 |
type: bool |
| 123 |
sample: |
| 124 |
- id: "b9e54dd3-d99c-4a17-bfde-17321d973511" |
| 125 |
name: "Incident Response Plan" |
| 126 |
description: "Standard incident response procedure" |
| 127 |
source_template_id: "77b3888b-a25e-4def-89fa-071fdcc10e47" |
| 128 |
phases: |
| 129 |
- id: "1ad365e7-ae1e-4023-99c1-eb58dd11b250" |
| 130 |
name: "Investigation Phase" |
| 131 |
tasks: |
| 132 |
- id: "3226b3dc-a31b-4987-b76c-3cdb32135f37" |
| 133 |
name: "Initial Triage" |
| 134 |
description: "Perform initial assessment" |
| 135 |
status: "started" |
| 136 |
owner: "admin" |
| 137 |
is_note_required: false |
| 138 |
- id: "2c73e6c5-35ec-454a-bba0-aa12a3297d56" |
| 139 |
name: "Gather Evidence" |
| 140 |
description: "Collect relevant logs" |
| 141 |
status: "pending" |
| 142 |
owner: "unassigned" |
| 143 |
is_note_required: false |
| 144 |
changed: |
| 145 |
description: Always returns false as this is an info module |
| 146 |
returned: always |
| 147 |
type: bool |
| 148 |
sample: false |
| 149 |
""" |