splunk.es.splunk_correlation_searches 模块 – Splunk Enterprise Security 相关搜索资源模块

注意

此模块是 splunk.es 集合(版本 4.0.0)的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。 它不包含在 ansible-core 中。 要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install splunk.es

要在 playbook 中使用它,请指定: splunk.es.splunk_correlation_searches

splunk.es 2.1.0 中的新功能

概要

  • 此模块允许创建、删除和修改 Splunk Enterprise Security 相关搜索

  • 已针对 Splunk Enterprise Server v8.2.3 和安装在其上的 Splunk Enterprise Security v7.0.1 进行了测试。

注意

此模块具有相应的 操作插件

参数

参数

注释

config

列表 / 元素=字典

配置系统上的文件和目录监视

annotations

字典

从 Splunk Enterprise Security 或自定义注解中的行业标准网络安全映射中添加上下文

cis20

列表 / 元素=字符串

指定 CIS20 注解

custom

列表 / 元素=字典

指定自定义框架和自定义注解

custom_annotations

列表 / 元素=字符串

指定与自定义框架关联的注解

framework

字符串

指定注解框架

kill_chain_phases

列表 / 元素=字符串

指定 Kill 10 注解

mitre_attack

列表 / 元素=字符串

指定 MITRE ATTACK 注解

nist

列表 / 元素=字符串

指定 NIST 注解

app

字符串

与相关搜索关联的 Splunk 应用程序

默认值: "SplunkEnterpriseSecuritySuite"

cron_schedule

字符串

输入 cron 样式的时间表。

例如 '*/5 * * * ' (每 5 分钟)或 '0 21 * * ' (每天晚上 9 点)。

实时搜索使用 '*/5 * * * ' 的默认时间表。

默认值: "*/5 * * * *"

description

字符串

相关搜索的描述,这将填充 Web 控制台的描述字段

disabled

布尔值

禁用相关搜索

选项

  • false ←(默认)

  • true

name

字符串 / 必需

相关搜索的名称

schedule_priority

字符串

提高报告的调度优先级。设置为“更高”以使其优先级高于相同调度模式的其他搜索,或设置为“最高”以使其优先级高于其他搜索,无论模式如何。谨慎使用。

选项

  • "default" ←(默认)

  • "higher"

  • "highest"

schedule_window

字符串

让报告在其计划运行时间打开的窗口内的任何时间运行,以提高在同时计划多个报告时的效率。 “auto” 设置会自动确定报告的最佳窗口宽度。

默认值: "0"

scheduling

字符串

控制调度程序计算计划搜索的下一个执行时间的方式。

了解更多:https://docs.splunk.com/Documentation/Splunk/7.2.3/Report/Configurethepriorityofscheduledreports#Real-time_scheduling_and_continuous_scheduling

选项

  • "realtime" ←(默认)

  • "continuous"

字符串

SPL 搜索字符串

suppress_alerts

布尔值

是否禁止来自此相关搜索的警报

选项

  • false ←(默认)

  • true

throttle_fields_to_group_by

列表 / 元素=字符串

输入要考虑用于匹配节流事件的字段。

throttle_window_duration

字符串

忽略与“按字段分组”中指定的字段值匹配的其他事件的时间。

time_earliest

字符串

使用相对时间修饰符的最早时间。

默认值: "-24h"

time_latest

字符串

使用相对时间修饰符的最新时间。

默认值: "now"

trigger_alert

字符串

值得注意的响应操作和风险响应操作始终为每个结果触发。选择是激活一次触发器还是为每个结果激活触发器。

选项

  • "once" ←(默认)

  • "for each result"

trigger_alert_when

字符串

提高报告的调度优先级。设置为“更高”以使其优先级高于相同调度模式的其他搜索,或设置为“最高”以使其优先级高于其他搜索,无论模式如何。谨慎使用。

选项

  • "number of events" ←(默认)

  • "number of results"

  • "number of hosts"

  • "number of sources"

trigger_alert_when_condition

字符串

要传递给 trigger_alert_when 的条件

选项

  • "greater than" ←(默认)

  • "less than"

  • "equal to"

  • "not equal to"

  • "drops by"

  • "rises by"

trigger_alert_when_value

字符串

传递给 trigger_alert_when 的值

默认值: "10"

ui_dispatch_context

字符串

设置一个应用,用于诸如重要事件中的向下钻取搜索或电子邮件自适应响应操作中的链接。如果为 None,则使用应用程序上下文。

running_config

字符串

默认情况下,该模块将连接到远程设备并检索当前的运行配置,以用作与源内容进行比较的基础。有时,不希望任务在 playbook 中的每个任务都获取当前的运行配置。running_config 参数允许实施者传入配置,以用作比较的基本配置。此选项的值应该是执行命令从设备收到的输出。

state

字符串

配置应保留的状态

选项

  • "merged" ←(默认)

  • "replaced"

  • "deleted"

  • "gathered"

示例

# Using gathered
# --------------

- name: Gather correlation searches config
  splunk.es.splunk_correlation_searches:
    config:
      - name: Ansible Test
      - name: Ansible Test 2
    state: gathered

