Smaran Jawalkar
01/15/2025, 1:02 PMserver: tls: false
in the config.yaml
and using nginx as the reverse proxy to expos fleet. Since then, queries aren't going through to the osquery machines and Im getting this error:
Jan 15 12:49:53 localhost fleet[33217]: ts=2025-01-15T12:49:53.411443589Z component=http err="read auth token: reading from websocket: sockjs: session not in open state" msg="failed to read auth token"
which doesn't seem to have any documentation apart from this singular forum post which seems to imply its a load balancer issue? I'm running mysql and redis in a docker container.
This is my compose file:
version: '3.8'
services:
cache:
image: redis:6.2-alpine
restart: always
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass **********
volumes:
- cache:/data
db:
image: mysql:8.4.3
cap_add:
- SYS_NICE
restart: always
environment:
- MYSQL_DATABASE=fleet
- MYSQL_ROOT_PASSWORD=**********
ports:
- '3306:3306'
volumes:
- db:/var/lib/mysql
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
volumes:
db:
driver: local
cache:
driver: local
And fleet is running as a systemd servicewith this `config.yaml`:
mysql:
address: localhost:3306
database: fleet
username: root
password: ******
redis:
address: 127.0.0.1:6379
password: ********
server:
#cert: /etc/ssl/certs/kolide.csr
#key: /etc/ssl/private/kolide.key
tls: false
My osquery flags file is as follows:
# Server
--tls_hostname=*******
--tls_server_certs=/etc/osquery/fleet.pem
# Enrollment
--host_identifier=fleet-server
--enroll_secret_path=/etc/osquery/secret.txt
--enroll_tls_endpoint=/api/osquery/enroll
# Configuration
--config_plugin=tls
--config_tls_endpoint=/api/v1/osquery/config
--config_refresh=10
# Live query
--disable_distributed=false
--distributed_plugin=tls
--distributed_interval=10
--distributed_tls_max_attempts=3
--distributed_tls_read_endpoint=/api/v1/osquery/distributed/read
--distributed_tls_write_endpoint=/api/v1/osquery/distributed/write
# Logging
--logger_plugin=tls
--logger_tls_endpoint=/api/v1/osquery/log
--logger_tls_period=10
# File carving
--disable_carver=false
--carver_start_endpoint=/api/v1/osquery/carve/begin
--carver_continue_endpoint=/api/v1/osquery/carve/block
--carver_block_size=8000000
with secret.txt
and enroll
key taken from the fleet web gui in "Add hosts" > "Advanced"
Any idea why this might be happening?Zay Hanlon
01/15/2025, 1:06 PMSmaran Jawalkar
01/15/2025, 1:10 PMserver: tls: false
to the fleet config.yaml
instead of passing my own self signed certs to fleetSmaran Jawalkar
01/15/2025, 1:13 PMJan 15 12:49:53 localhost fleet[33217]: ts=2025-01-15T12:49:53.411443589Z component=http err="read auth token: reading from websocket: sockjs: session not in open state" msg="failed to read auth token"
Zay Hanlon
01/15/2025, 1:14 PMSmaran Jawalkar
01/15/2025, 1:14 PMJan 15 12:50:04 localhost fleet[33217]: level=error ts=2025-01-15T12:50:04.966243147Z component=http method=POST uri=/api/v1/osquery/distributed/write took=2.210057ms ip_addr=172.236.188.31 x_for_ip_addr=172.236.188.31 ingestion-err="campaignID=15 waiting for listener" err="error in query ingestion"
Live queries basically never complete on any hostsSmaran Jawalkar
01/15/2025, 1:16 PMAh got it. Thank you! Will have a member of the team take a look at this todayTysm!
Benjamin Edwards
01/15/2025, 2:28 PMZay Hanlon
01/15/2025, 2:50 PMSmaran Jawalkar
01/15/2025, 3:44 PMwebsockets_allow_unsafe_origin: true
😞Kathy Satterlee
01/15/2025, 7:33 PMKathy Satterlee
01/15/2025, 7:36 PMKathy Satterlee
01/15/2025, 7:36 PMSmaran Jawalkar
01/17/2025, 2:44 AMfleet
and everything works fine now. Tysm for the help!