« Atelier SysRes SE4 2024/2025 E10 » : différence entre les versions
(5 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
Lilian Grévin | Lilian Grévin | ||
== Creation des VM == | == Creation des VM == | ||
<syntaxhighlight | <syntaxhighlight> | ||
xen-create-image --hostname=SE4.Orion --dhcp --dir=/usr/local/xen --size=10G --dist=daedalus --memory=2G --bridge=Styx | xen-create-image --hostname=SE4.Orion --dhcp --dir=/usr/local/xen --size=10G --dist=daedalus --memory=2G --bridge=Styx | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Ligne 52 : | Ligne 52 : | ||
https://docs.gandi.net/en/ssl/common_operations/csr.html | https://docs.gandi.net/en/ssl/common_operations/csr.html | ||
<syntaxhighlight | <syntaxhighlight> | ||
openssl req -nodes -newkey rsa:2048 -sha256 -keyout basrion.online.key -out server.csr -utf8 | openssl req -nodes -newkey rsa:2048 -sha256 -keyout basrion.online.key -out server.csr -utf8 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight> | |||
Country Name (2 letter code) [AU]:FR | Country Name (2 letter code) [AU]:FR | ||
State or Province Name (full name) [Some-State]:Nord | State or Province Name (full name) [Some-State]:Nord | ||
Ligne 65 : | Ligne 64 : | ||
Common Name (e.g. server FQDN or YOUR name) []:basrion.online | Common Name (e.g. server FQDN or YOUR name) []:basrion.online | ||
Email Address []:lilian.grevin@polytech-lille.net | Email Address []:lilian.grevin@polytech-lille.net | ||
</syntaxhighlight> | |||
basrion.online.key server.csr | |||
<syntaxhighlight> | |||
root@Orion:/etc/bind# ls | |||
bind.keys db.0 db.127 db.255 db.basrion.online db.empty db.local named.conf named.conf.default-zones named.conf.local named.conf.options rndc.key zones.rfc1918 | |||
root@Orion:/etc/bind# cat named.conf.local | |||
// | |||
// Do any local configuration here | |||
// | |||
// Consider adding the 1918 zones here, if they are not used in your | |||
// organization | |||
//include "/etc/bind/zones.rfc1918"; | |||
zone "basrion.online" { | |||
type master; | |||
file "/etc/bind/db.basrion.online"; | |||
allow-transfer{secondaries;}; // filtrage des secondaires | |||
//also-notify{hiddensecondaries;}; // pour les secondaires vicieux | |||
notify yes; | |||
}; | |||
acl "secondaries" { | |||
192.168.2.3; // Serveur secondaire | |||
fe80::216:3eff:fe28:c918; // Serveur secondaire en IPv6 | |||
}; | |||
root@Orion:/etc/bind# cat db.basrion.online | |||
$TTL 200 | |||
@ IN SOA ns1.basrion.online. admin.basrion.online. ( | |||
2025020501 ; Serial Number | |||
86400 ; Refresh (1 jour) | |||
7200 ; Retry (2 heures) | |||
1209600 ; Expire (14 jours) | |||
3600 ) ; Minimum TTL (1 heure) | |||
@ IN NS ns1.basrion.online. | |||
ns1 IN A 193.48.57.171 | |||
IN AAAA 2001:660:4401:60a0:216:3eff:fe7c:cea | |||
</syntaxhighlight> | |||
https://oldwiki.gandi.net/fr/hosting/using-linux/tutorials/ubuntu/ssl.html | |||
<syntaxhighlight> | |||
root@Orion:/etc/apache2/sites-available# cat 000-basrion.online-ssl.conf | |||
#NameVirtualHost *:443 | |||
<VirtualHost *:80> | |||
ServerName basrion.online | |||
Redirect permanent / https://basrion.online/ | |||
</VirtualHost> | |||
<VirtualHost *:443> | |||
ServerName basrion.online | |||
ServerAlias basrion.online | |||
DocumentRoot /var/www/basrion.online | |||
CustomLog /var/log/apache2/secure_access.log combined | |||
SSLEngine on | |||
SSLCertificateFile /etc/ssl/certs/basrion.online.crt | |||
SSLCertificateKeyFile /etc/ssl/private/basrion.online.key | |||
SSLCertificateChainFile /etc/ssl/certs/GandiCert.pem | |||
SSLVerifyClient None | |||
</VirtualHost> | |||
</syntaxhighlight> |
Version actuelle datée du 11 février 2025 à 16:54
Lilian Grévin
Creation des VM
xen-create-image --hostname=SE4.Orion --dhcp --dir=/usr/local/xen --size=10G --dist=daedalus --memory=2G --bridge=Styx
Configuration de la machine de service
Afin de rendre les partitions permanentes pour les répertoires /var et /home, il faut ajouter une ligne pour chaque partition dans le fichier /etc/fstab, en précisant le nom de la partition, le point de montage (respectivement /var et /home), le type de système de fichiers (ici ext4), ainsi que les options de montage
La commande df -h permet de vérifier l'espace disque utilisé et disponible sur les systèmes de fichiers montés, ici df -h permet de s'assurer que nos partitions ont bien été montées aux bons endroits et que l'espace disque est correctement attribué
Ping entre les VM
Pour configurer le réseau, nous avons modifié le fichier /etc/network/interfaces afin que la machine de services obtienne automatiquement une adresse IPv6 et utilise une adresse IPv4 fixe sur le réseau privé de la machine mandataire
VM Orion:
Interface de notre machine mandataire Zeus:
Chaque machine possède une adresse fixe sur le commutateur virtuel privé, ce qui permet aux différentes VM de communiquer entre elles et de se ping sans problème
apt install
En ayant voulu faire un apt update sur Zeus j'ai eu cette erreur:
En regardant on voit que c'est car la date est mauvaise
J'ai donc installer ntpdate et ntp pour mettre à jour à la date:
On a une date correcte et je peux enfin faire apt update
SLL Certificates
https://docs.gandi.net/en/ssl/common_operations/csr.html
openssl req -nodes -newkey rsa:2048 -sha256 -keyout basrion.online.key -out server.csr -utf8
Country Name (2 letter code) [AU]:FR
State or Province Name (full name) [Some-State]:Nord
Locality Name (eg, city) []:Lille
Organization Name (eg, company) [Internet Widgits Pty Ltd]:PolytechLille
Organizational Unit Name (eg, section) []:SE
Common Name (e.g. server FQDN or YOUR name) []:basrion.online
Email Address []:lilian.grevin@polytech-lille.net
basrion.online.key server.csr
root@Orion:/etc/bind# ls
bind.keys db.0 db.127 db.255 db.basrion.online db.empty db.local named.conf named.conf.default-zones named.conf.local named.conf.options rndc.key zones.rfc1918
root@Orion:/etc/bind# cat named.conf.local
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "basrion.online" {
type master;
file "/etc/bind/db.basrion.online";
allow-transfer{secondaries;}; // filtrage des secondaires
//also-notify{hiddensecondaries;}; // pour les secondaires vicieux
notify yes;
};
acl "secondaries" {
192.168.2.3; // Serveur secondaire
fe80::216:3eff:fe28:c918; // Serveur secondaire en IPv6
};
root@Orion:/etc/bind# cat db.basrion.online
$TTL 200
@ IN SOA ns1.basrion.online. admin.basrion.online. (
2025020501 ; Serial Number
86400 ; Refresh (1 jour)
7200 ; Retry (2 heures)
1209600 ; Expire (14 jours)
3600 ) ; Minimum TTL (1 heure)
@ IN NS ns1.basrion.online.
ns1 IN A 193.48.57.171
IN AAAA 2001:660:4401:60a0:216:3eff:fe7c:cea
https://oldwiki.gandi.net/fr/hosting/using-linux/tutorials/ubuntu/ssl.html
root@Orion:/etc/apache2/sites-available# cat 000-basrion.online-ssl.conf
#NameVirtualHost *:443
<VirtualHost *:80>
ServerName basrion.online
Redirect permanent / https://basrion.online/
</VirtualHost>
<VirtualHost *:443>
ServerName basrion.online
ServerAlias basrion.online
DocumentRoot /var/www/basrion.online
CustomLog /var/log/apache2/secure_access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/basrion.online.crt
SSLCertificateKeyFile /etc/ssl/private/basrion.online.key
SSLCertificateChainFile /etc/ssl/certs/GandiCert.pem
SSLVerifyClient None
</VirtualHost>