# RUN output:
# -----------

# "gathered": [
#     {
#       "annotations": {
#           "cis20": [
#               "test1"
#           ],
#           "custom": [
#               {
#                   "custom_annotations": [
#                       "test5"
#                   ],
#                   "framework": "test_framework"
#               }
#           ],
#           "kill_chain_phases": [
#               "test3"
#           ],
#           "mitre_attack": [
#               "test2"
#           ],
#           "nist": [
#               "test4"
#           ]
#       },
#       "app": "DA-ESS-EndpointProtection",
#       "cron_schedule": "*/5 * * * *",
#       "description": "test description",
#       "disabled": false,
#       "name": "Ansible Test",
#       "schedule_priority": "default",
#       "schedule_window": "0",
#       "scheduling": "realtime",
#       "search": '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
#                 'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
#                 'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
#                 'n.src" as "src" | where "count">=6',
#       "suppress_alerts": false,
#       "throttle_fields_to_group_by": [
#           "test_field1"
#       ],
#       "throttle_window_duration": "5s",
#       "time_earliest": "-24h",
#       "time_latest": "now",
#       "trigger_alert": "once",
#       "trigger_alert_when": "number of events",
#       "trigger_alert_when_condition": "greater than",
#       "trigger_alert_when_value": "10",
#       "ui_dispatch_context": "SplunkEnterpriseSecuritySuite"
#     }
# ]

# Using merged
# ------------

- name: Merge and create new correlation searches configuration
  splunk.es.splunk_correlation_searches:
    config:
      - name: Ansible Test
        disabled: false
        description: test description
        app: DA-ESS-EndpointProtection
        annotations:
          cis20:
            - test1
          mitre_attack:
            - test2
          kill_chain_phases:
            - test3
          nist:
            - test4
          custom:
            - framework: test_framework
              custom_annotations:
                - test5
        ui_dispatch_context: SplunkEnterpriseSecuritySuite
        time_earliest: -24h
        time_latest: now
        cron_schedule: "*/5 * * * *"
        scheduling: realtime
        schedule_window: "0"
        schedule_priority: default
        trigger_alert: once
        trigger_alert_when: number of events
        trigger_alert_when_condition: greater than
        trigger_alert_when_value: "10"
        throttle_window_duration: 5s
        throttle_fields_to_group_by:
          - test_field1
        suppress_alerts: false
        search: >
                '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
                'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
                'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
                'n.src" as "src" | where "count">=6'
    state: merged

# RUN output:
# -----------

# "after": [
#     {
#       "annotations": {
#           "cis20": [
#               "test1"
#           ],
#           "custom": [
#               {
#                   "custom_annotations": [
#                       "test5"
#                   ],
#                   "framework": "test_framework"
#               }
#           ],
#           "kill_chain_phases": [
#               "test3"
#           ],
#           "mitre_attack": [
#               "test2"
#           ],
#           "nist": [
#               "test4"
#           ]
#       },
#       "app": "DA-ESS-EndpointProtection",
#       "cron_schedule": "*/5 * * * *",
#       "description": "test description",
#       "disabled": false,
#       "name": "Ansible Test",
#       "schedule_priority": "default",
#       "schedule_window": "0",
#       "scheduling": "realtime",
#       "search": '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
#                 'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
#                 'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
#                 'n.src" as "src" | where "count">=6',
#       "suppress_alerts": false,
#       "throttle_fields_to_group_by": [
#           "test_field1"
#       ],
#       "throttle_window_duration": "5s",
#       "time_earliest": "-24h",
#       "time_latest": "now",
#       "trigger_alert": "once",
#       "trigger_alert_when": "number of events",
#       "trigger_alert_when_condition": "greater than",
#       "trigger_alert_when_value": "10",
#       "ui_dispatch_context": "SplunkEnterpriseSecuritySuite"
#     },
# ],
# "before": [],

# Using replaced
# --------------

- name: Replace existing correlation searches configuration
  splunk.es.splunk_correlation_searches:
    state: replaced
    config:
      - name: Ansible Test
        disabled: false
        description: test description
        app: SplunkEnterpriseSecuritySuite
        annotations:
          cis20:
            - test1
            - test2
          mitre_attack:
            - test3
            - test4
          kill_chain_phases:
            - test5
            - test6
          nist:
            - test7
            - test8
          custom:
            - framework: test_framework2
              custom_annotations:
                - test9
                - test10
        ui_dispatch_context: SplunkEnterpriseSecuritySuite
        time_earliest: -24h
        time_latest: now
        cron_schedule: "*/5 * * * *"
        scheduling: continuous
        schedule_window: auto
        schedule_priority: default
        trigger_alert: once
        trigger_alert_when: number of events
        trigger_alert_when_condition: greater than
        trigger_alert_when_value: 10
        throttle_window_duration: 5s
        throttle_fields_to_group_by:
          - test_field1
          - test_field2
        suppress_alerts: true
        search: >
                '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
                'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
                'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
                'n.src" as "src" | where "count">=6'

# RUN output:
# -----------

