无法将 osquery 从 window 服务器连接到 kolide 舰队

Fail to connect osquery from window server to kolide fleet

我尝试将 window 服务器中的 osquery 连接到 kolide fleet。 osqueryd 服务创建成功,但我的 kolide fleet 仪表板上没有任何显示。

我通过以下方式创建了服务:

sc.exe create osqueryd type= own start= auto error= normal binpath= "C:\Program Files\osquery\osqueryd\osqueryd.exe --flagfile=\Program Files\osquery\osquery.flags" displayname= 'osqueryd'

sc.exe start osqueryd

我的osquery.flags

--enroll_secret_path="C:\Users\xxx\Desktop\Secret\enroll_secret.txt"
--tls_server_certs="C:\Users\xxx\Desktop\Secret\certiticate.cer"
--tls_hostname=127.0.0.1:8080
--host_identifier=uuid
--enroll_tls_endpoint=/api/v1/osquery/enroll
--config_plugin=tls
--config_tls_endpoint=/api/v1/osquery/config
--config_refresh=10
--disable_distributed=false
--distributed_plugin=tls
--distributed_interval=3
--distributed_tls_max_attempts=3
--distributed_tls_read_endpoint=/api/v1/osquery/distributed/read
--distributed_tls_write_endpoint=/api/v1/osquery/distributed/write
--logger_plugin=tls
--logger_tls_endpoint=/api/v1/osquery/log
--logger_tls_period=10

我不知道如何更改标志命令以适应 window 服务

调试此类问题的最佳方法是通过 运行 osqueryd 手动测试您的配置,而不是作为一项服务。这将让您在设置服务之前查看日志并正确设置。

您需要在 Powershell 中使用以下命令:

& 'C:\Program Files\osquery\osqueryd\osqueryd.exe' --flagfile='\Program Files\osquery\osquery.flags'

现在您可以看到 osqueryd 的输出,您或许可以确定问题所在。如果没有,请添加 --verbose --tls_dump 标志,您将有更多的输出可以使用:

& 'C:\Program Files\osquery\osqueryd\osqueryd.exe' --flagfile='\Program Files\osquery\osquery.flags' --verbose --tls_dump

使用它来调试您的问题,适当地设置标志文件。完成后,您应该能够使用相同的标志文件启动服务并成功连接。