Jonathan Ober
07/13/2023, 5:30 PMJonathan Ober
07/13/2023, 5:30 PMJonathan Ober
07/13/2023, 5:30 PMKathy Satterlee
07/13/2023, 5:37 PMNo node key returned typically indicates that the enroll secret is being rejected. Adding the --tls-dump flag to osquery will add the json being sent to the logs to verify.
If you could share the flagfile, I can also take a look at that.
Feel free to redact any sensitive info or send that to me over DM. If you DM, I may share a snippet here but will make sure sensitive data is removed.Kathy Satterlee
07/13/2023, 5:43 PMcat /etc/osquery/enroll_secret to make sure that's pulling as expected?Jonathan Ober
07/13/2023, 5:47 PMKathy Satterlee
07/13/2023, 5:48 PMJonathan Ober
07/13/2023, 5:52 PMJonathan Ober
07/13/2023, 5:53 PMKathy Satterlee
07/13/2023, 5:53 PMJonathan Ober
07/13/2023, 5:53 PMKathy Satterlee
07/13/2023, 5:54 PMKathy Satterlee
07/14/2023, 2:26 PMJonathan Ober
07/14/2023, 2:31 PMmax_connections = 230Kathy Satterlee
07/14/2023, 2:36 PMbenbass
07/14/2023, 3:01 PMKathy Satterlee
07/14/2023, 3:11 PMbenbass
07/14/2023, 3:12 PMKathy Satterlee
07/14/2023, 3:31 PMbenbass
07/14/2023, 3:32 PMKathy Satterlee
07/14/2023, 3:33 PMbenbass
07/14/2023, 3:34 PMKathy Satterlee
07/14/2023, 3:34 PM230 total connections. 10 may be a bit lower than you need, but better to start conservatively and adjust upwards as needed.Kathy Satterlee
07/14/2023, 3:36 PMbenbass
07/14/2023, 3:58 PMbenbass
07/14/2023, 4:07 PMKathy Satterlee
07/14/2023, 4:35 PMKathy Satterlee
07/14/2023, 4:35 PMKathy Satterlee
07/14/2023, 4:36 PMbenbass
07/14/2023, 4:36 PMKathy Satterlee
07/14/2023, 4:38 PMKathy Satterlee
07/14/2023, 4:38 PMbenbass
07/14/2023, 4:56 PMKathy Satterlee
07/14/2023, 5:01 PMKathy Satterlee
07/14/2023, 5:01 PMJonathan Ober
07/14/2023, 5:02 PMbenbass
07/14/2023, 5:02 PMKathy Satterlee
07/14/2023, 5:02 PMbenbass
07/14/2023, 5:03 PMKathy Satterlee
07/14/2023, 5:04 PMJonathan Ober
07/14/2023, 5:05 PMKathy Satterlee
07/14/2023, 5:05 PMJonathan Ober
07/14/2023, 5:05 PMsudo osqueryd --flagfile /etc/osquery/osquery.flags --tls_dump --verbose > osquery.log 2>&1
if you want me to do it a differnt way let me knowKathy Satterlee
07/14/2023, 5:06 PMKathy Satterlee
07/14/2023, 5:09 PMKathy Satterlee
07/14/2023, 5:09 PMJonathan Ober
07/14/2023, 5:12 PMKathy Satterlee
07/14/2023, 5:14 PMJonathan Ober
07/14/2023, 5:15 PMKathy Satterlee
07/14/2023, 5:26 PMKathy Satterlee
07/14/2023, 5:27 PMbenbass
07/14/2023, 5:28 PMKathy Satterlee
07/14/2023, 5:35 PMI0714 13:14:38.634207 21948 tls.cpp:263] TLS/HTTPS POST request to URI: {{server_url}}/api/v1/osquery/enroll
{[...]}
{
"node_key": "IsyEcUEkirMcCZmoNkFtU1uzPimOWDJN"
}
Then immediately attempts to connect to the server and gets the invalid node key:
I0714 13:14:39.276793 21948 tls.cpp:263] TLS/HTTPS POST request to URI: {{server_url}}:8080/api/v1/osquery/distributed/read
{"node_key":"IsyEcUEkirMcCZmoNkFtU1uzPimOWDJN"}
{
"error": "authentication error: invalid node key: IsyEcUEkirMcCZmoNkFtU1uzPimOWDJN",
"node_invalid": true,
"uuid": "[...]"
}Kathy Satterlee
07/14/2023, 5:35 PMbenbass
07/14/2023, 5:36 PMKathy Satterlee
07/14/2023, 5:38 PMKathy Satterlee
07/14/2023, 5:38 PMbenbass
07/14/2023, 5:38 PMKathy Satterlee
07/14/2023, 5:39 PMbenbass
07/14/2023, 5:39 PMbenbass
07/14/2023, 5:39 PMKathy Satterlee
07/14/2023, 5:39 PMbenbass
07/14/2023, 5:40 PMKathy Satterlee
07/14/2023, 5:40 PMKathy Satterlee
07/14/2023, 5:42 PMSELECT id, hostname, primary_ip, orbit_node_key FROM hosts WHERE uuid="d9570f42-be62-6214-a6b6-7f80ec4c3d2f";Kathy Satterlee
07/14/2023, 5:43 PMbenbass
07/14/2023, 5:43 PMKathy Satterlee
07/14/2023, 5:43 PMUUID as your host identifier, Fleet sees all of these as the same host.benbass
07/14/2023, 5:44 PMKathy Satterlee
07/14/2023, 5:44 PMbenbass
07/14/2023, 5:44 PMbenbass
07/14/2023, 5:46 PMKathy Satterlee
07/14/2023, 5:46 PMbenbass
07/14/2023, 5:48 PMinstance
?Kathy Satterlee
07/14/2023, 5:49 PMKathy Satterlee
07/14/2023, 5:51 PMfleetd package rather than plain osquery. For y'all, changing the host identifier should do the trick.benbass
07/14/2023, 5:52 PMKathy Satterlee
07/14/2023, 5:58 PM--tls-dump to the osquery logs
b. In those logs, the host was enrolling and then immediately getting an error response that the node key was invalid
c. Querying the Fleet database showed that a host with that UUID (Pulled from the body of the enrollment request in the logs) was enrolled and that the data was continuously updating
SELECT id, hostname, primary_ip, orbit_node_key FROM hosts WHERE uuid="{{UUID}}";
3. This can be resolved by changing the host identifier to instance rather than uuidJonathan Ober
07/14/2023, 5:59 PMKathy Satterlee
07/14/2023, 6:01 PMJonathan Ober
07/14/2023, 6:02 PMJonathan Ober
07/14/2023, 6:04 PMKathy Satterlee
07/14/2023, 6:05 PMJonathan Ober
07/14/2023, 6:05 PMJonathan Ober
07/14/2023, 6:05 PMKathy Satterlee
07/14/2023, 6:06 PMKathy Satterlee
07/14/2023, 6:08 PMJonathan Ober
07/14/2023, 6:24 PMKathy Satterlee
07/14/2023, 6:37 PM