Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:redhat:rh134:l107 [2024/10/21 15:23] – admin | elearning:workbooks:redhat:rh134:l107 [2024/11/21 15:28] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | |||
- | Version : **2024.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LRF606 | + | ======RH13408 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LRF606 | + | * **RH13408 |
* Contenu du Module | * Contenu du Module | ||
- | * Les Problématiques | + | * Présentation du Network File System (NFS) |
- | * L'IP Spoofing | + | * NFSv3 |
- | * Déni de Service (DoS) | + | * Les Services et Processus Principaux du Serveur NFSv3 |
- | * SYN Flooding | + | * Options d'un Partage NFSv3 |
- | * Flood | + | * Commandes |
- | * Le Contre-Mesure | + | * NFSv4 |
- | * Le Pare-feu Netfilter/ | + | * Différences entre NFSv4 et NFSv3 |
- | * LAB #1 - La Configuration | + | * LAB #1 - Configuration du Serveur NFSv4 |
- | * La Configuration de Base de firewalld | + | * 1.1 - Désactivation de NFSv3 |
- | * La Commande firewall-cmd | + | |
- | * La Configuration | + | |
- | * Le mode Panic de firewalld | + | * 2.1 - Montage Éphémère |
+ | * 2.2 - Montage Persistant | ||
+ | * LAB #3 - Configuration de NFSv4 avec Automounter | ||
+ | * Présentation | ||
+ | * Le Service autofs | ||
+ | * 3.1 - Création d'un Fichier | ||
+ | * Configuration du Serveur | ||
+ | * Configuration | ||
+ | * 3.2 - Création d'un Fichier | ||
+ | * Configuration du Serveur | ||
+ | * Configuration du Client | ||
- | =====Les Problématiques===== | + | =====Présentation du Network File System (NFS)===== |
- | ====L'IP Spoofing==== | + | Le Network File System (NFS) est un protocole Internet standard que Linux, UNIX et d'autres systèmes d' |
+ | les permissions Linux natives et les attributs du système de fichiers. | ||
- | L'IP Spoofing consiste en faire croire à un serveur que sa machine possède une adresse IP autre que celle réellement attribuée. Le but de cette opération est de se placer | + | Par défaut, Red Hat 9 utilise la version 4.2 de NFS. RHEL prend entièrement |
- | * L' | + | Les serveurs NFS exportent des répertoires. Les clients NFS montent les répertoires exportés dans un répertoire local existant. Les clients NFS peuvent monter les répertoires exportés de plusieurs manières : |
- | * L' | + | |
- | * L' | + | |
- | * Le serveur accepte la requête car elle provient d'une adresse IP à laquelle il peux faire confiance et renvoie une réponse en utilisant la route spécifiée par l' | + | |
- | * Le client utilise la route spécifiée par l' | + | |
- | ====Déni | + | * Manuellement en utilisant la commande mount, |
+ | * De manière persistante au démarrage en configurant des entrées dans le fichier / | ||
+ | * À la demande, en configurant une méthode | ||
- | Une attaque de déni de service consiste à rendre inopérable une machine en lui envoyant une grande quantité de données inutiles. Un exemple de ce type d'attaque s' | + | Les méthodes |
- | * L' | + | * le service autofs, |
- | * Il envoie ensuite un ping à une machine de diffusion, | + | * systemd.automount. |
- | * La machine de diffusion envoie ce même ping à un grand nombre de clients en spécifiant l' | + | |
- | * L' | + | |
- | * Tous les clients renvoie une réponse au ping //en même temps// à la cible. | + | |
- | ====SYN Flooding==== | + | Il convient d' |
- | Le **SYN Flooding**, aussi appelé un //SYN-ACK Attack//, consiste | + | Red Hat 9 prend également en charge le montage de répertoires partagés |
+ | **Common Internet File System** (CIFS). Les options | ||
- | ====Flood==== | + | ====NFSv3==== |
- | Le **Flood** consiste à envoyer très rapidement des gros paquets **ICMP** vers la cible. | + | Le protocole NFS a changé de manière significative entre NFSv3 et NFSv4. La méthode d' |
- | =====Le Contre-Mesure===== | + | ===Les Services et Processus Principaux du Serveur NFSv3=== |
- | Le contre-mesure est principalement l' | + | La version NFSv3 utilise les services suivants : |
- | ====Le Pare-feu Netfilter/ | + | ^ Services ^ Fonction ^ |
+ | | **nfsd** | Démarre le service NFS ainsi que les processus RPC pour recevoir et traiter les demandes des clients | | ||
+ | | **nfslock** | Démarre les processus RPC qui permettent aux clients de verrouiller les fichiers sur le serveur | ||
+ | | **portmap** | Gestion des réservations des ports pour les services RPC locaux afin que les services RPC distants puissent se connecter | | ||
- | **Netfilter** est composé de 5 //hooks// : | + | ===Options d'un Partage NFSv3=== |
- | * NF_IP_PRE_ROUTING | + | Certaines options, appliquées à un partage, modifient le comportement du serveur NFSv3 pour le partage concerné lors de son démarrage : |
- | * NF_IP_LOCAL_IN | + | |
- | * NF_IP_LOCAL_OUT | + | |
- | * NF_IP_FORWARD | + | |
- | * NF_IP_POSTROUTING | + | |
- | Ces hooks sont utilisés par deux branches, | + | ^ Option ^ Comportement ^ |
+ | | **ro** | Accès en lecture seule | | ||
+ | | **rw** | Accès en lecture / écriture | | ||
+ | | **sync** | Ecriture synchrone ( écriture immédiate sur disque ) | | ||
+ | | **async** | Ecriture asynchrone ( écriture sur disque en utilisant une cache ) | | ||
+ | | **root_squash** | Root perd ses prérogatives sur le partage concerné | | ||
+ | | **no_root_squash** | Root garde ses prérogatives sur le partage concerné | | ||
+ | | **no_lock** | Pas de verrous sur les fichiers accédés | | ||
+ | | **all_squash** | Force la mapping de tous les utilisateurs | ||
+ | | **anonuid** | Fixe l'UID de l' | ||
+ | | **anongid** | Fixe le GID de l' | ||
- | * NF_IP_PRE_ROUTING | + | <WRAP center round important> |
+ | **Important** : Si plusieurs options sont spécifiées, | ||
+ | </WRAP> | ||
- | tandis que la deuxième concerne les paquets qui traversent la passerelle: | + | ===Commandes de Base de NFSv3=== |
- | * NF_IP_PRE_ROUTING > NF_IP_FORWARD > NF_IP_POSTROUTING | + | Plusieurs commandes permettent de gérer et de s' |
- | Si IPTABLES a été compilé en tant que module, son utilisation nécessite | + | ^ Commande ^ Comportement ^ |
+ | | **exportfs** | Affiche les partages actifs sur le serveur courant | | ||
+ | | **nfsstat** | Affiche les statistiques | ||
+ | | **rpcinfo** | Affiche les démons gérés | ||
+ | | **showmount** | Affiche les partages actifs sur un serveur distant | | ||
+ | | **mount** | Permet | ||
- | * iptable_filter | + | ====NFSv4==== |
- | * iptable_mangle | + | |
- | * iptable_net | + | |
- | * etc | + | |
- | Netfilter est organisé en **tables**. La commande **iptables** de netfilter permet d' | + | ===Différences entre NFSv4 et NFSv3==== |
- | * La table **FILTER** | + | Le protocole NFSv4 a éliminé l' |
- | * La chaîne INPUT | + | |
- | * Concerne | + | |
- | * Policies: ACCEPT, DROP, REJECT | + | |
- | * La chaîne OUTPUT | + | |
- | * Concerne les paquets sortants | + | |
- | * Policies: ACCEPT, DROP, REJECT | + | |
- | * La chaîne FORWARD | + | |
- | * Concerne les paquets traversant | + | |
- | * Policies: ACCEPT, DROP, REJECT | + | |
- | Si aucune table n'est précisée, c'est la table FILTER qui s'applique par défaut. | + | NFSv4 a introduit une arborescence d'exportation qui contient tous les chemins d' |
- | * La table **NAT** | + | Le format |
- | * La chaîne PREROUTING | + | |
- | * Permet | + | |
- | * Cibles: SNAT, DNAT, MASQUERADE | + | |
- | * La chaîne POSTROUTING | + | |
- | * Permet de faire la translation d' | + | |
- | * Cibles: SNAT, DNAT, MASQUERADE | + | |
- | * Le cas spécifique OUTPUT | + | |
- | * Permet la modification de la destination des paquets générés localement | + | |
- | * La table **MANGLE** | + | < |
- | * Permet le marquage de paquets générés localement (OUTPUT) et entrants (PREROUTING) | + | # mkdir /mountpoint |
- | Les **policies** sont: | + | # mount -t nfs -o rw,sync server:/export / |
+ | </ | ||
- | * ACCEPT | + | <WRAP center round important 60%> |
- | * Permet d'accepter le paquet concerné | + | **Important** : L'option |
- | | + | </ |
- | | + | |
- | * REJECT | + | |
- | * Permet de rejeter le paquet concerné | + | |
- | Les **cibles** sont: | + | Pour monter une exportation NFSv4 tout en parcourant l' |
- | * SNAT | + | A noter que, les répertoires exportés qui utilisent la sécurité Kerberos n' |
- | * Permet de modifier | + | |
- | * DNAT | + | |
- | * Permet de modifier | + | |
- | * MASQUERADE | + | |
- | * Permet de remplacer | + | |
- | IPTABLES peut être configuré soit par des outils tels shorewall, soit en utilisant des lignes de commandes ou un script. Dans ce dernier cas, la ligne prend la forme: | + | =====LAB #1 - Configuration du Serveur NFSv4===== |
- | # IPTABLES --action CHAINE --option1 --option2 | + | Vérifiez l' |
- | Les actions sont: | + | < |
+ | [root@redhat9 ~]# virsh list --all | ||
+ | | ||
+ | ------------------------- | ||
+ | | ||
+ | | ||
+ | </ | ||
- | ^ Action | + | Connectez-vous à machine virtuelle **testvm2** et activez et démarrez le service **nfs-server** : |
- | | - -append | -A | Ajouter une règle | + | |
- | | - -delete | -D | Supprimer une règle en spécifiant son numéro ou la règle à supprimer | | + | |
- | | - -replace | -R | Permet de remplacer la règle spécifée par son numéro | | + | |
- | | - -insert | -I | Permet d' | + | |
- | | - -list | -L | Permet d' | + | |
- | | - -flush | | + | |
- | Les options sont: | + | < |
+ | [root@redhat9 ~]# virsh console testvm2 | ||
+ | Connected to domain ' | ||
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm2 ~]# systemctl enable --now nfs-server | ||
+ | Created symlink / | ||
+ | [root@testvm2 ~]# systemctl status nfs-server | ||
+ | ● nfs-server.service - NFS server and services | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | Process: 5309 ExecStartPre=/ | ||
+ | Process: 5310 ExecStart=/ | ||
+ | Process: 5329 ExecStart=/ | ||
+ | Main PID: 5329 (code=exited, | ||
+ | CPU: 31ms | ||
- | ^ Option | + | Oct 28 12:08:12 testvm2.ittraining.loc systemd[1]: Starting NFS server and serv> |
- | | - -protocol | -p | Permet de spécifier un protocol - tcp, udp, icmp, all | | + | Oct 28 12:08:12 testvm2.ittraining.loc systemd[1]: Finished NFS server and serv> |
- | | - -source | -s | Permet de spécifier une adresse source | | + | </code> |
- | | - -destination | -d | Permet de spécifier une adresse de destination | | + | |
- | | - -in-interface | -i | Permet de spécifier une interface réseau d' | + | |
- | | - -out-interface | -o | Permet de spécifier une interface réseau de sortie | | + | |
- | | - -fragment | -f | Permet de ne spécifier que les paquets fragmentés | | + | |
- | | - -source-port | -sport | + | |
- | | - -destination-port | -dport | + | |
- | | - -tcp-flags | s/o | Permet de spécifier un flag TCP à matcher - SYN, ACK, FIN, RST, URG, PSH, ALL, NONE | | + | |
- | | - -icmp-type | s/o | Permet de spécifier un type de paquet ICMP | | + | |
- | | - -mac-source | s/o | Permet de spécifier une adresse MAC | | + | |
- | Les options spécifiques à NET sont: | + | ====1.1 - Désactivation de NFSv3==== |
- | | - -to-destination | s/o | Permet | + | Le serveur NFS fonctionne en mode mixte NFSv3/NFSv4. Ceci est visible grâce à la sortie |
- | | - -to-source | s/o | Permet spécifier l' | + | |
- | Les options spécifiques aux LOGS sont: | + | < |
+ | [root@testvm2 ~]# nfsstat | ||
+ | Server rpc stats: | ||
+ | calls badcalls | ||
+ | 0 0 0 0 0 | ||
+ | </ | ||
- | | - -log-level | s/o | Permet de spécifier | + | Pour désactiver |
- | | - -log-prefix | s/o | Permet de spécifier un préfix pour les logs | | + | |
- | L' | + | < |
+ | [root@testvm2 ~]# cat / | ||
+ | ... | ||
+ | [nfsd] | ||
+ | # debug=0 | ||
+ | # threads=8 | ||
+ | # host= | ||
+ | # port=0 | ||
+ | # grace-time=90 | ||
+ | # lease-time=90 | ||
+ | # udp=n | ||
+ | # tcp=y | ||
+ | # vers3=y | ||
+ | # vers4=y | ||
+ | # vers4.0=y | ||
+ | # vers4.1=y | ||
+ | # vers4.2=y | ||
+ | rdma=y | ||
+ | rdma-port=20049 | ||
+ | ... | ||
+ | </ | ||
- | | - -state | s/o | Permet de spécifier l' | + | < |
+ | [root@testvm2 ~]# vi / | ||
+ | [root@testvm2 ~]# cat / | ||
+ | ... | ||
+ | [nfsd] | ||
+ | # debug=0 | ||
+ | # threads=8 | ||
+ | # host= | ||
+ | # port=0 | ||
+ | # grace-time=90 | ||
+ | # lease-time=90 | ||
+ | # udp=n | ||
+ | # tcp=y | ||
+ | vers3=n | ||
+ | # vers4=y | ||
+ | # vers4.0=y | ||
+ | # vers4.1=y | ||
+ | vers4.2=y | ||
+ | rdma=y | ||
+ | rdma-port=20049 | ||
+ | ... | ||
+ | </code> | ||
- | Ce dernier cas fait référence au STATEFUL. Le STATEFUL est la capacité du par-feu à enregistrer dans une table spécifique, | + | Désactivez tous les services NFSv3 : |
- | Il existe 4 états: | + | < |
+ | [root@testvm2 ~]# systemctl mask --now rpc-statd.service rpcbind.service rpcbind.socket | ||
+ | Created symlink / | ||
+ | Created symlink / | ||
+ | Created symlink / | ||
+ | </ | ||
- | | + | Redémarrez le service |
- | | + | |
- | | + | |
- | | + | |
- | * RELATED | + | |
- | * Le paquet est d'une connexion qui présente une relation avec une autre connexion | + | |
- | * INVALID | + | |
- | * La paquet provient d'une connexion anormale. | + | |
- | ====LAB | + | < |
+ | [root@testvm2 ~]# systemctl restart nfs-server | ||
+ | </ | ||
- | Firewalld utilise des **zones** - des jeux de règles pré-définis dans lesquels sont placés les interfaces | + | Vérifiez la désactivation de NFSv3 en consultant le fichier |
- | * **trusted** - un réseau fiable. Dans ce cas tous les ports sont autorisés, | + | < |
- | * **work**, **home**, **internal** - un réseau partiellement fiable. Dans ce cas quelques ports sont autorisés, | + | [root@testvm2 ~]# cat / |
- | * **dmz**, **public**, **external** | + | -3 +4 +4.1 +4.2 |
- | * **block**, **drop** - tout est interdit. La zone drop n' | + | </ |
- | <WRAP center round important 50%> | + | Créez ensuite le fichier |
- | **Important** - Une interface ne peut être que dans une zone à la fois tandis que plusieurs interfaces peuvent être dans la même zone. | + | |
- | </WRAP> | + | |
- | Le service | + | < |
+ | [root@testvm2 ~]# mkdir / | ||
+ | |||
+ | [root@testvm2 ~]# vi / | ||
+ | |||
+ | [root@testvm2 ~]# cat / | ||
+ | [Service] | ||
+ | ExecStart= | ||
+ | ExecStart=/ | ||
+ | </ | ||
+ | |||
+ | Rechargez le service **nfs-mountd** | ||
< | < | ||
- | [root@centos8 | + | [root@testvm2 ~]# systemctl daemon-reload |
- | ● firewalld.service - firewalld - dynamic firewall daemon | + | |
- | | + | [root@testvm2 ~]# systemctl restart nfs-mountd |
- | | + | |
- | | + | [root@testvm2 |
- | Main PID: 1079 (firewalld) | + | ● nfs-mountd.service - NFS Mount Daemon |
- | Tasks: | + | |
- | | + | |
- | | + | |
- | | + | Active: active (running) since Mon 2024-10-28 12:44:22 CET; 10s ago |
+ | | ||
+ | | ||
+ | Main PID: 1412 (rpc.mountd) | ||
+ | Tasks: | ||
+ | | ||
+ | CPU: 6ms | ||
+ | CGroup: / | ||
+ | | ||
- | Oct 01 12:13:53 centos8.ittraining.loc systemd[1]: Starting | + | Oct 28 12:44:22 testvm2.ittraining.loc systemd[1]: Starting |
- | Oct 01 12:13:55 centos8.ittraining.loc | + | Oct 28 12:44:22 testvm2.ittraining.loc |
- | Oct 01 12:13:56 centos8.ittraining.loc | + | Oct 28 12:44:22 testvm2.ittraining.loc |
- | [q] | + | Oct 28 12:44:22 testvm2.ittraining.loc systemd[1]: Started NFS Mount Daemon. |
</ | </ | ||
- | ===La Configuration de Base de firewalld=== | + | ====1.2 - Définition d'un Partage==== |
- | La configuration par défaut de firewalld se trouve dans **/usr/ | + | Créez le répertoire |
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | total 16 | + | </code> |
- | drwxr-xr-x. 2 root root 224 Mar 6 2022 helpers | + | |
- | drwxr-xr-x. 2 root root 4096 Mar 6 2022 icmptypes | + | |
- | drwxr-xr-x. 2 root root 20 Mar 6 2022 ipsets | + | |
- | drwxr-xr-x. 2 root root 33 Mar 6 2022 policies | + | |
- | drwxr-xr-x. 2 root root 8192 Mar 6 2022 services | + | |
- | drwxr-xr-x. 2 root root 203 Mar 6 2022 zones | + | |
- | [root@centos8 | + | Modifez les permissions et le groupe du répertoire : |
- | total 44 | + | |
- | -rw-r--r--. 1 root root 299 Aug 9 2021 block.xml | + | < |
- | -rw-r--r--. 1 root root 293 Aug 9 2021 dmz.xml | + | [root@testvm2 |
- | -rw-r--r--. 1 root root 291 Aug 9 2021 drop.xml | + | |
- | -rw-r--r--. 1 root root 304 Aug 9 2021 external.xml | + | |
- | -rw-r--r--. 1 root root 397 Aug 9 2021 home.xml | + | |
- | -rw-r--r--. 1 root root 412 Aug 9 2021 internal.xml | + | |
- | -rw-r--r--. 1 root root 809 Nov 26 2019 libvirt.xml | + | |
- | -rw-r--r--. 1 root root 729 Aug 18 2021 nm-shared.xml | + | |
- | -rw-r--r--. 1 root root 343 Aug 9 2021 public.xml | + | |
- | -rw-r--r--. 1 root root 162 Aug 9 2021 trusted.xml | + | |
- | -rw-r--r--. 1 root root 339 Aug 9 2021 work.xml | + | |
- | [root@centos8 | + | [root@testvm2 |
- | total 704 | + | |
- | -rw-r--r--. 1 root root 399 Aug 9 2021 amanda-client.xml | + | |
- | -rw-r--r--. 1 root root 427 Aug 9 2021 amanda-k5-client.xml | + | |
- | -rw-r--r--. 1 root root 283 Aug 9 2021 amqps.xml | + | |
- | -rw-r--r--. 1 root root 273 Aug 9 2021 amqp.xml | + | |
- | -rw-r--r--. 1 root root 285 Aug 9 2021 apcupsd.xml | + | |
- | -rw-r--r--. 1 root root 301 Aug 9 2021 audit.xml | + | |
- | -rw-r--r--. 1 root root 320 Aug 9 2021 bacula-client.xml | + | |
- | -rw-r--r--. 1 root root 346 Aug 9 2021 bacula.xml | + | |
- | -rw-r--r--. 1 root root 429 Aug 9 2021 bb.xml | + | |
- | -rw-r--r--. 1 root root 339 Aug 9 2021 bgp.xml | + | |
- | -rw-r--r--. 1 root root 275 Aug 9 2021 bitcoin-rpc.xml | + | |
- | -rw-r--r--. 1 root root 307 Aug 9 2021 bitcoin-testnet-rpc.xml | + | |
- | -rw-r--r--. 1 root root 281 Aug 9 2021 bitcoin-testnet.xml | + | |
- | -rw-r--r--. 1 root root 244 Aug 9 2021 bitcoin.xml | + | |
- | -rw-r--r--. 1 root root 410 Aug 9 2021 bittorrent-lsd.xml | + | |
- | -rw-r--r--. 1 root root 294 Aug 9 2021 ceph-mon.xml | + | |
- | -rw-r--r--. 1 root root 329 Aug 9 2021 ceph.xml | + | |
- | -rw-r--r--. 1 root root 168 Aug 9 2021 cfengine.xml | + | |
- | -rw-r--r--. 1 root root 211 Aug 9 2021 cockpit.xml | + | |
- | -rw-r--r--. 1 root root 296 Aug 9 2021 collectd.xml | + | |
- | -rw-r--r--. 1 root root 260 Aug 9 2021 condor-collector.xml | + | |
- | -rw-r--r--. 1 root root 296 Aug 9 2021 ctdb.xml | + | |
- | -rw-r--r--. 1 root root 305 Aug 9 2021 dhcpv6-client.xml | + | |
- | -rw-r--r--. 1 root root 234 Aug 9 2021 dhcpv6.xml | + | |
- | -rw-r--r--. 1 root root 227 Aug 9 2021 dhcp.xml | + | |
- | -rw-r--r--. 1 root root 205 Aug 9 2021 distcc.xml | + | |
- | -rw-r--r--. 1 root root 318 Aug 9 2021 dns-over-tls.xml | + | |
- | -rw-r--r--. 1 root root 346 Aug 9 2021 dns.xml | + | |
- | -rw-r--r--. 1 root root 374 Aug 9 2021 docker-registry.xml | + | |
- | -rw-r--r--. 1 root root 391 Aug 9 2021 docker-swarm.xml | + | |
- | -rw-r--r--. 1 root root 228 Aug 9 2021 dropbox-lansync.xml | + | |
- | -rw-r--r--. 1 root root 338 Aug 9 2021 elasticsearch.xml | + | |
- | -rw-r--r--. 1 root root 304 Aug 9 2021 etcd-client.xml | + | |
- | -rw-r--r--. 1 root root 304 Aug 9 2021 etcd-server.xml | + | |
- | -rw-r--r--. 1 root root 224 Aug 9 2021 finger.xml | + | |
- | -rw-r--r--. 1 root root 270 Aug 9 2021 foreman-proxy.xml | + | |
- | -rw-r--r--. 1 root root 408 Aug 9 2021 foreman.xml | + | |
- | -rw-r--r--. 1 root root 709 Aug 9 2021 freeipa-4.xml | + | |
- | -rw-r--r--. 1 root root 489 Aug 9 2021 freeipa-ldaps.xml | + | |
- | -rw-r--r--. 1 root root 488 Aug 9 2021 freeipa-ldap.xml | + | |
- | -rw-r--r--. 1 root root 242 Aug 9 2021 freeipa-replication.xml | + | |
- | -rw-r--r--. 1 root root 657 Aug 9 2021 freeipa-trust.xml | + | |
- | -rw-r--r--. 1 root root 361 Aug 9 2021 ftp.xml | + | |
- | -rw-r--r--. 1 root root 292 Aug 9 2021 galera.xml | + | |
- | -rw-r--r--. 1 root root 184 Aug 9 2021 ganglia-client.xml | + | |
- | -rw-r--r--. 1 root root 176 Aug 9 2021 ganglia-master.xml | + | |
- | -rw-r--r--. 1 root root 212 Aug 9 2021 git.xml | + | |
- | -rw-r--r--. 1 root root 218 Aug 9 2021 grafana.xml | + | |
- | -rw-r--r--. 1 root root 119 Aug 9 2021 gre.xml | + | |
- | -rw-r--r--. 1 root root 608 Aug 9 2021 high-availability.xml | + | |
- | -rw-r--r--. 1 root root 448 Aug 9 2021 https.xml | + | |
- | -rw-r--r--. 1 root root 353 Aug 9 2021 http.xml | + | |
- | -rw-r--r--. 1 root root 372 Aug 9 2021 imaps.xml | + | |
- | -rw-r--r--. 1 root root 327 Aug 9 2021 imap.xml | + | |
- | -rw-r--r--. 1 root root 454 Aug 9 2021 ipp-client.xml | + | |
- | -rw-r--r--. 1 root root 427 Aug 9 2021 ipp.xml | + | |
- | -rw-r--r--. 1 root root 894 Aug 9 2021 ipsec.xml | + | |
- | -rw-r--r--. 1 root root 255 Aug 9 2021 ircs.xml | + | |
- | -rw-r--r--. 1 root root 247 Aug 9 2021 irc.xml | + | |
- | -rw-r--r--. 1 root root 264 Aug 9 2021 iscsi-target.xml | + | |
- | -rw-r--r--. 1 root root 358 Aug 9 2021 isns.xml | + | |
- | -rw-r--r--. 1 root root 213 Aug 9 2021 jenkins.xml | + | |
- | -rw-r--r--. 1 root root 182 Aug 9 2021 kadmin.xml | + | |
- | -rw-r--r--. 1 root root 272 Aug 9 2021 kdeconnect.xml | + | |
- | -rw-r--r--. 1 root root 233 Aug 9 2021 kerberos.xml | + | |
- | -rw-r--r--. 1 root root 384 Aug 9 2021 kibana.xml | + | |
- | -rw-r--r--. 1 root root 249 Aug 9 2021 klogin.xml | + | |
- | -rw-r--r--. 1 root root 221 Aug 9 2021 kpasswd.xml | + | |
- | -rw-r--r--. 1 root root 182 Aug 9 2021 kprop.xml | + | |
- | -rw-r--r--. 1 root root 242 Aug 9 2021 kshell.xml | + | |
- | -rw-r--r--. 1 root root 308 Aug 9 2021 kube-apiserver.xml | + | |
- | -rw-r--r--. 1 root root 232 Aug 9 2021 ldaps.xml | + | |
- | -rw-r--r--. 1 root root 199 Aug 9 2021 ldap.xml | + | |
- | -rw-r--r--. 1 root root 385 Aug 9 2021 libvirt-tls.xml | + | |
- | -rw-r--r--. 1 root root 389 Aug 9 2021 libvirt.xml | + | |
- | -rw-r--r--. 1 root root 269 Aug 9 2021 lightning-network.xml | + | |
- | -rw-r--r--. 1 root root 324 Aug 9 2021 llmnr.xml | + | |
- | -rw-r--r--. 1 root root 349 Aug 9 2021 managesieve.xml | + | |
- | -rw-r--r--. 1 root root 432 Aug 9 2021 matrix.xml | + | |
- | -rw-r--r--. 1 root root 424 Aug 9 2021 mdns.xml | + | |
- | -rw-r--r--. 1 root root 245 Aug 9 2021 memcache.xml | + | |
- | -rw-r--r--. 1 root root 343 Aug 9 2021 minidlna.xml | + | |
- | -rw-r--r--. 1 root root 237 Aug 9 2021 mongodb.xml | + | |
- | -rw-r--r--. 1 root root 473 Aug 9 2021 mosh.xml | + | |
- | -rw-r--r--. 1 root root 211 Aug 9 2021 mountd.xml | + | |
- | -rw-r--r--. 1 root root 296 Aug 9 2021 mqtt-tls.xml | + | |
- | -rw-r--r--. 1 root root 287 Aug 9 2021 mqtt.xml | + | |
- | -rw-r--r--. 1 root root 170 Aug 9 2021 mssql.xml | + | |
- | -rw-r--r--. 1 root root 190 Aug 9 2021 ms-wbt.xml | + | |
- | -rw-r--r--. 1 root root 242 Aug 9 2021 murmur.xml | + | |
- | -rw-r--r--. 1 root root 171 Aug 9 2021 mysql.xml | + | |
- | -rw-r--r--. 1 root root 250 Aug 9 2021 nbd.xml | + | |
- | -rw-r--r--. 1 root root 342 Aug 9 2021 nfs3.xml | + | |
- | -rw-r--r--. 1 root root 324 Aug 9 2021 nfs.xml | + | |
- | -rw-r--r--. 1 root root 293 Aug 9 2021 nmea-0183.xml | + | |
- | -rw-r--r--. 1 root root 247 Aug 9 2021 nrpe.xml | + | |
- | -rw-r--r--. 1 root root 389 Aug 9 2021 ntp.xml | + | |
- | -rw-r--r--. 1 root root 368 Aug 9 2021 nut.xml | + | |
- | -rw-r--r--. 1 root root 335 Aug 9 2021 openvpn.xml | + | |
- | -rw-r--r--. 1 root root 260 Aug 9 2021 ovirt-imageio.xml | + | |
- | -rw-r--r--. 1 root root 343 Aug 9 2021 ovirt-storageconsole.xml | + | |
- | -rw-r--r--. 1 root root 235 Aug 9 2021 ovirt-vmconsole.xml | + | |
- | -rw-r--r--. 1 root root 1024 Aug 9 2021 plex.xml | + | |
- | -rw-r--r--. 1 root root 433 Aug 9 2021 pmcd.xml | + | |
- | -rw-r--r--. 1 root root 474 Aug 9 2021 pmproxy.xml | + | |
- | -rw-r--r--. 1 root root 544 Aug 9 2021 pmwebapis.xml | + | |
- | -rw-r--r--. 1 root root 460 Aug 9 2021 pmwebapi.xml | + | |
- | -rw-r--r--. 1 root root 357 Aug 9 2021 pop3s.xml | + | |
- | -rw-r--r--. 1 root root 348 Aug 9 2021 pop3.xml | + | |
- | -rw-r--r--. 1 root root 181 Aug 9 2021 postgresql.xml | + | |
- | -rw-r--r--. 1 root root 509 Aug 9 2021 privoxy.xml | + | |
- | -rw-r--r--. 1 root root 213 Aug 9 2021 prometheus.xml | + | |
- | -rw-r--r--. 1 root root 261 Aug 9 2021 proxy-dhcp.xml | + | |
- | -rw-r--r--. 1 root root 424 Aug 9 2021 ptp.xml | + | |
- | -rw-r--r--. 1 root root 414 Aug 9 2021 pulseaudio.xml | + | |
- | -rw-r--r--. 1 root root 297 Aug 9 2021 puppetmaster.xml | + | |
- | -rw-r--r--. 1 root root 273 Aug 9 2021 quassel.xml | + | |
- | -rw-r--r--. 1 root root 520 Aug 9 2021 radius.xml | + | |
- | -rw-r--r--. 1 root root 183 Aug 9 2021 rdp.xml | + | |
- | -rw-r--r--. 1 root root 212 Aug 9 2021 redis-sentinel.xml | + | |
- | -rw-r--r--. 1 root root 268 Aug 9 2021 redis.xml | + | |
- | -rw-r--r--. 1 root root 381 Aug 9 2021 RH-Satellite-6-capsule.xml | + | |
- | -rw-r--r--. 1 root root 556 Aug 9 2021 RH-Satellite-6.xml | + | |
- | -rw-r--r--. 1 root root 214 Aug 9 2021 rpc-bind.xml | + | |
- | -rw-r--r--. 1 root root 213 Aug 9 2021 rquotad.xml | + | |
- | -rw-r--r--. 1 root root 310 Aug 9 2021 rsh.xml | + | |
- | -rw-r--r--. 1 root root 311 Aug 9 2021 rsyncd.xml | + | |
- | -rw-r--r--. 1 root root 350 Aug 9 2021 rtsp.xml | + | |
- | -rw-r--r--. 1 root root 329 Aug 9 2021 salt-master.xml | + | |
- | -rw-r--r--. 1 root root 371 Aug 9 2021 samba-client.xml | + | |
- | -rw-r--r--. 1 root root 1298 Aug 9 2021 samba-dc.xml | + | |
- | -rw-r--r--. 1 root root 448 Aug 9 2021 samba.xml | + | |
- | -rw-r--r--. 1 root root 324 Aug 9 2021 sane.xml | + | |
- | -rw-r--r--. 1 root root 283 Aug 9 2021 sips.xml | + | |
- | -rw-r--r--. 1 root root 496 Aug 9 2021 sip.xml | + | |
- | -rw-r--r--. 1 root root 299 Aug 9 2021 slp.xml | + | |
- | -rw-r--r--. 1 root root 231 Aug 9 2021 smtp-submission.xml | + | |
- | -rw-r--r--. 1 root root 577 Aug 9 2021 smtps.xml | + | |
- | -rw-r--r--. 1 root root 550 Aug 9 2021 smtp.xml | + | |
- | -rw-r--r--. 1 root root 308 Aug 9 2021 snmptrap.xml | + | |
- | -rw-r--r--. 1 root root 342 Aug 9 2021 snmp.xml | + | |
- | -rw-r--r--. 1 root root 405 Aug 9 2021 spideroak-lansync.xml | + | |
- | -rw-r--r--. 1 root root 275 Aug 9 2021 spotify-sync.xml | + | |
- | -rw-r--r--. 1 root root 173 Aug 9 2021 squid.xml | + | |
- | -rw-r--r--. 1 root root 421 Aug 9 2021 ssdp.xml | + | |
- | -rw-r--r--. 1 root root 463 Aug 9 2021 ssh.xml | + | |
- | -rw-r--r--. 1 root root 631 Aug 9 2021 steam-streaming.xml | + | |
- | -rw-r--r--. 1 root root 287 Aug 9 2021 svdrp.xml | + | |
- | -rw-r--r--. 1 root root 231 Aug 9 2021 svn.xml | + | |
- | -rw-r--r--. 1 root root 297 Aug 9 2021 syncthing-gui.xml | + | |
- | -rw-r--r--. 1 root root 311 Aug 9 2021 syncthing.xml | + | |
- | -rw-r--r--. 1 root root 496 Aug 9 2021 synergy.xml | + | |
- | -rw-r--r--. 1 root root 444 Aug 9 2021 syslog-tls.xml | + | |
- | -rw-r--r--. 1 root root 329 Aug 9 2021 syslog.xml | + | |
- | -rw-r--r--. 1 root root 393 Aug 9 2021 telnet.xml | + | |
- | -rw-r--r--. 1 root root 252 Aug 9 2021 tentacle.xml | + | |
- | -rw-r--r--. 1 root root 288 Aug 9 2021 tftp-client.xml | + | |
- | -rw-r--r--. 1 root root 424 Aug 9 2021 tftp.xml | + | |
- | -rw-r--r--. 1 root root 221 Aug 9 2021 tile38.xml | + | |
- | -rw-r--r--. 1 root root 336 Aug 9 2021 tinc.xml | + | |
- | -rw-r--r--. 1 root root 771 Aug 9 2021 tor-socks.xml | + | |
- | -rw-r--r--. 1 root root 244 Aug 9 2021 transmission-client.xml | + | |
- | -rw-r--r--. 1 root root 264 Aug 9 2021 upnp-client.xml | + | |
- | -rw-r--r--. 1 root root 593 Aug 9 2021 vdsm.xml | + | |
- | -rw-r--r--. 1 root root 475 Aug 9 2021 vnc-server.xml | + | |
- | -rw-r--r--. 1 root root 310 Aug 9 2021 wbem-https.xml | + | |
- | -rw-r--r--. 1 root root 352 Aug 9 2021 wbem-http.xml | + | |
- | -rw-r--r--. 1 root root 323 Aug 9 2021 wsmans.xml | + | |
- | -rw-r--r--. 1 root root 316 Aug 9 2021 wsman.xml | + | |
- | -rw-r--r--. 1 root root 329 Aug 9 2021 xdmcp.xml | + | |
- | -rw-r--r--. 1 root root 509 Aug 9 2021 xmpp-bosh.xml | + | |
- | -rw-r--r--. 1 root root 488 Aug 9 2021 xmpp-client.xml | + | |
- | -rw-r--r--. 1 root root 264 Aug 9 2021 xmpp-local.xml | + | |
- | -rw-r--r--. 1 root root 545 Aug 9 2021 xmpp-server.xml | + | |
- | -rw-r--r--. 1 root root 314 Aug 9 2021 zabbix-agent.xml | + | |
- | -rw-r--r--. 1 root root 315 Aug 9 2021 zabbix-server.xml | + | |
- | [root@centos8 | + | [root@testvm2 |
- | total 180 | + | drwxrws---. 2 root users 6 Oct 28 13:05 / |
- | -rw-r--r--. 1 root root 385 Aug 9 2021 address-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 258 Aug 9 2021 bad-header.xml | + | |
- | -rw-r--r--. 1 root root 294 Aug 9 2021 beyond-scope.xml | + | |
- | -rw-r--r--. 1 root root 279 Aug 9 2021 communication-prohibited.xml | + | |
- | -rw-r--r--. 1 root root 222 Aug 9 2021 destination-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 173 Aug 9 2021 echo-reply.xml | + | |
- | -rw-r--r--. 1 root root 210 Aug 9 2021 echo-request.xml | + | |
- | -rw-r--r--. 1 root root 261 Aug 9 2021 failed-policy.xml | + | |
- | -rw-r--r--. 1 root root 280 Aug 9 2021 fragmentation-needed.xml | + | |
- | -rw-r--r--. 1 root root 266 Aug 9 2021 host-precedence-violation.xml | + | |
- | -rw-r--r--. 1 root root 257 Aug 9 2021 host-prohibited.xml | + | |
- | -rw-r--r--. 1 root root 242 Aug 9 2021 host-redirect.xml | + | |
- | -rw-r--r--. 1 root root 239 Aug 9 2021 host-unknown.xml | + | |
- | -rw-r--r--. 1 root root 247 Aug 9 2021 host-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 229 Aug 9 2021 ip-header-bad.xml | + | |
- | -rw-r--r--. 1 root root 355 Aug 9 2021 neighbour-advertisement.xml | + | |
- | -rw-r--r--. 1 root root 457 Aug 9 2021 neighbour-solicitation.xml | + | |
- | -rw-r--r--. 1 root root 250 Aug 9 2021 network-prohibited.xml | + | |
- | -rw-r--r--. 1 root root 248 Aug 9 2021 network-redirect.xml | + | |
- | -rw-r--r--. 1 root root 239 Aug 9 2021 network-unknown.xml | + | |
- | -rw-r--r--. 1 root root 247 Aug 9 2021 network-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 239 Aug 9 2021 no-route.xml | + | |
- | -rw-r--r--. 1 root root 328 Aug 9 2021 packet-too-big.xml | + | |
- | -rw-r--r--. 1 root root 225 Aug 9 2021 parameter-problem.xml | + | |
- | -rw-r--r--. 1 root root 233 Aug 9 2021 port-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 256 Aug 9 2021 precedence-cutoff.xml | + | |
- | -rw-r--r--. 1 root root 249 Aug 9 2021 protocol-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 185 Aug 9 2021 redirect.xml | + | |
- | -rw-r--r--. 1 root root 244 Aug 9 2021 reject-route.xml | + | |
- | -rw-r--r--. 1 root root 241 Aug 9 2021 required-option-missing.xml | + | |
- | -rw-r--r--. 1 root root 227 Aug 9 2021 router-advertisement.xml | + | |
- | -rw-r--r--. 1 root root 223 Aug 9 2021 router-solicitation.xml | + | |
- | -rw-r--r--. 1 root root 248 Aug 9 2021 source-quench.xml | + | |
- | -rw-r--r--. 1 root root 236 Aug 9 2021 source-route-failed.xml | + | |
- | -rw-r--r--. 1 root root 253 Aug 9 2021 time-exceeded.xml | + | |
- | -rw-r--r--. 1 root root 233 Aug 9 2021 timestamp-reply.xml | + | |
- | -rw-r--r--. 1 root root 228 Aug 9 2021 timestamp-request.xml | + | |
- | -rw-r--r--. 1 root root 258 Aug 9 2021 tos-host-redirect.xml | + | |
- | -rw-r--r--. 1 root root 257 Aug 9 2021 tos-host-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 272 Aug 9 2021 tos-network-redirect.xml | + | |
- | -rw-r--r--. 1 root root 269 Aug 9 2021 tos-network-unreachable.xml | + | |
- | -rw-r--r--. 1 root root 293 Aug 9 2021 ttl-zero-during-reassembly.xml | + | |
- | -rw-r--r--. 1 root root 256 Aug 9 2021 ttl-zero-during-transit.xml | + | |
- | -rw-r--r--. 1 root root 259 Aug 9 2021 unknown-header-type.xml | + | |
- | -rw-r--r--. 1 root root 249 Aug 9 2021 unknown-option.xml | + | |
</ | </ | ||
- | Ces fichiers | + | Créez ensuite les fichiers **test1.txt** et **test2.txt** dans le répertoire **/ |
< | < | ||
- | [root@centos8 ~]# cat /usr/ | + | [root@testvm2 mountpoint1]# cd /mountpoint |
- | <?xml version=" | + | |
- | < | + | [root@testvm2 mountpoint]# |
- | < | + | |
- | < | + | [root@testvm2 mountpoint1]# |
- | < | + | |
- | < | + | |
- | <service name=" | + | |
- | <service name=" | + | |
- | <service name=" | + | |
- | </ | + | |
</ | </ | ||
- | La configuration de firewalld ainsi que les définitions et règles personnalisées se trouvent dans **/etc/firewalld** : | + | Editez ensuite le fichier |
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | total 8 | + | |
- | -rw-r--r--. 1 root root 2840 Aug 9 2021 firewalld.conf | + | |
- | drwxr-x---. 2 root root 6 Aug 9 2021 helpers | + | |
- | drwxr-x---. 2 root root 6 Aug 9 2021 icmptypes | + | |
- | drwxr-x---. 2 root root 6 Aug 9 2021 ipsets | + | |
- | -rw-r--r--. 1 root root 283 Aug 9 2021 lockdown-whitelist.xml | + | |
- | drwxr-x---. 2 root root 6 Aug 9 2021 policies | + | |
- | drwxr-x---. 2 root root 6 Aug 9 2021 services | + | |
- | drwxr-x---. 2 root root 46 Aug 9 2021 zones | + | |
- | [root@centos8 | + | [root@testvm2 |
- | total 8 | + | /mountpoint |
- | -rw-r--r--. 1 root root 380 Jun 16 2021 public.xml | + | </ |
- | -rw-r--r--. 1 root root 343 Jun 16 2021 public.xml.old | + | |
- | [root@centos8 ~]# ls -l /etc/firewalld/ | + | Configurez SELinux en mode **permissive** et arrêtez le service **firewalld** : |
- | total 0 | + | |
- | [root@centos8 | + | < |
- | total 0 | + | [root@testvm2 |
+ | |||
+ | [root@testvm2 ~]# systemctl stop firewalld | ||
</ | </ | ||
- | Le fichier de configuration de firewalld est **/ | + | Redémarrez le service |
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | # firewalld config file | + | |
- | # default zone | + | [root@testvm2 ~]# systemctl status nfs-server |
- | # The default zone used if an empty zone string is used. | + | ● nfs-server.service - NFS server and services |
- | # Default: public | + | Loaded: loaded (/ |
- | DefaultZone=public | + | Active: active (exited) since Mon 2024-10-28 13:10:35 CET; 10s ago |
+ | Docs: man: | ||
+ | | ||
+ | Process: 1475 ExecStartPre=/ | ||
+ | Process: 1476 ExecStart=/ | ||
+ | Process: 1486 ExecStart=/ | ||
+ | Main PID: 1486 (code=exited, | ||
+ | CPU: 30ms | ||
- | # Clean up on exit | + | Oct 28 13:10:34 testvm2.ittraining.loc systemd[1]: Starting NFS server and serv> |
- | # If set to no or false the firewall configuration will not get cleaned up | + | Oct 28 13:10:35 testvm2.ittraining.loc systemd[1]: Finished NFS server and serv> |
- | # on exit or stop of firewalld | + | </ |
- | # Default: yes | + | |
- | CleanupOnExit=yes | + | |
- | # Lockdown | + | Ajoutez le groupe et l' |
- | # If set to enabled, firewall changes with the D-Bus interface will be limited | + | |
- | # to applications that are listed in the lockdown whitelist. | + | |
- | # The lockdown whitelist file is lockdown-whitelist.xml | + | |
- | # Default: no | + | |
- | Lockdown=no | + | |
- | # IPv6_rpfilter | + | < |
- | # Performs a reverse path filter test on a packet for IPv6. If a reply to the | + | [root@testvm2 ~]# groupadd trainee && useradd trainee -c Trainee -d / |
- | # packet would be sent via the same interface that the packet arrived on, the | + | </ |
- | # packet will match and be accepted, otherwise dropped. | + | |
- | # The rp_filter for IPv4 is controlled using sysctl. | + | |
- | # Note: This feature has a performance impact. See man page FIREWALLD.CONF(5) | + | |
- | # for details. | + | |
- | # Default: yes | + | |
- | IPv6_rpfilter=yes | + | |
- | # IndividualCalls | + | Définissez le mot de passe **trainee** pour l' |
- | # Do not use combined -restore calls, but individual calls. This increases the | + | |
- | # time that is needed to apply changes and to start the daemon, but is good for | + | |
- | # debugging. | + | |
- | # Default: no | + | |
- | IndividualCalls=no | + | |
- | # LogDenied | + | < |
- | # Add logging rules right before reject and drop rules in the INPUT, FORWARD | + | [root@testvm2 ~]# passwd trainee |
- | # and OUTPUT chains for the default rules and also final reject and drop rules | + | Changement de mot de passe pour l' |
- | # in zones. Possible values are: all, unicast, broadcast, multicast and off. | + | Nouveau mot de passe : trainee |
- | # Default: off | + | MOT DE PASSE INCORRECT |
- | LogDenied=off | + | Retapez le nouveau mot de passe : trainee |
+ | passwd : mise à jour réussie de tous les jetons d' | ||
+ | </ | ||
- | # FirewallBackend | + | =====LAB |
- | # Selects the firewall backend implementation. | + | |
- | # Choices are: | + | |
- | # - nftables (default) | + | |
- | # - iptables (iptables, ip6tables, ebtables and ipset) | + | |
- | FirewallBackend=nftables | + | |
- | # FlushAllOnReload | + | Déconnectez-vous de la machine virtuelle **testvm2** |
- | # Flush all runtime rules on a reload. In previous releases some runtime | + | |
- | # configuration was retained during a reload, namely; interface to zone | + | |
- | # assignment, and direct rules. This was confusing to users. To get the old | + | |
- | # behavior set this to " | + | |
- | # Default: yes | + | |
- | FlushAllOnReload=yes | + | |
- | # RFC3964_IPv4 | + | < |
- | # As per RFC 3964, filter IPv6 traffic with 6to4 destination addresses that | + | [root@testvm2 ~]# [CTRL]+[VERR MAJ]+[5] |
- | # correspond to IPv4 addresses that should not be routed over the public | + | [root@redhat9 ~]# |
- | # internet. | + | </ |
- | # Defaults to " | + | |
- | RFC3964_IPv4=yes | + | |
- | # AllowZoneDrifting | + | Connectez-vous à la machine virtuelle **testvm1** : |
- | # Older versions of firewalld had undocumented behavior known as "zone | + | |
- | # drifting" | + | < |
- | # violation of zone based firewalls. However, some users rely on this behavior | + | [root@redhat9 ~]# virsh console testvm1 |
- | # to have a " | + | Connected |
- | # desire such behavior. It's disabled by default for security reasons. | + | Escape character is ^] (Ctrl + ]) |
- | # Note: If " | + | [Enter] |
- | # based zones (including the default zone). Packets never drift from interface | + | [root@testvm1 /]# |
- | # based zones to other interfaces based zones (including the default zone). | + | |
- | # Possible values; " | + | |
- | AllowZoneDrifting=yes | + | |
</ | </ | ||
- | ===La Commande firewall-cmd=== | + | Installez le paquet **nfs-utils** : |
- | firewalld s' | + | < |
+ | [root@testvm1 /]# dnf install | ||
+ | </ | ||
- | <WRAP center round important 50%> | + | Ajoutez |
- | **Important** - firewall-cmd est le front-end de firewalld en ligne de commande. Il existe aussi la commande | + | |
- | </ | + | |
- | Pour obtenir la liste de toutes les zones prédéfinies, | + | < |
+ | [root@testvm1 /]# groupadd trainee && useradd trainee -c Trainee -d / | ||
+ | </ | ||
+ | |||
+ | Définissez le mot de passe **trainee** pour l' | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-zones | + | [root@testvm1 /]# passwd trainee |
- | block dmz drop external home internal libvirt nm-shared public trusted work | + | Changement de mot de passe pour l' |
+ | Nouveau mot de passe : trainee | ||
+ | MOT DE PASSE INCORRECT : Le mot de passe comporte moins de 8 caractères | ||
+ | Retapez le nouveau mot de passe : trainee | ||
+ | passwd : mise à jour réussie de tous les jetons d' | ||
</ | </ | ||
- | Pour obtenir la liste de toutes les services prédéfinis, | + | ===2.1 - Montage Ephémère=== |
+ | |||
+ | Montez le partage **192.168.56.100:/ | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-services | + | [root@testvm1 /]# mount -t nfs -o rw,sync 192.168.56.100:/ |
- | RH-Satellite-6 RH-Satellite-6-capsule amanda-client amanda-k5-client amqp amqps apcupsd audit bacula bacula-client bb bgp bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc bittorrent-lsd ceph ceph-mon cfengine cockpit collectd condor-collector ctdb dhcp dhcpv6 dhcpv6-client distcc dns dns-over-tls docker-registry docker-swarm dropbox-lansync elasticsearch etcd-client etcd-server finger foreman foreman-proxy freeipa-4 freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp galera ganglia-client ganglia-master git grafana gre high-availability http https imap imaps ipp ipp-client ipsec irc ircs iscsi-target isns jenkins kadmin kdeconnect kerberos kibana klogin kpasswd kprop kshell kube-apiserver ldap ldaps libvirt libvirt-tls lightning-network llmnr managesieve matrix mdns memcache minidlna mongodb mosh mountd mqtt mqtt-tls ms-wbt mssql murmur mysql nbd nfs nfs3 nmea-0183 nrpe ntp nut openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole plex pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy prometheus proxy-dhcp ptp pulseaudio puppetmaster quassel radius rdp redis redis-sentinel rpc-bind rquotad rsh rsyncd rtsp salt-master samba samba-client samba-dc sane sip sips slp smtp smtp-submission smtps snmp snmptrap spideroak-lansync spotify-sync squid ssdp ssh steam-streaming svdrp svn syncthing syncthing-gui synergy syslog syslog-tls telnet tentacle tftp tftp-client tile38 tinc tor-socks transmission-client upnp-client vdsm vnc-server wbem-http wbem-https wsman wsmans xdmcp xmpp-bosh xmpp-client xmpp-local xmpp-server zabbix-agent zabbix-server | + | [172524.919003] FS-Cache: Loaded |
+ | [172525.206140] Key type dns_resolver registered | ||
+ | [172525.606078] NFS: Registering the id_resolver key type | ||
+ | [172525.606089] Key type id_resolver registered | ||
+ | [172525.606090] Key type id_legacy registered | ||
</ | </ | ||
- | Pour obtenir la liste de toutes les types ICMP prédéfinis, | + | Vérifiez que le montage a été effectué |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-icmptypes | + | [root@testvm1 /]# mount | grep mountpoint |
- | address-unreachable bad-header beyond-scope communication-prohibited destination-unreachable echo-reply echo-request failed-policy fragmentation-needed host-precedence-violation host-prohibited host-redirect host-unknown host-unreachable ip-header-bad neighbour-advertisement neighbour-solicitation network-prohibited network-redirect network-unknown network-unreachable no-route packet-too-big parameter-problem port-unreachable precedence-cutoff protocol-unreachable redirect reject-route required-option-missing router-advertisement router-solicitation source-quench source-route-failed time-exceeded timestamp-reply timestamp-request tos-host-redirect tos-host-unreachable tos-network-redirect tos-network-unreachable ttl-zero-during-reassembly ttl-zero-during-transit unknown-header-type unknown-option | + | 192.168.56.100:/ |
</ | </ | ||
- | Pour obtenir la liste des zones de la configuration courante, utilisez la commande suivante | + | Essayez |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-active-zones | + | [root@testvm1 /]# ls -l /mnt |
- | libvirt | + | ls: impossible d' |
- | interfaces: virbr0 | + | |
- | public | + | |
- | interfaces: ens18 | + | |
</ | </ | ||
- | Pour obtenir la liste des zones de la configuration courante pour une interface spécifique, | + | L' |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-zone-of-interface=ens18 | + | [root@testvm1 /]# su - trainee |
- | public | + | |
+ | [trainee@testvm1 ~]$ ls -l /mnt | ||
+ | total 0 | ||
+ | -rw-r--r--. 1 root users 0 28 oct. 13:59 test1.txt | ||
+ | -rw-r--r--. 1 root users 0 28 oct. 13:59 test2.txt | ||
</ | </ | ||
- | Pour obtenir la liste des services autorisés pour la zone public, utilisez la commande suivante | + | Créez maintenant le fichier **/ |
< | < | ||
- | [root@centos8 | + | [trainee@testvm1 |
- | cockpit dhcpv6-client ssh | + | |
+ | [trainee@testvm1 ~]$ ls -l /mnt | ||
+ | total 0 | ||
+ | -rw-r--r--. 1 root users 0 28 oct. 13:59 test1.txt | ||
+ | -rw-r--r--. 1 root users 0 28 oct. 13:59 test2.txt | ||
+ | -rw-r--r--. 1 trainee users 0 28 oct. 14:06 test3.txt | ||
</ | </ | ||
- | Pour obtenir toute la configuration pour la zone public, utilisez la commande suivante | + | ====2.2 - Montage Permanent==== |
+ | |||
+ | Démontez le point de montage **/ | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --get-active-zones | + | [root@testvm1 /]# umount /mnt |
- | libvirt | + | |
- | interfaces: virbr0 | + | [root@testvm1 /]# mount | grep mountpoint |
- | public | + | |
- | interfaces: ens18 | + | [root@testvm1 /]# ls /mnt |
- | [root@centos8 ~]# firewall-cmd --get-zone-of-interface=ens18 | + | |
- | public | + | |
- | [root@centos8 ~]# firewall-cmd --zone=public --list-services | + | |
- | cockpit dhcpv6-client ssh | + | |
- | [root@centos8 ~]# firewall-cmd --zone=public --list-all | + | |
- | public (active) | + | |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: ens18 | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: 5901/tcp | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
</ | </ | ||
- | Pour obtenir | + | Editez ensuite le fichier **/ |
< | < | ||
- | root@centos8 ~]# firewall-cmd --zone=public --list-all | + | [root@testvm1 /]# vi /etc/fstab |
- | public (active) | + | |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: ens18 | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: 5901/tcp | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | [root@centos8 ~]# firewall-cmd --list-all-zones | + | |
- | block | + | |
- | target: %%REJECT%% | + | |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | dmz | + | [root@testvm1 /]# cat /etc/fstab |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | drop | + | # |
- | | + | # /etc/fstab |
- | | + | # Created by anaconda on Fri Oct 25 15:41:24 2024 |
- | interfaces: | + | # |
- | | + | # Accessible filesystems, |
- | | + | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. |
- | | + | # |
- | | + | # After editing this file, run ' |
- | | + | # units generated from this file. |
- | | + | # |
- | | + | UUID=e778bb41-0528-4e4b-9b6b-b80070117978 / |
- | | + | UUID=6d55a589-bef2-4a9b-941f-d2f288057104 /boot |
- | icmp-blocks: | + | UUID=11306088-b22e-4906-9c31-b2f1a8b416fd none swap defaults |
- | rich rules: | + | 192.168.56.100:/ |
+ | </ | ||
- | external | + | Exécutez la commande **systemctl daemon-reload** pour une prise en compte des modifications |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: yes | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | home | + | < |
- | | + | [root@testvm1 /]# systemctl daemon-reload |
- | icmp-block-inversion: | + | [175309.751966] systemd-rc-local-generator[4833]: / |
- | | + | </ |
- | sources: | + | |
- | services: cockpit dhcpv6-client mdns samba-client ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | internal | + | Appliquez maintenant le fichier **/ |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client mdns samba-client ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | libvirt (active) | + | < |
- | | + | [root@testvm1 /]# mount -a |
- | icmp-block-inversion: | + | |
- | interfaces: virbr0 | + | |
- | sources: | + | |
- | services: dhcp dhcpv6 dns ssh tftp | + | |
- | ports: | + | |
- | protocols: icmp ipv6-icmp | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | rule priority=" | + | |
- | nm-shared | + | [root@testvm1 /]# mount | grep mountpoint |
- | | + | 192.168.56.100:/mountpoint on /mnt type nfs4 (rw, |
- | | + | </ |
- | interfaces: | + | |
- | sources: | + | |
- | services: dhcp dns ssh | + | |
- | ports: | + | |
- | protocols: icmp ipv6-icmp | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | rule priority=" | + | |
- | public (active) | + | Devenez l' |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: ens18 | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: 5901/tcp | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | trusted | + | < |
- | | + | [root@testvm1 /]# su - trainee |
- | icmp-block-inversion: | + | Dernière connexion |
- | | + | |
- | sources: | + | [trainee@testvm1 ~]$ ls -l /mnt |
- | services: | + | total 0 |
- | | + | -rw-r--r--. 1 root users 0 28 oct. 13:59 test1.txt |
- | | + | -rw-r--r--. 1 root users 0 28 oct. 13:59 test2.txt |
- | | + | -rw-r--r--. 1 trainee users 0 28 oct. 14:06 test3.txt |
- | | + | |
- | | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | work | + | [trainee@testvm1 ~]$ exit |
- | | + | déconnexion |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
</ | </ | ||
- | Pour changer la zone par défaut | + | Déconnectez-vous |
< | < | ||
- | [root@centos8 | + | [root@testvm1 /]# [CTRL]+[VERR MAJ]+[5] |
- | success | + | [root@redhat9 |
+ | </ | ||
- | [root@centos8 | + | Connectez-vous à la machine virtuelle **testvm2** : |
- | libvirt | + | |
- | | + | < |
- | work | + | [root@redhat9 |
- | | + | Connected to domain ' |
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm2 ~]# | ||
</ | </ | ||
- | Pour ajouter l' | + | Vérifiez |
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | success | + | total 0 |
+ | -rw-r--r--. 1 root users 0 Oct 28 13:59 test1.txt | ||
+ | -rw-r--r--. 1 root users 0 Oct 28 13:59 test2.txt | ||
+ | -rw-r--r--. 1 trainee users 0 Oct 28 14:06 test3.txt | ||
+ | </ | ||
- | [root@centos8 | + | =====LAB #3 - Configuration de NFSv4 avec Automounter===== |
- | libvirt | + | |
- | | + | ====Présentation==== |
- | work | + | |
- | | + | L' |
+ | |||
+ | Automounter a été créée pour résoudre le problème des utilisateurs non privilégiés qui ne disposent pas des autorisations suffisantes pour utiliser la commande **mount**. Sans l' | ||
+ | |||
+ | En outre, si un système de fichiers local ou distant n'est pas monté au démarrage à l'aide de la configuration **/ | ||
+ | |||
+ | Les fichiers de configuration d' | ||
+ | |||
+ | Bien que les systèmes de fichiers spécifiés dans /etc/fstab se montent au démarrage du système restent montés jusqu' | ||
+ | |||
+ | L' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Lorsque le système de fichiers est à nouveau monté, le service autofs utilise la configuration de montage la plus récente, contrairement à un montage dans le fichier /etc/fstab, qui peut encore utiliser une configuration montée il y a plusieurs mois lors du dernier démarrage du système. En outre, si la configuration de serveur NFS comprend des serveurs et des chemins d' | ||
+ | |||
+ | ====Le Service autofs==== | ||
+ | |||
+ | Le service autofs prend en charge les mêmes systèmes de fichiers locaux et distants que le fichier /etc/fstab, y compris les protocoles de partage de fichiers NFS et SMB, et prend en charge les mêmes options de montage spécifiques au protocole, y compris les paramètres de sécurité. Les systèmes de fichiers montés par l' | ||
+ | |||
+ | Comme l' | ||
+ | |||
+ | La différence est qu'un système de fichiers Automounter reste démonté jusqu' | ||
+ | |||
+ | ====3.1 - Création d'un Fichier de Mappage Indirect==== | ||
+ | |||
+ | On parle de montage indirect lorsque l' | ||
+ | |||
+ | ===Configuration du Serveur=== | ||
+ | |||
+ | Editez le fichier **/ | ||
+ | |||
+ | < | ||
+ | [root@testvm2 | ||
+ | |||
+ | [root@testvm2 ~]# cat / | ||
+ | / | ||
+ | /home | ||
+ | </ | ||
+ | |||
+ | Redémarrez le service **nfs-server** | ||
+ | |||
+ | < | ||
+ | [root@testvm2 ~]# systemctl restart nfs-server | ||
</ | </ | ||
- | Pour supprimer | + | Devenez |
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | success | + | Last login: Tue Oct 29 13:56:07 CET 2024 on ttyS0 |
- | [root@centos8 | + | [trainee@testvm2 |
- | libvirt | + | |
- | interfaces: virbr0 | + | |
- | work | + | |
- | interfaces: ens18 | + | |
</ | </ | ||
- | Pour ajouter le service **http** à la zone **work**, utilisez la commande suivante | + | ===Configuration du Client=== |
+ | |||
+ | Déconnectez-vous de la machine virtuelle | ||
< | < | ||
- | [root@centos8 | + | [root@testvm2 ~]# [CTRL]+[VERR MAJ]+[5] |
- | success | + | [root@redhat9 |
+ | </ | ||
- | [root@centos8 | + | Connectez-vous à la machine virtuelle **testvm1** : |
- | cockpit dhcpv6-client http ssh | + | |
+ | < | ||
+ | [root@redhat9 | ||
+ | Connected to domain ' | ||
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm1 /]# | ||
</ | </ | ||
- | Pour supprimer le service | + | Configurez SELinux en mode **permissive** |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --remove-service=http | + | [root@testvm1 /]# setenforce permissive |
- | success | + | </ |
- | [root@centos8 ~]# firewall-cmd --zone=work --list-services | + | Arrêtez le service **firewalld** : |
- | cockpit dhcpv6-client ssh | + | |
+ | < | ||
+ | [root@testvm1 /]# systemctl stop firewalld | ||
</ | </ | ||
- | Pour ajouter un nouveau bloc ICMP, utilisez la commande suivante | + | Installez le paquet **autofs** |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --add-icmp-block=echo-reply | + | [root@testvm1 /]# dnf install autofs |
- | success | + | </ |
+ | |||
+ | Créez ensuite le fichier de mappage indirect maître **/ | ||
+ | |||
+ | < | ||
+ | [root@testvm1 /]# vi / | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --list-icmp-blocks | + | [root@testvm1 /]# cat / |
- | echo-reply | + | /home / |
</ | </ | ||
- | Pour supprimer un bloc ICMP, utilisez la commande suivante | + | Créez le fichier de mappage **/ |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --remove-icmp-block=echo-reply | + | [root@testvm1 /]# vi / |
- | success | + | |
- | [root@centos8 ~]# firewall-cmd --zone=work --list-icmp-blocks | + | [root@testvm1 /]# cat / |
+ | * -fstype=nfs4, | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Notez que le format du nom du fichier de mappage maître est **nom**.autofs et que le format du nom du fichier de mappage est auto.**nom**. Les deux valeurs de **nom** doivent être identique. | ||
+ | </ | ||
+ | |||
+ | Afin d' | ||
+ | |||
+ | < | ||
+ | [root@testvm1 /]# vi / | ||
- | [root@centos8 ~]# | + | [root@testvm1 /]# cat / |
+ | ... | ||
+ | # In order of likelihood of use to accelerate lookup. | ||
+ | passwd: | ||
+ | shadow: | ||
+ | group: | ||
+ | hosts: | ||
+ | services: | ||
+ | netgroup: | ||
+ | automount: | ||
+ | ... | ||
</ | </ | ||
- | Pour ajouter | + | Activez et démarrez |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --add-port=591/ | + | [root@testvm1 /]# systemctl enable |
- | success | + | |
- | [root@centos8 ~]# firewall-cmd --zone=work | + | [root@testvm1 /]# systemctl status autofs |
- | 591/tcp | + | ● autofs.service |
+ | | ||
+ | | ||
+ | Main PID: 3425 (automount) | ||
+ | Tasks: 7 (limit: 23172) | ||
+ | | ||
+ | CPU: 68ms | ||
+ | | ||
+ | | ||
+ | |||
+ | oct. 29 13:55:10 testvm1.ittraining.loc systemd[1]: Starting Automounts filesys> | ||
+ | oct. 29 13:55:10 testvm1.ittraining.loc systemd[1]: Started Automounts filesyst> | ||
</ | </ | ||
- | Pour supprimer le port 591/tcp à la zone work, utilisez | + | Vérifiez |
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --remove-port=591/tcp | + | [root@testvm1 /]# mount | tail |
- | success | + | none on / |
+ | fusectl on / | ||
+ | /dev/vda1 on /boot type xfs (rw, | ||
+ | none on / | ||
+ | sunrpc on /var/ | ||
+ | 192.168.56.100:/ | ||
+ | tmpfs on /run/user/0 type tmpfs (rw, | ||
+ | / | ||
+ | -hosts on /net type autofs (rw, | ||
+ | / | ||
+ | </ | ||
- | [root@centos8 ~]# firewall-cmd --zone=work --list-ports | + | Devenez l' |
- | [root@centos8 ~]# | + | < |
+ | [root@testvm1 /]# su - trainee | ||
+ | Dernière connexion : mardi 29 octobre 2024 à 13:55:17 CET sur ttyS0 | ||
</ | </ | ||
- | Pour créer un nouveau service, il convient de : | + | Exécutez la commande **ls**. Vous devez voir le fichier **test4.txt** qui a été créé dans la machine virtuelle **testvm2** |
- | * copier un fichier existant se trouvant dans le répertoire **/ | + | < |
- | * modifier le fichier, | + | [trainee@testvm1 ~]$ ls |
- | * recharger la configuration de firewalld, | + | test4.txt |
- | * vérifier que firewalld voit le nouveau service. | + | |
- | Par exemple | + | [trainee@testvm1 ~]$ exit |
+ | </ | ||
+ | |||
+ | Déconnectez-vous de la machine virtuelle **testvm1** | ||
< | < | ||
- | [root@centos8 | + | [root@testvm1 /]# [CTRL]+[VERR MAJ]+[5] |
+ | [root@redhat9 | ||
+ | </code> | ||
- | [root@centos8 ~]# vi / | + | Connectez-vous à la machine virtuelle **testvm2** : |
- | [root@centos8 | + | < |
- | <?xml version=" | + | [root@redhat9 |
- | < | + | Connected to domain ' |
- | < | + | Escape character is ^] (Ctrl + ]) |
- | < | + | [Enter] |
- | < | + | [root@testvm2 ~]# |
- | </service> | + | </code> |
+ | |||
+ | Devenez l' | ||
+ | |||
+ | <code> | ||
+ | [root@testvm2 ~]# su - trainee | ||
+ | Last login: Tue Oct 29 13:56:07 CET 2024 on ttyS0 | ||
- | [root@centos8 | + | [trainee@testvm2 |
- | success | + | |
- | [root@centos8 | + | [trainee@testvm2 |
- | RH-Satellite-6 RH-Satellite-6-capsule amanda-client amanda-k5-client amqp amqps apcupsd audit bacula bacula-client bb bgp bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc bittorrent-lsd ceph ceph-mon cfengine cockpit collectd condor-collector ctdb dhcp dhcpv6 dhcpv6-client distcc dns dns-over-tls docker-registry docker-swarm dropbox-lansync elasticsearch etcd-client etcd-server filemaker finger foreman foreman-proxy freeipa-4 freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp galera ganglia-client ganglia-master git grafana gre high-availability http https imap imaps ipp ipp-client ipsec irc ircs iscsi-target isns jenkins kadmin kdeconnect kerberos kibana klogin kpasswd kprop kshell kube-apiserver ldap ldaps libvirt libvirt-tls lightning-network llmnr managesieve matrix mdns memcache minidlna mongodb mosh mountd mqtt mqtt-tls ms-wbt mssql murmur mysql nbd nfs nfs3 nmea-0183 nrpe ntp nut openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole plex pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy prometheus proxy-dhcp ptp pulseaudio puppetmaster quassel radius rdp redis redis-sentinel rpc-bind rquotad rsh rsyncd rtsp salt-master samba samba-client samba-dc sane sip sips slp smtp smtp-submission smtps snmp snmptrap spideroak-lansync spotify-sync squid ssdp ssh steam-streaming svdrp svn syncthing syncthing-gui synergy syslog syslog-tls telnet tentacle tftp tftp-client tile38 tinc tor-socks transmission-client upnp-client vdsm vnc-server wbem-http wbem-https wsman wsmans xdmcp xmpp-bosh xmpp-client xmpp-local xmpp-server zabbix-agent zabbix-server | + | test4.txt |
</ | </ | ||
- | ===La Configuration Avancée | + | Déconnectez-vous |
- | La configuration de base de firewalld ne permet que la configuration des zones, services, blocs ICMP et les ports non-standard. Cependant firewalld peut également être configuré avec des **Rich Rules** ou **//Règles Riches//**. Rich Rules ou Règles Riches évaluent des **critères** pour ensuite entreprendre une **action**. | + | < |
+ | [root@testvm2 ~]# [CTRL]+[VERR MAJ]+[5] | ||
+ | [root@redhat9 ~]# | ||
+ | </code> | ||
- | Les **Critères** sont : | + | Connectez-vous à la machine virtuelle |
- | * **source address=" | + | <code> |
- | * **destination address="< | + | [root@redhat9 ~]# virsh console testvm1 |
- | * **rule port port="< | + | Connected to domain ' |
- | * **service name=<nom_d' | + | Escape character is ^] (Ctrl + ]) |
+ | [Enter] | ||
+ | [root@testvm1 /]# | ||
+ | </code> | ||
- | Les **Actions** sont : | + | Devenez l' |
- | * **accept**, | + | <code> |
- | * **reject**, | + | [trainee@testvm1 ~]$ ls |
- | * une Action reject peut être associée avec un message d' | + | test4.txt |
- | | + | |
- | Saisissez | + | [trainee@testvm1 ~]$ exit |
+ | </ | ||
+ | |||
+ | ====3.2 - Création d'un Fichier de Mappage Direct==== | ||
+ | |||
+ | On parle de montage direct lorsqu' | ||
+ | |||
+ | Déconnectez-vous de la machine virtuelle **testvm1** | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --add-rich-rule=' | + | [root@testvm1 /]# [CTRL]+[VERR MAJ]+[5] |
- | success | + | [root@redhat9 ~]# |
</ | </ | ||
- | <WRAP center round important 50%> | + | Connectez-vous à la machine virtuelle |
- | **Important** | + | |
- | </ | + | |
- | <WRAP center round important 50%> | + | <code> |
- | **Important** - Notez que la Rich Rule a créé deux règles, une pour IPv4 et une deuxième pour IPv6. Une règle peut être créée pour IPv4 seul en incluant le Critère **family=ipv4**. De la même façon, une règle peut être créée pour IPv6 seul en incluant le Critère **family=ipv6**. | + | [root@redhat9 ~]# virsh console testvm2 |
- | </WRAP> | + | Connected to domain ' |
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm2 ~]# | ||
+ | </code> | ||
- | Cette nouvelle règle est écrite en mémoire mais non pas sur disque. Pour l' | + | ===Configuration du Serveur=== |
+ | |||
+ | Éditez | ||
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | success | + | |
- | [root@centos8 | + | [root@testvm2 |
- | <?xml version=" | + | /mountpoint |
- | < | + | /home 192.168.56.0/24(rw) |
- | < | + | /mountpoint1 |
- | < | + | |
- | <service name=" | + | |
- | < | + | |
- | <service name=" | + | |
- | < | + | |
- | <port port=" | + | |
- | < | + | |
- | </ | + | |
- | </zone> | + | |
</ | </ | ||
- | <WRAP center round important 50%> | + | Redémarrez le service |
- | **Important** - Attention ! La règle ajoutée avec l' | + | |
- | </ | + | |
- | Redémarrez | + | < |
+ | [root@testvm2 ~]# systemctl restart nfs-server | ||
+ | </ | ||
+ | |||
+ | Créez | ||
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
+ | |||
+ | [root@testvm2 ~]# chmod 777 / | ||
</ | </ | ||
- | Pour visualiser cette règle dans la configuration de firewalld, il convient | + | ===Configuration du Client=== |
+ | |||
+ | Déconnectez-vous | ||
< | < | ||
- | [root@centos8 | + | [root@testvm2 |
- | work (active) | + | [root@redhat9 ~]# |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: ens18 | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | rule port port=" | + | |
</ | </ | ||
- | Notez que la Rich Rule est créée dans la Zone par Défaut. Il est possible de créer une Rich Rule dans une autre zone en utilisant l' | + | Connectez-vous à la machine virtuelle |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | success | + | Connected to domain |
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm1 /]# | ||
+ | </ | ||
+ | |||
+ | Créez le fichier de mappage direct maître **/ | ||
+ | |||
+ | < | ||
+ | [root@testvm1 /]# vi / | ||
- | [root@centos8 ~]# firewall-cmd --zone=public --list-all | + | [root@testvm1 /]# cat / |
- | public | + | /- /etc/ |
- | target: default | + | |
- | icmp-block-inversion: | + | |
- | interfaces: | + | |
- | sources: | + | |
- | services: cockpit dhcpv6-client ssh | + | |
- | ports: 5901/tcp | + | |
- | protocols: | + | |
- | forward: no | + | |
- | masquerade: no | + | |
- | forward-ports: | + | |
- | source-ports: | + | |
- | icmp-blocks: | + | |
- | rich rules: | + | |
- | rule port port=" | + | |
</ | </ | ||
+ | Créez le fichier de mappage **/ | ||
- | Pour supprimer une Rich Rule, il faut copier la ligne entière la concernant qui se trouve dans la sortie de la commande | + | < |
+ | [root@testvm1 /]# vi / | ||
+ | |||
+ | [root@testvm1 /]# cat / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Redémarrez le service | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --zone=public | + | [root@testvm1 /]# systemctl restart autofs |
- | success | + | |
+ | [root@testvm1 /]# systemctl status autofs | ||
+ | ● autofs.service | ||
+ | | ||
+ | | ||
+ | Main PID: 3612 (automount) | ||
+ | Tasks: 8 (limit: 23172) | ||
+ | | ||
+ | CPU: 29ms | ||
+ | | ||
+ | | ||
+ | |||
+ | oct. 29 14:40:16 testvm1.ittraining.loc systemd[1]: Starting Automounts filesys> | ||
+ | oct. 29 14:40:16 testvm1.ittraining.loc systemd[1]: Started Automounts filesyst> | ||
</ | </ | ||
- | ===Le mode Panic de firewalld=== | + | Vérifiez la pris en compte |
- | Le mode Panic de firewalld permet de bloquer tout le trafic avec une seule commande. Pour connaître l' | + | < |
+ | [root@testvm1 /]# mount | tail | ||
+ | fusectl on / | ||
+ | /dev/vda1 on /boot type xfs (rw, | ||
+ | none on / | ||
+ | sunrpc on / | ||
+ | 192.168.56.100:/ | ||
+ | tmpfs on /run/user/0 type tmpfs (rw, | ||
+ | / | ||
+ | -hosts on /net type autofs (rw, | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Créez le fichier **/ | ||
< | < | ||
- | [root@centos8 ~]# firewall-cmd --query-panic | + | [root@testvm1 /]# touch / |
- | no | + | |
+ | [root@testvm1 /]# ls / | ||
+ | test6.txt | ||
</ | </ | ||
- | Pour activer le mode Panic, il convient | + | Déconnectez-vous |
< | < | ||
- | # firewall-cmd --panic-on | + | [root@testvm1 /]# [CTRL]+[VERR MAJ]+[5] |
+ | [root@redhat9 ~]# | ||
</ | </ | ||
- | Pour désactiver le mode Panic, il convient de saisir | + | Connectez-vous à la machine virtuelle **testvm2** |
< | < | ||
- | # firewall-cmd --panic-off | + | [root@redhat9 ~]# virsh console testvm2 |
+ | Connected to domain ' | ||
+ | Escape character is ^] (Ctrl + ]) | ||
+ | [Enter] | ||
+ | [root@testvm2 ~]# | ||
</ | </ | ||
- | ----- | + | Consultez ls contenu du répertoire **/ |
- | Copyright © 2024 Hugh Norris. | + | |
+ | < | ||
+ | [root@testvm2 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-r--r--. 1 nobody nobody 0 Oct 29 14:43 test6.txt | ||
+ | </ | ||
+ | |||
+ | Déconnectez-vous de la machine virtuelle **testvm2** : | ||
+ | |||
+ | < | ||
+ | [root@testvm2 ~]# [CTRL]+[VERR MAJ]+[5] | ||
+ | [root@redhat9 ~]# | ||
+ | </ | ||
+ | |||
+ | ----- | ||
+ | Copyright © 2024 Hugh Norris |