Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e2bfe5de51 | ||
|
10379acf6f | ||
|
bf15f643c7 | ||
|
b33711c33d | ||
|
fcf2e401c2 | ||
|
3816043214 | ||
|
55330d41e1 | ||
|
367f8578bd | ||
|
09ec8a80bd | ||
|
9fe6b402c6 | ||
|
f29e7d8290 | ||
|
0af8bc089e | ||
|
6c816d3ceb | ||
|
884cd7ae9a |
10
README.md
10
README.md
@ -1,6 +1,6 @@
|
|||||||
# vagrant
|
# vagrant
|
||||||
|
|
||||||
le 2024-12-14 21h30 - ps
|
le 2025-02-02 11h30 - ps
|
||||||
|
|
||||||
Ce dépôt héberge des **Vagrantfile** dont :
|
Ce dépôt héberge des **Vagrantfile** dont :
|
||||||
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
||||||
@ -12,21 +12,21 @@ Ce dépôt héberge des **Vagrantfile** dont :
|
|||||||
* **docker-traefik-nextcloud**
|
* **docker-traefik-nextcloud**
|
||||||
* **docker-traefik-nextcloud-ss-tls**
|
* **docker-traefik-nextcloud-ss-tls**
|
||||||
* **docker-traefik-nginx**
|
* **docker-traefik-nginx**
|
||||||
* **docker-elk**
|
* **devstack** : Vagrantfile pour Openstack devstack
|
||||||
* **devstack**
|
|
||||||
* **dvlpt** : Vagrantfile pour VM Debian 11 LAMP + phpmyadmin
|
* **dvlpt** : Vagrantfile pour VM Debian 11 LAMP + phpmyadmin
|
||||||
* **glpi** : Vagrantfile pour VM Debian 11 GLPI 10.0.7
|
* **glpi** : Vagrantfile pour VM Debian 11 GLPI 10.0.7
|
||||||
* **guacamole** : Vagrantfile pour Apache Guacamole dockerise sans frontal
|
* **guacamole** : Vagrantfile pour Apache Guacamole dockerise sans frontal
|
||||||
|
* **jenkins** : Vagrantfile et script d'installation de Jenkins sur Debian 12
|
||||||
* **k8s** : kubernetes 1.26.00 + playbook pour master **k8s-master** et 2 noeuds **node-1** et **node-2**
|
* **k8s** : kubernetes 1.26.00 + playbook pour master **k8s-master** et 2 noeuds **node-1** et **node-2**
|
||||||
* **k3s-awx** : Vagrantfile + script **inst-awx** pour installation **Ansible AWX** sur **k3s** avec **awx-on-k3s**
|
* **k3s-awx** : Vagrantfile + script **inst-awx** pour installation **Ansible AWX** sur **k3s** avec **awx-on-k3s**
|
||||||
* **kea-dhcp-ha** : Vagrantfile pour serveur DHCP kea - HA avec serveur stork - machines **kea1**, **kea2** et **stork**
|
* **kea-dhcp-ha** : Vagrantfile pour serveur DHCP kea - HA avec serveur stork - machines **kea1**, **kea2** et **stork**
|
||||||
* **lldap** : Vagrantfile pour serveur LDAP en mode service **lldap**
|
* **lldap** : Vagrantfile pour serveur LDAP en mode service **lldap**
|
||||||
* **lldap2** : Vagrantfile pour serveur LDAP en mode service **lldap** - integration pour Proxmox
|
* **lldap2** : Vagrantfile pour serveur LDAP en mode service **lldap** - integration pour Proxmox
|
||||||
* **minione**
|
* **minione** : Vagrantfile pour Opennebula All In One
|
||||||
* **netbox** : Vagrantfile pour Netbox dockerisée
|
* **netbox** : Vagrantfile pour Netbox dockerisée
|
||||||
* **rundeck** : Vagrantfile + playbook pour installation avec Mariadb
|
* **rundeck** : Vagrantfile + playbook pour installation avec Mariadb
|
||||||
* **samba-ad-dc** : Vagrantfile + playbook pour **Samba 4.17 ad-dc** sur **Debian 12 Bookworm**
|
* **samba-ad-dc** : Vagrantfile + playbook pour **Samba 4.17 ad-dc** sur **Debian 12 Bookworm**
|
||||||
|
* **wazuh** : Vagrantfile + playbook pour serveur **wazuh** 4.10 et client Debian
|
||||||
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
||||||
* **zabbix** : Vagrantfile pour VM Debian 12 **zabbix7** Srv et VM Debian 12 **web1** apache, zabbix agent2
|
* **zabbix** : Vagrantfile pour VM Debian 12 **zabbix7** Srv et VM Debian 12 **web1** apache, zabbix agent2
|
||||||
|
|
||||||
|
12
auth/README.md
Normal file
12
auth/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Authelia - un outil d'authentification centralisée 2FA
|
||||||
|
|
||||||
|
|
||||||
|
## Mise en oeuvre
|
||||||
|
|
||||||
|
|
||||||
|
* lancer la Vagrantfile avec : 'vagrant up'
|
||||||
|
* se connecter avec : 'vagrant ssh'
|
||||||
|
puis sur une machine disposant de docker et de git :
|
||||||
|
````shell
|
||||||
|
cd
|
||||||
|
````
|
87
auth/Vagrantfile
vendored
Normal file
87
auth/Vagrantfile
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
|
# configures the configuration version (we support older styles for
|
||||||
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
|
# you're doing.
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
# The most common configuration options are documented and commented below.
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
|
# boxes at https://vagrantcloud.com/search.
|
||||||
|
config.vm.box = "debian/bookworm64"
|
||||||
|
config.vm.hostname= "auth"
|
||||||
|
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
# NOTE: This will enable public access to the opened port
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine and only allow access
|
||||||
|
# via 127.0.0.1 to disable public access
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
||||||
|
|
||||||
|
# Create a private network, which allows host-only access to the machine
|
||||||
|
# using a specific IP.
|
||||||
|
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
# Create a public network, which generally matched to bridged network.
|
||||||
|
# Bridged networks make the machine appear as another physical device on
|
||||||
|
# your network.
|
||||||
|
config.vm.network "public_network"
|
||||||
|
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||||
|
|
||||||
|
# Disable the default share of the current code directory. Doing this
|
||||||
|
# provides improved isolation between the vagrant box and your host
|
||||||
|
# by making sure your Vagrantfile isn't accessible to the vagrant box.
|
||||||
|
# If you use this you may want to enable additional shared subfolders as
|
||||||
|
# shown above.
|
||||||
|
# config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
# config.vm.provider "virtualbox" do |vb|
|
||||||
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
|
# vb.gui = true
|
||||||
|
#
|
||||||
|
# # Customize the amount of memory on the VM:
|
||||||
|
# vb.memory = "1024"
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
|
# information on available options.
|
||||||
|
|
||||||
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
|
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
||||||
|
# documentation for more information about their specific syntax and use.
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
timedatectl set-timzzone Europe/Paris
|
||||||
|
apt-get update
|
||||||
|
apt install -y wget curl git vim
|
||||||
|
if ! which docker ; then
|
||||||
|
curl -s -o getdocker.sh https://get.docker.com
|
||||||
|
bash getdocker.sh
|
||||||
|
gpasswd -a vagrant docker
|
||||||
|
fi
|
||||||
|
git clone https://github.com/authelia/authelia.git
|
||||||
|
cd authelia
|
||||||
|
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
|
SHELL
|
||||||
|
end
|
2
docker/Vagrantfile
vendored
2
docker/Vagrantfile
vendored
@ -12,7 +12,7 @@ Vagrant.configure("2") do |config|
|
|||||||
|
|
||||||
# Every Vagrant development environment requires a box. You can search for
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
# boxes at https://vagrantcloud.com/search.
|
# boxes at https://vagrantcloud.com/search.
|
||||||
config.vm.box = "debian/bullseye64"
|
config.vm.box = "debian/bookworm64"
|
||||||
config.vm.hostname = "docker"
|
config.vm.hostname = "docker"
|
||||||
|
|
||||||
# Disable automatic box update checking. If you disable this, then
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
12
jenkins/README.md
Normal file
12
jenkins/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Jenkins
|
||||||
|
|
||||||
|
## Présentation
|
||||||
|
|
||||||
|
Le script **install-jenkins.sh** installe l'application CI/CD **jenkins** sur Debian 12 avec openJDK 17 à partir du dépot jenkins.
|
||||||
|
|
||||||
|
Il installe également les applications **git** et **ansible**.
|
||||||
|
|
||||||
|
Jenkins est accessible sur le port 8080
|
||||||
|
|
||||||
|
Le script fonctionne sur une VM KVM ou sur un conteneur LXC.
|
||||||
|
|
71
jenkins/Vagrantfile
vendored
Normal file
71
jenkins/Vagrantfile
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
|
# configures the configuration version (we support older styles for
|
||||||
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
|
# you're doing.
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
# The most common configuration options are documented and commented below.
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
|
# boxes at https://vagrantcloud.com/search.
|
||||||
|
config.vm.box = "debian/bookworm64"
|
||||||
|
config.vm.hostname = "jenkins"
|
||||||
|
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
# NOTE: This will enable public access to the opened port
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine and only allow access
|
||||||
|
# via 127.0.0.1 to disable public access
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
||||||
|
|
||||||
|
# Create a private network, which allows host-only access to the machine
|
||||||
|
# using a specific IP.
|
||||||
|
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
# Create a public network, which generally matched to bridged network.
|
||||||
|
# Bridged networks make the machine appear as another physical device on
|
||||||
|
# your network.
|
||||||
|
config.vm.network "public_network"
|
||||||
|
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
|
# vb.gui = true
|
||||||
|
#
|
||||||
|
# # Customize the amount of memory on the VM:
|
||||||
|
vb.memory = "2048"
|
||||||
|
end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
|
# information on available options.
|
||||||
|
|
||||||
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
|
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
||||||
|
# documentation for more information about their specific syntax and use.
|
||||||
|
config.vm.provision "shell",
|
||||||
|
inline: "timedatectl set-timezone Europe/Paris ; apt-get update ; apt-get install -y vim curl wget"
|
||||||
|
config.vm.provision "shell", path: "provision/install-jenkins.sh"
|
||||||
|
end
|
||||||
|
|
9
jenkins/jenkins-proxy.d2
Normal file
9
jenkins/jenkins-proxy.d2
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
direction: right
|
||||||
|
client.shape: cloud
|
||||||
|
client -> jenkins: " :443"
|
||||||
|
jenkins: {
|
||||||
|
caddy
|
||||||
|
jenkins
|
||||||
|
caddy -> jenkins: ":8080"
|
||||||
|
}
|
||||||
|
|
11
jenkins/provision/Caddyfile
Normal file
11
jenkins/provision/Caddyfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
192.168.1.30:443 {
|
||||||
|
tls internal
|
||||||
|
reverse_proxy localhost:8080
|
||||||
|
}
|
||||||
|
|
||||||
|
jenkins:443 {
|
||||||
|
tls internal
|
||||||
|
reverse_proxy localhost:8080
|
||||||
|
}
|
||||||
|
|
||||||
|
|
6
jenkins/provision/install-caddy.sh
Normal file
6
jenkins/provision/install-caddy.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y caddy
|
||||||
|
|
||||||
|
|
19
jenkins/provision/install-jenkins.sh
Normal file
19
jenkins/provision/install-jenkins.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y gnupg openjdk-17-jdk
|
||||||
|
|
||||||
|
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null
|
||||||
|
|
||||||
|
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y jenkins
|
||||||
|
|
||||||
|
sudo systemctl start jenkins
|
||||||
|
sudo systemctl enable jenkins
|
||||||
|
|
||||||
|
sudo systemctl status jenkins
|
||||||
|
|
||||||
|
sudo apt-get install -y git ansible
|
||||||
|
|
10
k3s-awx/Vagrantfile
vendored
10
k3s-awx/Vagrantfile
vendored
@ -12,7 +12,7 @@ Vagrant.configure("2") do |config|
|
|||||||
|
|
||||||
# Every Vagrant development environment requires a box. You can search for
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
# boxes at https://vagrantcloud.com/search.
|
# boxes at https://vagrantcloud.com/search.
|
||||||
config.vm.box = "debian/bullseye64"
|
config.vm.box = "debian/bookworm64"
|
||||||
config.vm.hostname = "k3s-awx"
|
config.vm.hostname = "k3s-awx"
|
||||||
|
|
||||||
# Disable automatic box update checking. If you disable this, then
|
# Disable automatic box update checking. If you disable this, then
|
||||||
@ -33,12 +33,12 @@ Vagrant.configure("2") do |config|
|
|||||||
|
|
||||||
# Create a private network, which allows host-only access to the machine
|
# Create a private network, which allows host-only access to the machine
|
||||||
# using a specific IP.
|
# using a specific IP.
|
||||||
config.vm.network "private_network", ip: "192.168.56.10"
|
# config.vm.network "private_network", ip: "192.168.56.10"
|
||||||
|
|
||||||
# Create a public network, which generally matched to bridged network.
|
# Create a public network, which generally matched to bridged network.
|
||||||
# Bridged networks make the machine appear as another physical device on
|
# Bridged networks make the machine appear as another physical device on
|
||||||
# your network.
|
# your network.
|
||||||
# config.vm.network "public_network"
|
config.vm.network "public_network"
|
||||||
|
|
||||||
# Share an additional folder to the guest VM. The first argument is
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
# the path on the host to the actual folder. The second argument is
|
# the path on the host to the actual folder. The second argument is
|
||||||
@ -55,7 +55,8 @@ Vagrant.configure("2") do |config|
|
|||||||
# vb.gui = true
|
# vb.gui = true
|
||||||
#
|
#
|
||||||
# # Customize the amount of memory on the VM:
|
# # Customize the amount of memory on the VM:
|
||||||
vb.memory = "3072"
|
vb.memory = "6144"
|
||||||
|
vb.cpus = 2
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
# View the documentation for the provider you are using for more
|
# View the documentation for the provider you are using for more
|
||||||
@ -65,6 +66,7 @@ Vagrant.configure("2") do |config|
|
|||||||
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
||||||
# documentation for more information about their specific syntax and use.
|
# documentation for more information about their specific syntax and use.
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
timdatectl set-timezone Europe/Paris
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y curl vim git make
|
apt-get install -y curl vim git make
|
||||||
SHELL
|
SHELL
|
||||||
|
38
restic-minio/README.md
Normal file
38
restic-minio/README.md
Normal file
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
47
restic-minio/Vagrantfile
vendored
Normal file
47
restic-minio/Vagrantfile
vendored
Normal file
@ -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
|
||||||
|
|
14
restic-minio/provision/install-minio.sh
Normal file
14
restic-minio/provision/install-minio.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
|
||||||
|
sudo groupadd -r minio
|
||||||
|
sudo useradd -M -r -g minio minio
|
||||||
|
|
||||||
|
|
||||||
|
echo -e "mkdir ~/minio\nminio server ~/minio --console-address :9001"
|
||||||
|
|
11
restic-minio/provision/install-restic.sh
Normal file
11
restic-minio/provision/install-restic.sh
Normal file
@ -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
|
||||||
|
|
||||||
|
|
38
wazuh/README.md
Normal file
38
wazuh/README.md
Normal file
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
60
wazuh/Vagrantfile
vendored
Normal file
60
wazuh/Vagrantfile
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# -*- 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
|
||||||
|
|
||||||
|
# wazuh.
|
||||||
|
config.vm.define "wazuh" do |wazuh|
|
||||||
|
wazuh.vm.box = "alvistack/ubuntu-24.04"
|
||||||
|
wazuh.vm.hostname = "wazuh"
|
||||||
|
wazuh.vm.network :private_network, ip: "192.168.56.5"
|
||||||
|
wazuh.vm.provider :virtualbox do |v|
|
||||||
|
v.customize ["modifyvm", :id, "--memory", 4100]
|
||||||
|
v.cpus = 2
|
||||||
|
end
|
||||||
|
wazuh.vm.provision "shell",
|
||||||
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget gnupg"
|
||||||
|
wazuh.vm.provision "ansible" do |ansible|
|
||||||
|
ansible.extra_vars = {
|
||||||
|
wazuh_db_name: "wazuh",
|
||||||
|
wazuh_db_user: "wazuh-server",
|
||||||
|
wazuh_db_passwd: "wazuh-passwd",
|
||||||
|
}
|
||||||
|
ansible.playbook = "provision/setup-wazuh.yml"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# wazuh-cli.
|
||||||
|
config.vm.define "wazuhcli" do |wazucli|
|
||||||
|
wazucli.vm.hostname = "wazuh-cli"
|
||||||
|
wazucli.vm.network :private_network, ip: "192.168.56.2"
|
||||||
|
wazucli.vm.provider :virtualbox do |v|
|
||||||
|
v.customize ["modifyvm", :id, "--memory", 1024]
|
||||||
|
end
|
||||||
|
wazucli.vm.provision "shell",
|
||||||
|
inline: "timedatectl set-timezone Europe/Paris ; apt-get update ; apt-get install -y vim curl wget gnupg"
|
||||||
|
wazucli.vm.provision "ansible" do |ansible|
|
||||||
|
ansible.extra_vars = {
|
||||||
|
srv_ip: "192.168.56.5",
|
||||||
|
}
|
||||||
|
ansible.playbook = "provision/setup-wazuh-cli.yml"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
105
wazuh/provision/kea-ctrl-agent.conf
Normal file
105
wazuh/provision/kea-ctrl-agent.conf
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
// This is a basic configuration for the Kea Control Agent.
|
||||||
|
//
|
||||||
|
// This is just a very basic configuration. Kea comes with large suite (over 30)
|
||||||
|
// of configuration examples and extensive Kea User's Guide. Please refer to
|
||||||
|
// those materials to get better understanding of what this software is able to
|
||||||
|
// do. Comments in this configuration file sometimes refer to sections for more
|
||||||
|
// details. These are section numbers in Kea User's Guide. The version matching
|
||||||
|
// your software should come with your Kea package, but it is also available
|
||||||
|
// in ISC's Knowledgebase (https://kea.readthedocs.io; the direct link for
|
||||||
|
// the stable version is https://kea.readthedocs.io/).
|
||||||
|
//
|
||||||
|
// This configuration file contains only Control Agent's configuration.
|
||||||
|
// If configurations for other Kea services are also included in this file they
|
||||||
|
// are ignored by the Control Agent.
|
||||||
|
{
|
||||||
|
|
||||||
|
// This is a basic configuration for the Kea Control Agent.
|
||||||
|
// RESTful interface to be available at http://127.0.0.1:8000/
|
||||||
|
"Control-agent": {
|
||||||
|
"http-host": "127.0.0.1",
|
||||||
|
// If enabling HA and multi-threading, the 8000 port is used by the HA
|
||||||
|
// hook library http listener. When using HA hook library with
|
||||||
|
// multi-threading to function, make sure the port used by dedicated
|
||||||
|
// listener is different (e.g. 8001) than the one used by CA. Note
|
||||||
|
// the commands should still be sent via CA. The dedicated listener
|
||||||
|
// is specifically for HA updates only.
|
||||||
|
"http-port": 8000,
|
||||||
|
|
||||||
|
// Specify location of the files to which the Control Agent
|
||||||
|
// should connect to forward commands to the DHCPv4, DHCPv6
|
||||||
|
// and D2 servers via unix domain sockets.
|
||||||
|
"control-sockets": {
|
||||||
|
"dhcp4": {
|
||||||
|
"socket-type": "unix",
|
||||||
|
"socket-name": "/run/kea/kea4-ctrl-socket"
|
||||||
|
},
|
||||||
|
"dhcp6": {
|
||||||
|
"socket-type": "unix",
|
||||||
|
"socket-name": "/run/kea/kea6-ctrl-socket"
|
||||||
|
},
|
||||||
|
"d2": {
|
||||||
|
"socket-type": "unix",
|
||||||
|
"socket-name": "/run/kea/kea-ddns-ctrl-socket"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Specify hooks libraries that are attached to the Control Agent.
|
||||||
|
// Such hooks libraries should support 'control_command_receive'
|
||||||
|
// hook point. This is currently commented out because it has to
|
||||||
|
// point to the existing hooks library. Otherwise the Control
|
||||||
|
// Agent will fail to start.
|
||||||
|
"hooks-libraries": [
|
||||||
|
// {
|
||||||
|
// "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/control-agent-commands.so",
|
||||||
|
// "parameters": {
|
||||||
|
// "param1": "foo"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
],
|
||||||
|
|
||||||
|
// Logging configuration starts here. Kea uses different loggers to log various
|
||||||
|
// activities. For details (e.g. names of loggers), see Chapter 18.
|
||||||
|
"loggers": [
|
||||||
|
{
|
||||||
|
// This specifies the logging for Control Agent daemon.
|
||||||
|
"name": "kea-ctrl-agent",
|
||||||
|
"output_options": [
|
||||||
|
{
|
||||||
|
// Specifies the output file. There are several special values
|
||||||
|
// supported:
|
||||||
|
// - stdout (prints on standard output)
|
||||||
|
// - stderr (prints on standard error)
|
||||||
|
// - syslog (logs to syslog)
|
||||||
|
// - syslog:name (logs to syslog using specified name)
|
||||||
|
// Any other value is considered a name of the file
|
||||||
|
"output": "stdout",
|
||||||
|
|
||||||
|
// Shorter log pattern suitable for use with systemd,
|
||||||
|
// avoids redundant information
|
||||||
|
"pattern": "%-5p %m\n"
|
||||||
|
|
||||||
|
// This governs whether the log output is flushed to disk after
|
||||||
|
// every write.
|
||||||
|
// "flush": false,
|
||||||
|
|
||||||
|
// This specifies the maximum size of the file before it is
|
||||||
|
// rotated.
|
||||||
|
// "maxsize": 1048576,
|
||||||
|
|
||||||
|
// This specifies the maximum number of rotated files to keep.
|
||||||
|
// "maxver": 8
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// This specifies the severity of log messages to keep. Supported values
|
||||||
|
// are: FATAL, ERROR, WARN, INFO, DEBUG
|
||||||
|
"severity": "INFO",
|
||||||
|
|
||||||
|
// If DEBUG level is specified, this value is used. 0 is least verbose,
|
||||||
|
// 99 is most verbose. Be cautious, Kea can generate lots and lots
|
||||||
|
// of logs if told to do so.
|
||||||
|
"debuglevel": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
25
wazuh/provision/setup-wazuh-cli.yml
Normal file
25
wazuh/provision/setup-wazuh-cli.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Recup clefs depot
|
||||||
|
ansible.builtin.shell: curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg
|
||||||
|
|
||||||
|
- name: Ajoute depot
|
||||||
|
ansible.builtin.shell: echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
|
||||||
|
|
||||||
|
- name: Update apt
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Installation wazuh-agent et liaison wazuh-server
|
||||||
|
ansible.builtin.shell: "WAZUH_MANAGER={{ srv_ip }} apt-get install wazuh-agent"
|
||||||
|
|
||||||
|
- name: Relance wazuh-agent
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: wazuh-agent
|
||||||
|
state: restarted
|
||||||
|
enabled: true
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
|
|
14
wazuh/provision/setup-wazuh.yml
Normal file
14
wazuh/provision/setup-wazuh.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Arrete service unattended-upgrades
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: unattended-upgrades
|
||||||
|
state: stopped
|
||||||
|
|
||||||
|
- name: Recup script install et lance wazuh-installl.sh en mode AIO - 15 min
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: curl -s -O https://packages.wazuh.com/4.10/wazuh-install.sh && bash wazuh-install.sh -a
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user