I installed the windows bundle on a windows 10 machine and trying to register to a remote lapi. For some reason the local_api_credentials.yaml will not auto generate after the usual “cscli lapi register…” command. The command is successful and the remote lapi is reachable as i am able to see and validate the windows node from the remote lapi. Although the message indicates the credentials where created and provides the path, the file is always empty.
Is there an additional step that im missing to generate the credential?
Yes I’m doing everything on powershell running as admin. I finally was able to get it to generate the credentials but still having issues that I haven’t faced with the other 10 nodes running on linux. I register to the remote lapi, then go over to the cli on that machine and validate. Everything validates fine and it shows the checkmark on the new node and shows the first heartbeat. The problem is after I validate the node then there are no more heartbeats, only the first one and then nothing. When I go to the windows machine and run cscli metrics I get this:
level=warning msg="while fetching metrics: executing GET request for URL \"http://127.0.0.1:6060/metrics\" failed: Get \"http://127.0.0.1:6060/metrics\": dial tcp 127.0.0.1:6060: connectex: No connection could be made because the target machine actively refused it."
I have ports 8080, 6060 and 443 open on the windows firewall both in and out. Not sure what else to try. I have already removed and validated the windows node 10-12 times and I see the same behavior.
The Crowdsec service is in fact stopped. I actually noticed it will run and stop after a few seconds. Maybe that’s the clue? Here is my config on the windows node:
In case it matters. Here is the output of cscli lapi status
PS C:\WINDOWS\system32> cscli lapi status
Loaded credentials from C:\ProgramData\CrowdSec\config\local_api_credentials.yaml
Trying to authenticate with username xxxxx on http://192.168.x.x:8080/
You can successfully interact with Local API (LAPI)
I installed the crowdsecurity/iis collection so I’m not sure what I’m missing still but at least I have a working agent after commenting out that entry
I thought I had IIS on my machine since I have a few homelab service sites hosted on it but it looks like I don’t have it installed. The error pointed me in the right direction but it took a while since it wasn’t clear what was missing or which entry was the issue.