Skip to content
Snippets Groups Projects
Commit 1d8bba99 authored by Matevz Erzen's avatar Matevz Erzen
Browse files

Added new environment

parent b458e2c1
No related branches found
No related tags found
No related merge requests found
ENVIRONMENT ?= vagrant-full-setup
ENVIRONMENT ?= full-setup
DEPLOY_DIR = $(PWD)
ENV_DIR = $(DEPLOY_DIR)/environments/$(ENVIRONMENT)
ANSIBLE_DIR = $(DEPLOY_DIR)/ansible
......
......@@ -20,6 +20,8 @@ $ git clone https://github.com/wazuh/wazuh-ansible.git
$ git checkout tags/v4.1.5
```
Then select your `ENVIRONMENT` in `Makefile`. Set it to `full-setup` or `no-collector`.
1. Provision Wazuh server and Wazuh agents:
```
......@@ -49,6 +51,10 @@ $ docker logs -ft evidence-collector
## Potential issues
### ClamAV (re)start failed/timed out
Try re-running `make provision` one more time. If this doesn't help, comment out the last task in `/ansible/clamav/tasks/install-clamav.yml` & try restarting ClamAV manually.
### Vagrant issue:
```
......@@ -94,10 +100,8 @@ Host key verification failed.
Solution:
```
ssh-keygen -f "/home/ales/.ssh/known_hosts" -R "192.168.33.10"
ssh-keygen -f "/home/ales/.ssh/known_hosts" -R "192.168.33.11"
ssh-keygen -f "/home/ales/.ssh/known_hosts" -R "192.168.33.12"
ssh-keyscan -H 192.168.33.10 >> /home/ales/.ssh/known_hosts
ssh-keyscan -H 192.168.33.11 >> /home/ales/.ssh/known_hosts
ssh-keyscan -H 192.168.33.12 >> /home/ales/.ssh/known_hosts
ssh-keygen -f ".ssh/known_hosts" -R "192.168.33.10"
ssh-keygen -f ".ssh/known_hosts" -R "192.168.33.11"
ssh-keygen -f ".ssh/known_hosts" -R "192.168.33.12"
ssh-keygen -f ".ssh/known_hosts" -R "192.168.33.13"
```
\ No newline at end of file
......@@ -6,7 +6,7 @@ servers=[
:hostname => "manager",
:ip => "192.168.33.10",
:box => "centos/8",
:ram => 4096,
:ram => 2048,
:cpu => 2
},
{
......@@ -27,7 +27,7 @@ servers=[
:hostname => "evidence-collector",
:ip => "192.168.33.13",
:box => "centos/8",
:ram => 2048,
:ram => 1024,
:cpu => 2
}
]
......@@ -35,18 +35,6 @@ servers=[
Vagrant.configure(2) do |config|
servers.each do |machine|
config.vm.define machine[:hostname] do |node|
# Can cause error:
# "You are trying to forward a host IP that does not exist. Please set `host_ip`
# to the address of an existing IPv4 network interface, or remove the option
# from your port forward configuration."
#if machine[:hostname] == "manager"
# node.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "192.168.33.10"
# node.vm.network "forwarded_port", guest: 443, host: 8443 , host_ip: "192.168.33.10"
# node.vm.network "forwarded_port", guest: 55000, host: 55000 , host_ip: "192.168.33.10"
# node.vm.network "forwarded_port", guest: 1514, host: 1514 , host_ip: "192.168.33.10"
# node.vm.network "forwarded_port", guest: 1515, host: 1515 , host_ip: "192.168.33.10"
# node.vm.network "forwarded_port", guest: 1516, host: 1516 , host_ip: "192.168.33.10"
#end
node.vm.box = machine[:box]
node.vm.hostname = machine[:hostname]
node.vm.network "private_network", ip: machine[:ip]
......
[wazuh_managers]
192.168.33.10 public_ip=192.168.33.10 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/vagrant-full-setup/.vagrant/machines/manager/virtualbox/private_key
192.168.33.10 public_ip=192.168.33.10 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/full-setup/.vagrant/machines/manager/virtualbox/private_key
[wazuh_managers:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[wazuh_agents]
192.168.33.11 public_ip=192.168.33.11 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/vagrant-full-setup/.vagrant/machines/agent1/virtualbox/private_key
192.168.33.12 public_ip=192.168.33.12 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/vagrant-full-setup/.vagrant/machines/agent2/virtualbox/private_key
192.168.33.11 public_ip=192.168.33.11 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/full-setup/.vagrant/machines/agent1/virtualbox/private_key
192.168.33.12 public_ip=192.168.33.12 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/full-setup/.vagrant/machines/agent2/virtualbox/private_key
[wazuh_agents:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[evidence_collector]
192.168.33.13 public_ip=192.168.33.13 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/vagrant-full-setup/.vagrant/machines/evidence-collector/virtualbox/private_key
192.168.33.13 public_ip=192.168.33.13 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/full-setup/.vagrant/machines/evidence-collector/virtualbox/private_key
[evidence_collector:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
servers=[
{
:hostname => "manager",
:ip => "192.168.33.10",
:box => "centos/8",
:ram => 2048,
:cpu => 2
},
{
:hostname => "agent1",
:ip => "192.168.33.11",
:box => "centos/8",
:ram => 512,
:cpu => 1
},
{
:hostname => "agent2",
:ip => "192.168.33.12",
:box => "centos/8",
:ram => 512,
:cpu => 1
}
]
Vagrant.configure(2) do |config|
servers.each do |machine|
config.vm.define machine[:hostname] do |node|
node.vm.box = machine[:box]
node.vm.hostname = machine[:hostname]
node.vm.network "private_network", ip: machine[:ip]
node.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", machine[:ram]]
end
end
end
end
\ No newline at end of file
[wazuh_managers]
192.168.33.10 public_ip=192.168.33.10 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/no-collector/.vagrant/machines/manager/virtualbox/private_key
[wazuh_managers:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[wazuh_agents]
192.168.33.11 public_ip=192.168.33.11 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/no-collector/.vagrant/machines/agent1/virtualbox/private_key
192.168.33.12 public_ip=192.168.33.12 ansible_ssh_pass=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=environments/no-collector/.vagrant/machines/agent2/virtualbox/private_key
[wazuh_agents:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
\ No newline at end of file
VAGRANT_RUN = cd $(ENV_DIR) && vagrant
SSH_PRIVATE_KEY = $(HOME)/.vagrant.d/insecure_private_key
SSH_USER = vagrant
create:
@$(VAGRANT_RUN) up
delete:
@$(VAGRANT_RUN) destroy -f
ssh-manager:
@$(VAGRANT_RUN) ssh manager
ssh-agent1:
@$(VAGRANT_RUN) ssh agent1
ssh-agent2:
@$(VAGRANT_RUN) ssh agent2
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment