From fcf2e401c25545d5b933fdf40fd66ae6496ac44c Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 10 Feb 2025 13:10:14 +0100 Subject: [PATCH] ajout restic-minio - non finalise --- restic-minio/README.md | 38 +++++++++++++++++++ restic-minio/Vagrantfile | 47 ++++++++++++++++++++++++ restic-minio/provision/install-minio.sh | 9 +++++ restic-minio/provision/install-restic.sh | 11 ++++++ 4 files changed, 105 insertions(+) create mode 100644 restic-minio/README.md create mode 100644 restic-minio/Vagrantfile create mode 100644 restic-minio/provision/install-minio.sh create mode 100644 restic-minio/provision/install-restic.sh diff --git a/restic-minio/README.md b/restic-minio/README.md new file mode 100644 index 0000000..e79bc45 --- /dev/null +++ b/restic-minio/README.md @@ -0,0 +1,38 @@ +# Serveur Wazuh All in One et machine wazuh-agent debian 12 + +## Présentation + +Cette `Vagrantfile` permet d'installer : + * un serveur Wazuh **wazuh** All-In-One ( indexer + manager + Dashboard) - Ubuntu 24.04 + * un serveur Linux **wazuh-cli** ( wazuh-agent ) - Debian 12.9 + +La Vagrantfile utilise les playbooks ansible suivants : + * **provision/setup-wazuh.yml** qui: + * coupe le service **unattended-upgrades** + * recupère le script **wazuh-install.sh** et le lance + * **provision/setup-wazuh-cli.yml** qui: + * installe les dépots pour wazuh + * installe le paquet **wazuh-agent** en enregistrant la machine **wazuh-cli** + * relance le service **wazuh-agent** + +## Utilisation de la Vagrantfile + +L'installation du serveur **wazuh** est assez longue ( ~ 15 minutes ). + +````shell + vagrant up wazuh + vagrant up wazuhcli +```` + +Le mot de passe du compte **admin** se trouve dans le fichier `wazuh-install-files/wazuh-passwords.txt`, lui-même contenu dans le ficher `wazuh-install-files.tar` à extraire avec la commande : + +````shell + sudo tar xvf wazuh-install-file.tar +```` +On peut alors se connecter au serveur **wazuh** avec un navigateur : http://adresse +(admin/mdp) + +Une fois connecté, on doit autoriser chacun des deux serveurs **kea1** et **kea2** inscrits + + + diff --git a/restic-minio/Vagrantfile b/restic-minio/Vagrantfile new file mode 100644 index 0000000..737463f --- /dev/null +++ b/restic-minio/Vagrantfile @@ -0,0 +1,47 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + # Base VM OS configuration. + config.vm.box = "debian/bookworm64" + config.ssh.insert_key = false + config.vm.synced_folder '.', '/vagrant', disabled: true + + # General VirtualBox VM configuration. + config.vm.provider :virtualbox do |v| + v.memory = 1024 + v.cpus = 1 + v.linked_clone = true + v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] + v.customize ["modifyvm", :id, "--ioapic", "on"] + v.check_guest_additions = false + end + + # Minio. + config.vm.define "minio" do |minio| + minio.vm.box = "debian/bookworm64" + minio.vm.hostname = "minio" + minio.vm.network :private_network, ip: "192.168.56.5" + minio.vm.provider :virtualbox do |v| + v.customize ["modifyvm", :id, "--memory", 1024] + v.cpus = 1 + end + minio.vm.provision "shell", + inline: "timedatectl set-timezone Europe/Paris ; apt-get update ; apt-get install -y vim curl wget" + minio.vm.provision "shell", path: "provision/install-minio.sh" + end + + # Restic. + config.vm.define "restic" do |restic| + restic.vm.hostname = "restic" + restic.vm.network :private_network, ip: "192.168.56.2" + restic.vm.provider :virtualbox do |v| + v.customize ["modifyvm", :id, "--memory", 1024] + end + restic.vm.provision "shell", + inline: "timedatectl set-timezone Europe/Paris ; apt-get update ; apt-get install -y vim curl wget" + restic.vm.provision "shell", path: "provision/install-restic.sh" + end + +end + diff --git a/restic-minio/provision/install-minio.sh b/restic-minio/provision/install-minio.sh new file mode 100644 index 0000000..1107a60 --- /dev/null +++ b/restic-minio/provision/install-minio.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +sudo apt-get update + +wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20250203210304.0.0_amd64.deb -O minio.deb +sudo dpkg -i minio.deb + +echo -e "mkdir ~/minio\nminio server ~/minio --console-address :9001" + diff --git a/restic-minio/provision/install-restic.sh b/restic-minio/provision/install-restic.sh new file mode 100644 index 0000000..d8ab6ad --- /dev/null +++ b/restic-minio/provision/install-restic.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo apt-get update + +apt install restic + +wget https://dl.min.io/client/mc/release/linux-amd64/mc +chmod +x mc +sudo mv mc /usr/local/bin/mc + +