Debian Codegraph @

ansible_collections/splunk/es/docs/splunk.es.splunk_notes_module.rst

raw
1 .. _splunk.es.splunk_notes_module:
2
3
4 **********************
5 splunk.es.splunk_notes
6 **********************
7
8 **Manage notes for findings, investigations, and response plan tasks**
9
10
11 Version added: 5.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module allows for creation, update, and deletion of notes in Splunk Enterprise Security.
21 - Notes can be created for findings, investigations, or response plan tasks.
22 - Use ``target_type`` to specify where the note should be attached.
23 - When ``state=present`` without ``note_id``, a new note is created.
24 - When ``state=present`` with ``note_id``, the existing note is updated.
25 - When ``state=absent`` with ``note_id``, the note is deleted.
26 - Note creation (without ``note_id``) is **NOT idempotent**. Each call creates a new note, even if the content is identical. This is by design, as notes are meant to be additive and multiple notes with the same content may be intentional.
27 - Note updates (with ``note_id``) **ARE idempotent**. The module compares the existing note's content with the desired state and only updates if there are differences.
28
29
30
31
32 Parameters
33 ----------
34
35 .. raw:: html
36
37 <table border=0 cellpadding=0 class="documentation-table">
38 <tr>
39 <th colspan="1">Parameter</th>
40 <th>Choices/<font color="blue">Defaults</font></th>
41 <th width="100%">Comments</th>
42 </tr>
43 <tr>
44 <td colspan="1">
45 <div class="ansibleOptionAnchor" id="parameter-"></div>
46 <b>api_app</b>
47 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
48 <div style="font-size: small">
49 <span style="color: purple">string</span>
50 </div>
51 </td>
52 <td>
53 <b>Default:</b><br/><div style="color: blue">"missioncontrol"</div>
54 </td>
55 <td>
56 <div>The app portion of the Splunk API path.</div>
57 <div>Override this if your environment uses a different app name.</div>
58 </td>
59 </tr>
60 <tr>
61 <td colspan="1">
62 <div class="ansibleOptionAnchor" id="parameter-"></div>
63 <b>api_namespace</b>
64 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
65 <div style="font-size: small">
66 <span style="color: purple">string</span>
67 </div>
68 </td>
69 <td>
70 <b>Default:</b><br/><div style="color: blue">"servicesNS"</div>
71 </td>
72 <td>
73 <div>The namespace portion of the Splunk API path.</div>
74 <div>Override this if your environment uses a different namespace.</div>
75 </td>
76 </tr>
77 <tr>
78 <td colspan="1">
79 <div class="ansibleOptionAnchor" id="parameter-"></div>
80 <b>api_user</b>
81 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
82 <div style="font-size: small">
83 <span style="color: purple">string</span>
84 </div>
85 </td>
86 <td>
87 <b>Default:</b><br/><div style="color: blue">"nobody"</div>
88 </td>
89 <td>
90 <div>The user portion of the Splunk API path.</div>
91 <div>Override this if your environment requires a different user context.</div>
92 </td>
93 </tr>
94 <tr>
95 <td colspan="1">
96 <div class="ansibleOptionAnchor" id="parameter-"></div>
97 <b>content</b>
98 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
99 <div style="font-size: small">
100 <span style="color: purple">string</span>
101 </div>
102 </td>
103 <td>
104 </td>
105 <td>
106 <div>The content/body of the note.</div>
107 <div>Required when <code>state=present</code> (creating or updating a note).</div>
108 </td>
109 </tr>
110 <tr>
111 <td colspan="1">
112 <div class="ansibleOptionAnchor" id="parameter-"></div>
113 <b>finding_ref_id</b>
114 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
115 <div style="font-size: small">
116 <span style="color: purple">string</span>
117 </div>
118 </td>
119 <td>
120 </td>
121 <td>
122 <div>The reference ID of the finding to attach the note to.</div>
123 <div>Required when <code>target_type=finding</code>.</div>
124 <div>Format is typically <code>uuid@@notable@@time{timestamp}</code>.</div>
125 </td>
126 </tr>
127 <tr>
128 <td colspan="1">
129 <div class="ansibleOptionAnchor" id="parameter-"></div>
130 <b>investigation_ref_id</b>
131 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
132 <div style="font-size: small">
133 <span style="color: purple">string</span>
134 </div>
135 </td>
136 <td>
137 </td>
138 <td>
139 <div>The investigation UUID.</div>
140 <div>Required when <code>target_type=investigation</code> or <code>target_type=response_plan_task</code>.</div>
141 </td>
142 </tr>
143 <tr>
144 <td colspan="1">
145 <div class="ansibleOptionAnchor" id="parameter-"></div>
146 <b>note_id</b>
147 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
148 <div style="font-size: small">
149 <span style="color: purple">string</span>
150 </div>
151 </td>
152 <td>
153 </td>
154 <td>
155 <div>The ID of an existing note.</div>
156 <div>Required when updating or deleting a note.</div>
157 <div>When <code>state=present</code> and <code>note_id</code> is provided, the note is updated.</div>
158 <div>When <code>state=absent</code>, <code>note_id</code> is required to identify the note to delete.</div>
159 </td>
160 </tr>
161 <tr>
162 <td colspan="1">
163 <div class="ansibleOptionAnchor" id="parameter-"></div>
164 <b>phase_id</b>
165 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
166 <div style="font-size: small">
167 <span style="color: purple">string</span>
168 </div>
169 </td>
170 <td>
171 </td>
172 <td>
173 <div>The ID of the phase containing the task.</div>
174 <div>Required when <code>target_type=response_plan_task</code>.</div>
175 </td>
176 </tr>
177 <tr>
178 <td colspan="1">
179 <div class="ansibleOptionAnchor" id="parameter-"></div>
180 <b>response_plan_id</b>
181 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
182 <div style="font-size: small">
183 <span style="color: purple">string</span>
184 </div>
185 </td>
186 <td>
187 </td>
188 <td>
189 <div>The ID of the applied response plan.</div>
190 <div>Required when <code>target_type=response_plan_task</code>.</div>
191 </td>
192 </tr>
193 <tr>
194 <td colspan="1">
195 <div class="ansibleOptionAnchor" id="parameter-"></div>
196 <b>state</b>
197 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
198 <div style="font-size: small">
199 <span style="color: purple">string</span>
200 </div>
201 </td>
202 <td>
203 <ul style="margin: 0; padding: 0"><b>Choices:</b>
204 <li><div style="color: blue"><b>present</b>&nbsp;&larr;</div></li>
205 <li>absent</li>
206 </ul>
207 </td>
208 <td>
209 <div>The desired state of the note.</div>
210 <div>Use <code>present</code> to create or update a note.</div>
211 <div>Use <code>absent</code> to delete a note (requires <code>note_id</code>).</div>
212 </td>
213 </tr>
214 <tr>
215 <td colspan="1">
216 <div class="ansibleOptionAnchor" id="parameter-"></div>
217 <b>target_type</b>
218 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
219 <div style="font-size: small">
220 <span style="color: purple">string</span>
221 / <span style="color: red">required</span>
222 </div>
223 </td>
224 <td>
225 <ul style="margin: 0; padding: 0"><b>Choices:</b>
226 <li>finding</li>
227 <li>investigation</li>
228 <li>response_plan_task</li>
229 </ul>
230 </td>
231 <td>
232 <div>The type of object to attach the note to.</div>
233 <div>Use <code>finding</code> to attach a note to a security finding.</div>
234 <div>Use <code>investigation</code> to attach a note to an investigation.</div>
235 <div>Use <code>response_plan_task</code> to attach a note to a task within an applied response plan.</div>
236 </td>
237 </tr>
238 <tr>
239 <td colspan="1">
240 <div class="ansibleOptionAnchor" id="parameter-"></div>
241 <b>task_id</b>
242 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
243 <div style="font-size: small">
244 <span style="color: purple">string</span>
245 </div>
246 </td>
247 <td>
248 </td>
249 <td>
250 <div>The ID of the task to attach the note to.</div>
251 <div>Required when <code>target_type=response_plan_task</code>.</div>
252 </td>
253 </tr>
254 </table>
255 <br/>
256
257
258
259
260 Examples
261 --------
262
263 .. code-block:: yaml
264
265 # Create a note on a finding
266 - name: Add note to a finding
267 splunk.es.splunk_notes:
268 target_type: finding
269 finding_ref_id: "2008e99d-af14-4fec-89da-b9b17a81820a@@notable@@time1768225865"
270 content: "Initial investigation shows suspicious activity from external IP."
271
272 # Create a note on an investigation
273 - name: Add note to an investigation
274 splunk.es.splunk_notes:
275 target_type: investigation
276 investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1"
277 content: "Escalating to security team for further analysis."
278
279 # Create a note on a response plan task
280 - name: Add note to a response plan task
281 splunk.es.splunk_notes:
282 target_type: response_plan_task
283 investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1"
284 response_plan_id: "b9ef7dce-6dcd-4900-b5d5-982fc194554a"
285 phase_id: "phase-001"
286 task_id: "task-001"
287 content: "Completed isolation of affected systems."
288
289 # Update an existing note
290 - name: Update a note on a finding
291 splunk.es.splunk_notes:
292 target_type: finding
293 finding_ref_id: "2008e99d-af14-4fec-89da-b9b17a81820a@@notable@@time1768225865"
294 note_id: "note-abc123"
295 content: "Updated analysis: confirmed malicious activity."
296
297 # Delete a note from an investigation
298 - name: Delete a note from an investigation
299 splunk.es.splunk_notes:
300 target_type: investigation
301 investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1"
302 note_id: "note-abc123"
303 state: absent
304
305 # Create note with custom API configuration
306 - name: Add note with custom API path
307 splunk.es.splunk_notes:
308 target_type: investigation
309 investigation_ref_id: "590afa9c-23d5-4377-b909-cd2cfa1bc0f1"
310 content: "Note content here"
311 api_namespace: "{{ es_namespace | default('servicesNS') }}"
312 api_user: "{{ es_user | default('nobody') }}"
313 api_app: "{{ es_app | default('missioncontrol') }}"
314
315
316
317 Return Values
318 -------------
319 Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
320
321 .. raw:: html
322
323 <table border=0 cellpadding=0 class="documentation-table">
324 <tr>
325 <th colspan="3">Key</th>
326 <th>Returned</th>
327 <th width="100%">Description</th>
328 </tr>
329 <tr>
330 <td colspan="3">
331 <div class="ansibleOptionAnchor" id="return-"></div>
332 <b>changed</b>
333 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
334 <div style="font-size: small">
335 <span style="color: purple">boolean</span>
336 </div>
337 </td>
338 <td>always</td>
339 <td>
340 <div>Whether any changes were made.</div>
341 <br/>
342 <div style="font-size: smaller"><b>Sample:</b></div>
343 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">True</div>
344 </td>
345 </tr>
346 <tr>
347 <td colspan="3">
348 <div class="ansibleOptionAnchor" id="return-"></div>
349 <b>msg</b>
350 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
351 <div style="font-size: small">
352 <span style="color: purple">string</span>
353 </div>
354 </td>
355 <td>always</td>
356 <td>
357 <div>Message describing the result.</div>
358 <br/>
359 <div style="font-size: smaller"><b>Sample:</b></div>
360 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">Note created successfully</div>
361 </td>
362 </tr>
363 <tr>
364 <td colspan="3">
365 <div class="ansibleOptionAnchor" id="return-"></div>
366 <b>note</b>
367 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
368 <div style="font-size: small">
369 <span style="color: purple">dictionary</span>
370 </div>
371 </td>
372 <td>always</td>
373 <td>
374 <div>The note result containing before/after states.</div>
375 <br/>
376 <div style="font-size: smaller"><b>Sample:</b></div>
377 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{&#x27;before&#x27;: None, &#x27;after&#x27;: {&#x27;note_id&#x27;: &#x27;note-abc123&#x27;, &#x27;content&#x27;: &#x27;Investigation shows suspicious activity.&#x27;}}</div>
378 </td>
379 </tr>
380 <tr>
381 <td class="elbow-placeholder">&nbsp;</td>
382 <td colspan="2">
383 <div class="ansibleOptionAnchor" id="return-"></div>
384 <b>after</b>
385 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
386 <div style="font-size: small">
387 <span style="color: purple">dictionary</span>
388 </div>
389 </td>
390 <td>when state is present</td>
391 <td>
392 <div>The note state after module execution.</div>
393 <br/>
394 </td>
395 </tr>
396 <tr>
397 <td class="elbow-placeholder">&nbsp;</td>
398 <td class="elbow-placeholder">&nbsp;</td>
399 <td colspan="1">
400 <div class="ansibleOptionAnchor" id="return-"></div>
401 <b>content</b>
402 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
403 <div style="font-size: small">
404 <span style="color: purple">string</span>
405 </div>
406 </td>
407 <td></td>
408 <td>
409 <div>The content of the note.</div>
410 <br/>
411 </td>
412 </tr>
413 <tr>
414 <td class="elbow-placeholder">&nbsp;</td>
415 <td class="elbow-placeholder">&nbsp;</td>
416 <td colspan="1">
417 <div class="ansibleOptionAnchor" id="return-"></div>
418 <b>note_id</b>
419 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
420 <div style="font-size: small">
421 <span style="color: purple">string</span>
422 </div>
423 </td>
424 <td></td>
425 <td>
426 <div>The unique identifier of the note.</div>
427 <br/>
428 </td>
429 </tr>
430
431 <tr>
432 <td class="elbow-placeholder">&nbsp;</td>
433 <td colspan="2">
434 <div class="ansibleOptionAnchor" id="return-"></div>
435 <b>before</b>
436 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
437 <div style="font-size: small">
438 <span style="color: purple">dictionary</span>
439 </div>
440 </td>
441 <td>when note existed (update/delete operations)</td>
442 <td>
443 <div>The note state before module execution (if existed).</div>
444 <br/>
445 </td>
446 </tr>
447
448 </table>
449 <br/><br/>
450
451
452 Status
453 ------
454
455
456 Authors
457 ~~~~~~~
458
459 - Ron Gershburg (@rgershbu)