# "after": [
#     {
#         "annotations": {
#             "cis20": [
#                 "test1",
#                 "test2"
#             ],
#             "custom": [
#                 {
#                     "custom_annotations": [
#                         "test9",
#                         "test10"
#                     ],
#                     "framework": "test_framework2"
#                 }
#             ],
#             "kill_chain_phases": [
#                 "test5",
#                 "test6"
#             ],
#             "mitre_attack": [
#                 "test3",
#                 "test4"
#             ],
#             "nist": [
#                 "test7",
#                 "test8"
#             ]
#         },
#         "app": "SplunkEnterpriseSecuritySuite",
#         "cron_schedule": "*/5 * * * *",
#         "description": "test description",
#         "disabled": false,
#         "name": "Ansible Test",
#         "schedule_priority": "default",
#         "schedule_window": "auto",
#         "scheduling": "continuous",
#         "search": '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
#                   'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
#                   'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
#                   'n.src" as "src" | where "count">=6',
#         "suppress_alerts": true,
#         "throttle_fields_to_group_by": [
#             "test_field1",
#             "test_field2"
#         ],
#         "throttle_window_duration": "5s",
#         "time_earliest": "-24h",
#         "time_latest": "now",
#         "trigger_alert": "once",
#         "trigger_alert_when": "number of events",
#         "trigger_alert_when_condition": "greater than",
#         "trigger_alert_when_value": "10",
#         "ui_dispatch_context": "SplunkEnterpriseSecuritySuite"
#     }
# ],
# "before": [
#     {
#         "annotations": {
#             "cis20": [
#                 "test1"
#             ],
#             "custom": [
#                 {
#                     "custom_annotations": [
#                         "test5"
#                     ],
#                     "framework": "test_framework"
#                 }
#             ],
#             "kill_chain_phases": [
#                 "test3"
#             ],
#             "mitre_attack": [
#                 "test2"
#             ],
#             "nist": [
#                 "test4"
#             ]
#         },
#         "app": "DA-ESS-EndpointProtection",
#         "cron_schedule": "*/5 * * * *",
#         "description": "test description",
#         "disabled": false,
#         "name": "Ansible Test",
#         "schedule_priority": "default",
#         "schedule_window": "0",
#         "scheduling": "realtime",
#         "search": '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
#                   'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
#                   'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
#                   'n.src" as "src" | where "count">=6',
#         "suppress_alerts": false,
#         "throttle_fields_to_group_by": [
#             "test_field1"
#         ],
#         "throttle_window_duration": "5s",
#         "time_earliest": "-24h",
#         "time_latest": "now",
#         "trigger_alert": "once",
#         "trigger_alert_when": "number of events",
#         "trigger_alert_when_condition": "greater than",
#         "trigger_alert_when_value": "10",
#         "ui_dispatch_context": "SplunkEnterpriseSecuritySuite"
#     }
# ]

# Using deleted
# -------------

- name: Example to delete the corelation search
  splunk.es.splunk_correlation_searches:
    config:
      - name: Ansible Test
    state: deleted

# RUN output:
# -----------

# "after": [],
# "before": [
#     {
#       "annotations": {
#           "cis20": [
#               "test1"
#           ],
#           "custom": [
#               {
#                   "custom_annotations": [
#                       "test5"
#                   ],
#                   "framework": "test_framework"
#               }
#           ],
#           "kill_chain_phases": [
#               "test3"
#           ],
#           "mitre_attack": [
#               "test2"
#           ],
#           "nist": [
#               "test4"
#           ]
#       },
#       "app": "DA-ESS-EndpointProtection",
#       "cron_schedule": "*/5 * * * *",
#       "description": "test description",
#       "disabled": false,
#       "name": "Ansible Test",
#       "schedule_priority": "default",
#       "schedule_window": "0",
#       "scheduling": "realtime",
#       "search": '| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",dc("Authent'
#                 'ication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Fai'
#                 'led_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authenticatio'
#                 'n.src" as "src" | where "count">=6',
#       "suppress_alerts": false,
#       "throttle_fields_to_group_by": [
#           "test_field1"
#       ],
#       "throttle_window_duration": "5s",
#       "time_earliest": "-24h",
#       "time_latest": "now",
#       "trigger_alert": "once",
#       "trigger_alert_when": "number of events",
#       "trigger_alert_when_condition": "greater than",
#       "trigger_alert_when_value": "10",
#       "ui_dispatch_context": "SplunkEnterpriseSecuritySuite"
#     },
# ],

返回值

常见返回值在此处记录 此处,以下是此模块特有的字段

描述

after

列表 / 元素=字符串

模块完成后,作为结构化数据的配置。

返回值: 当发生更改时

示例: ["返回的配置将始终与上述参数的格式相同。"]

before

列表 / 元素=字符串

在模块调用之前,作为结构化数据的配置。

返回值: 总是

示例: ["返回的配置将始终与上述参数的格式相同。"]

gathered

字典

从远程设备收集的关于网络资源的 Facts,作为结构化数据。

返回值: 当状态为 *gathered* 时

示例: "此输出将始终与模块的 argspec 格式相同。\n"

作者