Basically what I want to do is, observe my Linux terminal with custom-defined rules. I think I need some integrations/agents to do that. This why I am trying to create a Fleet server and an agent policy. Everything is running on the same machine. I think this might be the issue, I was not aware of that.
I have static IP in my both machines (Linux and a Mac). Mac machine plays the role of attacker, and Linux machine plays the role of victim. I safely simulate attack scenarios from my Mac (while having access to Linux C2) with different techniques. And the rules which are specifically designed to catch my step by step attack, will catch them and save logs.
My fleet server’s host URL is https://192.168.0.200:8220, which is the static IP that I have on my Linux, and default port that Elastic suggests. After that, I use this commands to install Fleet server to my Linux machine:
curl -L -O ``https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.2.0-linux-x86_64.tar.gz
tar xzvf elastic-agent-9.2.0-linux-x86_64.tar.gz
cd elastic-agent-9.2.0-linux-x86_64
sudo ./elastic-agent install \
--fleet-server-es=http://localhost:9200 \
--fleet-server-service-token=”can’t_publish_that” \
--fleet-server-policy=fleet-server-policy \
--fleet-server-port=8220 \
--install-servers
An experienced friend of mine also suggested using ‘insecure’ flag here to prevent possible further complications with integrations. After that fleet connection is confirmed in Kibana UI, it automatically leads me to:
Continue enrolling elastic agent
And from there, there is the ‘Enroll in Fleet’ option. It says:
The selected agent policy will collect data for 1 integration: system
Here it says ‘Install Elastic Agent on your host’. Under that, there is a warning:
Root priviliges required. This agent policy contains the following integrations that require Elastic Agents to have root priviliges. blablabla: system
I know that if you don’t add –unpriviliged flag, there is no problem. I also can use priviliged afterwards. I don’t know it makes a difference though. And here is the commands for installing elastic agent on my host:
curl -L -O ``https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.2.0-linux-x86_64.tar.gz
tar xzvf elastic-agent-9.2.0-linux-x86_64.tar.gz
cd elastic-agent-9.2.0-linux-x86_64
sudo ./elastic-agent install --url=https://192.168.0.200:8220 --enrollment-token=blablalba
It is the same thing! This why it gives an error. Do I have to use two separate machines? And even if I use that, how the other will be able to communicate with the other? Now it waits for agent enrollment. I also can close this window, but I don’t know what happens then.
I am really a beginner for Elastic Stack as you can see. So, any help is appreciated. Thanks for your time and patience.