在 Windows 主机上安装 Winlogbeat 和 Logstash

要在 QRadar®中检索 Winlogbeat JSON 格式的事件,必须在 Microsoft Windows 主机上安装 Winlogbeat 和 Logstash。

在开始之前

确保您正在使用 Oracle Java™ Development Kit V8 for Windows x64 和更高版本。

过程

  1. 使用缺省值安装 Winlogbeat 7.7 。 有关更多信息,请参阅 Winlogbeat 入门 (https://www.elastic.co/guide/en/beats/winlogbeat/7.7/winlogbeat-getting-started.html)。
  2. 启动 Winlogbeat 服务。
    注: 对于 Windows 服务,服务名称为 Winlogbeat。 安装后,服务将设置为 STOPPED ,然后必须首次启动。 超过此点的任何配置更改都需要重新启动服务。
  3. 可选。 有关配置 Winlogbeat 时的更多灵活性,请参阅 设置 Winlogbeat (https://www.elastic.co/guide/en/beats/winlogbeat/7.7/configuration-winlogbeat-options.html)。
  4. 通过下载软件包并将其保存到您选择的文件位置来安装 Logstash。
  5. 要确保 Winlogbeat 与 QRadar正确通信,请参阅 配置 Winlogbeat 以使用 Logstash (https://www.elastic.co/guide/en/beats/winlogbeat/7.7/config-winlogbeat-logstash.html)。
    可以在 <logstash_install_directory>/config 文件中使用以下基本样本配置文件。
    	input {	 beats {	    port => 5044	  }	}	output {	  tcp {	    host => ["172.16.199.22"]	    port => 514	    mode => "client"	    codec => "json_lines"	  }	  stdout { codec => rubydebug }	}
    注:
    • 如果您正在使用 rubydebug ,那么必须在 logstash.yml 文件中启用调试。 取消注释行 # log.level: info,并将 info 替换为 debug。 需要在任何配置更改后重新启动服务。
    • 输出中的 codec 必须设置为 json_lines ,以确保将每个事件单独发送到 QRadar
    • 如果要将 Kafka 输出发送到现有 Kafka 服务器,请参阅 配置 Kafka 输出 (https://www.elastic.co/guide/en/beats/winlogbeat/7.7/kafka-output.html)。
  6. 通过验证 Logstash 的 config 文件是否正常工作,确保正确设置了 Logstash。 从 Logstash bin 目录运行以下命令:
    logstash --config.test_and_exit -f <path_to_config_file>
  7. 确保正确配置了 Winlogbeat。
    1. 通过从 winlogbeat 目录运行以下命令来验证配置文件是否正常工作:
      ./winlogbeat test config
    2. 通过从 winlogbeat 目录运行以下命令,验证 Winlogbeat 能否访问 Logstash 服务器:
      ./winlogbeat test output

      如果 ./winlogbeat test output 命令的输出成功,那么可能会中断与 Logstash 的任何现有连接。 如果连接中断,请重新启动 Logstash 服务。

后续步骤

QRadar 中添加日志源,并使用 Microsoft Windows Security Event Log 日志源参数中列出的参数。