Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:redhat:rh134:l103 [2024/09/26 13:26] – created admin | elearning:workbooks:redhat:rh134:l103 [2024/10/22 10:15] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2023.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF511 | + | ======RH13404 |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# sed -i ' | + | |
- | [root@centos8 ~]# sed -i ' | + | |
- | </ | + | |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF511 | + | * **RH13404 |
* Contenu du Module | * Contenu du Module | ||
- | | + | * LAB #1 - Les Droits Unix Avancés |
- | | + | * 1.1 - Les ACL |
- | * 1.1 - La Commande lspci | + | * 1.2 - Les Attributs Étendus |
- | * 1.2 - La Commande lsusb | + | * LAB #2 - Mise en place de SELinux pour sécuriser le serveur |
- | * 1.3 - La Commande lsblk | + | * 2.1 - Introducton |
- | * 1.4 - La Commande lsscsi | + | * 2.2 - Définitions |
- | * 1.5 - La Commande lscpu | + | * Security Context |
- | * 1.6 - La Commande lshw | + | * Domains et Types |
- | * 1.7 - La Commande dmidecode | + | * Roles |
- | * 1.8 - La Commande smartctl | + | * Politiques de Sécurité |
- | * 1.9 - Les Commandes accton et dump-acct | + | * Langage de Politiques |
- | * 1.10 - La Commande lastcomm | + | * allow |
- | * 1.11 - La Commande sa | + | * type |
- | * 1.12 - La Commande ac | + | * type_transition |
- | * LAB #2 - La Commande sysctl | + | * Décisions |
- | * 2.1 - Répertoire /proc | + | * Décisions |
- | * Fichiers | + | * Décisions |
- | * Processeur | + | * Commandes SELinux |
- | * Interruptions système | + | * Les Etats de SELinux |
- | * Canaux DMA | + | * Booléens |
- | * Plages d' | + | * LAB #3 - Travailler avec SELinux |
- | * Périphériques | + | * 3.1 - Copier et Déplacer des Fichiers |
- | * Modules | + | * 3.2 - Vérifier les SC des Processus |
- | * Statistiques de l' | + | * 3.3 - Visualiser la SC d'un Utilisateur |
- | * Partitions | + | * 3.4 - Vérifier la SC d'un fichier |
- | * Espaces | + | * 3.4 - La commande chcon |
- | * Statistiques | + | * 3.5 - La commande restorecon |
- | * Statistiques d' | + | * 3.6 - Le fichier / |
- | * Version du noyau | + | * 3.7 - La commande semanage |
- | * Répertoires | + | * 3.8 - La commande audit2allow |
- | * ide/scsi | + | * LAB #4 - Le Pare-feu Netfilter/ |
- | * acpi | + | * 4.1 - La Configuration par firewalld |
- | * bus | + | * 4.2 - La Configuration |
- | * net | + | * 4.3 - La Commande |
- | * sys | + | * 4.4 - La Configuration Avancée de firewalld |
- | * 2.2 - Utilisation de la Commande sysctl | + | * 4.5 - Le mode Panic de firewalld |
- | * LAB #3 - Interprétation des informations dans /proc | + | |
- | * 3.1 - free | + | |
- | * 3.2 - uptime ou w | + | |
- | * 3.3 - iostat | + | |
- | * 3.4 - hdparm | + | |
- | * 3.5 - vmstat | + | |
- | * 3.6 - mpstat | + | |
- | * 3.7 - sar | + | |
- | * Modules usb | + | |
- | * udev | + | |
- | * La Commande udevadm | + | |
- | * Système de fichiers /sys | + | |
- | * LAB #4 - Limiter les Ressources | + | |
- | * 4.1 - ulimit | + | |
- | * 4.2 - Groupes de Contrôle | + | |
- | * La Limitation | + | |
- | * La Commande | + | |
- | * La Commande cgdelete | + | |
- | * Le Fichier / | + | |
- | * La Commande cgconfigparser | + | |
- | =====Présentation des Fichiers Spéciaux===== | + | =====LAB #1 - Les Droits Unix Avancés===== |
- | Dans l' | + | ====1.1 - Les ACL==== |
- | <WRAP center round important 60%> | + | Au delà des droits étendus d'Unix, Linux utilise un système d'ACL pour permettre une meilleure gestion |
- | **Important** : Les périphériques qui nécessitent à ce que l'ordinateur soit éteint afin des les brancher/ | + | |
- | </ | + | |
- | Consultez le contenu du répertoire /dev : | + | Pour connaître les ACL positionnés sur un fichier, il convient d' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | total 0 | + | |
- | crw-r--r--. 1 root root 10, 235 Jun 28 02:04 autofs | + | [root@redhat9 ~]# getfacl tux.jpg |
- | drwxr-xr-x. | + | # file: tux.jpg |
- | drwxr-xr-x. | + | # owner: root |
- | drwxr-xr-x. 3 root root 60 Jun 28 02:04 bus | + | # group: root |
- | lrwxrwxrwx. | + | user::rw- |
- | drwxr-xr-x. 2 root root 2940 Jun 28 02:04 char | + | group::r-- |
- | drwxr-xr-x. | + | other::r-- |
- | crw-------. | + | |
- | lrwxrwxrwx. | + | |
- | drwxr-xr-x. 10 root root 200 Jun 28 02:04 cpu | + | |
- | crw-------. | + | |
- | drwxr-xr-x. | + | |
- | brw-rw----. 1 root disk 253, 0 Jun 28 02:04 dm-0 | + | |
- | brw-rw----. | + | |
- | drwxr-xr-x. | + | |
- | crw-rw----. | + | |
- | lrwxrwxrwx. | + | |
- | crw-rw-rw-. | + | |
- | crw-rw-rw-. | + | |
- | crw-------. | + | |
- | crw-------. | + | |
- | drwxr-xr-x. | + | |
- | crw-------. | + | |
- | lrwxrwxrwx. | + | |
- | drwxr-xr-x. | + | |
- | crw-r--r--. 1 root root 1, 11 Jun 28 02:04 kmsg | + | |
- | lrwxrwxrwx. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | drwxr-xr-x. | + | |
- | crw-------. | + | |
- | crw-r-----. | + | |
- | drwxrwxrwt. | + | |
- | drwxr-xr-x. | + | |
- | crw-rw-rw-. | + | |
- | --More-- | + | |
</ | </ | ||
- | On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d'autre sont de type **caractère** (**c**). | + | Pour positionner des ACL sur un fichier, il convient |
< | < | ||
- | ... | + | [root@redhat9 ~]# setfacl |
- | brw-rw----. 1 root disk 8, 1 Jun 28 02:04 sda1 | + | |
- | ... | + | [root@redhat9 ~]# getfacl tux.jpg |
- | crw-rw-rw-. 1 root tty | + | # file: tux.jpg |
- | ... | + | # owner: root |
+ | # group: root | ||
+ | user::rwx | ||
+ | user: | ||
+ | group::r-x | ||
+ | mask::rwx | ||
+ | other::--- | ||
</ | </ | ||
- | La différence entre les deux repose sur le type de communication entre le système et le module. Dans le premier cas le système accède au périphérique par des coordonnées du bloc de données sur le support tandis que dans le deuxième cas la communication d' | + | <WRAP center round important 60%> |
- | + | **Important** - Veuillez noter l' | |
- | Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : | + | </ |
- | + | ||
- | * le **majeur** identifie le pilote du périphérique et donc son contrôleur, | + | |
- | * le **mineur** identifie le périphérique | + | |
- | + | ||
- | =====LAB #1 - Découvrir le Matériel===== | + | |
- | + | ||
- | ====1.1 - La Commande lspci==== | + | |
- | Cette commande vous renseigne | + | Regardez maintenant l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) | + | |
- | 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/ | + | |
- | 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ | + | |
- | 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/ | + | |
- | 00:01.3 Bridge: Intel Corporation 82371AB/ | + | |
- | 00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) | + | |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | 00:07.0 SATA controller: Intel Corporation 82801IR/ | + | |
- | 00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device | + | |
- | 00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | + | |
- | 00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | + | |
</ | </ | ||
- | Pour obtenir de l' | + | Positionnez des ACL le répertoire avec la commande **setfacl** : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | Subsystem: Red Hat, Inc. Device 0005 | + | |
- | Physical Slot: 3 | + | |
- | Flags: bus master, fast devsel, latency 0, IRQ 10 | + | |
- | I/O ports at e000 [size=64] | + | |
- | Memory at fe400000 (64-bit, prefetchable) [size=16K] | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Kernel driver in use: virtio-pci | + | |
</ | </ | ||
- | ou : | + | Notez l' |
+ | |||
+ | Créez maintenant un fichier appelé fichier1 dans / | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | Subsystem: Red Hat, Inc. Device 0005 | + | |
- | Physical Slot: 3 | + | |
- | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- | + | |
- | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | + | |
- | Latency: 0 | + | |
- | Interrupt: pin A routed to IRQ 10 | + | |
- | Region 0: I/O ports at e000 [size=64] | + | |
- | Region 4: Memory at fe400000 (64-bit, prefetchable) [size=16K] | + | |
- | Capabilities: | + | |
- | BAR=0 offset=00000000 size=00000000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00003000 size=00001000 multiplier=00000004 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00002000 size=00001000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00001000 size=00001000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00000000 size=00001000 | + | |
- | Kernel driver in use: virtio-pci | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Utilisez |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | lspci: invalid option | + | # file: rep1 |
- | Usage: lspci [< | + | # owner: root |
+ | # group: root | ||
+ | user::rwx | ||
+ | group::r-x | ||
+ | other::r-x | ||
+ | default: | ||
+ | default: | ||
+ | default:other::--- | ||
- | Basic display modes: | + | [root@redhat9 ~]# getfacl rep1/ |
- | -mm | + | # file: rep1/ |
- | -t Show bus tree | + | # owner: root |
- | + | # group: | |
- | Display options: | + | user::r-- |
- | -v Be verbose (-vv or -vvv for higher verbosity) | + | group::--- |
- | -k Show kernel drivers handling each device | + | other::--- |
- | -x Show hex-dump of the standard part of the config space | + | |
- | -xxx Show hex-dump of the whole config space (dangerous; | + | |
- | -xxxx Show hex-dump of the 4096-byte extended config space (root only) | + | |
- | -b Bus-centric view (addresses and IRQ's as seen by the bus) | + | |
- | -D Always show domain numbers | + | |
- | -P Display bridge path in addition to bus and device number | + | |
- | -PP | + | |
- | + | ||
- | Resolving of device ID's to names: | + | |
- | -n Show numeric ID's | + | |
- | -nn Show both textual and numeric ID's (names & numbers) | + | |
- | -q Query the PCI ID database for unknown ID's via DNS | + | |
- | -qq As above, but re-query locally cached entries | + | |
- | -Q Query the PCI ID database for all ID's via DNS | + | |
- | + | ||
- | Selection of devices: | + | |
- | -s [[[[< | + | |
- | -d [< | + | |
- | + | ||
- | Other options: | + | |
- | -i < | + | |
- | -p < | + | |
- | -M Enable `bus | + | |
</ | </ | ||
- | ====1.2 - La Commande lsusb==== | + | Notez que le fichier créé possède les ACL positionnés sur le répertoire rep1. |
- | Cette commande | + | Dernièrement, |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd | + | |
- | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | + | [root@redhat9 rep1]# getfacl -R --skip-base . > backup.acl |
- | [root@centos8 ~]# lsusb -vt | + | [root@redhat9 rep1]# cat backup.acl |
- | /: Bus 01.Port 1: Dev 1, Class=root_hub, | + | # file: . |
- | |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, | + | # owner: root |
+ | # group: root | ||
+ | user::rwx | ||
+ | group:: | ||
+ | other:: | ||
+ | default: | ||
+ | default: | ||
+ | default: | ||
</ | </ | ||
- | ===Options de la commande=== | + | La restauration des ACL se fait avec la commande |
- | Les options de cette commande sont : | + | # setfacl --restore=backup.acl [Entrée] |
- | < | + | ==Options des Commandes=== |
- | [root@centos8 ~]# lsusb --help | + | |
- | Usage: lsusb [options]... | + | |
- | List USB devices | + | |
- | -v, --verbose | + | |
- | Increase verbosity (show descriptors) | + | |
- | -s [[bus]: | + | |
- | Show only devices with specified device and/or | + | |
- | bus numbers (in decimal) | + | |
- | -d vendor: | + | |
- | Show only devices with the specified vendor and | + | |
- | product ID numbers (in hexadecimal) | + | |
- | .LAB#1 | + | |
- | -D device | + | |
- | Selects which device lsusb will examine | + | |
- | -t, --tree | + | |
- | Dump the physical USB device hierarchy as a tree | + | |
- | -V, --version | + | |
- | Show version of program | + | |
- | -h, --help | + | |
- | Show usage and help | + | |
- | </ | + | |
- | ====1.3 - La Commande lsblk==== | + | Les options de la commande |
- | + | ||
- | Cette commande | + | |
< | < | ||
- | [root@centos8 ~]# lsblk | + | [root@redhat9 rep1]# getfacl --help |
- | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | + | getfacl 2.3.1 -- get file access control lists |
- | sda | + | Usage: getfacl [-aceEsRLPtpndvh] file ... |
- | ├─sda1 | + | -a, --access |
- | └─sda2 | + | |
- | ├─cl_centos8-root 253:0 0 27.8G 0 lvm / | + | |
- | | + | |
- | sdb | + | |
- | sdc | + | -s, --skip-base |
- | └─sdc1 | + | |
- | sdd | + | |
- | sr0 11:0 1 1024M 0 rom | + | |
- | + | | |
- | [root@centos8 ~]# lsblk -l | + | |
- | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | + | |
- | sda | + | |
- | sda1 8:1 0 1G 0 part /boot | + | |
- | sda2 8:2 0 | + | -h, --help this help text |
- | sdb | + | |
- | sdc | + | |
- | sdc1 8:33 | + | |
- | sdd | + | |
- | sr0 11:0 1 1024M 0 rom | + | |
- | cl_centos8-root 253:0 0 27.8G 0 lvm / | + | |
- | cl_centos8-swap 253:1 0 3.2G 0 lvm [SWAP] | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Les options de la commande |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 ~]# lsblk --help | + | [root@redhat9 rep1]# setfacl |
+ | setfacl 2.3.1 -- set file access control lists | ||
+ | Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ... | ||
+ | -m, --modify=acl | ||
+ | -M, --modify-file=file | ||
+ | -x, --remove=acl | ||
+ | -X, --remove-file=file | ||
+ | -b, --remove-all | ||
+ | -k, --remove-default | ||
+ | --set=acl | ||
+ | --set-file=file | ||
+ | --mask | ||
+ | -n, --no-mask | ||
+ | -d, --default | ||
+ | -R, --recursive | ||
+ | -L, --logical | ||
+ | -P, --physical | ||
+ | --restore=file | ||
+ | --test | ||
+ | -v, --version | ||
+ | -h, --help | ||
+ | </ | ||
- | Usage: | + | ====1.2 - Les Attributs Etendus==== |
- | lsblk [options] [< | + | |
- | List information about block devices. | + | Les attributs s' |
- | Options: | + | Les principaux attributs sont : |
- | -a, --all print all devices | + | |
- | -b, --bytes | + | |
- | -d, --nodeps | + | |
- | -D, --discard | + | |
- | -z, --zoned | + | |
- | -e, --exclude < | + | |
- | -f, --fs | + | |
- | -i, --ascii | + | |
- | -I, --include < | + | |
- | -J, --json | + | |
- | -l, --list | + | |
- | -T, --tree | + | |
- | -m, --perms | + | |
- | -n, --noheadings | + | |
- | -o, --output < | + | |
- | -O, --output-all | + | |
- | -p, --paths | + | |
- | -P, --pairs | + | |
- | -r, --raw use raw output format | + | |
- | -s, --inverse | + | |
- | -S, --scsi | + | |
- | -t, --topology | + | |
- | -x, --sort < | + | |
- | -h, --help | + | ^ Attribut ^ Description ^ |
- | -V, --version | + | | a | Fichier journal |
+ | | i | Le fichier ne peut ni être modifié, ni être détruit, ni être déplacé. Le placement d'un lien sur le fichier n'est pas permis | | ||
+ | | s | Le fichier sera physiquement détruit lors de sa suppression | | ||
+ | | D | Répertoire synchrone | | ||
+ | | S | Fichier synchrone | | ||
+ | | A | La date et l' | ||
- | Available output columns: | + | <WRAP center round important 60%> |
- | | + | **Important** |
- | | + | </WRAP> |
- | | + | |
- | FSTYPE | + | |
- | MOUNTPOINT | + | |
- | | + | |
- | UUID filesystem UUID | + | |
- | PARTTYPE | + | |
- | | + | |
- | PARTUUID | + | |
- | | + | |
- | RA read-ahead of the device | + | |
- | RO read-only device | + | |
- | RM removable device | + | |
- | | + | |
- | MODEL device identifier | + | |
- | SERIAL | + | |
- | SIZE size of the device | + | |
- | | + | |
- | | + | |
- | | + | |
- | MODE device node permissions | + | |
- | | + | |
- | MIN-IO | + | |
- | OPT-IO | + | |
- | | + | |
- | | + | |
- | ROTA rotational device | + | |
- | | + | |
- | | + | |
- | TYPE device type | + | |
- | DISC-ALN | + | |
- | | + | |
- | DISC-MAX | + | |
- | | + | |
- | | + | |
- | | + | |
- | RAND adds randomness | + | |
- | PKNAME | + | |
- | HCTL Host: | + | |
- | TRAN device transport type | + | |
- | SUBSYSTEMS | + | |
- | | + | |
- | VENDOR | + | |
- | | + | |
- | For more details see lsblk(8). | + | Les commandes associées avec les attributs sont : |
- | </ | + | |
- | ====1.4 - La Commande | + | ^ Commande |
+ | | chattr | Modifie les attributs | | ||
+ | | lsattr | Visualise les attributs | | ||
- | Cette commmande vous renseigne sur les périphériques SCSI et NVMe : | + | Pour mieux comprendre, créez le répertoire **/ |
< | < | ||
- | [root@centos8 ~]# lsscsi | + | [root@redhat9 rep1]# cd .. |
- | [1: | + | [root@redhat9 ~]# mkdir -p attributs/rep |
- | [2: | + | |
- | [3:0:0:0] | + | |
- | [4: | + | |
- | [5: | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Créez ensuite les fichier **fichier** et **rep/ |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 | + | [root@redhat9 |
- | Usage: lsscsi | + | |
- | [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] | + | |
- | [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] | + | |
- | [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] | + | |
- | [--unit] [--verbose] [--version] [--wwn] | + | |
- | where: | + | |
- | --brief|-b | + | |
- | --classic|-c | + | |
- | --controllers|-C | + | |
- | like SCSI hosts | + | |
- | --device|-d | + | |
- | --generic|-g | + | |
- | --help|-h | + | |
- | --hosts|-H | + | |
- | --kname|-k | + | |
- | --list|-L | + | |
- | attribute=value per line | + | |
- | --long|-l | + | |
- | --long-unit|-U | + | |
- | ' | + | |
- | --lunhex|-x | + | |
- | use twice to get full 16 digit hexadecimal LUN | + | |
- | --no-nvme|-N | + | |
- | --pdt|-D | + | |
- | --protection|-p | + | |
- | --protmode|-P | + | |
- | --scsi_id|-i | + | |
- | --size|-s | + | |
- | twice for power of two (e.g. 2.7 GiB), | + | |
- | thrice for number of blocks)) | + | |
- | --sysfsroot=PATH|-y PATH set sysfs mount point to PATH (def: /sys) | + | |
- | --sz-lbs|-S | + | |
- | adds comma followed by logical block size in bytes | + | |
- | --transport|-t | + | |
- | given, for initiator | + | |
- | --unit|-u | + | |
- | --verbose|-v | + | |
- | --version|-V | + | |
- | --wwn|-w | + | |
- | < | + | |
- | < | + | |
- | <' | + | |
- | + | ||
- | List SCSI devices or hosts, followed by NVMe namespaces or controllers. | + | |
- | Many storage devices (e.g. SATA disks and USB attached storage) use SCSI | + | |
- | command sets and hence are also listed by this utility. Hyphenated long | + | |
- | options can also take underscore (and vice versa). | + | |
</ | </ | ||
- | ====1.5 - La Commande lscpu==== | + | Modifiez les attributs d'une manière récursive sur le répertoire **attributs** |
- | + | ||
- | Cett commande vous renseigne sur l'architecture des CPUs : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Architecture: | + | |
- | CPU op-mode(s): | + | |
- | Byte Order: | + | |
- | CPU(s): | + | |
- | On-line CPU(s) list: 0-7 | + | |
- | Thread(s) per core: 1 | + | |
- | Core(s) per socket: | + | |
- | Socket(s): | + | |
- | NUMA node(s): | + | |
- | Vendor ID: | + | |
- | BIOS Vendor ID: QEMU | + | |
- | CPU family: | + | |
- | Model: | + | |
- | Model name: Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz | + | |
- | BIOS Model name: | + | |
- | Stepping: | + | |
- | CPU MHz: | + | |
- | BogoMIPS: | + | |
- | Virtualization: | + | |
- | Hypervisor vendor: | + | |
- | Virtualization type: full | + | |
- | L1d cache: | + | |
- | L1i cache: | + | |
- | L2 cache: | + | |
- | L3 cache: | + | |
- | NUMA node0 CPU(s): | + | |
- | Flags: | + | |
</ | </ | ||
- | ===Options | + | Visualisez les attributs |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | ----i----------------- attributs/ | ||
- | Usage: | + | attributs/ |
- | lscpu [options] | + | ----i----------------- attributs/ |
- | Display information about the CPU architecture. | + | ----i----------------- attributs/ |
+ | </ | ||
- | Options: | + | <WRAP center round important 60%> |
- | -a, --all print both online and offline CPUs (default for -e) | + | **Important** |
- | -b, --online | + | </WRAP> |
- | -c, --offline | + | |
- | -J, --json | + | |
- | -e, --extended[=<list>] print out an extended readable format | + | |
- | -p, --parse[=< | + | |
- | -s, --sysroot | + | |
- | -x, --hex print hexadecimal masks rather than lists of CPUs | + | |
- | -y, --physical | + | |
- | -h, --help | + | Essayez maintenant de déplacer le fichier **fichier**. Vous obtiendrez un résultat similaire à celui-ci : |
- | -V, --version | + | |
- | Available output columns: | + | < |
- | CPU logical CPU number | + | [root@redhat9 ~]# cd attributs; mv / |
- | | + | mv: cannot move '/ |
- | SOCKET | + | |
- | | + | |
- | NODE logical NUMA node number | + | |
- | BOOK logical book number | + | |
- | DRAWER | + | |
- | | + | |
- | POLARIZATION | + | |
- | | + | |
- | CONFIGURED | + | |
- | ONLINE | + | |
- | MAXMHZ | + | |
- | MINMHZ | + | |
- | + | ||
- | For more details see lscpu(1). | + | |
</ | </ | ||
- | ====1.6 - La Command lshw==== | + | =====LAB #2 - Mise en place de SELinux pour sécuriser le serveur===== |
- | Cette commande vous renseigne sur le matériel selon la **classe** de celui-ci. Commencez par visualiser les périphériques et leurs classes répectives : | + | ====2.1 - Introducton==== |
- | < | + | L' |
- | [root@centos8 ~]# lshw -businfo | + | ur |
- | Bus info Device | + | ^ Type de Sécurité ^ Nom ^ Description ^ |
- | ==================================================== | + | | TE | //Type enforcement/ |
- | system | + | | RBAC | |
- | bus Motherboard | + | | MAC | |
- | memory | + | | MLS | |
- | cpu@0 | + | |
- | cpu@1 | + | |
- | memory | + | |
- | memory | + | |
- | pci@0000:00: | + | |
- | pci@0000: | + | |
- | | + | |
- | | + | |
- | storage | + | |
- | system | + | |
- | pci@0000: | + | |
- | scsi@1: | + | |
- | pci@0000: | + | |
- | usb@1 | + | |
- | usb@1: | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | virtio@0 | + | |
- | pci@0000: | + | |
- | scsi@2:0.0.0 | + | |
- | scsi@2: | + | |
- | scsi@2:0.0.0,2 / | + | |
- | scsi@3: | + | |
- | scsi@4: | + | |
- | scsi@4:0.0.0,1 / | + | |
- | scsi@5: | + | |
- | pci@0000: | + | |
- | virtio@1 | + | |
- | pci@0000: | + | |
- | virtio@2 | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | input0 | + | |
- | input1 | + | |
- | input3 | + | |
- | input4 | + | |
- | input6 | + | |
- | </ | + | |
- | Consultez maintenant | + | Même quand le modèle %%SELinux%% |
- | < | + | %%SELinux%% évalue toujours des **// |
- | [root@centos8 ~]# lshw -c system | + | |
- | centos8.ittraining.loc | + | |
- | description: | + | |
- | product: Standard PC (i440FX + PIIX, 1996) | + | |
- | vendor: QEMU | + | |
- | version: pc-i440fx-7.0 | + | |
- | width: 64 bits | + | |
- | capabilities: | + | |
- | configuration: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </code> | + | |
- | Consultez maintenant | + | Dans le contexte de %%SELinux%% |
- | < | + | * un **// |
- | [root@centos8 ~]# lshw -c memory | + | * un **//objet//** peut être un fichier, un répertoire, |
- | *-firmware | + | * une **// |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | date: 04/01/2014 | + | |
- | size: 96KiB | + | |
- | *-memory | + | |
- | | + | |
- | | + | |
- | size: 16GiB | + | |
- | | + | |
- | | + | |
- | *-bank | + | |
- | description: | + | |
- | vendor: QEMU | + | |
- | physical id: 0 | + | |
- | slot: DIMM 0 | + | |
- | [root@centos8 ~]# lshw -c video | + | Chaque **//classe d' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: pci@0000: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | ====2.2 - Définitions==== | ||
- | [root@centos8 ~]# lshw -c storage | + | ===Security Context=== |
- | *-pnp00: | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-ide | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: pci@0000: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-sata | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: pci@0000: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | %%SELinux%% associe un //Security Context// (SC) à chaque **// | ||
- | [root@centos8 ~]# lshw -c disk | + | Un SC prend la forme **identité:rôle:type:niveau** : |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@1: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 32GiB (34GB) | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@3: | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 4GiB (4294MB) | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@4: | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 64GiB (68GB) | + | |
- | | + | |
- | | + | |
- | *-disk:3 | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@5: | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 32GiB (34GB) | + | |
- | | + | |
+ | ^ Nom ^ Descriptions ^ | ||
+ | | Identité | Le nom du propriétaire de l' | ||
+ | | Rôle | Essentiellement appliqué aux processus, le rôle est appelé une domaine. Dans le cas d'un rôle de fichier, celui-ci est toujours **object_r**. Un rôle se termine généralement par **_r**. | | ||
+ | | Type | Définit la classification de sécurité de l' | ||
+ | | Niveau | Un niveau est un attribut de MLS et MCS. Une plage MLS est une paire de niveaux exprimée en utilisant la syntaxe // | ||
- | [root@centos8 ~]# lshw -c volume | + | Sous RedHat 9, le fichier **/etc/selinux/targeted/setrans.conf** contient la correspondance entre les niveaux et leurs valeurs compréhensibles par l' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 1GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | size: 30GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@4: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 63GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | [root@centos8 ~]# lshw -c network | + | < |
- | *-network: | + | [root@redhat9 attributs]# cat / |
- | | + | # |
- | | + | # Multi-Category Security translation table for SELinux |
- | | + | # |
- | physical id: 12 | + | # Uncomment the following to disable translation libary |
- | bus info: pci@0000: | + | # disable=1 |
- | version: 00 | + | # |
- | width: 64 bits | + | # Objects can be categorized with 0-1023 categories defined by the admin. |
- | clock: 33MHz | + | # Objects can be in more than one category at a time. |
- | | + | # Categories are stored in the system as c0-c1023. |
- | | + | # table to translate the categories into a more meaningful output. |
- | | + | # Examples: |
- | | + | # s0:c0=CompanyConfidential |
- | description: | + | # s0:c1=PatientRecord |
- | physical id: 0 | + | # s0:c2=Unclassified |
- | bus info: virtio@1 | + | # s0:c3=TopSecret |
- | | + | # s0:c1, |
- | | + | s0=SystemLow |
- | capabilities: | + | s0-s0:c0.c1023=SystemLow-SystemHigh |
- | configuration: | + | s0:c0.c1023=SystemHigh |
- | *-network:1 | + | |
- | description: | + | |
- | | + | |
- | | + | |
- | physical id: 13 | + | |
- | bus info: pci@0000: | + | |
- | version: 00 | + | |
- | width: 64 bits | + | |
- | clock: 33MHz | + | |
- | capabilities: msix bus_master cap_list rom | + | |
- | configuration: | + | |
- | | + | |
- | *-virtio2 | + | |
- | description: Ethernet interface | + | |
- | physical id: 0 | + | |
- | bus info: virtio@2 | + | |
- | logical name: ens19 | + | |
- | serial: ea: | + | |
- | capabilities: | + | |
- | configuration: | + | |
</ | </ | ||
- | ===Options | + | Dans le contexte d'un SC pour un **// |
- | Les options de cette commande sont : | + | Dans le contexte d'un SC pour un **// |
- | < | + | %%SELinux%% maintient sa propre liste d' |
- | [root@centos8 ~]# lshw -h | + | |
- | Hardware Lister (lshw) - B.02.19.2 | + | |
- | usage: lshw [-format] [-options ...] | + | |
- | lshw -version | + | |
- | | + | < |
+ | [root@redhat9 attributs]# / | ||
- | format can be | + | Login Name |
- | -html | + | |
- | -xml output hardware tree as XML | + | |
- | -json | + | |
- | -short | + | |
- | -businfo | + | |
- | options can be | + | __default__ |
- | | + | root |
- | -class CLASS only show a certain class of hardware | + | |
- | -C CLASS same as ' | + | |
- | -c CLASS same as ' | + | |
- | -disable TEST | + | |
- | -enable TEST enable a test (like pci, isapnp, cpuid, etc. ) | + | |
- | -quiet | + | |
- | -sanitize | + | |
- | -numeric | + | |
- | -notime | + | |
</ | </ | ||
- | ====1.7 - La Commande dmidecode==== | + | ===Domains et Types=== |
- | La commande | + | Le **Domain** est l' |
- | | + | Le **Domain** contient des **// |
- | | + | |
- | < | + | Dans %%SELinux%% on utilise le mot : |
- | [root@centos8 ~]# dmidecode | + | |
- | # dmidecode 3.2 | + | |
- | Getting SMBIOS data from sysfs. | + | |
- | SMBIOS 2.8 present. | + | |
- | 11 structures occupying 511 bytes. | + | |
- | Table at 0x000F5870. | + | |
- | Handle 0x0000, DMI type 0, 24 bytes | + | * **Domain** pour un processus, |
- | BIOS Information | + | * **Type** pour un fichier. |
- | Vendor: SeaBIOS | + | |
- | Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org | + | |
- | Release Date: 04/ | + | |
- | Address: 0xE8000 | + | |
- | Runtime Size: 96 kB | + | |
- | ROM Size: 64 kB | + | |
- | Characteristics: | + | |
- | BIOS characteristics not supported | + | |
- | Targeted content distribution is supported | + | |
- | BIOS Revision: 0.0 | + | |
- | Handle 0x0100, DMI type 1, 27 bytes | + | ===Roles=== |
- | System Information | + | |
- | Manufacturer: | + | |
- | Product Name: Standard PC (i440FX + PIIX, 1996) | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Serial Number: Not Specified | + | |
- | UUID: 95bd69e3-4a74-44a7-b58c-b74fbfb86df2 | + | |
- | Wake-up Type: Power Switch | + | |
- | SKU Number: Not Specified | + | |
- | Family: Not Specified | + | |
- | Handle 0x0300, DMI type 3, 22 bytes | + | Un **Rôle** est comme un utilisateur dans le système de sécurité DAC de Linux. Chaque utilisateur autorisé peut assumer l' |
- | Chassis Information | + | |
- | Manufacturer: | + | |
- | Type: Other | + | |
- | Lock: Not Present | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Boot-up State: Safe | + | |
- | Power Supply State: Safe | + | |
- | Thermal State: Safe | + | |
- | Security Status: Unknown | + | |
- | OEM Information: | + | |
- | Height: Unspecified | + | |
- | Number Of Power Cords: Unspecified | + | |
- | Contained Elements: 0 | + | |
- | SKU Number: Not Specified | + | |
- | Handle 0x0400, DMI type 4, 42 bytes | + | ===Politiques de Sécurité=== |
- | Processor Information | + | |
- | Socket Designation: | + | |
- | Type: Central Processor | + | |
- | Family: Other | + | |
- | Manufacturer: | + | |
- | ID: 61 0F 00 00 FF FB 8B 07 | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Voltage: Unknown | + | |
- | External Clock: Unknown | + | |
- | Max Speed: 2000 MHz | + | |
- | Current Speed: 2000 MHz | + | |
- | Status: Populated, Enabled | + | |
- | Upgrade: Other | + | |
- | L1 Cache Handle: Not Provided | + | |
- | L2 Cache Handle: Not Provided | + | |
- | L3 Cache Handle: Not Provided | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Part Number: Not Specified | + | |
- | Core Count: 4 | + | |
- | Core Enabled: 4 | + | |
- | Thread Count: 1 | + | |
- | Characteristics: | + | |
- | Handle 0x0401, DMI type 4, 42 bytes | + | Une politique de sécurité définit les SC de chaque application. Elle définit des droits d' |
- | Processor Information | + | |
- | Socket Designation: | + | |
- | Type: Central Processor | + | |
- | Family: Other | + | |
- | Manufacturer: | + | |
- | ID: 61 0F 00 00 FF FB 8B 07 | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Voltage: Unknown | + | |
- | External Clock: Unknown | + | |
- | Max Speed: 2000 MHz | + | |
- | Current Speed: 2000 MHz | + | |
- | Status: Populated, Enabled | + | |
- | Upgrade: Other | + | |
- | L1 Cache Handle: Not Provided | + | |
- | L2 Cache Handle: Not Provided | + | |
- | L3 Cache Handle: Not Provided | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Part Number: Not Specified | + | |
- | Core Count: 4 | + | |
- | Core Enabled: 4 | + | |
- | Thread Count: 1 | + | |
- | Characteristics: None | + | |
- | Handle 0x1000, DMI type 16, 23 bytes | + | ^ Politique ^ Description ^ |
- | Physical Memory Array | + | | targeted | Les politiques de sécurité ne s' |
- | | + | | mls | Multi Level Security protection | |
- | Use: System Memory | + | |
- | Error Correction Type: Multi-bit ECC | + | |
- | Maximum Capacity: 4 GB | + | |
- | Error Information Handle: Not Provided | + | |
- | Number Of Devices: 1 | + | |
- | Handle 0x1100, DMI type 17, 40 bytes | + | Les politiques de sécurité se trouvent dans le répertoire **/ |
- | Memory Device | + | |
- | Array Handle: 0x1000 | + | |
- | Error Information Handle: Not Provided | + | |
- | Total Width: Unknown | + | |
- | Data Width: Unknown | + | |
- | Size: 4 GB | + | |
- | Form Factor: DIMM | + | |
- | Set: None | + | |
- | Locator: DIMM 0 | + | |
- | Bank Locator: Not Specified | + | |
- | Type: RAM | + | |
- | Type Detail: Other | + | |
- | Speed: Unknown | + | |
- | Manufacturer: | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Part Number: Not Specified | + | |
- | Rank: Unknown | + | |
- | Configured Memory Speed: Unknown | + | |
- | Minimum Voltage: Unknown | + | |
- | Maximum Voltage: Unknown | + | |
- | Configured Voltage: Unknown | + | |
- | Handle 0x1300, DMI type 19, 31 bytes | + | < |
- | Memory Array Mapped Address | + | [root@redhat9 attributs]# ls -lR / |
- | | + | / |
- | | + | total 8 |
- | Range Size: 3 GB | + | -rw-r--r--. 1 root root 1187 Oct 19 2023 config |
- | | + | -rw-r--r--. 1 root root 2668 Dec 14 2023 semanage.conf |
- | | + | drwxr-xr-x. 5 root root 133 Sep 25 12:04 targeted |
- | Handle 0x1301, DMI type 19, 31 bytes | + | / |
- | Memory Array Mapped Address | + | total 16 |
- | | + | -rw-r--r--. 1 root root 2367 Jun 5 11:17 booleans.subs_dist |
- | | + | drwxr-xr-x. 4 root root 4096 Sep 25 11:58 contexts |
- | Range Size: 1 GB | + | drwxr-xr-x. 2 root root 6 Jun 5 11:17 logins |
- | | + | drwxr-xr-x. 2 root root 23 Sep 25 12:04 policy |
- | | + | -rw-r--r--. 1 root root 607 Jun 5 11:17 setrans.conf |
+ | -rw-r--r--. | ||
- | Handle 0x2000, DMI type 32, 11 bytes | + | / |
- | System Boot Information | + | total 72 |
- | | + | -rw-r--r--. 1 root root 262 Sep 25 11:58 customizable_types |
- | + | -rw-r--r--. 1 root root 195 Jun 5 11:17 dbus_contexts | |
- | Handle 0x7F00, DMI type 127, 4 bytes | + | -rw-r--r--. 1 root root 1111 Jun 5 11:17 default_contexts |
- | End Of Table | + | -rw-r--r--. 1 root root 114 Jun 5 11:17 default_type |
+ | -rw-r--r--. 1 root root 29 Jun 5 11:17 failsafe_context | ||
+ | drwxr-xr-x. 2 root root 4096 Sep 25 12:04 files | ||
+ | --More-- | ||
</ | </ | ||
- | ===Options | + | Afin d' |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos7 ~]# dmidecode | + | [root@redhat9 attributs]# dnf install setools-console |
- | Usage: dmidecode [OPTIONS] | + | |
- | Options are: | + | |
- | -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) | + | |
- | -h, --help | + | |
- | -q, --quiet | + | |
- | -s, --string KEYWORD | + | |
- | -t, --type TYPE Only display the entries of given type | + | |
- | -u, --dump | + | |
- | | + | |
- | | + | |
- | -V, --version | + | |
</ | </ | ||
- | ====1.8 - La Commande smartctl==== | + | Pour consulter les statistiques de la politique, il convient d' |
- | + | ||
- | **smartctl** contrôle le système SMART (Self-Monitoring, | + | |
< | < | ||
- | [root@centos8 ~]# smartctl --smart=on --saveauto=on --offlineauto=on | + | [root@redhat9 attributs]# seinfo |
+ | Statistics for policy file: /sys/fs/ | ||
+ | Policy Version: | ||
+ | Target Policy: | ||
+ | Handle unknown classes: | ||
+ | Classes: | ||
+ | Sensitivities: | ||
+ | Types: | ||
+ | Users: | ||
+ | Booleans: | ||
+ | Allow: | ||
+ | Auditallow: | ||
+ | Type_trans: | ||
+ | Type_member: | ||
+ | Role allow: | ||
+ | Constraints: | ||
+ | MLS Constrain: | ||
+ | Permissives: | ||
+ | Defaults: | ||
+ | Allowxperm: | ||
+ | Auditallowxperm: | ||
+ | Ibendportcon: | ||
+ | Initial SIDs: | ||
+ | Genfscon: | ||
+ | Netifcon: | ||
+ | </ | ||
- | [root@centos8 ~]# smartctl -a /dev/sdb | + | <WRAP center round important 50%> |
- | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) | + | **Important** : Notez ici le grand nombre de la catégorie **Dontaudit**. |
- | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | + | </ |
- | === START OF INFORMATION SECTION | + | ===Langage de Politiques=== |
- | Device Model: | + | |
- | Serial Number: | + | |
- | Firmware Version: 2.5+ | + | |
- | User Capacity: | + | |
- | Sector Size: 512 bytes logical/ | + | |
- | Device is: Not in smartctl database [for details use: -P showall] | + | |
- | ATA Version is: | + | |
- | Local Time is: Sun Nov 13 09:12:18 2022 CET | + | |
- | SMART support is: Available - device has SMART capability. | + | |
- | SMART support is: Enabled | + | |
- | === START OF READ SMART DATA SECTION === | + | Un politique est composé de centaines de directives. Les principales directives sont : |
- | SMART overall-health self-assessment test result: PASSED | + | |
- | General SMART Values: | + | ==allow== |
- | Offline data collection status: | + | |
- | was completed without error. | + | |
- | Auto Offline Data Collection: Disabled. | + | |
- | Self-test execution status: | + | |
- | without error or no self-test has ever | + | |
- | been run. | + | |
- | Total time to complete Offline | + | |
- | data collection: | + | |
- | Offline data collection | + | |
- | capabilities: | + | |
- | No Auto Offline data collection support. | + | |
- | Suspend Offline collection upon new | + | |
- | command. | + | |
- | Offline surface scan supported. | + | |
- | Self-test supported. | + | |
- | No Conveyance Self-test supported. | + | |
- | No Selective Self-test supported. | + | |
- | SMART capabilities: | + | |
- | power-saving mode. | + | |
- | Supports SMART auto save timer. | + | |
- | Error logging capability: | + | |
- | No General Purpose Logging support. | + | |
- | Short self-test routine | + | |
- | recommended polling time: ( 2) minutes. | + | |
- | Extended self-test routine | + | |
- | recommended polling time: ( 54) minutes. | + | |
- | SMART Attributes Data Structure revision number: 1 | + | **allow** autorise l' |
- | Vendor Specific SMART Attributes with Thresholds: | + | |
- | ID# ATTRIBUTE_NAME | + | |
- | 1 Raw_Read_Error_Rate | + | |
- | 3 Spin_Up_Time | + | |
- | 4 Start_Stop_Count | + | |
- | 5 Reallocated_Sector_Ct | + | |
- | 9 Power_On_Hours | + | |
- | 12 Power_Cycle_Count | + | |
- | 190 Airflow_Temperature_Cel 0x0003 | + | |
- | SMART Error Log Version: 1 | + | allow user_t domaine_t |
- | No Errors Logged | + | |
- | SMART Self-test log structure revision number 1 | + | Dans cette directive |
- | No self-tests have been logged. | + | |
- | Selective Self-tests/ | + | * user_t est le type de fichier, |
- | </ | + | * domaine_t est le domaine des processus qui sont autorisés par allow, |
+ | * file (droit1 droit2 etc) est la liste des permissions accordées. | ||
- | ===Options de la commande=== | + | Les permissions possibles sont : |
- | Les options de cette commande sont : | + | * read |
+ | * write | ||
+ | * append | ||
+ | * execute | ||
+ | * getattr | ||
+ | * setattr | ||
+ | * lock | ||
+ | * link | ||
+ | * unlink | ||
+ | * rename | ||
+ | * ioctl | ||
- | < | + | ==type== |
- | [root@centos8 ~]# smartctl --help | + | |
- | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) | + | |
- | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | + | |
- | Usage: smartctl [options] device | + | La directive **type** définit un type %%SELinux%%. Le type se termine généralement par **_t**. |
- | ============================================ SHOW INFORMATION OPTIONS ===== | + | **auditallow, |
- | -h, --help, --usage | + | La directive **auditallow** demande l' |
- | | + | |
- | -V, --version, --copyright, | + | L' |
- | Print license, copyright, and version information and exit | + | |
- | -i, --info | + | ===type_transition=== |
- | Show identity information for device | + | |
- | --identify[=[w][nvb]] | + | Normalement quand un fichier est créé, il hérite du SC du répertoire parent. De même quand un processus %%SELinux%% active un nouveau processus, ce dernier s' |
- | Show words and bits from IDENTIFY DEVICE data (ATA) | + | |
- | -g NAME, --get=NAME | + | ===Décisions de SELinux=== |
- | Get device setting: all, aam, apm, dsn, lookahead, security, | + | |
- | wcache, rcache, wcreorder, wcache-sct | + | |
- | -a, --all | + | Il existe deux types de décisions auxquelles %%SELinux%% doit faire face : |
- | Show all SMART information for device | + | |
- | | + | |
- | Show all information for device | + | * **Décisions de Transition** |
- | --scan | + | ==Décisions d' |
- | Scan for devices | + | |
- | --scan-open | + | Dans ce type de décision %%SELinux%% doit décider d' |
- | Scan for devices and try to open each device | + | |
- | ================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== | + | * un **// |
+ | * un **// | ||
- | -j, --json[=[cgiosuv]] | + | ==Décisions de Transition== |
- | Print output in JSON format | + | |
- | -q TYPE, --quietmode=TYPE | + | Dans ce type de décision %%SELinux%% doit décider d' |
- | Set smartctl quiet mode to one of: errorsonly, silent, noserial | + | |
- | | + | |
- | Specify device type to one of: | + | * de créer des **//objets//** dans différents **Types** que le répertoire parent de l' |
- | ata, scsi[+TYPE], | + | |
- | -T TYPE, --tolerance=TYPE | + | ====Commandes SELinux==== |
- | | + | |
- | | + | ^ Commande ^ Description ^ |
- | Set action on bad checksum to one of: warn, exit, ignore | + | | chcon | Changer le SC d'un fichier | |
+ | | audit2allow | Générer la source de la règle de sécurité à l' | ||
+ | | restorecon | Restaurer le SC par défaut à un ou plusieurs fichiers | | ||
+ | | setfiles | ||
+ | | semodule | Gèrer les modules de politiques | | ||
+ | | semodule | ||
+ | | checkmodule | Compiler un module | | ||
+ | | semodule_package | Créer un module installable par semodule | | ||
+ | | semanage | Administrer une politique | | ||
+ | | audit2allow | ||
+ | | sesearch | Recherche des règles %%SELinux%% | | ||
+ | | seinfo | Effectuer des recherches dans la politique | | ||
+ | | getsebool | Affiche l' | ||
+ | | getsebool -a | Affiche l' | ||
+ | | sestatus -b | Affiche l' | ||
+ | | setsebool | Modifie l' | ||
+ | | togglesebool | Bascule la valeur d'un booléen | | ||
- | -r TYPE, --report=TYPE | + | ====Les Etats de SELinux==== |
- | | + | |
- | -n MODE[, | + | %%SELinux%% connait trois états |
- | No check if: never, sleep, standby, idle (see man page) | + | |
- | ============================== DEVICE FEATURE ENABLE/ | + | ^ Etat ^ Description ^ |
+ | | disabled | %%SELinux%% est inactif. | | ||
+ | | permissive | %%SELinux%% est actif mais tout est permis. Des interdictions ne font que de générer des messages d' | ||
+ | | enforcing | %%SELinux%% est actif. | | ||
- | -s VALUE, --smart=VALUE | + | L' |
- | Enable/disable SMART on device (on/off) | + | |
- | -o VALUE, --offlineauto=VALUE | + | ^ Valeur ^ Description ^ |
- | | + | | 0 | %%SELinux%% est en mode //permissive// |
+ | | 1 | %%SELinux%% est en mode // | ||
- | -S VALUE, --saveauto=VALUE | + | La configuration de l' |
- | Enable/disable Attribute autosave on device (on/off) | + | |
- | -s NAME[,VALUE], --set=NAME[, | + | < |
- | Enable/disable/change device setting: aam, | + | [root@redhat9 attributs]# cat /etc/selinux/ |
- | dsn, | + | |
- | standby, | + | |
- | wcreorder, | + | |
- | ======================================= READ AND DISPLAY DATA OPTIONS ===== | + | # This file controls the state of SELinux on the system. |
+ | # SELINUX= can take one of these three values: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # See also: | ||
+ | # https:// | ||
+ | # | ||
+ | # NOTE: In earlier Fedora kernel builds, SELINUX=disabled would also | ||
+ | # fully disable SELinux during boot. If you need a system with SELinux | ||
+ | # fully disabled instead of SELinux running with no policy loaded, you | ||
+ | # need to pass selinux=0 to the kernel command line. You can use grubby | ||
+ | # to persistently set the bootloader to boot with selinux=0: | ||
+ | # | ||
+ | # grubby --update-kernel ALL --args selinux=0 | ||
+ | # | ||
+ | # To revert back to SELinux enabled: | ||
+ | # | ||
+ | # grubby --update-kernel ALL --remove-args selinux | ||
+ | # | ||
+ | SELINUX=enforcing | ||
+ | # SELINUXTYPE= can take one of these three values: | ||
+ | # | ||
+ | # | ||
+ | # mls - Multi Level Security protection. | ||
+ | SELINUXTYPE=targeted | ||
+ | </ | ||
- | -H, --health | + | Afin de connaître l' |
- | Show device SMART health status | + | |
- | -c, --capabilities | + | < |
- | Show device SMART capabilities | + | [root@redhat9 attributs]# getenforce |
+ | Enforcing | ||
+ | </ | ||
- | -A, --attributes | + | Pour modifier l' |
- | Show device SMART vendor-specific Attributes and values | + | |
- | -f FORMAT, --format=FORMAT | + | < |
- | Set output format for attributes: old, brief, hex[,id|val] | + | [root@redhat9 attributs]# setenforce permissive |
- | -l TYPE, --log=TYPE | + | [root@redhat9 attributs]# getenforce |
- | Show device log. TYPE: error, selftest, selective, directory[,g|s], | + | Permissive |
- | | + | </ |
- | | + | |
- | scttempint, | + | |
- | gplog, | + | |
- | -v N,OPTION , --vendorattribute=N, | + | La commande **sestatus** vous informe sur la configuration de %%SELinux%% et notamment sur la version de la politique utilisée : |
- | Set display OPTION for vendor Attribute N (see man page) | + | |
- | -F TYPE, --firmwarebug=TYPE | + | < |
- | Use firmware bug workaround: | + | root@redhat9 attributs]# sestatus |
- | none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid | + | SELinux status: |
+ | SELinuxfs mount: | ||
+ | SELinux root directory: | ||
+ | Loaded policy name: | ||
+ | Current mode: | ||
+ | Mode from config file: enforcing | ||
+ | Policy MLS status: | ||
+ | Policy deny_unknown status: | ||
+ | Memory protection checking: | ||
+ | Max kernel policy version: 33 | ||
+ | </ | ||
- | -P TYPE, --presets=TYPE | + | Les différentes versions de politiques évolue en même temps que le noyau Linux. |
- | Drive-specific presets: use, ignore, show, showall | + | |
- | | + | La commande sestatus peut aussi prendre l' |
- | Read and replace [add] drive database from FILE | + | |
- | [default is +/ | + | |
- | and then / | + | |
- | ============================================ DEVICE SELF-TEST OPTIONS ===== | + | < |
+ | [root@redhat9 attributs]# sestatus | ||
+ | SELinux status: | ||
+ | SELinuxfs mount: | ||
+ | SELinux root directory: | ||
+ | Loaded policy name: | ||
+ | Current mode: | ||
+ | Mode from config file: enforcing | ||
+ | Policy MLS status: | ||
+ | Policy deny_unknown status: | ||
+ | Memory protection checking: | ||
+ | Max kernel policy version: | ||
- | -t TEST, --test=TEST | + | Process contexts: |
- | Run test. TEST: offline, short, long, conveyance, force, vendor,N, | + | Current context: |
- | | + | Init context: system_u: |
+ | / | ||
- | | + | File contexts: |
- | Do test in captive mode (along with -t) | + | Controlling terminal: |
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
- | -X, --abort | + | ====Booléens==== |
- | Abort any non-captive test on device | + | |
- | =================================================== SMARTCTL EXAMPLES ===== | + | Les booléens permettent à des ensembles de règles d' |
- | smartctl | + | Pour visualiser l' |
- | smartctl | + | < |
- | | + | [root@redhat9 attributs]# getsebool |
+ | abrt_anon_write | ||
+ | abrt_handle_event --> off | ||
+ | abrt_upload_watch_anon_write --> | ||
+ | antivirus_can_scan_system | ||
+ | antivirus_use_jit --> off | ||
+ | auditadm_exec_content --> | ||
+ | authlogin_nsswitch_use_ldap | ||
+ | authlogin_radius --> off | ||
+ | authlogin_yubikey --> off | ||
+ | awstats_purge_apache_log_files --> off | ||
+ | boinc_execmem --> | ||
+ | cdrecord_read_content --> off | ||
+ | cluster_can_network_connect --> off | ||
+ | cluster_manage_all_files --> off | ||
+ | cluster_use_execmem --> off | ||
+ | cobbler_anon_write --> off | ||
+ | cobbler_can_network_connect --> off | ||
+ | cobbler_use_cifs --> off | ||
+ | cobbler_use_nfs --> off | ||
+ | collectd_tcp_network_connect --> off | ||
+ | colord_use_nfs --> off | ||
+ | condor_tcp_network_connect --> off | ||
+ | conman_can_network --> off | ||
+ | conman_use_nfs --> off | ||
+ | container_connect_any --> off | ||
+ | container_manage_cgroup --> off | ||
+ | container_read_certs --> off | ||
+ | container_use_cephfs --> off | ||
+ | container_use_devices --> off | ||
+ | container_use_dri_devices --> | ||
+ | container_use_ecryptfs --> off | ||
+ | container_user_exec_content --> on | ||
+ | cron_can_relabel --> off | ||
+ | cron_system_cronjob_use_shares --> off | ||
+ | cron_userdomain_transition --> on | ||
+ | cups_execmem --> off | ||
+ | cvs_read_shadow --> off | ||
+ | daemons_dontaudit_scheduling --> on | ||
+ | daemons_dump_core --> off | ||
+ | daemons_enable_cluster_mode --> off | ||
+ | daemons_use_tcp_wrapper --> off | ||
+ | daemons_use_tty --> off | ||
+ | dbadm_exec_content --> on | ||
+ | dbadm_manage_user_files --> off | ||
+ | dbadm_read_user_files --> off | ||
+ | deny_bluetooth --> off | ||
+ | deny_execmem --> off | ||
+ | deny_ptrace --> off | ||
+ | dhcpc_exec_iptables --> off | ||
+ | dhcpd_use_ldap --> off | ||
+ | dnsmasq_use_ipset --> off | ||
+ | domain_can_mmap_files --> off | ||
+ | --More-- | ||
+ | </ | ||
- | smartctl | + | ou la commande **sestatus |
- | smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda | + | < |
- | | + | [root@redhat9 attributs]# sestatus |
- | | + | SELinux status: |
- | | + | SELinuxfs mount: |
- | smartctl --all --device=3ware, | + | SELinux root directory: |
- | | + | Loaded policy name: |
- | | + | Current mode: |
- | | + | Mode from config file: enforcing |
- | | + | Policy MLS status: |
- | of the 1st channel on the 1st HighPoint RAID controller) | + | Policy deny_unknown status: |
- | | + | Memory protection checking: |
- | (Prints all SMART info for 3rd ATA disk of the 1st enclosure | + | Max kernel policy version: |
- | on Areca RAID controller) | + | |
- | </ | + | |
- | ====1.9 | + | Policy booleans: |
+ | abrt_anon_write | ||
+ | abrt_handle_event | ||
+ | abrt_upload_watch_anon_write | ||
+ | antivirus_can_scan_system | ||
+ | antivirus_use_jit | ||
+ | auditadm_exec_content | ||
+ | authlogin_nsswitch_use_ldap | ||
+ | authlogin_radius | ||
+ | authlogin_yubikey | ||
+ | awstats_purge_apache_log_files | ||
+ | boinc_execmem | ||
+ | cdrecord_read_content | ||
+ | cluster_can_network_connect | ||
+ | cluster_manage_all_files | ||
+ | cluster_use_execmem | ||
+ | cobbler_anon_write | ||
+ | cobbler_can_network_connect | ||
+ | cobbler_use_cifs | ||
+ | cobbler_use_nfs | ||
+ | collectd_tcp_network_connect | ||
+ | colord_use_nfs | ||
+ | condor_tcp_network_connect | ||
+ | conman_can_network | ||
+ | conman_use_nfs | ||
+ | container_connect_any | ||
+ | container_manage_cgroup | ||
+ | container_read_certs | ||
+ | container_use_cephfs | ||
+ | container_use_devices | ||
+ | container_use_dri_devices | ||
+ | container_use_ecryptfs | ||
+ | container_user_exec_content | ||
+ | cron_can_relabel | ||
+ | cron_system_cronjob_use_shares | ||
+ | cron_userdomain_transition | ||
+ | cups_execmem | ||
+ | cvs_read_shadow | ||
+ | daemons_dontaudit_scheduling | ||
+ | daemons_dump_core | ||
+ | daemons_enable_cluster_mode | ||
+ | --More-- | ||
+ | </ | ||
- | Cette commande permet | + | Pour fixer l' |
< | < | ||
- | [root@centos8 ~]# accton on | + | [root@redhat9 attributs]# setsebool antivirus_can_scan_system 1 |
- | Turning on process accounting, file set to the default '/ | + | |
- | [root@centos8 ~]# systemctl status psacct | + | |
- | ● psacct.service - Kernel process accounting | + | |
- | | + | |
- | | + | |
- | ...skipping... | + | |
- | ● psacct.service - Kernel process accounting | + | |
- | | + | |
- | | + | |
- | [root@centos8 ~]# systemctl enable psacct | + | [root@redhat9 attributs]# getsebool antivirus_can_scan_system |
- | Created symlink / | + | antivirus_can_scan_system |
- | [root@centos8 ~]# systemctl start psacct | + | [root@redhat9 attributs]# setsebool antivirus_can_scan_system 0 |
- | [root@centos8 ~]# systemctl status psacct | + | [root@redhat9 attributs]# getsebool antivirus_can_scan_system |
- | ● psacct.service | + | antivirus_can_scan_system |
- | | + | |
- | | + | |
- | Process: 39765 ExecStart=/ | + | |
- | Process: 39763 ExecStartPre=/ | + | |
- | Main PID: 39765 (code=exited, | + | |
- | + | ||
- | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Starting Kernel process accounting> | + | |
- | Nov 13 09:35:16 centos8.ittraining.loc accton[39765]: | + | |
- | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Started Kernel process accounting. | + | |
</ | </ | ||
- | Par contre le fichier **/ | + | =====LAB #3 - Travailler |
+ | Afin reconstruire la politique actuelle **sans** les règles **dontaudit**, | ||
+ | |||
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@redhat9 attributs]# semodule |
- | #pcKaccton pcEusleep%$pcu, | + | |
</ | </ | ||
- | La commande | + | Vérifiez qu'il ne reste aucune règle de type **dontaudit** : |
< | < | ||
- | [root@centos8 ~]# dump-acct | + | [root@redhat9 attributs]# seinfo |
- | accton | + | Statistics for policy file: /sys/fs/selinux/ |
- | sleep | + | Policy Version: |
- | awk | + | Target Policy: |
- | ksmtuned | + | Handle unknown classes: |
- | pgrep | + | Classes: |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | awk | + | Users: 8 Roles: 15 |
- | ksmtuned | + | |
- | less |v3| 0.00| | + | Allow: 65504 Neverallow: 0 |
- | systemctl | + | Auditallow: |
- | sleep | + | Type_trans: |
- | awk | + | |
- | ksmtuned | + | Role allow: 40 Role_trans: 417 |
- | pgrep | + | |
- | ksmtuned | + | MLS Constrain: |
- | ksmtuned | + | Permissives: |
- | awk | + | |
- | ksmtuned | + | |
- | rpc-pipefs-gene |v3| | + | Auditallowxperm: |
- | nfs-server-gene |v3| | + | Ibendportcon: |
- | systemd-cryptse |v3| | + | Initial SIDs: 27 Fs_use: |
- | systemd-system- |v3| 0.00| | + | Genfscon: |
- | systemd-hiberna |v3| 0.00| | + | |
- | ... | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ====3.1 - Copier et Déplacer des Fichiers==== |
- | Les options de cette commande sont : | + | Créez deux fichiers **file1** et **file2** en tant que l' |
< | < | ||
- | [root@centos8 ~]# dump-acct --help | + | [root@redhat9 attributs]# exit |
- | Usage: dump-acct [-hrR] [-n < | + | logout |
- | | + | |
- | [--format < | + | [trainee@redhat9 ~]$ touch file1 file2 |
- | [--ahz < | + | |
- | The system' | + | [trainee@redhat9 ~]$ ls -Z file* |
+ | unconfined_u: | ||
+ | unconfined_u: | ||
</ | </ | ||
- | ====1.10 - La Commande lastcomm==== | + | Notez que le type des deux fichiers est **user_home_t**. |
- | Cette commande | + | Copiez maintenant le fichier **file1** vers **/tmp** en utilisant la commande |
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
- | bash F root pts/0 0.00 secs Sun Nov 13 09:41 | + | |
- | gdbus X root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | kworker/ | + | |
- | kworker/ | + | |
- | kworker/ | + | |
- | dump-acct | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | dump-acct | + | |
- | man root | + | |
- | less | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | man | + | |
- | nroff root | + | |
- | groff root | + | |
- | grotty | + | |
- | troff root | + | |
- | nroff | + | |
- | locale | + | |
- | tbl root | + | |
- | preconv | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | dump-acct | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | cat root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | kworker/ | + | |
- | systemctl | + | |
- | less | + | |
- | systemd-cgroups | + | |
- | systemd-cgroups | + | |
- | systemctl | + | |
- | systemd-tty-ask | + | |
- | accton | + | |
- | accton | + | |
- | accton-create | + | |
- | systemctl | + | |
- | (sd-executor) | + | |
- | systemd-gpt-aut | + | |
- | systemd-getty-g | + | |
- | systemd-veritys | + | |
- | systemd-sysv-ge | + | |
- | systemd-debug-g | + | |
- | selinux-autorel | + | |
- | grep | + | |
- | ostree-system-g | + | |
- | systemd-rc-loca | + | |
- | anaconda-genera | + | |
- | lvm2-activation | + | |
- | kdump-dep-gener | + | |
- | selinuxenabled | + | |
- | lvmconfig | + | |
- | grep | + | |
- | readlink | + | |
- | systemd-fstab-g | + | |
- | systemd-hiberna | + | |
- | systemd-system- | + | |
- | systemd-cryptse | + | |
- | nfs-server-gene | + | |
- | rpc-pipefs-gene | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | systemctl | + | |
- | less | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | accton | + | |
- | [root@centos8 | + | [trainee@redhat9 |
- | grep | + | unconfined_u:object_r:user_tmp_t: |
- | grep | + | |
- | grep | + | |
- | grep | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Notez que le fichier ainsi copié a hérité du **type** du répertoire parent, à savoir **tmp_t**. |
- | Les options de cette commande sont : | + | Déplacez maintenant le fichier **file2** dans le répertoire **/tmp** et contrôlez son SC : |
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
- | Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ... | + | |
- | | + | |
- | | + | |
- | | + | |
- | The system' | + | [trainee@redhat9 ~]$ ls -Z /tmp/file2 |
+ | unconfined_u: | ||
</ | </ | ||
- | ====1.11 - La Commande sa==== | + | Notez que la commande **mv** maintient le **type** d' |
- | Cette commande | + | ====3.2 - Vérifier les SC des Processus==== |
+ | |||
+ | Il convient d' | ||
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
- | root 0.00 cpu 1090k mem 0 io accton | + | LABEL |
- | root 0.00 cpu 1827k mem 0 io sleep | + | system_u: |
- | root 0.00 cpu 6378k mem 0 io awk | + | system |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | system_u: |
- | root 0.00 cpu | + | system_u: |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 6344k mem 0 io awk | + | system_u: |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 2426k mem 0 io less | + | system_u: |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | system_u: |
- | root 0.00 cpu 1827k mem 0 io sleep | + | system_u: |
- | root 0.00 cpu 6378k mem 0 io awk | + | system_u: |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | system_u: |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 6344k mem 0 io awk | + | system_u: |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | system_u: |
- | root 0.00 cpu 9688k mem 0 io rpc-pipefs-gene | + | system_u: |
- | root 0.00 cpu 9720k mem 0 io nfs-server-gene | + | system_u: |
- | root 0.00 cpu 22592k mem 0 io systemd-cryptse | + | system_u: |
- | root 0.00 cpu 22592k mem 0 io systemd-system- | + | system_u: |
- | root 0.00 cpu 22592k mem 0 io systemd-hiberna | + | system_u: |
- | root 0.00 cpu 22592k mem 0 io systemd-fstab-g | + | system_u: |
- | root 0.00 cpu 1098k mem 0 io readlink | + | system_u: |
- | root 0.00 cpu 2302k mem 0 io grep | + | system_u: |
- | root 0.00 cpu 16260k mem 0 io lvmconfig | + | system_u: |
- | root 0.00 cpu 3350k mem 0 io selinuxenabled | + | system_u: |
- | root 0.00 cpu 5862k mem 0 io kdump-dep-gener | + | system_u: |
- | root | + | --More-- |
- | root 0.00 cpu 5764k mem | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-rc-loca | + | |
- | root 0.01 cpu 38192k mem 0 io ostree-system-g | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 5764k mem 0 io selinux-autorel | + | |
- | root 0.00 cpu 22592k mem | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-sysv-ge | + | |
- | root | + | |
- | root 0.00 cpu 22592k mem | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-gpt-aut | + | |
- | root 0.00 cpu 63728k mem 0 io (sd-executor) | + | |
- | root 0.00 cpu 23632k mem 0 io systemctl | + | |
- | root 0.00 cpu 6496k mem 0 io accton-create | + | |
- | root | + | |
- | root 0.00 cpu 1090k mem | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-tty-ask | + | |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-cgroups | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-cgroups | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 1828k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 0k mem 0 io kworker/dying * | + | |
- | root 0.00 cpu 1994k mem 0 io dump-acct | + | |
- | root | + | |
- | root 0.00 cpu 6378k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 4582k mem 0 io man * | + | |
- | root | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3674k mem 0 io grotty | + | |
- | root 0.00 cpu 3496k mem 0 io groff | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.01 cpu 4770k mem 0 io man | + | |
- | root | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 0k mem | + | |
- | root | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 6344k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 93648k mem | + | |
- | root 0.00 cpu 6888k mem 0 io bash * | + | |
- | root | + | |
- | root 0.00 cpu 1827k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root | + | |
- | root 0.00 cpu 6528k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 4570k mem 0 io man * | + | |
- | root | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3706k mem 0 io grotty | + | |
- | root 0.00 cpu 3496k mem 0 io groff | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root | + | |
- | root 0.00 cpu 6528k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root | + | |
- | root 0.00 cpu 4604k mem 0 io man * | + | |
- | root 0.00 cpu 4760k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem 0 io tbl | + | |
- | root 0.00 cpu 1831k mem 0 io locale | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3700k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root | + | |
- | root 0.00 cpu 6344k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root | + | |
- | root 0.00 cpu 4770k mem 0 io man | + | |
- | root 0.00 cpu 5312k mem | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 5312k mem 0 io sa | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ====3.3 - Visualiser |
- | Les options de cette commande | + | Utilisez l' |
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
+ | unconfined_u: | ||
+ | </ | ||
- | Usage: sa [ options ] [ file ] | + | Notez que vous ne pouvez pas consulter le SC d'un autre utilisateur |
- | + | ||
- | options: [-abcdfiljkmnprstuDKP] [-v < | + | |
- | [--other-acct-file < | + | |
- | [--print-seconds] [--dont-read-summary-files] [--debug] | + | |
- | | + | |
- | | + | |
- | [--list-all-names] [--not-interactive] [--threshold < | + | |
- | | + | |
- | | + | |
- | | + | |
- | The system' | + | < |
+ | [trainee@redhat9 ~]$ id root | ||
+ | uid=0(root) gid=0(root) groups=0(root) | ||
- | raw process accounting data: / | + | [trainee@redhat9 ~]$ id -Z root |
- | summary by command name: / | + | id: cannot print security context when user specified |
- | | + | |
</ | </ | ||
- | ====1.12 - La Commande ac==== | + | ====3.4 - Vérifier la SC d'un fichier==== |
- | Cette commande | + | Il convient d' |
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
- | trainee | + | |
- | total 247.51 | + | |
- | [root@centos8 ~]# ac -d | + | [trainee@redhat9 etc]$ ls -Z l* -d |
- | Jun 16 total 6.41 | + | unconfined_u: |
- | Jun 17 total 12.09 | + | |
- | Jul 19 total 6.94 | + | |
- | Jul 20 total 38.95 | + | |
- | Sep 2 total 0.03 | + | |
- | Sep 3 total 0.01 | + | |
- | Sep 5 total 11.01 | + | |
- | Oct 9 total 0.92 | + | |
- | Oct 11 total 4.17 | + | |
- | Oct 12 total 5.45 | + | |
- | Nov 7 total 19.40 | + | |
- | Nov 8 total 54.12 | + | |
- | Nov 9 total 67.32 | + | |
- | Nov 10 total 8.48 | + | |
- | Nov 11 total 3.01 | + | |
- | Today | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ====3.5 - Troubleshooting SELinux==== |
- | Les options | + | L' |
- | < | + | Si le démon **auditd** est démarré, les messages de %%SELinux%% sont consignés dans le fichier **/ |
- | [root@centos8 ~]# ac --help | + | |
- | Usage: ac [OPTION] ... | + | ====3.6 - La commande chcon==== |
- | OPTIONS: | + | La commande **chcon** permet de modifier // |
- | -d, --daily-totals | + | |
- | -p, --individual-totals | + | |
- | -f, --file < | + | |
- | --complain | + | |
- | --reboots | + | |
- | --supplants | + | |
- | --timewarps | + | |
- | --compatibility | + | |
- | -a, --all-days | + | |
- | --tw-leniency < | + | |
- | --tw-suspicious < | + | |
- | --print-year | + | |
- | --print-zeros | + | |
- | --debug | + | |
- | -V, --version | + | |
- | -h, --help | + | |
- | The system's default login accounting file is / | + | Prenons le cas de la création d'un répertoire à la racine du système de fichiers afin d'y stocker les pages web du serveur apache : |
- | </ | + | |
- | =====LAB #2 - La commande sysctl===== | + | < |
+ | [trainee@redhat9 etc]$ su - | ||
+ | Password: fenestros | ||
- | ====2.1 - Répertoire | + | [root@redhat9 ~]# mkdir /www |
+ | [root@redhat9 ~]# touch /www/index.html | ||
+ | </code> | ||
- | Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc. | + | Installez maintenant |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 1 16391 19 2212 2427 2622 431 | + | |
- | 10 | + | |
- | 1007 | + | |
- | 11 | + | |
- | 11805 16593 2 | + | |
- | 12 | + | |
- | 1219 | + | |
- | 1228 | + | |
- | 1232 | + | |
- | 1234 | + | |
- | 1235 | + | |
- | 1247 | + | |
- | 13 | + | |
- | 1307 | + | |
- | 1339 | + | |
- | 1356 | + | |
- | 14 | + | |
- | 1441 | + | |
- | 1443 | + | |
- | 1444 | + | |
- | 1446 | + | |
- | 14977 1828 | + | |
- | 15 | + | |
- | 15067 183 2167 2330 2571 422 | + | |
- | 1536 | + | |
- | 1553 | + | |
- | 15594 186 2187 2358 259 | + | |
- | 15735 187 2190 2373 2593 427 | + | |
- | 16 | + | |
- | 16165 1883 | + | |
- | 16167 1888 | + | |
</ | </ | ||
- | ===Fichiers=== | + | Activez et démarrez le service **httpd** : |
- | + | ||
- | ==Processeur== | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | processor | + | ○ httpd.service - The Apache HTTP Server |
- | vendor_id | + | |
- | cpu family | + | Active: inactive (dead) |
- | model : 6 | + | Docs: man:httpd.service(8) |
- | model name : Common KVM processor | + | [root@redhat9 ~]# systemctl enable --now httpd |
- | stepping | + | Created symlink / |
- | microcode | + | [root@redhat9 ~]# systemctl status httpd |
- | cpu MHz : 1999.987 | + | ● httpd.service - The Apache HTTP Server |
- | cache size | + | Loaded: loaded (/ |
- | physical id : 0 | + | Active: active (running) since Tue 2024-10-22 10:15:49 CEST; 3s ago |
- | siblings | + | Docs: man:httpd.service(8) |
- | core id : 0 | + | Main PID: 101100 (httpd) |
- | cpu cores : 4 | + | Status: " |
- | apicid | + | Tasks: 177 (limit: 48800) |
- | initial apicid | + | Memory: 34.5M |
- | fpu : yes | + | CPU: 86ms |
- | fpu_exception | + | CGroup: / |
- | cpuid level : 13 | + | ├─101100 / |
- | wp | + | ├─101101 / |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs | + | |
- | bogomips | + | |
- | clflush size | + | |
- | cache_alignment | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | processor | + | Oct 22 10:15:49 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | vendor_id | + | Oct 22 10:15:49 redhat9.ittraining.loc httpd[101100]: Server configured, listening on: port 80 |
- | cpu family | + | Oct 22 10:15:49 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 1 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 2 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 3 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 0 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 1 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 2 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 3 | + | |
- | cpu cores : 4 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | cpuid level : 13 | + | |
- | wp : yes | + | |
- | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti | + | |
- | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit | + | |
- | bogomips | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
</ | </ | ||
- | ==Interruptions système== | + | Modifiez ensuite la directive **%%DocumentRoot%%** dans le fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | | + | |
- | 0: 109 0 0 0 0 0 0 0 | + | |
- | 1: 0 0 0 0 9 0 0 0 | + | |
- | 8: 0 0 0 0 0 1 0 0 | + | |
- | 9: 0 0 0 0 0 0 0 0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | NMI: 0 0 0 0 0 0 0 0 | + | |
- | LOC: | + | |
- | SPU: 0 0 0 0 0 0 0 0 | + | |
- | PMI: 0 0 0 0 0 0 0 0 | + | |
- | IWI: 0 0 0 0 2 0 0 0 IRQ work interrupts | + | |
- | RTR: 0 0 0 0 0 0 0 0 APIC ICR read retries | + | |
- | RES: | + | |
- | CAL: 11095 11007 10841 10343 14679 | + | |
- | TLB: | + | |
- | TRM: 0 0 0 0 0 0 0 0 | + | |
- | THR: 0 0 0 0 0 0 0 0 | + | |
- | DFR: 0 0 0 0 0 0 0 0 | + | |
- | MCE: 0 0 0 0 0 0 0 0 | + | |
- | MCP: 288 288 288 288 288 288 288 288 | + | |
- | HYP: 0 0 0 0 0 0 0 0 | + | |
- | HRE: 0 0 0 0 0 0 0 0 | + | |
- | HVS: 0 0 0 0 0 0 0 0 | + | |
- | ERR: 0 | + | |
- | MIS: 0 | + | |
- | PIN: 0 0 0 0 0 0 0 0 | + | |
- | NPI: 0 0 0 0 0 0 0 0 | + | |
- | PIW: 0 0 0 0 0 0 0 0 | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | <file> |
- | **Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un IRQ. Quand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQ. Techniquement l' | + | [...] |
- | </WRAP> | + | # |
+ | DocumentRoot "/ | ||
+ | [...] | ||
+ | </file> | ||
- | ==Canaux DMA== | + | Ajoutez les section **< |
- | <code> | + | <file> |
- | [root@centos8 ~]# cat /proc/dma | + | ... |
- | 4: cascade | + | < |
- | </code> | + | |
+ | # Allow open access: | ||
+ | Require all granted | ||
+ | </Directory> | ||
- | ==Plages d' | + | < |
+ | Options Indexes FollowSymLinks | ||
+ | AllowOverride None | ||
+ | Require all granted | ||
+ | </ | ||
- | < | + | # Further relax access to the default document |
- | root@centos8 ~]# cat / | + | <Directory "/var/ |
- | 0000-0cf7 | + | ... |
- | 0000-001f : dma1 | + | </file> |
- | 0020-0021 : pic1 | + | |
- | 0040-0043 : timer0 | + | |
- | 0050-0053 : timer1 | + | |
- | 0060-0060 : keyboard | + | |
- | 0064-0064 : keyboard | + | |
- | 0070-0077 : rtc0 | + | |
- | 0080-008f : dma page reg | + | |
- | 00a0-00a1 : pic2 | + | |
- | 00c0-00df : dma2 | + | |
- | 00f0-00ff : fpu | + | |
- | 0170-0177 : 0000: | + | |
- | 0170-0177 : ata_piix | + | |
- | 01f0-01f7 : 0000: | + | |
- | 01f0-01f7 : ata_piix | + | |
- | 0376-0376 : 0000: | + | |
- | 0376-0376 : ata_piix | + | |
- | 03c0-03df : vga+ | + | |
- | 03f6-03f6 : 0000: | + | |
- | 03f6-03f6 : ata_piix | + | |
- | --More-- | + | |
- | </code> | + | |
- | + | ||
- | <WRAP center round alert 60%> | + | |
- | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. | + | |
- | </WRAP> | + | |
- | ==Périphériques== | + | Créez le fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Character devices: | + | |
- | 1 mem | + | |
- | 4 /dev/vc/0 | + | |
- | 4 tty | + | |
- | 4 ttyS | + | |
- | 5 /dev/tty | + | |
- | 5 / | + | |
- | 5 /dev/ptmx | + | |
- | 7 vcs | + | |
- | 10 misc | + | |
- | 13 input | + | |
- | 21 sg | + | |
- | 29 fb | + | |
- | 128 ptm | + | |
- | 136 pts | + | |
- | 162 raw | + | |
- | 180 usb | + | |
- | 188 ttyUSB | + | |
- | 189 usb_device | + | |
- | 202 cpu/msr | + | |
- | 203 cpu/cpuid | + | |
- | 226 drm | + | |
- | 244 aux | + | |
- | 245 hidraw | + | |
- | 246 usbmon | + | |
- | 247 bsg | + | |
- | 248 watchdog | + | |
- | 249 ptp | + | |
- | 250 pps | + | |
- | 251 rtc | + | |
- | 252 dax | + | |
- | 253 tpm | + | |
- | 254 gpiochip | + | |
- | Block devices: | + | [root@redhat9 ~]# cat / |
- | 8 sd | + | < |
- | 9 md | + | < |
- | 11 sr | + | This is a test |
- | 65 sd | + | </ |
- | 66 sd | + | < |
- | 67 sd | + | www test page |
- | 68 sd | + | </ |
- | 69 sd | + | </ |
- | 70 sd | + | |
- | 71 sd | + | |
- | 128 sd | + | |
- | 129 sd | + | |
- | 130 sd | + | |
- | 131 sd | + | |
- | 132 sd | + | |
- | 133 sd | + | |
- | 134 sd | + | |
- | 135 sd | + | |
- | 253 device-mapper | + | |
- | 254 mdp | + | |
- | 259 blkext | + | |
</ | </ | ||
- | ==Modules== | + | Modifiez ensuite le propriétaire et le groupe du répertoire **/www** et son contenu : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | xt_CHECKSUM 16384 1 - Live 0xffffffffc09a8000 | + | |
- | ipt_MASQUERADE 16384 3 - Live 0xffffffffc09a3000 | + | |
- | xt_conntrack 16384 1 - Live 0xffffffffc099e000 | + | |
- | ipt_REJECT 16384 2 - Live 0xffffffffc0999000 | + | |
- | nft_compat 20480 16 - Live 0xffffffffc0993000 | + | |
- | nf_nat_tftp 16384 0 - Live 0xffffffffc098b000 | + | |
- | nft_objref 16384 1 - Live 0xffffffffc0986000 | + | |
- | nf_conntrack_tftp 16384 3 nf_nat_tftp, | + | |
- | nft_counter 16384 33 - Live 0xffffffffc097c000 | + | |
- | tun 53248 1 - Live 0xffffffffc096e000 | + | |
- | bridge 192512 0 - Live 0xffffffffc093e000 | + | |
- | stp 16384 1 bridge, Live 0xffffffffc0939000 | + | |
- | llc 16384 2 bridge,stp, Live 0xffffffffc0930000 | + | |
- | nft_fib_inet 16384 1 - Live 0xffffffffc08f5000 | + | |
- | nft_fib_ipv4 16384 1 nft_fib_inet, | + | |
- | nft_fib_ipv6 16384 1 nft_fib_inet, | + | |
- | nft_fib 16384 3 nft_fib_inet, | + | |
- | nft_reject_inet 16384 5 - Live 0xffffffffc08de000 | + | |
- | nf_reject_ipv4 16384 2 ipt_REJECT, | + | |
- | nf_reject_ipv6 16384 1 nft_reject_inet, | + | |
- | nft_reject 16384 1 nft_reject_inet, | + | |
- | --More-- | + | |
</ | </ | ||
- | ==Statistiques de l' | + | Dernièrement, |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 11 0 sr0 10 0 4 2 0 0 0 0 0 9 2 0 0 0 0 | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | ==Partitions== | + | Redémarrez maintenant le service httpd : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | major minor # | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 11 0 1048575 sr0 | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | ==Espaces de pagination== | + | Installez le paquet **lynx** : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Filename | + | |
- | /dev/dm-1 | + | |
</ | </ | ||
- | ==Statistiques d' | + | Consultez le site localhost en utilisant **lynx** : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 0.00 0.00 0.00 1/697 16936 | + | |
</ | </ | ||
- | ==Statistiques d' | + | La commande **sealert** possède à la fois une interface graphique **et** un mode en ligne de commande : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | MemTotal: | + | |
- | MemFree: | + | |
- | MemAvailable: | + | |
- | Buffers: | + | |
- | Cached: | + | |
- | SwapCached: | + | |
- | Active: | + | |
- | Inactive: | + | |
- | Active(anon): | + | |
- | Inactive(anon): | + | |
- | Active(file): | + | |
- | Inactive(file): | + | |
- | Unevictable: | + | |
- | Mlocked: | + | |
- | SwapTotal: | + | |
- | SwapFree: | + | |
- | Dirty: | + | |
- | Writeback: | + | |
- | AnonPages: | + | |
- | Mapped: | + | |
- | Shmem: | + | |
- | KReclaimable: | + | |
- | Slab: | + | |
- | SReclaimable: | + | |
- | SUnreclaim: | + | |
- | KernelStack: | + | |
- | PageTables: | + | |
- | NFS_Unstable: | + | |
- | Bounce: | + | |
- | WritebackTmp: | + | |
- | CommitLimit: | + | |
- | Committed_AS: | + | |
- | VmallocTotal: | + | |
- | VmallocUsed: | + | |
- | VmallocChunk: | + | |
- | Percpu: | + | |
- | HardwareCorrupted: | + | |
- | AnonHugePages: | + | |
- | ShmemHugePages: | + | |
- | ShmemPmdMapped: | + | |
- | FileHugePages: | + | |
- | FilePmdMapped: | + | |
- | HugePages_Total: | + | |
- | HugePages_Free: | + | |
- | HugePages_Rsvd: | + | |
- | HugePages_Surp: | + | |
- | Hugepagesize: | + | |
- | Hugetlb: | + | |
- | DirectMap4k: | + | |
- | DirectMap2M: | + | |
</ | </ | ||
- | ==Version du noyau== | + | Consultez le fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux version 4.18.0-305.3.1.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Tue Jun 1 16:14:33 UTC 2021 | + | |
- | </ | + | |
- | ===Répertoires=== | + | found 24 alerts in / |
+ | -------------------------------------------------------------------------------- | ||
- | ==ide/scsi== | + | SELinux is preventing |
- | Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. | + | ***** Plugin catchall (100. confidence) suggests |
- | ==acpi== | + | If you believe that pkla-check-authorization should be allowed noatsecure access on processes labeled policykit_auth_t by default. |
+ | Then you should report this as a bug. | ||
+ | You can generate a local policy module to allow this access. | ||
+ | Do | ||
+ | allow this access for now by executing: | ||
+ | # ausearch -c ' | ||
+ | # semodule -X 300 -i my-pklacheckauth.pp | ||
- | Ce répertoire contient des informations sur la gestion de l' | ||
- | ==bus== | + | Additional Information: |
+ | Source Context | ||
+ | Target Context | ||
+ | Target Objects | ||
+ | Source | ||
+ | Source Path / | ||
+ | Port < | ||
+ | Host < | ||
+ | Source RPM Packages | ||
+ | Target RPM Packages | ||
+ | SELinux Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch | ||
+ | Local Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch | ||
+ | Selinux Enabled | ||
+ | Policy Type | ||
+ | Enforcing Mode Permissive | ||
+ | Host Name | ||
+ | Platform | ||
+ | 5.14.0-427.37.1.el9_4.x86_64 #1 SMP | ||
+ | PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 | ||
+ | x86_64 x86_64 | ||
+ | Alert Count 10 | ||
+ | First Seen 2024-10-22 10:01:01 CEST | ||
+ | Last Seen | ||
+ | Local ID 344c2abc-bac6-4064-ae22-411f0ce680cd | ||
- | Ce répertoire contient un sous-répertoire par bus. | + | Raw Audit Messages |
+ | type=AVC msg=audit(1729585981.217:17543): avc: denied | ||
+ | ntext=system_u: | ||
- | ==net== | ||
- | Ce répertoire contient des informations sur le réseau. | + | type=AVC msg=audit(1729585981.217:17543): avc: denied |
+ | :s0 tcontext=system_u: | ||
- | ==sys== | ||
- | Ce répertoire contient des paramètres du noyau. Certains des fichiers dans ce répertoire sont accessibles en écriture par root en temps réel. Par exemple pour éviter des attaques réseau **%%DoS%%** utilisant la commande **ping**, saisissez la commande suivante : | + | --More--(1%) |
+ | </ | ||
- | # echo 1 > / | + | Cherchez |
- | + | ||
- | Cette commande a pour résultat d' | + | |
- | + | ||
- | ====2.2 - Utilisation de la Commande sysctl==== | + | |
- | + | ||
- | Les fichiers | + | |
- | + | ||
- | La commande **sysctl** applique les règles consignés dans le fichier **/ | + | |
- | + | ||
- | Saisissez la commande | + | |
< | < | ||
- | [root@centos8 ~]# cat /etc/sysctl.conf | + | ... |
- | # sysctl settings are defined through files in | + | ***** Plugin catchall |
- | # / | + | |
- | # | + | |
- | # Vendors settings live in / | + | |
- | # To override a whole file, create a new file with the same in | + | |
- | # / | + | |
- | # only specific settings, add a file with a lexically later | + | |
- | # name in / | + | |
- | # | + | |
- | # For more information, | + | |
- | [root@centos8 ~]# ls -l /etc/sysctl.d/ | + | If you believe that httpd should have the net_admin capability by default. |
- | total 0 | + | Then you should report this as a bug. |
- | lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../sysctl.conf | + | You can generate a local policy module to allow this access. |
- | [root@centos8 ~]# ls -l / | + | Do |
- | total 24 | + | allow this access for now by executing: |
- | -rw-r--r--. 1 root root 1810 Dec 22 2020 10-default-yama-scope.conf | + | # ausearch |
- | -rw-r--r--. 1 root root 524 Mar 16 15:42 50-coredump.conf | + | # semodule |
- | -rw-r--r--. 1 root root 1270 Mar 16 15:42 50-default.conf | + | |
- | -rw-r--r--. 1 root root 246 Jun 15 2020 50-libkcapi-optmem_max.conf | + | |
- | -rw-r--r--. 1 root root 636 Mar 16 15:42 50-pid-max.conf | + | |
- | -rw-r--r--. 1 root root 499 Nov 26 2019 60-libvirtd.conf | + | |
- | [root@centos8 ~]# cat / | ||
- | # This file is part of systemd. | ||
- | # | ||
- | # systemd is free software; you can redistribute it and/or modify it | ||
- | # under the terms of the GNU Lesser General Public License as published by | ||
- | # the Free Software Foundation; either version 2.1 of the License, or | ||
- | # (at your option) any later version. | ||
- | # See sysctl.d(5) and core(5) for documentation. | + | Additional Information: |
+ | Source Context | ||
+ | Target Context | ||
+ | Target Objects | ||
+ | Source | ||
+ | Source Path / | ||
+ | Port < | ||
+ | Host < | ||
+ | Source RPM Packages | ||
+ | Target RPM Packages | ||
+ | SELinux Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch | ||
+ | Local Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch | ||
+ | Selinux Enabled | ||
+ | Policy Type | ||
+ | Enforcing Mode Permissive | ||
+ | Host Name | ||
+ | Platform | ||
+ | | ||
+ | PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 | ||
+ | x86_64 x86_64 | ||
+ | Alert Count 9 | ||
+ | First Seen 2024-10-22 10:15:49 CEST | ||
+ | Last Seen | ||
+ | Local ID 15ae5915-d5a6-4849-b0d1-e4829bfcb57e | ||
- | # To override settings in this file, create a local file in /etc | + | Raw Audit Messages |
- | # (e.g. / | + | type=AVC msg=audit(1729585954.475:17532): avc: denied |
- | # there. | + | t:s0 tcontext=system_u: |
- | # System Request functionality of the kernel (SYNC) | ||
- | # | ||
- | # Use kernel.sysrq = 1 to allow all keys. | ||
- | # See https:// | ||
- | # of values and keys. | ||
- | kernel.sysrq = 16 | ||
- | # Append the PID to the core filename | + | type=SYSCALL msg=audit(1729585954.475:17532): arch=x86_64 syscall=setsockopt success=yes exit=0 a0=9 a1=1 a2=20 a3=7ffeb581bbe4 items=0 ppid=1 pid= |
- | kernel.core_uses_pid | + | 101828 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=httpd exe=/ |
+ | _u: | ||
+ | ID=root | ||
- | # https:// | + | Hash: httpd, |
- | kernel.kptr_restrict = 1 | + | </code> |
- | # Source route verification | + | Ce message a été généré parce que le repertoire /www ainsi que le fichier index.html ne possèdent pas le **type** nécessaire pour que le service apache puisse les utiliser : |
- | net.ipv4.conf.all.rp_filter = 1 | + | |
- | # Do not accept source routing | + | < |
- | net.ipv4.conf.all.accept_source_route = 0 | + | [root@redhat9 ~]# ls -Z /www/index.html |
- | + | unconfined_u: | |
- | # Promote secondary addresses when the primary address is removed | + | |
- | net.ipv4.conf.all.promote_secondaries = 1 | + | |
- | + | ||
- | # Fair Queue CoDel packet scheduler to fight bufferbloat | + | |
- | net.core.default_qdisc = fq_codel | + | |
- | + | ||
- | # Enable hard and soft link protection | + | |
- | fs.protected_hardlinks = 1 | + | |
- | fs.protected_symlinks = 1 | + | |
</ | </ | ||
- | |||
- | Les options de la commande **sysctl** sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | unconfined_u: | ||
+ | </ | ||
- | Usage: | + | L' |
- | | + | |
- | Options: | + | Modifiez donc la SC de /www et / |
- | -a, --all display all variables | + | |
- | -A alias of -a | + | |
- | -X alias of -a | + | |
- | --deprecated | + | |
- | -b, --binary | + | |
- | -e, --ignore | + | |
- | -N, --names | + | |
- | -n, --values | + | |
- | -p, --load[=< | + | |
- | -f alias of -p | + | |
- | --system | + | |
- | -r, --pattern < | + | |
- | | + | |
- | -q, --quiet | + | |
- | -w, --write | + | |
- | -o does nothing | + | |
- | -x does nothing | + | |
- | -d alias of -h | + | |
- | -h, --help | + | < |
- | -V, --version | + | [root@redhat9 ~]# chcon -Rv --type=httpd_sys_content_t /www |
+ | changing security context of '/ | ||
+ | changing security context of '/ | ||
- | For more details see sysctl(8). | + | [root@redhat9 ~]# ls -Z /www/index.html |
+ | unconfined_u: | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | Afin de maintenir ces SC lors d' |
- | **Important** : Consultez la page de la traduction du manuel | + | |
- | </ | + | |
- | + | ||
- | =====LAB#3 - Interprétation | + | |
- | + | ||
- | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | + | |
- | + | ||
- | | + | |
- | | + | |
- | * iostat, | + | |
- | * hdparm, | + | |
- | * vmstat, | + | |
- | * mpstat, | + | |
- | * sar. | + | |
- | + | ||
- | ====3.1 - La Commande free==== | + | |
- | + | ||
- | La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | total used free shared | + | |
- | Mem: | + | |
- | Swap: 3279 | + | |
</ | </ | ||
- | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre | + | Les options |
- | * 3735 Mo de mémoire physique totale, | + | < |
- | | + | [root@redhat9 ~]# chcon --help |
- | | + | Usage: chcon [OPTION]... CONTEXT FILE... |
+ | | ||
+ | | ||
+ | Change the SELinux security context of each FILE to CONTEXT. | ||
+ | With --reference, | ||
- | Les options | + | Mandatory arguments to long options |
+ | --dereference | ||
+ | the default), rather than the symbolic link itself | ||
+ | -h, --no-dereference | ||
+ | -u, --user=USER | ||
+ | -r, --role=ROLE | ||
+ | -t, --type=TYPE | ||
+ | -l, --range=RANGE | ||
+ | --no-preserve-root | ||
+ | --preserve-root | ||
+ | --reference=RFILE | ||
+ | a CONTEXT value | ||
+ | -R, --recursive | ||
+ | -v, --verbose | ||
- | < | + | The following options modify how a hierarchy is traversed when the -R |
- | [root@centos8 ~]# free --help | + | option is also specified. |
+ | one takes effect. | ||
- | Usage: | + | -H if a command line argument is a symbolic link |
- | free [options] | + | to a directory, traverse it |
+ | -L | ||
+ | | ||
+ | -P do not traverse any symbolic links (default) | ||
- | Options: | + | |
- | -b, --bytes | + | --version |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -k, --kibi | + | |
- | -m, --mebi | + | |
- | -g, --gibi | + | |
- | | + | |
- | | + | |
- | -h, --human | + | |
- | | + | |
- | -l, --lohi | + | |
- | -t, --total | + | |
- | -s N, --seconds N | + | |
- | -c N, --count N | + | |
- | -w, --wide | + | |
- | --help display this help and exit | + | GNU coreutils online |
- | -V, --version | + | Full documentation < |
- | + | or available locally via: info '(coreutils) chcon invocation' | |
- | For more details see free(1). | + | |
</ | </ | ||
- | ====3.2 - Les Commandes uptime et w==== | + | ====3.7 - La commande restorecon==== |
- | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes | + | Pour illustrer l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | | + | |
- | + | [root@redhat9 tmp]# ls -Z | grep html | |
- | [root@centos8 ~]# w | + | unconfined_u:object_r:user_tmp_t:s0 copy.html |
- | 04:39:04 up 1 day, 2:34, 1 user, load average: 0.00, 0.00, 0.00 | + | unconfined_u: |
- | USER | + | |
- | trainee | + | |
</ | </ | ||
- | Les valeurs | + | **Copiez** le fichier copy.html vers /var/www/html et **déplacez** le fichier move.html vers la même cible : |
- | + | ||
- | Par exemple si les valeurs sur un système muni d'un seul processeur étaient | + | |
- | + | ||
- | * 2,48 processus en attente dans la dernière minute, | + | |
- | * 3,00 processus en attente dans les dernières 5 minutes, | + | |
- | * 2,85 processus en attente dans les dernières 15 minutes. | + | |
- | + | ||
- | Les options de ces commandes sont : | + | |
< | < | ||
- | [root@centos8 ~]# uptime --help | + | [root@redhat9 tmp]# cp copy.html / |
- | Usage: | + | [root@redhat9 tmp]# mv move.html / |
- | | + | |
- | Options: | + | [root@redhat9 tmp]# ls -Z / |
- | -p, --pretty | + | unconfined_u: |
- | -h, --help | + | unconfined_u: |
- | -s, --since | + | </ |
- | -V, --version | + | |
- | For more details see uptime(1). | + | <WRAP center round important 50%> |
+ | **Important** : Notez ici que copy.html a pris le type du répertoire de destination tandis que move.html retient le type obtenu lors de la création. | ||
+ | </ | ||
- | [root@centos8 ~]# w --help | + | Restaurez maintenant la SC par défaut de move.html compte tenu de son emplacement en utilisant la commande **restorecon** : |
- | Usage: | + | < |
- | w [options] | + | [root@redhat9 tmp]# restorecon -v / |
+ | Relabeled / | ||
- | Options: | + | [root@redhat9 tmp]# ls -Z / |
- | -h, --no-header | + | unconfined_u: |
- | -u, --no-current | + | unconfined_u: |
- | -s, --short | + | |
- | -f, --from | + | |
- | -o, --old-style | + | |
- | -i, --ip-addr | + | |
- | + | ||
- | | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see w(1). | + | |
</ | </ | ||
- | ====3.3 - La Commande iostat==== | + | ====3.8 - Le fichier / |
- | La commande **iostat** affiche des statistiques | + | En cas de besoin il est intéressant de pouvoir restaurer les SC par défaut |
< | < | ||
- | [root@centos8 ~]# iostat | + | [root@redhat9 tmp]# touch /.autorelabel |
- | bash: iostat: command not found... | + | |
- | Install package ' | + | |
- | + | ||
- | + | ||
- | * Waiting in queue... | + | |
- | The following packages have to be installed: | + | |
- | | + | |
- | | + | |
- | Proceed with changes? [N/y] y | + | |
- | + | ||
- | + | ||
- | * Waiting in queue... | + | |
- | * Waiting for authentication... | + | |
- | * Waiting in queue... | + | |
- | * Downloading packages... | + | |
- | * Requesting data... | + | |
- | * Testing changes... | + | |
- | * Installing packages... | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | + | ||
- | avg-cpu: | + | |
- | | + | |
- | Device | + | [root@redhat9 tmp]# shutdown |
- | sda | + | |
- | sdb | + | |
- | scd0 0.00 | + | |
- | dm-0 0.26 | + | |
- | dm-1 0.00 | + | |
</ | </ | ||
- | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | + | ====3.9 - La commande semanage==== |
- | * **%user** - Pourcentage | + | Pour illustrer l' |
- | * **%nice** - Pourcentage | + | |
- | * **%system** - Pourcentage de temps passé en mode noyau | + | |
- | * **%steal** - Pourcentage | + | |
- | | + | |
- | * **%idle** - Pourcentage de temps passé en inactivité | + | |
- | Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. | + | %%SELinux%% gère aussi l' |
- | + | ||
- | Au-dessous du rapport d'utilisation du CPU de la sortie | + | |
- | + | ||
- | * La spécification du périphérique. | + | |
- | * Le nombre de transferts (ou opérations d'E/S) par seconde. | + | |
- | * Le nombre de blocs de KB lus par seconde. | + | |
- | * Le nombre de blocs de KB écrits par seconde. | + | |
- | * Le nombre total de KB lus. | + | |
- | * Le nombre total de KB écrits. | + | |
- | + | ||
- | Dernièrement, | + | |
< | < | ||
- | [root@centos8 | + | [trainee@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | Password: fenestros |
- | Device | + | [root@redhat9 ~]# semanage port -l | grep http |
- | sda 0.20 0.16 | + | http_cache_port_t |
- | sdb 0.00 0.00 0.02 0.00 | + | http_cache_port_t |
- | scd0 | + | http_port_t |
- | dm-0 | + | pegasus_http_port_t |
- | dm-1 | + | pegasus_https_port_t |
</ | </ | ||
- | Les options de cette commande sont : | + | Notez par exemple que le serveur apache est autorisé d' |
- | <code> | + | <file> |
- | [root@centos8 ~]# iostat --help | + | http_port_t |
- | Usage: iostat [ options ] [ < | + | </file> |
- | Options are: | + | |
- | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | + | |
- | [ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] | + | |
- | [ [ -H ] -g < | + | |
- | [ < | + | |
- | </code> | + | |
- | + | ||
- | ====3.4 - La Commande hdparm==== | + | |
- | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande | + | Dans le cas où on souhaite qu' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | + | ||
- | /dev/sda: | + | |
- | | + | |
</ | </ | ||
- | ====3.5 - La Commande vmstat==== | + | Vous noterez que le port 8090 a été ajouté à la liste des ports reconnus comme valides par %%SELinux%% |
- | + | ||
- | La commande **vmstat** affiche | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | + | http_cache_port_t |
- | r b | + | http_cache_port_t |
- | | + | http_port_t |
- | 0 0 0 1765136 | + | pegasus_http_port_t |
- | | + | pegasus_https_port_t |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 0 0 0 1765108 | + | |
- | 0 0 0 1765108 | + | |
</ | </ | ||
- | La première ligne subdivise le champ en six catégories à savoir | + | Les options **semanage** sont : |
- | Les champs relatifs aux processus sont les suivants | + | [root@redhat9 ~]# semanage --help |
+ | usage: semanage [-h] {import, | ||
- | * r — Le nombre de processus exécutables attendant d' | + | semanage is used to configure certain elements of SELinux policy with-out requiring modification or recompilation from policy source. |
- | * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu | + | |
- | Les champs relatifs à la mémoire sont les suivants | + | positional arguments: |
+ | {import, | ||
+ | import | ||
+ | export | ||
+ | login | ||
+ | user Manage SELinux confined users (Roles and levels for an SELinux user) | ||
+ | port Manage network port type definitions | ||
+ | ibpkey | ||
+ | ibendport | ||
+ | interface | ||
+ | module | ||
+ | node Manage network node type definitions | ||
+ | fcontext | ||
+ | boolean | ||
+ | permissive | ||
+ | dontaudit | ||
- | * swpd — La quantité de mémoire virtuelle utilisée | + | optional arguments: |
- | | + | |
- | * buff — La quantité de mémoire utilisée par les tampons (ou buffers) | + | |
- | * cache — La quantité de mémoire utilisée comme cache de pages | + | |
- | Les champs relatifs au swap sont les suivants : | + | ====3.10 - La commande audit2allow==== |
- | * si — La quantité | + | La création d'un module |
- | | + | |
- | Les champs relatifs aux Entrées/ | + | * la résolution du problème n'est pas possible en utilisant une des commandes précédemment citées, |
+ | * il n' | ||
- | * bi — Blocs envoyés vers un périphérique blocs | + | Pour illustrer l' |
- | * bo— Blocs reçus | + | |
- | Les champs relatifs au système sont les suivants : | + | < |
+ | [root@redhat9 ~]# mkdir /www1 | ||
- | * in — Nombre d' | + | [root@redhat9 ~]# touch / |
- | * cs — Nombre de changements de contexte par seconde | + | </ |
- | Les champs relatifs au CPU sont les suivants : | + | Éditez |
- | + | ||
- | * us — Le pourcentage de temps pendant lequel | + | |
- | | + | |
- | | + | |
- | * wa — Attente d'E/S | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | </ | ||
- | Usage: | + | < |
- | vmstat | + | [...] |
+ | # | ||
+ | DocumentRoot "/ | ||
+ | [...] | ||
+ | </ | ||
- | Options: | + | Ajoutez les section **< |
- | -a, --active | + | |
- | -f, --forks | + | |
- | -m, --slabs | + | |
- | -n, --one-header | + | |
- | -s, --stats | + | |
- | -d, --disk | + | |
- | -D, --disk-sum | + | |
- | -p, --partition <dev> | + | |
- | -S, --unit < | + | |
- | -w, --wide | + | |
- | -t, --timestamp | + | |
- | -h, --help | + | < |
- | -V, --version | + | ... |
+ | < | ||
+ | AllowOverride None | ||
+ | # Allow open access: | ||
+ | Require all granted | ||
+ | </ | ||
- | For more details see vmstat(8). | + | < |
- | </code> | + | Options Indexes FollowSymLinks |
+ | AllowOverride None | ||
+ | Require all granted | ||
+ | </Directory> | ||
- | <WRAP center round important 60%> | + | # Further relax access to the default document root: |
- | **Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système. | + | <Directory "/ |
- | </WRAP> | + | ... |
+ | </file> | ||
- | ====3.6 - La Commande mpstat==== | + | Créez le fichier |
- | + | ||
- | La commande | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 04: | + | [root@redhat9 ~]# cat / |
- | 04: | + | < |
+ | < | ||
+ | This is a test | ||
+ | </ | ||
+ | < | ||
+ | www test page | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
- | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement | + | Modifiez ensuite |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
</ | </ | ||
- | Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient d' | + | Redémarrez le service httpd : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | + | ||
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | + | ||
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
</ | </ | ||
- | Les options de cette commande sont : | + | Consultez le site localhost en utilisant **lynx** |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: mpstat [ options ] [ < | + | Red Hat Logo |
- | Options are: | + | Red Hat Enterprise Linux Test Page |
- | [ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] | + | |
- | [ -N { < | + | |
- | </ | + | |
- | ====3.7 - La Commande sar==== | + | This page is used to test the proper operation of the HTTP server after |
+ | it has been installed. If you can read this page, it means that the | ||
+ | HTTP server installed at this site is working properly. | ||
+ | | ||
- | La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' | + | If you are a member of the general public: |
- | Sous RHEL/CentOS 8 la commande **/ | + | The fact that you are seeing this page indicates that the website you |
+ | just visited is either experiencing problems, or is undergoing routine | ||
+ | | ||
- | < | + | If you would like to let the administrators of this website know that |
- | [root@centos8 ~]# ls / | + | you've seen this page instead of the page you expected, you should send |
- | sa1 sa2 sadc | + | them e-mail. In general, mail sent to the name " |
- | </ | + | to the website' |
- | Le script **/ | + | For example, if you experienced problems while visiting |
+ | | ||
- | ^ Option ^ Description ^ | + | For information on Red Hat Enterprise Linux, please visit the [1]Red |
- | | -t | L' | + | Hat, Inc. website. The documentation for Red Hat Enterprise Linux is |
- | | -n | Nombre de collectes | | + | [2]available on the Red Hat, Inc. website. |
+ | | ||
- | Le script **/ | + | If you are the website administrator: |
- | < | + | You may now add content to the webroot directory. Note that until you |
- | [root@centos8 ~]# ls / | + | do so, people visiting your website will see this page, and not your |
- | sa29 s | + | content. |
+ | For systems using the Apache HTTP Server: You may now add content to | ||
+ | the directory / | ||
+ | | ||
+ | | ||
+ | file / | ||
- | ar29 | + | For systems using NGINX: You should now put your content in a location |
- | </code> | + | of your choice and edit the root configuration directive in the nginx |
+ | | ||
+ | [3][ Powered by Red Hat Enterprise Linux ] [ Powered by Red Hat | ||
+ | | ||
- | Sous CentOS | + | |
+ | | ||
+ | | ||
- | < | + | References |
- | [root@centos8 ~]# cat / | + | |
- | # / | + | |
- | # (C) 2014 Tomasz Torcz < | + | |
- | # | + | |
- | # sysstat-11.7.3 systemd unit file: | + | |
- | # Activates activity collector every 10 minutes | + | |
- | + | ||
- | [Unit] | + | |
- | Description=Run system activity accounting tool every 10 minutes | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*: | + | |
- | [Install] | + | 1. http:// |
- | WantedBy=sysstat.service | + | 2. http:// |
+ | 3. https:// | ||
+ | 4. https:// | ||
+ | 5. https:// | ||
+ | 6. https:// | ||
+ | 7. https:// | ||
</ | </ | ||
- | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | + | Notez que cette fois SELinux est en mode enforcing |
- | + | ||
- | Pour modifier l' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# cat / | + | Enforcing |
- | [Unit] | + | |
- | Description=Run system activity accounting tool every 2 minutes | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar= | + | |
- | OnCalendar=*: | + | |
- | AccuracySec=0 | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Le fichier |
- | **Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut. | + | |
- | </ | + | |
- | + | ||
- | Vérifiez ensuite la prise en compte de la configuration | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | + | type=AVC msg=audit(1729587121.979:17697): avc: denied |
- | | + | type=AVC msg=audit(1729587121.979:17697): avc: denied |
- | | + | type=AVC msg=audit(1729587121.979: |
- | └─override.conf | + | type=AVC msg=audit(1729587426.204: |
- | Active: active | + | type=AVC msg=audit(1729587481.218:17751): avc: denied |
- | | + | type=AVC msg=audit(1729587481.218:17751): avc: denied |
+ | type=AVC msg=audit(1729587481.218: | ||
+ | type=AVC msg=audit(1729587592.855: | ||
+ | type=AVC msg=audit(1729588933.891: | ||
+ | type=AVC msg=audit(1729588933.891: | ||
+ | </ | ||
- | Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes. | + | A l'aide de la commande grep, il convient maintenant d' |
- | </ | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- | + | |
- | Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | ... | + | |
</ | </ | ||
- | Saisissez | + | L' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 06: | + | module httpdlocal 1.0; |
- | 06: | + | require { |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 07: | + | } |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | |
- | 07:55:44 LINUX RESTART | + | # |
+ | allow httpd_t default_t:file { getattr open read }; | ||
- | 07: | + | #!!!! This avc can be allowed using the boolean ' |
- | 07: | + | allow httpd_t default_t:file map; |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09:12:00 all 0.02 0.00 0.03 0.00 0.00 99.94 | + | |
- | 09: | + | #!!!! This avc has a dontaudit rule in the current policy |
- | 09: | + | allow httpd_t self:capability net_admin; |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
</ | </ | ||
- | ===Statistiques d'Utilisation | + | L'audit du fichier terminé, il faut maintenant |
- | + | ||
- | Visualisez | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | ******************** IMPORTANT *********************** |
+ | To make this policy package active, execute: | ||
- | 09: | + | semodule -i httpdlocal.pp |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
</ | </ | ||
- | D' | + | Chargez maintenant le module dans la politique %%SELinux%% |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | + | ||
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | Average: | + | |
</ | </ | ||
- | Pour consulter les statistiques d'un coeur spécifique, | + | Vérifiez que le module est chargé |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | httpdlocal |
- | + | ||
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | Average: | + | |
- | [root@centos8 ~]# sar -u -P 5 5 3 | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | + | ||
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | Average: | + | |
</ | </ | ||
- | ===Statistiques d' | + | Consultez le site localhost en utilisant |
- | + | ||
- | Utilisez l' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | www test page |
- | + | ||
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | |
</ | </ | ||
- | Utilisez l' | + | Les options |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | Usage: audit2allow [options] |
- | 07:31:58 kbswpfree kbswpused | + | Options: |
- | 07: | + | --version |
- | 07: | + | -h, --help |
- | 07: | + | -b, --boot |
- | Average: | + | -a, --all read input from audit log - conflicts with -i |
+ | -p POLICY, --policy=POLICY | ||
+ | Policy file to use for analysis | ||
+ | -d, --dmesg | ||
+ | --input | ||
+ | -i INPUT, --input=INPUT | ||
+ | read input from < | ||
+ | -l, --lastreload | ||
+ | -r, --requires | ||
+ | -m MODULE, --module=MODULE | ||
+ | set the module name - implies --requires | ||
+ | -M MODULE_PACKAGE, | ||
+ | generate a module package - conflicts with -o and -m | ||
+ | -o OUTPUT, --output=OUTPUT | ||
+ | append output to < | ||
+ | -D, --dontaudit | ||
+ | -R, --reference | ||
+ | -N, --noreference | ||
+ | -v, --verbose | ||
+ | -e, --explain | ||
+ | -t TYPE, --type=TYPE | ||
+ | regex | ||
+ | --perm-map=PERM_MAP | ||
+ | --interface-info=INTERFACE_INFO | ||
+ | file name of interface information | ||
+ | -x, --xperms | ||
+ | -w, --why | ||
+ | of why the access was denied | ||
</ | </ | ||
- | ===Statistiques des E/S=== | + | =====LAB #4 - Le Pare-feu Netfilter/iptables====== |
- | Utilisez l' | + | **Netfilter** est composé de 5 //hooks// : |
- | < | + | * NF_IP_PRE_ROUTING |
- | [root@centos8 ~]# sar -b 5 3 | + | * NF_IP_LOCAL_IN |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | * NF_IP_LOCAL_OUT |
+ | * NF_IP_FORWARD | ||
+ | * NF_IP_POSTROUTING | ||
- | 09:24:49 tps rtps wtps | + | Ces hooks sont utilisés par deux branches, la première est celle concernée par les paquets qui entrent vers des services locaux |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
- | </ | + | |
- | ===Statistiques des E/S par Disque=== | + | * NF_IP_PRE_ROUTING > NF_IP_LOCAL_IN > NF_IP_LOCAL_OUT > NF_IP_POSTROUTING |
- | Utilisez l' | + | tandis que la deuxième concerne |
- | <code> | + | * NF_IP_PRE_ROUTING |
- | [root@centos8 ~]# sar -d 5 3 | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 09:25:45 DEV | + | Si IPTABLES a été compilé en tant que module, son utilisation nécessite le chargement de plusieurs modules supplémentaires en fonction de la situation: |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | * iptable_mangle |
- | 09: | + | * iptable_net |
- | 09: | + | * etc |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | Netfilter est organisé en **tables**. La commande **iptables** de netfilter permet d' |
- | 09: | + | |
- | 09:26:00 dev8-16 | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
- | Average: | + | * La chaîne INPUT |
- | Average: | + | |
- | Average: | + | * Policies: ACCEPT, DROP, REJECT |
- | Average: dev253-0 | + | * La chaîne OUTPUT |
- | Average: | + | * Concerne les paquets sortants |
- | </ | + | * Policies: ACCEPT, DROP, REJECT |
+ | * La chaîne FORWARD | ||
+ | * Concerne les paquets traversant le par-feu. | ||
+ | * Policies: ACCEPT, DROP, REJECT | ||
- | La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disques, ajoutez l'option **-p** : | + | Si aucune table n'est précisée, c'est la table FILTER qui s' |
- | < | + | * La table **NAT** |
- | [root@centos8 ~]# sar -p -d 5 3 | + | * La chaîne PREROUTING |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | * Permet de faire la translation |
+ | | ||
+ | * 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 | ||
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07:48:37 DEV | + | Les **policies** sont: |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | * Permet d' |
- | 07: | + | * DROP |
- | 07: | + | |
- | 07: | + | * REJECT |
- | 07: | + | |
- | Average: | + | Les **cibles** sont: |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | </ | + | |
- | Les options | + | * SNAT |
+ | * Permet de modifier l' | ||
+ | * DNAT | ||
+ | * Permet de modifier l' | ||
+ | * MASQUERADE | ||
+ | * Permet de remplacer l' | ||
- | < | + | 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: |
- | [root@centos8 ~]# sar --help | + | |
- | Usage: sar [ options ] [ < | + | |
- | Main options and reports (report name between square brackets): | + | |
- | -B Paging statistics [A_PAGE] | + | |
- | -b I/O and transfer rate statistics [A_IO] | + | |
- | -d Block devices statistics [A_DISK] | + | |
- | -F [ MOUNT ] | + | |
- | Filesystems statistics [A_FS] | + | |
- | -H Hugepages utilization statistics [A_HUGE] | + | |
- | -I { < | + | |
- | Interrupts statistics [A_IRQ] | + | |
- | -m { < | + | |
- | Power management statistics [A_PWR_...] | + | |
- | Keywords are: | + | |
- | CPU CPU instantaneous clock frequency | + | |
- | FAN Fans speed | + | |
- | FREQ CPU average clock frequency | + | |
- | IN Voltage inputs | + | |
- | TEMP Devices temperature | + | |
- | USB USB devices plugged into the system | + | |
- | -n { < | + | |
- | Network statistics [A_NET_...] | + | |
- | Keywords are: | + | |
- | DEV | + | |
- | EDEV Network interfaces (errors) | + | |
- | NFS NFS client | + | |
- | NFSD NFS server | + | |
- | SOCK Sockets (v4) | + | |
- | IP IP traffic | + | |
- | EIP IP traffic | + | |
- | ICMP ICMP traffic | + | |
- | EICMP ICMP traffic | + | |
- | TCP TCP traffic | + | |
- | ETCP TCP traffic | + | |
- | UDP UDP traffic | + | |
- | SOCK6 | + | |
- | IP6 IP traffic | + | |
- | EIP6 IP traffic | + | |
- | ICMP6 ICMP traffic | + | |
- | EICMP6 | + | |
- | UDP6 UDP traffic | + | |
- | FC Fibre channel HBAs | + | |
- | SOFT Software-based network processing | + | |
- | -q Queue length and load average statistics [A_QUEUE] | + | |
- | -r [ ALL ] | + | |
- | Memory utilization statistics [A_MEMORY] | + | |
- | -S Swap space utilization statistics [A_MEMORY] | + | |
- | -u [ ALL ] | + | |
- | CPU utilization statistics [A_CPU] | + | |
- | -v Kernel tables statistics [A_KTABLES] | + | |
- | -W Swapping statistics [A_SWAP] | + | |
- | -w Task creation and system switching statistics [A_PCSW] | + | |
- | -y TTY devices statistics [A_SERIAL] | + | |
- | </ | + | |
- | =====Modules usb===== | + | # IPTABLES --action CHAINE --option1 --option2 |
- | L' | + | Les actions |
- | ^ Version USB ^ Module | + | ^ |
- | | | + | | - -append |
- | | | + | | - -delete |
- | | | + | | - -replace |
- | | | + | | - -insert | -I | Permet d' |
+ | | - -list | | ||
+ | | - -flush | -F | Permet de vider toutes les règles d'une chaîne | | ||
- | Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé | + | Les options sont: |
- | ^ Module | + | ^ |
- | | | + | | - -protocol |
- | | | + | | - -source |
- | | **snd-usb-audio** | + | | - -destination | -d |
- | | | + | | - -in-interface |
- | | | + | | - -out-interface |
- | | | + | | - -fragment |
+ | | - -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 modules peuvent être chargés par un des moyens suivants | + | Les options spécifiques à NET sont: |
- | * INITrd, | + | | - -to-destination | s/o | Permet de spécifier l' |
- | * Le processus init (systemd), | + | | - -to-source | s/o | Permet spécifier l' |
- | * kmod, d' | + | |
- | | + | |
- | * manuellement. | + | |
- | =====udev===== | + | Les options spécifiques aux LOGS sont: |
- | Depuis | + | | - -log-level | s/o | Permet de spécifier |
+ | | - -log-prefix | | ||
- | * Udev, | + | L' |
- | * HAL, | + | |
- | * Dbus. | + | |
- | Les rôles | + | | - -state | s/o | Permet |
- | * Udev se charge de créer et supprimer d' | + | Ce dernier cas fait référence au STATEFUL. Le STATEFUL est la capacité du par-feu à enregistrer dans une table spécifique, |
- | * HAL obtient des informations | + | |
- | * Dbus joue le rôle d'un bus système qui est utilisé pour la communication | + | |
- | Lors de démarrage de Linux, Udev joue un rôle important | + | Il existe 4 états: |
- | * Au démarrage | + | * NEW |
- | * Udev copie les éventuels nœuds statiques de **/ | + | |
- | * le démon | + | * ESTABLISHED |
- | * Udev crée les nœuds et liens symboliques spécifiés dans la règle identifiée, | + | * Le paquet concerne une connexion déjà établie. Le paquet ne doit contenir |
- | * Udev stocke les règles contenues dans **/ | + | |
- | * En cas de modification des ces règles, Udev met à jour la mémoire. | + | |
+ | * INVALID | ||
+ | * La paquet provient | ||
- | Udev repose sur le filesystem **sysfs** monté sur /sys qui permet de rendre les périphériques visibles à Udev dans l'// | + | ====4.1 - La Configuration par firewalld ==== |
- | Le fichier de configuration principal d'Udev est **/ | + | Firewalld utilise des **zones** - des jeux de règles pré-définis dans lesquels sont placés les interfaces |
- | < | + | * **trusted** - un réseau fiable. Dans ce cas tous les ports sont autorisés, |
- | [root@centos8 ~]# cat / | + | * **work**, **home**, **internal** - un réseau partiellement fiable. Dans ce cas quelques ports sont autorisés, |
- | # see udev.conf(5) for details | + | |
- | # | + | * **block**, **drop** - tout est interdit. La zone drop n' |
- | # udevd is also started in the initrd. | + | |
- | # also want to rebuild the initrd, so that it will include the modified configuration. | + | |
- | # | + | <WRAP center round important 50%> |
- | </code> | + | **Important** - Une interface ne peut être que dans une zone à la fois tandis que plusieurs interfaces peuvent être dans la même zone. |
+ | </WRAP> | ||
- | Les fichiers de règles se trouvent dans **/ | + | Le service firewalld doit toujours être lancé |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 01-md-raid-creating.rules 70-uaccess.rules | + | ● firewalld.service |
- | 10-dm.rules | + | Loaded: loaded (/ |
- | 11-dm-lvm.rules 71-biosdevname.rules | + | Active: active (running) since Tue 2024-10-22 11:02:04 CEST; 32min ago |
- | 11-dm-mpath.rules | + | Docs: man: |
- | 11-dm-parts.rules | + | Main PID: 795 (firewalld) |
- | 13-dm-disk.rules | + | |
- | 39-usbmuxd.rules | + | Memory: 44.6M |
- | 40-elevator.rules | + | |
- | 40-libgphoto2.rules | + | CGroup: /system.slice/ |
- | 40-redhat.rules | + | └─795 / |
- | 40-usb-blacklist.rules | + | |
- | 40-usb_modeswitch.rules | + | Oct 22 11:02:01 redhat9.ittraining.loc systemd[1]: Starting firewalld |
- | 50-udev-default.rules | + | Oct 22 11:02:04 redhat9.ittraining.loc systemd[1]: Started firewalld |
- | 60-alias-kmsg.rules | + | |
- | 60-block.rules | + | |
- | 60-cdrom_id.rules | + | |
- | 60-drm.rules | + | |
- | 60-evdev.rules | + | |
- | 60-fido-id.rules | + | |
- | 60-input-id.rules | + | |
- | 60-libfprint-2-autosuspend.rules | + | |
- | 60-net.rules | + | |
- | 60-persistent-alsa.rules | + | |
- | 60-persistent-input.rules | + | |
- | 60-persistent-storage.rules | + | |
- | 60-persistent-storage-tape.rules | + | |
- | 60-persistent-v4l.rules | + | |
- | 60-raw.rules | + | |
- | 60-rdma-ndd.rules | + | |
- | 60-rdma-persistent-naming.rules | + | |
- | 60-sensor.rules 78-sound-card.rules | + | |
- | 60-serial.rules | + | |
- | 60-tpm-udev.rules | + | |
- | 61-gdm.rules | + | |
- | 61-gnome-bluetooth-rfkill.rules 80-mm-candidate.rules | + | |
- | 61-gnome-settings-daemon-rfkill.rules 80-net-setup-link.rules | + | |
- | 61-scsi-sg3_id.rules | + | |
- | 62-multipath.rules | + | |
- | 63-fc-wwpn-id.rules | + | |
- | 63-md-raid-arrays.rules | + | |
- | 63-scsi-sg3_symlink.rules | + | |
- | 64-btrfs.rules | + | |
- | 64-md-raid-assembly.rules | + | |
- | 65-libwacom.rules | + | |
- | 65-md-incremental.rules | + | |
- | 65-sane-backends.rules | + | |
- | 66-kpartx.rules | + | |
- | 68-del-part-nodes.rules | + | |
- | 69-btattach-bcm.rules | + | |
- | 69-cd-sensors.rules | + | |
- | 69-dm-lvm-metad.rules | + | |
- | 69-libmtp.rules | + | |
- | 69-md-clustered-confirm-device.rules | + | |
- | 70-hypervfcopy.rules | + | |
- | 70-hypervkvp.rules | + | |
- | 70-hypervvss.rules | + | |
- | 70-joystick.rules | + | |
- | 70-mouse.rules | + | |
- | 70-nvmf-autoconnect.rules | + | |
- | 70-power-switch.rules | + | |
- | 70-printers.rules | + | |
- | 70-spice-vdagentd.rules | + | |
- | 70-touchpad.rules | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | ====4.2 - La Configuration de Base de firewalld==== |
- | **Important** : Il vous est possible d' | + | |
- | </ | + | |
- | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' | + | La configuration |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # do not edit this file, it will be overwritten on update | + | total 20 |
+ | drwxr-xr-x. 2 root root 4096 Sep 25 12:05 helpers | ||
+ | drwxr-xr-x. 2 root root 4096 Sep 25 12:05 icmptypes | ||
+ | drwxr-xr-x. 2 root root 23 Sep 25 12:05 ipsets | ||
+ | drwxr-xr-x. 2 root root 33 Sep 25 12:05 policies | ||
+ | drwxr-xr-x. 2 root root 8192 Sep 25 12:06 services | ||
+ | drwxr-xr-x. 2 root root 184 Sep 25 12:05 zones | ||
- | # run a command on remove events | + | [root@redhat9 ~]# ls -l / |
- | ACTION==" | + | total 40 |
- | ACTION==" | + | -rw-r--r--. 1 root root 312 Nov 6 2023 block.xml |
+ | -rw-r--r--. 1 root root 306 Nov 6 2023 dmz.xml | ||
+ | -rw-r--r--. 1 root root 304 Nov 6 2023 drop.xml | ||
+ | -rw-r--r--. 1 root root 317 Nov 6 2023 external.xml | ||
+ | -rw-r--r--. 1 root root 410 Nov 6 2023 home.xml | ||
+ | -rw-r--r--. 1 root root 425 Nov 6 2023 internal.xml | ||
+ | -rw-r--r--. 1 root root 729 Feb 22 2024 nm-shared.xml | ||
+ | -rw-r--r--. 1 root root 356 Nov 6 2023 public.xml | ||
+ | -rw-r--r--. 1 root root 175 Nov 6 2023 trusted.xml | ||
+ | -rw-r--r--. 1 root root 352 Nov 6 2023 work.xml | ||
- | SUBSYSTEM==" | + | [root@redhat9 ~]# ls -l /usr/ |
+ | total 884 | ||
+ | -rw-r--r--. 1 root root 352 Nov 6 2023 afp.xml | ||
+ | -rw-r--r--. 1 root root 399 Nov 6 2023 amanda-client.xml | ||
+ | -rw-r--r--. 1 root root 427 Nov 6 2023 amanda-k5-client.xml | ||
+ | -rw-r--r--. 1 root root 283 Nov 6 2023 amqps.xml | ||
+ | -rw-r--r--. 1 root root 273 Nov 6 2023 amqp.xml | ||
+ | -rw-r--r--. 1 root root 285 Nov 6 2023 apcupsd.xml | ||
+ | -rw-r--r--. 1 root root 301 Nov 6 2023 audit.xml | ||
+ | -rw-r--r--. 1 root root 436 Nov 6 2023 ausweisapp2.xml | ||
+ | -rw-r--r--. 1 root root 320 Nov 6 2023 bacula-client.xml | ||
+ | -rw-r--r--. 1 root root 346 Nov 6 2023 bacula.xml | ||
+ | -rw-r--r--. 1 root root 390 Nov 6 2023 bareos-director.xml | ||
+ | -rw-r--r--. 1 root root 255 Nov 6 2023 bareos-filedaemon.xml | ||
+ | -rw-r--r--. 1 root root 316 Nov 6 2023 bareos-storage.xml | ||
+ | -rw-r--r--. 1 root root 429 Nov 6 2023 bb.xml | ||
+ | -rw-r--r--. 1 root root 339 Nov 6 2023 bgp.xml | ||
+ | -rw-r--r--. 1 root root 275 Nov 6 2023 bitcoin-rpc.xml | ||
+ | -rw-r--r--. 1 root root 307 Nov 6 2023 bitcoin-testnet-rpc.xml | ||
+ | -rw-r--r--. 1 root root 281 Nov 6 2023 bitcoin-testnet.xml | ||
+ | -rw-r--r--. 1 root root 244 Nov 6 2023 bitcoin.xml | ||
+ | -rw-r--r--. 1 root root 410 Nov 6 2023 bittorrent-lsd.xml | ||
+ | -rw-r--r--. 1 root root 222 Nov 6 2023 ceph-exporter.xml | ||
+ | -rw-r--r--. 1 root root 294 Nov 6 2023 ceph-mon.xml | ||
+ | -rw-r--r--. 1 root root 329 Nov 6 2023 ceph.xml | ||
+ | -rw-r--r--. 1 root root 168 Nov 6 2023 cfengine.xml | ||
+ | -rw-r--r--. 1 root root 234 Nov 6 2023 checkmk-agent.xml | ||
+ | -rw-r--r--. 1 root root 211 Nov 6 2023 cockpit.xml | ||
+ | -rw-r--r--. 1 root root 296 Nov 6 2023 collectd.xml | ||
+ | -rw-r--r--. 1 root root 260 Nov 6 2023 condor-collector.xml | ||
+ | -rw-r--r--. 1 root root 343 Nov 6 2023 cratedb.xml | ||
+ | -rw-r--r--. 1 root root 296 Nov 6 2023 ctdb.xml | ||
+ | -rw-r--r--. 1 root root 981 Nov 6 2023 dds-multicast.xml | ||
+ | -rw-r--r--. 1 root root 947 Nov 6 2023 dds-unicast.xml | ||
+ | -rw-r--r--. 1 root root 574 Nov 6 2023 dds.xml | ||
+ | -rw-r--r--. 1 root root 305 Nov 6 2023 dhcpv6-client.xml | ||
+ | -rw-r--r--. 1 root root 234 Nov 6 2023 dhcpv6.xml | ||
+ | -rw-r--r--. 1 root root 227 Nov 6 2023 dhcp.xml | ||
+ | -rw-r--r--. 1 root root 205 Nov 6 2023 distcc.xml | ||
+ | -rw-r--r--. 1 root root 318 Nov 6 2023 dns-over-tls.xml | ||
+ | -rw-r--r--. 1 root root 346 Nov 6 2023 dns.xml | ||
+ | -rw-r--r--. 1 root root 374 Nov 6 2023 docker-registry.xml | ||
+ | -rw-r--r--. 1 root root 391 Nov 6 2023 docker-swarm.xml | ||
+ | -rw-r--r--. 1 root root 228 Nov 6 2023 dropbox-lansync.xml | ||
+ | -rw-r--r--. 1 root root 338 Nov 6 2023 elasticsearch.xml | ||
+ | -rw-r--r--. 1 root root 304 Nov 6 2023 etcd-client.xml | ||
+ | -rw-r--r--. 1 root root 304 Nov 6 2023 etcd-server.xml | ||
+ | -rw-r--r--. 1 root root 224 Nov 6 2023 finger.xml | ||
+ | -rw-r--r--. 1 root root 270 Nov 6 2023 foreman-proxy.xml | ||
+ | -rw-r--r--. 1 root root 408 Nov 6 2023 foreman.xml | ||
+ | -rw-r--r--. 1 root root 709 Nov 6 2023 freeipa-4.xml | ||
+ | -rw-r--r--. 1 root root 489 Nov 6 2023 freeipa-ldaps.xml | ||
+ | -rw-r--r--. 1 root root 488 Nov 6 2023 freeipa-ldap.xml | ||
+ | -rw-r--r--. 1 root root 242 Nov 6 2023 freeipa-replication.xml | ||
+ | -rw-r--r--. 1 root root 657 Nov 6 2023 freeipa-trust.xml | ||
+ | -rw-r--r--. 1 root root 361 Nov 6 2023 ftp.xml | ||
+ | -rw-r--r--. 1 root root 292 Nov 6 2023 galera.xml | ||
+ | -rw-r--r--. 1 root root 184 Nov 6 2023 ganglia-client.xml | ||
+ | -rw-r--r--. 1 root root 176 Nov 6 2023 ganglia-master.xml | ||
+ | -rw-r--r--. 1 root root 212 Nov 6 2023 git.xml | ||
+ | -rw-r--r--. 1 root root 406 Nov 6 2023 gpsd.xml | ||
+ | -rw-r--r--. 1 root root 218 Nov 6 2023 grafana.xml | ||
+ | -rw-r--r--. 1 root root 119 Nov 6 2023 gre.xml | ||
+ | -rw-r--r--. 1 root root 608 Nov 6 2023 high-availability.xml | ||
+ | -rw-r--r--. 1 root root 336 Nov 6 2023 http3.xml | ||
+ | -rw-r--r--. 1 root root 448 Nov 6 2023 https.xml | ||
+ | -rw-r--r--. 1 root root 353 Nov 6 2023 http.xml | ||
+ | -rw-r--r--. 1 root root 293 Nov 6 2023 ident.xml | ||
+ | -rw-r--r--. 1 root root 372 Nov 6 2023 imaps.xml | ||
+ | -rw-r--r--. 1 root root 327 Nov 6 2023 imap.xml | ||
+ | -rw-r--r--. 1 root root 315 Nov 6 2023 ipfs.xml | ||
+ | -rw-r--r--. 1 root root 454 Nov 6 2023 ipp-client.xml | ||
+ | -rw-r--r--. 1 root root 427 Nov 6 2023 ipp.xml | ||
+ | -rw-r--r--. 1 root root 895 Nov 6 2023 ipsec.xml | ||
+ | -rw-r--r--. 1 root root 255 Nov 6 2023 ircs.xml | ||
+ | -rw-r--r--. 1 root root 247 Nov 6 2023 irc.xml | ||
+ | -rw-r--r--. 1 root root 264 Nov 6 2023 iscsi-target.xml | ||
+ | -rw-r--r--. 1 root root 358 Nov 6 2023 isns.xml | ||
+ | -rw-r--r--. 1 root root 213 Nov 6 2023 jenkins.xml | ||
+ | -rw-r--r--. 1 root root 182 Nov 6 2023 kadmin.xml | ||
+ | -rw-r--r--. 1 root root 272 Nov 6 2023 kdeconnect.xml | ||
+ | -rw-r--r--. 1 root root 233 Nov 6 2023 kerberos.xml | ||
+ | -rw-r--r--. 1 root root 384 Nov 6 2023 kibana.xml | ||
+ | -rw-r--r--. 1 root root 249 Nov 6 2023 klogin.xml | ||
+ | -rw-r--r--. 1 root root 221 Nov 6 2023 kpasswd.xml | ||
+ | -rw-r--r--. 1 root root 182 Nov 6 2023 kprop.xml | ||
+ | -rw-r--r--. 1 root root 242 Nov 6 2023 kshell.xml | ||
+ | -rw-r--r--. 1 root root 308 Nov 6 2023 kube-apiserver.xml | ||
+ | -rw-r--r--. 1 root root 204 Nov 6 2023 kube-api.xml | ||
+ | -rw-r--r--. 1 root root 289 Nov 6 2023 kube-controller-manager-secure.xml | ||
+ | -rw-r--r--. 1 root root 280 Nov 6 2023 kube-controller-manager.xml | ||
+ | -rw-r--r--. 1 root root 560 Nov 6 2023 kube-control-plane-secure.xml | ||
+ | -rw-r--r--. 1 root root 537 Nov 6 2023 kube-control-plane.xml | ||
+ | -rw-r--r--. 1 root root 244 Nov 6 2023 kubelet-readonly.xml | ||
+ | -rw-r--r--. 1 root root 212 Nov 6 2023 kubelet-worker.xml | ||
+ | -rw-r--r--. 1 root root 239 Nov 6 2023 kubelet.xml | ||
+ | -rw-r--r--. 1 root root 224 Nov 6 2023 kube-nodeport-services.xml | ||
+ | -rw-r--r--. 1 root root 328 Nov 6 2023 kube-scheduler-secure.xml | ||
+ | -rw-r--r--. 1 root root 319 Nov 6 2023 kube-scheduler.xml | ||
+ | -rw-r--r--. 1 root root 374 Nov 6 2023 kube-worker.xml | ||
+ | -rw-r--r--. 1 root root 232 Nov 6 2023 ldaps.xml | ||
+ | -rw-r--r--. 1 root root 199 Nov 6 2023 ldap.xml | ||
+ | -rw-r--r--. 1 root root 385 Nov 6 2023 libvirt-tls.xml | ||
+ | -rw-r--r--. 1 root root 389 Nov 6 2023 libvirt.xml | ||
+ | -rw-r--r--. 1 root root 269 Nov 6 2023 lightning-network.xml | ||
+ | -rw-r--r--. 1 root root 468 Nov 6 2023 llmnr-client.xml | ||
+ | -rw-r--r--. 1 root root 410 Nov 6 2023 llmnr-tcp.xml | ||
+ | -rw-r--r--. 1 root root 463 Nov 6 2023 llmnr-udp.xml | ||
+ | -rw-r--r--. 1 root root 519 Nov 6 2023 llmnr.xml | ||
+ | -rw-r--r--. 1 root root 349 Nov 6 2023 managesieve.xml | ||
+ | -rw-r--r--. 1 root root 432 Nov 6 2023 matrix.xml | ||
+ | -rw-r--r--. 1 root root 424 Nov 6 2023 mdns.xml | ||
+ | -rw-r--r--. 1 root root 245 Nov 6 2023 memcache.xml | ||
+ | -rw-r--r--. 1 root root 334 Nov 6 2023 minidlna.xml | ||
+ | -rw-r--r--. 1 root root 237 Nov 6 2023 mongodb.xml | ||
+ | -rw-r--r--. 1 root root 473 Nov 6 2023 mosh.xml | ||
+ | -rw-r--r--. 1 root root 211 Nov 6 2023 mountd.xml | ||
+ | -rw-r--r--. 1 root root 296 Nov 6 2023 mqtt-tls.xml | ||
+ | -rw-r--r--. 1 root root 287 Nov 6 2023 mqtt.xml | ||
+ | -rw-r--r--. 1 root root 170 Nov 6 2023 mssql.xml | ||
+ | -rw-r--r--. 1 root root 180 Nov 6 2023 ms-wbt.xml | ||
+ | -rw-r--r--. 1 root root 242 Nov 6 2023 murmur.xml | ||
+ | -rw-r--r--. 1 root root 171 Nov 6 2023 mysql.xml | ||
+ | -rw-r--r--. 1 root root 250 Nov 6 2023 nbd.xml | ||
+ | -rw-r--r--. 1 root root 309 Nov 6 2023 nebula.xml | ||
+ | -rw-r--r--. 1 root root 262 Nov 6 2023 netbios-ns.xml | ||
+ | -rw-r--r--. 1 root root 243 Nov 6 2023 netdata-dashboard.xml | ||
+ | -rw-r--r--. 1 root root 342 Nov 6 2023 nfs3.xml | ||
+ | -rw-r--r--. 1 root root 324 Nov 6 2023 nfs.xml | ||
+ | -rw-r--r--. 1 root root 293 Nov 6 2023 nmea-0183.xml | ||
+ | -rw-r--r--. 1 root root 247 Nov 6 2023 nrpe.xml | ||
+ | -rw-r--r--. 1 root root 389 Nov 6 2023 ntp.xml | ||
+ | -rw-r--r--. 1 root root 368 Nov 6 2023 nut.xml | ||
+ | -rw-r--r--. 1 root root 335 Nov 6 2023 openvpn.xml | ||
+ | -rw-r--r--. 1 root root 260 Nov 6 2023 ovirt-imageio.xml | ||
+ | -rw-r--r--. 1 root root 343 Nov 6 2023 ovirt-storageconsole.xml | ||
+ | -rw-r--r--. 1 root root 235 Nov 6 2023 ovirt-vmconsole.xml | ||
+ | -rw-r--r--. 1 root root 869 Nov 6 2023 plex.xml | ||
+ | -rw-r--r--. 1 root root 433 Nov 6 2023 pmcd.xml | ||
+ | -rw-r--r--. 1 root root 474 Nov 6 2023 pmproxy.xml | ||
+ | -rw-r--r--. 1 root root 544 Nov 6 2023 pmwebapis.xml | ||
+ | -rw-r--r--. 1 root root 460 Nov 6 2023 pmwebapi.xml | ||
+ | -rw-r--r--. 1 root root 357 Nov 6 2023 pop3s.xml | ||
+ | -rw-r--r--. 1 root root 348 Nov 6 2023 pop3.xml | ||
+ | -rw-r--r--. 1 root root 181 Nov 6 2023 postgresql.xml | ||
+ | -rw-r--r--. 1 root root 509 Nov 6 2023 privoxy.xml | ||
+ | -rw-r--r--. 1 root root 226 Nov 6 2023 prometheus-node-exporter.xml | ||
+ | -rw-r--r--. 1 root root 213 Nov 6 2023 prometheus.xml | ||
+ | -rw-r--r--. 1 root root 261 Nov 6 2023 proxy-dhcp.xml | ||
+ | -rw-r--r--. 1 root root 262 Nov 6 2023 ps2link.xml | ||
+ | -rw-r--r--. 1 root root 173 Nov 6 2023 ps3netsrv.xml | ||
+ | -rw-r--r--. 1 root root 424 Nov 6 2023 ptp.xml | ||
+ | -rw-r--r--. 1 root root 414 Nov 6 2023 pulseaudio.xml | ||
+ | -rw-r--r--. 1 root root 297 Nov 6 2023 puppetmaster.xml | ||
+ | -rw-r--r--. 1 root root 273 Nov 6 2023 quassel.xml | ||
+ | -rw-r--r--. 1 root root 520 Nov 6 2023 radius.xml | ||
+ | -rw-r--r--. 1 root root 183 Nov 6 2023 rdp.xml | ||
+ | -rw-r--r--. 1 root root 212 Nov 6 2023 redis-sentinel.xml | ||
+ | -rw-r--r--. 1 root root 268 Nov 6 2023 redis.xml | ||
+ | -rw-r--r--. 1 root root 381 Nov 6 2023 RH-Satellite-6-capsule.xml | ||
+ | -rw-r--r--. 1 root root 556 Nov 6 2023 RH-Satellite-6.xml | ||
+ | -rw-r--r--. 1 root root 214 Nov 6 2023 rpc-bind.xml | ||
+ | -rw-r--r--. 1 root root 213 Nov 6 2023 rquotad.xml | ||
+ | -rw-r--r--. 1 root root 310 Nov 6 2023 rsh.xml | ||
+ | -rw-r--r--. 1 root root 311 Nov 6 2023 rsyncd.xml | ||
+ | -rw-r--r--. 1 root root 350 Nov 6 2023 rtsp.xml | ||
+ | -rw-r--r--. 1 root root 329 Nov 6 2023 salt-master.xml | ||
+ | -rw-r--r--. 1 root root 339 Nov 6 2023 samba-client.xml | ||
+ | -rw-r--r--. 1 root root 782 Nov 6 2023 samba-dc.xml | ||
+ | -rw-r--r--. 1 root root 382 Nov 6 2023 samba.xml | ||
+ | -rw-r--r--. 1 root root 324 Nov 6 2023 sane.xml | ||
+ | -rw-r--r--. 1 root root 283 Nov 6 2023 sips.xml | ||
+ | -rw-r--r--. 1 root root 496 Nov 6 2023 sip.xml | ||
+ | -rw-r--r--. 1 root root 299 Nov 6 2023 slp.xml | ||
+ | -rw-r--r--. 1 root root 231 Nov 6 2023 smtp-submission.xml | ||
+ | -rw-r--r--. 1 root root 577 Nov 6 2023 smtps.xml | ||
+ | -rw-r--r--. 1 root root 550 Nov 6 2023 smtp.xml | ||
+ | -rw-r--r--. 1 root root 359 Nov 6 2023 snmptls-trap.xml | ||
+ | -rw-r--r--. 1 root root 390 Nov 6 2023 snmptls.xml | ||
+ | -rw-r--r--. 1 root root 308 Nov 6 2023 snmptrap.xml | ||
+ | -rw-r--r--. 1 root root 342 Nov 6 2023 snmp.xml | ||
+ | -rw-r--r--. 1 root root 405 Nov 6 2023 spideroak-lansync.xml | ||
+ | -rw-r--r--. 1 root root 275 Nov 6 2023 spotify-sync.xml | ||
+ | -rw-r--r--. 1 root root 173 Nov 6 2023 squid.xml | ||
+ | -rw-r--r--. 1 root root 421 Nov 6 2023 ssdp.xml | ||
+ | -rw-r--r--. 1 root root 463 Nov 6 2023 ssh.xml | ||
+ | -rw-r--r--. 1 root root 631 Nov 6 2023 steam-streaming.xml | ||
+ | -rw-r--r--. 1 root root 287 Nov 6 2023 svdrp.xml | ||
+ | -rw-r--r--. 1 root root 231 Nov 6 2023 svn.xml | ||
+ | -rw-r--r--. 1 root root 297 Nov 6 2023 syncthing-gui.xml | ||
+ | -rw-r--r--. 1 root root 414 Nov 6 2023 syncthing-relay.xml | ||
+ | -rw-r--r--. 1 root root 350 Nov 6 2023 syncthing.xml | ||
+ | -rw-r--r--. 1 root root 496 Nov 6 2023 synergy.xml | ||
+ | -rw-r--r--. 1 root root 444 Nov 6 2023 syslog-tls.xml | ||
+ | -rw-r--r--. 1 root root 329 Nov 6 2023 syslog.xml | ||
+ | -rw-r--r--. 1 root root 393 Nov 6 2023 telnet.xml | ||
+ | -rw-r--r--. 1 root root 252 Nov 6 2023 tentacle.xml | ||
+ | -rw-r--r--. 1 root root 424 Nov 6 2023 tftp.xml | ||
+ | -rw-r--r--. 1 root root 221 Nov 6 2023 tile38.xml | ||
+ | -rw-r--r--. 1 root root 336 Nov 6 2023 tinc.xml | ||
+ | -rw-r--r--. 1 root root 771 Nov 6 2023 tor-socks.xml | ||
+ | -rw-r--r--. 1 root root 244 Nov 6 2023 transmission-client.xml | ||
+ | -rw-r--r--. 1 root root 264 Nov 6 2023 upnp-client.xml | ||
+ | -rw-r--r--. 1 root root 593 Nov 6 2023 vdsm.xml | ||
+ | -rw-r--r--. 1 root root 475 Nov 6 2023 vnc-server.xml | ||
+ | -rw-r--r--. 1 root root 443 Nov 6 2023 warpinator.xml | ||
+ | -rw-r--r--. 1 root root 310 Nov 6 2023 wbem-https.xml | ||
+ | -rw-r--r--. 1 root root 352 Nov 6 2023 wbem-http.xml | ||
+ | -rw-r--r--. 1 root root 285 Nov 6 2023 wireguard.xml | ||
+ | -rw-r--r--. 1 root root 355 Nov 6 2023 ws-discovery-client.xml | ||
+ | -rw-r--r--. 1 root root 320 Nov 6 2023 ws-discovery-tcp.xml | ||
+ | -rw-r--r--. 1 root root 375 Nov 6 2023 ws-discovery-udp.xml | ||
+ | -rw-r--r--. 1 root root 357 Nov 6 2023 ws-discovery.xml | ||
+ | -rw-r--r--. 1 root root 323 Nov 6 2023 wsmans.xml | ||
+ | -rw-r--r--. 1 root root 316 Nov 6 2023 wsman.xml | ||
+ | -rw-r--r--. 1 root root 329 Nov 6 2023 xdmcp.xml | ||
+ | -rw-r--r--. 1 root root 509 Nov 6 2023 xmpp-bosh.xml | ||
+ | -rw-r--r--. 1 root root 488 Nov 6 2023 xmpp-client.xml | ||
+ | -rw-r--r--. 1 root root 264 Nov 6 2023 xmpp-local.xml | ||
+ | -rw-r--r--. 1 root root 545 Nov 6 2023 xmpp-server.xml | ||
+ | -rw-r--r--. 1 root root 314 Nov 6 2023 zabbix-agent.xml | ||
+ | -rw-r--r--. 1 root root 315 Nov 6 2023 zabbix-server.xml | ||
+ | -rw-r--r--. 1 root root 242 Nov 6 2023 zerotier.xml | ||
- | # select " | + | [root@redhat9 ~]# ls -l / |
- | SUBSYSTEM==" | + | total 180 |
- | SUBSYSTEM==" | + | -rw-r--r--. |
+ | -rw-r--r--. 1 root root 258 Nov 6 2023 bad-header.xml | ||
+ | -rw-r--r--. 1 root root 293 Nov 6 2023 beyond-scope.xml | ||
+ | -rw-r--r--. 1 root root 279 Nov 6 2023 communication-prohibited.xml | ||
+ | -rw-r--r--. 1 root root 222 Nov 6 2023 destination-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 173 Nov 6 2023 echo-reply.xml | ||
+ | -rw-r--r--. 1 root root 210 Nov 6 2023 echo-request.xml | ||
+ | -rw-r--r--. 1 root root 261 Nov 6 2023 failed-policy.xml | ||
+ | -rw-r--r--. 1 root root 280 Nov 6 2023 fragmentation-needed.xml | ||
+ | -rw-r--r--. 1 root root 266 Nov 6 2023 host-precedence-violation.xml | ||
+ | -rw-r--r--. 1 root root 257 Nov 6 2023 host-prohibited.xml | ||
+ | -rw-r--r--. 1 root root 242 Nov 6 2023 host-redirect.xml | ||
+ | -rw-r--r--. 1 root root 239 Nov 6 2023 host-unknown.xml | ||
+ | -rw-r--r--. 1 root root 247 Nov 6 2023 host-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 229 Nov 6 2023 ip-header-bad.xml | ||
+ | -rw-r--r--. 1 root root 355 Nov 6 2023 neighbour-advertisement.xml | ||
+ | -rw-r--r--. 1 root root 457 Nov 6 2023 neighbour-solicitation.xml | ||
+ | -rw-r--r--. 1 root root 250 Nov 6 2023 network-prohibited.xml | ||
+ | -rw-r--r--. 1 root root 248 Nov 6 2023 network-redirect.xml | ||
+ | -rw-r--r--. 1 root root 239 Nov 6 2023 network-unknown.xml | ||
+ | -rw-r--r--. 1 root root 247 Nov 6 2023 network-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 239 Nov 6 2023 no-route.xml | ||
+ | -rw-r--r--. 1 root root 328 Nov 6 2023 packet-too-big.xml | ||
+ | -rw-r--r--. 1 root root 225 Nov 6 2023 parameter-problem.xml | ||
+ | -rw-r--r--. 1 root root 233 Nov 6 2023 port-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 256 Nov 6 2023 precedence-cutoff.xml | ||
+ | -rw-r--r--. 1 root root 249 Nov 6 2023 protocol-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 185 Nov 6 2023 redirect.xml | ||
+ | -rw-r--r--. 1 root root 244 Nov 6 2023 reject-route.xml | ||
+ | -rw-r--r--. 1 root root 241 Nov 6 2023 required-option-missing.xml | ||
+ | -rw-r--r--. 1 root root 227 Nov 6 2023 router-advertisement.xml | ||
+ | -rw-r--r--. 1 root root 223 Nov 6 2023 router-solicitation.xml | ||
+ | -rw-r--r--. 1 root root 248 Nov 6 2023 source-quench.xml | ||
+ | -rw-r--r--. 1 root root 236 Nov 6 2023 source-route-failed.xml | ||
+ | -rw-r--r--. 1 root root 253 Nov 6 2023 time-exceeded.xml | ||
+ | -rw-r--r--. 1 root root 233 Nov 6 2023 timestamp-reply.xml | ||
+ | -rw-r--r--. 1 root root 228 Nov 6 2023 timestamp-request.xml | ||
+ | -rw-r--r--. 1 root root 258 Nov 6 2023 tos-host-redirect.xml | ||
+ | -rw-r--r--. 1 root root 257 Nov 6 2023 tos-host-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 272 Nov 6 2023 tos-network-redirect.xml | ||
+ | -rw-r--r--. 1 root root 269 Nov 6 2023 tos-network-unreachable.xml | ||
+ | -rw-r--r--. 1 root root 293 Nov 6 2023 ttl-zero-during-reassembly.xml | ||
+ | -rw-r--r--. 1 root root 256 Nov 6 2023 ttl-zero-during-transit.xml | ||
+ | -rw-r--r--. 1 root root 259 Nov 6 2023 unknown-header-type.xml | ||
+ | -rw-r--r--. 1 root root 249 Nov 6 2023 unknown-option.xml | ||
+ | </ | ||
- | SUBSYSTEM==" | + | Ces fichiers sont au format **xml**, par exemple : |
- | ENV{MODALIAS}!="", | + | |
- | ACTION!="add", GOTO="default_end" | + | < |
+ | [root@redhat9 ~]# cat / | ||
+ | <?xml version="1.0" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
- | SUBSYSTEM==" | + | La configuration de firewalld ainsi que les définitions et règles personnalisées se trouvent dans **/etc/ |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | KERNEL==" | + | |
- | SUBSYSTEM==" | + | < |
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 8 | ||
+ | -rw-r--r--. 1 root root 2483 Nov 6 2023 firewalld.conf | ||
+ | drwxr-x---. 2 root root 6 Nov 6 2023 helpers | ||
+ | drwxr-x---. 2 root root 6 Nov 6 2023 icmptypes | ||
+ | drwxr-x---. 2 root root 6 Nov 6 2023 ipsets | ||
+ | -rw-r--r--. 1 root root 271 Nov 6 2023 lockdown-whitelist.xml | ||
+ | drwxr-x---. 2 root root 6 Nov 6 2023 policies | ||
+ | drwxr-x---. 2 root root 6 Nov 6 2023 services | ||
+ | drwxr-x---. 2 root root 46 Nov 6 2023 zones | ||
- | SUBSYSTEM==" | + | [root@redhat9 ~]# ls -l / |
- | SUBSYSTEM==" | + | total 8 |
+ | -rw-r--r--. 1 root root 356 Oct 19 2023 public.xml | ||
+ | -rw-r--r--. 1 root root 356 Oct 19 2023 public.xml.old | ||
- | SUBSYSTEM==" | + | [root@redhat9 ~]# ls -l / |
- | SUBSYSTEM==" | + | total 0 |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | [root@redhat9 ~]# ls -l /etc/ |
- | SUBSYSTEM==" | + | total 0 |
- | + | ||
- | SUBSYSTEM==" | + | |
- | OPTIONS+=" | + | |
- | --More-- | + | |
</ | </ | ||
- | Chaque règle prend la forme suivante | + | Le fichier de configuration de firewalld est **/ |
- | KEY, [KEY, ...] NAME [, SYMLINK] | + | < |
+ | [root@redhat9 ~]# cat / | ||
+ | # firewalld config file | ||
- | Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes | + | # default zone |
+ | # The default zone used if an empty zone string is used. | ||
+ | # Default: public | ||
+ | DefaultZone=public | ||
- | ^ Type ^ Description ^ Exemples ^ | + | # Clean up on exit |
- | | BUS | Type de bus | usb, scsi, ide | | + | # If set to no or false the firewall configuration will not get cleaned up |
- | | KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | | + | # on exit or stop of firewalld. |
- | | SUBSYSTEM | Le nom noyau du sous-système, | + | # Default: yes |
- | | DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | | + | CleanupOnExit=yes |
- | | ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | | + | |
- | | PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | | + | |
- | | SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu' | + | |
- | | PROGRAM | Ceci permet à Udev d' | + | |
- | | RESULT | Valeur à comparer au résultat de PROGRAM | S/O | | + | |
- | NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique | + | # Clean up kernel modules on exit |
+ | # If set to yes or true the firewall related kernel modules will be | ||
+ | # unloaded on exit or stop of firewalld. This might attempt to unload | ||
+ | # modules not originally loaded by firewalld. | ||
+ | # Default: no | ||
+ | CleanupModulesOnExit=no | ||
- | ^ Type ^ Description ^ Exemples ^ | + | # Lockdown |
- | | NAME | Le nome du nœud dans /dev | S/O | | + | # If set to enabled, firewall changes with the D-Bus interface will be limited |
- | | SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | | + | # to applications that are listed in the lockdown whitelist. |
+ | # The lockdown whitelist file is lockdown-whitelist.xml | ||
+ | # Default: no | ||
+ | Lockdown=no | ||
- | ====La commande udevadm==== | + | # IPv6_rpfilter |
+ | # Performs a reverse path filter test on a packet for IPv6. If a reply to the | ||
+ | # 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 | ||
- | Pour obtenir de l' | + | # IndividualCalls |
+ | # 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 |
- | [root@centos8 ~]# udevadm info --query=all -n /dev/sda | + | # Add logging rules right before reject and drop rules in the INPUT, FORWARD |
- | P: / | + | # and OUTPUT chains for the default rules and also final reject and drop rules |
- | N: sda | + | # in zones. Possible values are: all, unicast, broadcast, multicast and off. |
- | S: disk/ | + | # Default: off |
- | S: disk/ | + | LogDenied=off |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | E: DEVLINKS=/ | + | |
- | E: DEVNAME=/ | + | |
- | E: DEVPATH=/ | + | |
- | E: DEVTYPE=disk | + | |
- | E: ID_ATA=1 | + | |
- | E: ID_ATA_FEATURE_SET_SMART=1 | + | |
- | E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 | + | |
- | E: ID_ATA_SATA=1 | + | |
- | E: ID_ATA_WRITE_CACHE=1 | + | |
- | E: ID_ATA_WRITE_CACHE_ENABLED=1 | + | |
- | E: ID_BUS=ata | + | |
- | E: ID_MODEL=QEMU_HARDDISK | + | |
- | E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | + | |
- | E: ID_PART_TABLE_TYPE=dos | + | |
- | E: ID_PART_TABLE_UUID=b39ec5c8 | + | |
- | E: ID_PATH=pci-0000: | + | |
- | E: ID_PATH_TAG=pci-0000_00_07_0-ata-1 | + | |
- | E: ID_REVISION=2.5+ | + | |
- | E: ID_SCSI=1 | + | |
- | E: ID_SCSI_INQUIRY=1 | + | |
- | E: ID_SERIAL=QEMU_HARDDISK_QM00005 | + | |
- | E: ID_SERIAL_SHORT=QM00005 | + | |
- | E: ID_TYPE=disk | + | |
- | E: ID_VENDOR=ATA | + | |
- | E: ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | + | |
- | E: MAJOR=8 | + | |
- | E: MINOR=0 | + | |
- | E: SCSI_IDENT_LUN_ATA=QEMU_HARDDISK_QM00005 | + | |
- | E: SCSI_IDENT_LUN_T10=ATA_QEMU_HARDDISK_QM00005 | + | |
- | E: SCSI_IDENT_LUN_VENDOR=QM00005 | + | |
- | E: SCSI_IDENT_SERIAL=QM00005 | + | |
- | E: SCSI_MODEL=QEMU_HARDDISK | + | |
- | E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | + | |
- | E: SCSI_REVISION=2.5+ | + | |
- | E: SCSI_TPGS=0 | + | |
- | E: SCSI_TYPE=disk | + | |
- | E: SCSI_VENDOR=ATA | + | |
- | E: SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | + | |
- | E: SUBSYSTEM=block | + | |
- | E: TAGS=: | + | |
- | E: USEC_INITIALIZED=8735808 | + | |
- | </ | + | |
- | ===Les options de la commande=== | + | # FirewallBackend |
+ | # Selects the firewall backend implementation. | ||
+ | # Choices are: | ||
+ | # - nftables (default) | ||
+ | # - iptables (iptables, ip6tables, ebtables and ipset) | ||
+ | # Note: The iptables backend is deprecated. It will be removed in a future | ||
+ | # release. | ||
+ | FirewallBackend=nftables | ||
- | Les options de la commande udevadm sont : | + | # FlushAllOnReload |
+ | # 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 |
- | [root@centos8 ~]# udevadm --help | + | # As per RFC 3964, filter IPv6 traffic with 6to4 destination addresses that |
- | udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] | + | # correspond to IPv4 addresses that should not be routed over the public |
+ | # internet. | ||
+ | # Defaults to " | ||
+ | RFC3964_IPv4=yes | ||
+ | </ | ||
- | Send control commands or test the device manager. | + | ====4.3 - La Commande firewall-cmd==== |
- | Commands: | + | firewalld s' |
- | info Query sysfs or the udev database | + | |
- | trigger | + | |
- | settle | + | |
- | control | + | |
- | monitor | + | |
- | test Test an event run | + | |
- | test-builtin | + | |
- | [root@centos8 ~]# udevadm info --help | + | <WRAP center round important 50%> |
- | udevadm info [OPTIONS] [DEVPATH|FILE] | + | **Important** - firewall-cmd est le front-end de firewalld en ligne de commande. Il existe aussi la commande **firewall-config** qui lance un outi de configuration graphique. |
+ | </ | ||
- | Query sysfs or the udev database. | + | Pour obtenir la liste de toutes les zones prédéfinies, |
- | -h --help | + | < |
- | -V --version | + | [root@redhat9 ~]# firewall-cmd --get-zones |
- | -q --query=TYPE | + | block dmz drop external home internal nm-shared public trusted work |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -p --path=SYSPATH | + | |
- | -n --name=NAME | + | |
- | -r --root Prepend dev directory to path names | + | |
- | | + | |
- | of parent devices | + | |
- | -d --device-id-of-file=FILE Print major:minor of device containing this file | + | |
- | -x --export | + | |
- | -P --export-prefix | + | |
- | -e --export-db | + | |
- | -c --cleanup-db Clean up the udev database | + | |
</ | </ | ||
- | =====Système | + | Pour obtenir la liste de toutes les services prédéfinis, |
- | + | ||
- | Le système de fichiers virtuel **/sys** a été introduit avec le noyau Linux **2.6**. Son rôle est de décrire le matériel pour udev. | + | |
- | + | ||
- | Saisissez | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | total 0 | + | RH-Satellite-6 RH-Satellite-6-capsule afp amanda-client amanda-k5-client amqp amqps apcupsd audit ausweisapp2 bacula bacula-client bareos-director bareos-filedaemon bareos-storage bb bgp bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc bittorrent-lsd ceph ceph-exporter ceph-mon cfengine checkmk-agent cockpit collectd condor-collector cratedb ctdb dds dds-multicast dds-unicast 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 gpsd grafana gre high-availability http http3 https ident imap imaps ipfs ipp ipp-client ipsec irc ircs iscsi-target isns jenkins kadmin kdeconnect kerberos kibana klogin kpasswd kprop kshell kube-api kube-apiserver kube-control-plane kube-control-plane-secure kube-controller-manager kube-controller-manager-secure kube-nodeport-services kube-scheduler kube-scheduler-secure kube-worker kubelet kubelet-readonly kubelet-worker ldap ldaps libvirt libvirt-tls lightning-network llmnr llmnr-client llmnr-tcp llmnr-udp managesieve matrix mdns memcache minidlna mongodb mosh mountd mqtt mqtt-tls ms-wbt mssql murmur mysql nbd nebula netbios-ns netdata-dashboard nfs nfs3 nmea-0183 nrpe ntp nut openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole plex pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy prometheus prometheus-node-exporter proxy-dhcp ps2link ps3netsrv 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 snmptls snmptls-trap snmptrap spideroak-lansync spotify-sync squid ssdp ssh steam-streaming svdrp svn syncthing syncthing-gui syncthing-relay synergy syslog syslog-tls telnet tentacle tftp tile38 tinc tor-socks transmission-client upnp-client vdsm vnc-server warpinator wbem-http wbem-https wireguard ws-discovery ws-discovery-client ws-discovery-tcp ws-discovery-udp wsman wsmans xdmcp xmpp-bosh xmpp-client xmpp-local xmpp-server zabbix-agent zabbix-server zerotier |
- | drwxr-xr-x. 2 root root 0 Jul 12 08:15 block | + | |
- | drwxr-xr-x. 33 root root 0 Jul 12 08:15 bus | + | |
- | drwxr-xr-x. 57 root root 0 Jul 12 08:15 class | + | |
- | drwxr-xr-x. 4 root root 0 Jul 12 08:15 dev | + | |
- | drwxr-xr-x. 14 root root 0 Jul 12 08:15 devices | + | |
- | drwxr-xr-x. 6 root root 0 Jul 12 08:15 firmware | + | |
- | drwxr-xr-x. 9 root root 0 Jul 12 08:15 fs | + | |
- | drwxr-xr-x. 2 root root 0 Jul 12 08:15 hypervisor | + | |
- | drwxr-xr-x. 15 root root 0 Jul 12 08:15 kernel | + | |
- | drwxr-xr-x. 153 root root 0 Jul 12 08:15 module | + | |
- | drwxr-xr-x. 2 root root 0 Jul 12 08:15 power | + | |
</ | </ | ||
- | Chaque répertoire contient des informations : | + | Pour obtenir |
- | + | ||
- | * **block** | + | |
- | * contient des informations sur les périphériques bloc | + | |
- | * **bus** | + | |
- | * contient des informations sur les bus de données | + | |
- | * **class** | + | |
- | * contient des informations sur des classes de matériel | + | |
- | * **devices** | + | |
- | * contient des informations sur la position des périphériques sur les bus | + | |
- | * **firmware** | + | |
- | * contient, entre autre, des informations sur l' | + | |
- | * **module** | + | |
- | * contient des informations sur les modules du noyau | + | |
- | * **power** | + | |
- | * contient des informations sur la gestion | + | |
- | * **fs** | + | |
- | * contient des informations sur les systèmes de fichiers | + | |
- | + | ||
- | Pour illustrer ceci, saisissez | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 2097152 | + | 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 |
</ | </ | ||
- | Ce chiffre correspond aux nombre de secteurs. | + | Pour obtenir la liste des zones de la configuration courante, utilisez |
- | + | ||
- | =====LAB #4 - Limitation | + | |
- | + | ||
- | ====4.1 - ulimit==== | + | |
- | + | ||
- | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | + | |
- | + | ||
- | La commande **ulimit** gère deux types de limite, la limite //hard// en utilisant l' | + | |
- | + | ||
- | La limite //soft// est la limite imposée à l' | + | |
- | + | ||
- | L' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # / | + | public |
- | # | + | |
- | #This file sets the resource limits for the users logged in via PAM. | + | </code> |
- | #It does not affect resource limits of the system services. | + | |
- | # | + | |
- | #Also note that configuration files in / | + | |
- | #which are read in alphabetical order, override the settings in this | + | |
- | #file in case the domain is the same or more specific. | + | |
- | #That means for example that setting a limit for wildcard domain here | + | |
- | #can be overriden with a wildcard setting in a config file in the | + | |
- | # | + | |
- | #with a user specific setting in the subdirectory. | + | |
- | # | + | |
- | #Each line describes a limit for a user in the form: | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | #Where: | + | |
- | #< | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # for maxlogin limit | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | # - " | + | |
- | # | + | |
- | #< | + | |
- | # - core - limits the core file size (KB) | + | |
- | # - data - max data size (KB) | + | |
- | # - fsize - maximum filesize (KB) | + | |
- | # - memlock - max locked-in-memory address space (KB) | + | |
- | # - nofile - max number of open file descriptors | + | |
- | # - rss - max resident set size (KB) | + | |
- | # - stack - max stack size (KB) | + | |
- | # - cpu - max CPU time (MIN) | + | |
- | # - nproc - max number of processes | + | |
- | # - as - address space limit (KB) | + | |
- | # - maxlogins - max number of logins for this user | + | |
- | # - maxsyslogins - max number of logins on the system | + | |
- | # - priority - the priority to run user process with | + | |
- | # - locks - max number of file locks the user can hold | + | |
- | # - sigpending - max number of pending signals | + | |
- | # - msgqueue - max memory used by POSIX message queues (bytes) | + | |
- | # - nice - max nice priority allowed to raise to values: [-20, 19] | + | |
- | # - rtprio - max realtime priority | + | |
- | # | + | |
- | #<domain> < | + | |
- | # | + | |
- | #* | + | Pour obtenir la liste des zones de la configuration courante pour une interface spécifique, utilisez |
- | #* | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | #ftp | + | |
- | # | + | |
- | + | ||
- | # End of file | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : La valeur | + | |
- | </ | + | |
- | + | ||
- | Par exemple, si root inscrit les deux ligne suivantes dans le fichier / | + | |
- | + | ||
- | < | + | |
- | ... | + | |
- | trainee | + | |
- | trainee | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | la limite du nombre de fichiers ouverts simultanément par trainee est de 1 024. Par contre, trainee a la possibilité d' | + | |
< | < | ||
- | $ ulimit | + | [root@redhat9 ~]# firewall-cmd --get-zone-of-interface=ens18 |
+ | public | ||
</ | </ | ||
- | Pour consulter | + | Pour obtenir |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | core file size (blocks, | + | cockpit dhcpv6-client ssh |
- | data seg size | + | |
- | scheduling priority | + | |
- | file size | + | |
- | pending signals | + | |
- | max locked memory | + | |
- | max memory size | + | |
- | open files (-n) 1024 | + | |
- | pipe size (512 bytes, -p) 8 | + | |
- | POSIX message queues | + | |
- | real-time priority | + | |
- | stack size (kbytes, -s) 8192 | + | |
- | cpu time | + | |
- | max user processes | + | |
- | virtual memory | + | |
- | file locks (-x) unlimited | + | |
</ | </ | ||
- | ====Options de la commande==== | + | Pour obtenir toute la configuration pour la zone public, utilisez |
- | + | ||
- | Les options de **ulimit** sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] | + | public |
- | Modify shell resource limits. | + | |
- | + | icmp-block-inversion: no | |
- | Provides control over the resources available to the shell and processes | + | |
- | it creates, on systems that allow such control. | + | |
- | + | | |
- | Options: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | icmp-blocks: |
- | -e the maximum scheduling priority | + | rich rules: |
- | | + | |
- | -i the maximum number of pending signals | + | |
- | | + | |
- | | + | |
- | | + | |
- | -n the maximum number of open file descriptors | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -t the maximum amount of cpu time in seconds | + | |
- | -u the maximum number of user processes | + | |
- | -v the size of virtual memory | + | |
- | -x the maximum number of file locks | + | |
- | -P the maximum number of pseudoterminals | + | |
- | -T the maximum number of threads | + | |
- | + | ||
- | Not all options are available on all platforms. | + | |
- | + | ||
- | If LIMIT is given, it is the new value of the specified resource; the | + | |
- | special LIMIT values `soft', | + | |
- | current soft limit, the current hard limit, and no limit, respectively. | + | |
- | | + | |
- | no option is given, then -f is assumed. | + | |
- | + | ||
- | Values are in 1024-byte increments, except for -t, which is in seconds, | + | |
- | -p, which is in increments of 512 bytes, and -u, which is an unscaled | + | |
- | | + | |
- | + | ||
- | Exit Status: | + | |
- | Returns success unless an invalid option is supplied or an error occurs. | + | |
</ | </ | ||
- | ====4.2 - Groupes | + | Pour obtenir la liste complète |
- | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | + | < |
+ | [root@redhat9 ~]# firewall-cmd --list-all-zones | ||
+ | block | ||
+ | target: %%REJECT%% | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | Les groupes de contrôle sont organisés de manière hiérarchique, | + | dmz |
+ | target: default | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: ssh | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous RHEl/CentOS 7 sont : | + | drop |
+ | target: DROP | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | * **blkio** - utilisé pour établir des limites sur l' | + | external |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | forward: yes |
- | | + | |
+ | forward-ports: | ||
+ | | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | Pour visualiser les hiérarchies, | + | home |
+ | target: default | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: cockpit dhcpv6-client mdns samba-client ssh | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | < | + | internal |
- | [root@centos8 ~]# lssubsys | + | |
- | bash: lssubsys: command not found... | + | icmp-block-inversion: |
- | Install package ' | + | |
+ | sources: | ||
+ | | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
+ | nm-shared | ||
+ | target: ACCEPT | ||
+ | icmp-block-inversion: | ||
+ | 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=" | ||
- | * Waiting in queue... | + | public (active) |
- | The following packages have to be installed: | + | |
- | libcgroup-0.41-19.el8.x86_64 | + | icmp-block-inversion: no |
- | libcgroup-tools-0.41-19.el8.x86_64 | + | |
- | Proceed with changes? [N/y] y | + | sources: |
+ | services: cockpit dhcpv6-client ssh | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
+ | trusted | ||
+ | target: ACCEPT | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
- | * Waiting in queue... | + | work |
- | * Waiting for authentication... | + | target: default |
- | * Waiting in queue... | + | |
- | * Downloading packages... | + | |
- | * Requesting data... | + | |
- | * Testing changes... | + | |
- | * Installing packages... | + | |
- | cpuset / | + | |
- | cpu,cpuacct / | + | |
- | blkio / | + | |
- | memory / | + | |
- | devices / | + | |
- | freezer / | + | |
- | net_cls, | + | rich rules: |
- | perf_event / | + | |
- | hugetlb / | + | |
- | pids / | + | |
- | rdma / | + | |
</ | </ | ||
+ | |||
+ | Pour changer la zone par défaut de public à work, utilisez la commande suivante : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | cpuset / | + | success |
- | cpu,cpuacct / | + | |
- | blkio / | + | |
- | memory / | + | |
- | devices / | + | |
- | freezer / | + | |
- | net_cls, | + | |
- | perf_event / | + | |
- | hugetlb / | + | |
- | pids / | + | |
- | rdma / | + | |
- | </ | + | |
- | Sous RHEL/CentOS 8, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé avec l' | + | [root@redhat9 ~]# firewall-cmd --get-active-zones |
+ | work | ||
+ | interfaces: ens18 | ||
+ | </code> | ||
- | En haut de l'arborescence des unités de Systemd se trouve | + | Pour ajouter |
- | * le **system.slice** - l' | + | < |
- | * le **user.slice** | + | [root@redhat9 ~]# firewall-cmd --zone=work --add-interface=ip_fixe |
- | * le **machine.slice** | + | success |
- | En dessous des tranches peuvent se trouver | + | [root@redhat9 ~]# firewall-cmd --get-active-zones |
+ | work | ||
+ | interfaces: ens18 ip_fixe | ||
+ | </ | ||
- | * des **scopes** - des processus crées par **fork**, | + | Pour supprimer l' |
- | * des **services** - des processus créés par une **Unité**. | + | |
- | + | ||
- | Les slices peuvent être visualisés avec la commande suivante : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | UNIT LOAD | + | success |
- | -.slice | + | |
- | machine.slice | + | |
- | system-getty.slice | + | |
- | system-lvm2\x2dpvscan.slice | + | |
- | system-sshd\x2dkeygen.slice | + | |
- | system-systemd\x2dfsck.slice | + | |
- | system-systemd\x2dhibernate\x2dresume.slice loaded active active system-systemd\x2dhibernate\x2dresume.slice | + | |
- | system-user\x2druntime\x2ddir.slice | + | |
- | system-vncserver.slice | + | |
- | system.slice | + | |
- | user-1000.slice | + | |
- | user-42.slice | + | |
- | user.slice | + | |
- | LOAD = Reflects whether the unit definition was properly loaded. | + | [root@redhat9 ~]# firewall-cmd --get-active-zones |
- | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | + | work |
- | SUB = The low-level unit activation state, values depend on unit type. | + | interfaces: ens18 |
- | + | ||
- | 13 loaded units listed. Pass --all to see loaded but inactive units, too. | + | |
- | To show all installed unit files use ' | + | |
</ | </ | ||
- | L' | + | Pour ajouter le service **http** à la zone **work**, utilisez la commande |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Control group /: | + | success |
- | -.slice | + | |
- | ├─user.slice | + | [root@redhat9 ~]# firewall-cmd --zone=work --list-services |
- | │ ├─user-42.slice | + | cockpit dhcpv6-client http ssh |
- | │ │ ├─session-c1.scope | + | |
- | │ │ │ ├─1317 gdm-session-worker [pam/ | + | |
- | │ │ │ ├─1459 / | + | |
- | │ │ │ ├─1856 / | + | |
- | │ │ │ ├─1882 / | + | |
- | │ │ │ ├─2059 / | + | |
- | │ │ │ ├─2132 ibus-daemon --xim --panel disable | + | |
- | │ │ │ ├─2135 / | + | |
- | │ │ │ ├─2138 / | + | |
- | │ │ │ ├─2251 / | + | |
- | │ │ │ ├─2261 / | + | |
- | │ │ │ ├─2268 / | + | |
- | │ │ │ ├─2271 / | + | |
- | │ │ │ ├─2272 / | + | |
- | │ │ │ ├─2273 / | + | |
- | │ │ │ ├─2274 / | + | |
- | │ │ │ ├─2275 / | + | |
- | │ │ │ ├─2280 / | + | |
- | │ │ │ ├─2281 / | + | |
- | │ │ │ ├─2283 / | + | |
- | │ │ │ ├─2284 / | + | |
- | │ │ │ ├─2285 / | + | |
- | │ │ │ ├─2290 / | + | |
- | │ │ │ ├─2321 / | + | |
- | │ │ │ ├─2328 / | + | |
- | │ │ │ ├─2333 / | + | |
- | │ │ │ └─2432 / | + | |
- | │ │ └─user@42.service | + | |
- | │ │ | + | |
- | │ │ │ └─2170 / | + | |
- | │ │ | + | |
- | │ │ │ └─1455 / | + | |
- | │ │ | + | |
- | │ │ │ ├─1357 / | + | |
- | │ │ │ └─1377 (sd-pam) | + | |
- | │ │ | + | |
- | │ │ │ ├─2090 / | + | |
- | │ │ │ ├─2095 / | + | |
- | │ │ │ └─2098 / | + | |
- | │ │ | + | |
- | │ │ | + | |
- | │ │ | + | |
- | │ └─user-1000.slice | + | |
- | │ | + | |
- | │ │ ├─gvfs-goa-volume-monitor.service | + | |
- | │ │ │ └─2369 / | + | |
- | │ │ ├─xdg-permission-store.service | + | |
- | │ │ │ └─2191 / | + | |
- | │ │ ├─tracker-store.service | + | |
- | │ │ │ └─2653 / | + | |
- | │ │ ├─evolution-calendar-factory.service | + | |
- | │ │ │ ├─2605 / | + | |
- | │ │ │ └─2706 / | + | |
- | │ │ ├─pulseaudio.service | + | |
- | │ │ │ └─1456 / | + | |
- | │ │ ├─gvfs-daemon.service | + | |
- | │ │ │ ├─1896 / | + | |
- | │ │ │ └─1901 / | + | |
- | │ │ ├─evolution-source-registry.service | + | |
- | │ │ │ └─2206 / | + | |
- | │ │ ├─gvfs-udisks2-volume-monitor.service | + | |
- | │ │ │ └─2243 / | + | |
- | │ │ ├─init.scope | + | |
- | │ │ │ ├─1239 / | + | |
- | │ │ │ └─1318 (sd-pam) | + | |
- | │ │ ├─gvfs-gphoto2-volume-monitor.service | + | |
- | │ │ │ └─2269 / | + | |
- | │ │ ├─at-spi-dbus-bus.service | + | |
- | │ │ │ ├─1964 / | + | |
- | │ │ │ ├─1969 / | + | |
- | │ │ │ └─1972 / | + | |
- | │ │ ├─dbus.service | + | |
- | │ │ │ ├─1786 / | + | |
- | │ │ │ ├─2183 / | + | |
- | │ │ │ ├─2201 / | + | |
- | │ │ │ ├─2225 / | + | |
- | │ │ │ ├─2397 / | + | |
- | │ │ │ └─2721 / | + | |
- | │ │ ├─evolution-addressbook-factory.service | + | |
- | │ │ │ ├─2727 / | + | |
- | │ │ │ └─2771 / | + | |
- | │ │ ├─gvfs-mtp-volume-monitor.service | + | |
- | lines 44-86 | + | |
</ | </ | ||
- | En utilisant Systemd, plusieurs ressources peuvent être limitées | + | Pour supprimer le service **http** de la zone **work**, utilisez la commande suivante |
- | * **CPUShares** - par défault 1024, | + | < |
- | * **MemoryLimit** | + | [root@redhat9 ~]# firewall-cmd --zone=work |
- | * **BlockIOWeight** | + | success |
- | * **StartupCPUShares** | + | |
- | * **StartupBlockIOWeight** | + | |
- | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | + | |
- | <WRAP center round important 60%> | + | [root@redhat9 ~]# firewall-cmd --zone=work --list-services |
- | **Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. | + | cockpit dhcpv6-client ssh |
- | </WRAP> | + | </code> |
- | ===Limitation de la Mémoire=== | + | Pour ajouter un nouveau bloc ICMP, utilisez |
- | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups : | + | < |
+ | [root@redhat9 ~]# firewall-cmd --zone=work --add-icmp-block=echo-reply | ||
+ | success | ||
- | < | + | [root@redhat9 |
- | [root@centos8 | + | echo-reply |
- | [root@centos8 ~]# cat hello-world.sh | + | |
- | # | + | |
- | while [ 1 ]; do | + | |
- | | + | |
- | sleep 360 | + | |
- | done | + | |
</ | </ | ||
- | Rendez le script exécutable et testez-le | + | Pour supprimer un bloc ICMP, utilisez la commande suivante |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# ./hello-world.sh | + | success |
- | hello world | + | |
- | ^C | + | |
- | </ | + | |
- | Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** : | + | [root@redhat9 ~]# firewall-cmd --zone=work --list-icmp-blocks |
- | < | + | [root@redhat9 |
- | [root@centos8 | + | |
</ | </ | ||
- | Par défaut, ce CGroup héritera de l' | + | Pour ajouter le port 591/tcp à la zone work, utilisez la commande suivante |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 | + | success |
- | 39997440 | + | |
+ | [root@redhat9 | ||
+ | 591/tcp | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour supprimer le port 591/ |
- | **Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond | + | |
- | </ | + | |
- | + | ||
- | Lancez maintenant le script **helloworld.sh** | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [1] 35148 | + | success |
- | [root@centos8 | + | [root@redhat9 |
- | [Entrée] | + | |
- | [root@centos8 | + | [root@redhat9 |
- | root | + | |
- | root | + | |
</ | </ | ||
- | Notez qu'il n'y a pas de limite de la mémoire, ce qui implique l' | + | Pour créer un nouveau service, |
- | < | + | * copier un fichier existant se trouvant dans le répertoire **/usr/lib/firewalld/services** vers **/etc/firewalld/services**, |
- | [root@centos8 ~]# ps -ww -o cgroup 35148 | + | * modifier le fichier, |
- | CGROUP | + | * recharger la configuration de firewalld, |
- | 12:memory:/user.slice/user-1000.slice/session-7.scope, | + | * vérifier que firewalld voit le nouveau service. |
- | </ | + | |
- | Insérer le PID de notre script dans le CGroup **helloworld** | + | Par exemple |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | </code> | + | |
- | Notez maintenant l' | + | [root@redhat9 ~]# vi /etc/ |
- | < | + | [root@redhat9 |
- | [root@centos8 | + | <?xml version=" |
- | CGROUP | + | < |
- | 12:memory:/helloworld, | + | < |
- | </code> | + | < |
+ | <port protocol=" | ||
+ | </service> | ||
- | Constatez ensuite l' | + | [root@redhat9 ~]# firewall-cmd --reload |
+ | success | ||
- | < | + | [root@redhat9 |
- | [root@centos8 | + | RH-Satellite-6 RH-Satellite-6-capsule afp amanda-client amanda-k5-client amqp amqps apcupsd audit ausweisapp2 bacula bacula-client bareos-director bareos-filedaemon bareos-storage bb bgp bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc bittorrent-lsd ceph ceph-exporter ceph-mon cfengine checkmk-agent cockpit collectd condor-collector cratedb ctdb dds dds-multicast dds-unicast 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 gpsd grafana gre high-availability http http3 https ident imap imaps ipfs ipp ipp-client ipsec irc ircs iscsi-target isns jenkins kadmin kdeconnect kerberos kibana klogin kpasswd kprop kshell kube-api kube-apiserver kube-control-plane kube-control-plane-secure kube-controller-manager kube-controller-manager-secure kube-nodeport-services kube-scheduler kube-scheduler-secure kube-worker kubelet kubelet-readonly kubelet-worker ldap ldaps libvirt libvirt-tls lightning-network llmnr llmnr-client llmnr-tcp llmnr-udp managesieve matrix mdns memcache minidlna mongodb mosh mountd mqtt mqtt-tls ms-wbt mssql murmur mysql nbd nebula netbios-ns netdata-dashboard nfs nfs3 nmea-0183 nrpe ntp nut openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole plex pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy prometheus prometheus-node-exporter proxy-dhcp ps2link ps3netsrv 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 snmptls snmptls-trap snmptrap spideroak-lansync spotify-sync squid ssdp ssh steam-streaming svdrp svn syncthing syncthing-gui syncthing-relay synergy syslog syslog-tls telnet tentacle tftp tile38 tinc tor-socks transmission-client upnp-client vdsm vnc-server warpinator wbem-http wbem-https wireguard ws-discovery ws-discovery-client ws-discovery-tcp ws-discovery-udp wsman wsmans xdmcp xmpp-bosh xmpp-client xmpp-local xmpp-server zabbix-agent zabbix-server zerotier |
- | 274432 | + | |
</ | </ | ||
- | Tuez le script **hello-world.sh** : | + | ====4.4 - La Configuration Avancée de firewalld==== |
- | < | + | 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@centos8 ~]# kill 35148 | + | |
- | [root@centos8 ~]# ps aux | grep hello-world | + | |
- | root | + | |
- | [1]+ Terminated | + | |
- | </ | + | |
- | Créez un second CGroup beaucoup plus restrictif | + | Les **Critères** sont : |
- | <code> | + | * **source address=" |
- | [root@centos8 ~]# mkdir / | + | * **destination address="< |
- | [root@centos8 ~]# echo 6000 > / | + | * **rule port port="< |
- | [root@centos8 ~]# cat / | + | * **service name=<nom_d' |
- | 4096 | + | |
- | </code> | + | |
- | Relancez le script | + | Les **Actions** sont : |
- | <code> | + | * **accept**, |
- | [root@centos8 ~]# ./ | + | * **reject**, |
- | [1] 35389 | + | * une Action reject peut être associée avec un message d' |
+ | * **drop**. | ||
- | [root@centos8 ~]# hello world | + | Saisissez la commande suivante pour ouvrir le port 80 : |
- | [Entrée] | + | |
- | [root@centos8 | + | < |
+ | [root@redhat9 | ||
+ | success | ||
</ | </ | ||
- | Attendez | + | <WRAP center round important 50%> |
+ | **Important** - Notez que la Rich Rule doit être entourée | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 50%> | ||
+ | **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 | ||
+ | </ | ||
+ | |||
+ | Cette nouvelle règle est écrite en mémoire mais non pas sur disque. Pour l'écrire sur disque dans le fichier zone se trouvant dans **/ | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [Entrée] | + | success |
- | [1]+ Killed | + | |
+ | [root@redhat9 ~]# cat / | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | <service name=" | ||
+ | < | ||
+ | <port port=" | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
</ | </ | ||
- | ===La Commande cgcreate=== | + | <WRAP center round important 50%> |
+ | **Important** - Attention ! La règle ajoutée avec l' | ||
+ | </ | ||
- | Cette commande permet la création d'un CGroup | + | Redémarrez le service **firewalld** |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# ls -l / | + | |
- | total 0 | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children | + | |
- | --w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt | + | |
- | --w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control | + | |
- | ----------. 1 root root 0 Jul 13 10:39 memory.pressure_level | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks | + | |
</ | </ | ||
- | Il n' | + | Pour visualiser cette règle dans la configuration |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | work (active) | ||
+ | target: default | ||
+ | icmp-block-inversion: | ||
+ | interfaces: ens18 | ||
+ | sources: | ||
+ | services: cockpit dhcpv6-client ssh | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
+ | rule port port=" | ||
</ | </ | ||
- | ==La Commande cgexec== | + | Notez que la Rich Rule est créée |
- | + | ||
- | Cette commande permet d' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [1] 37670 | + | success |
- | + | ||
- | [root@centos8 ~]# hello world | + | |
- | [Entrée] | + | |
- | [root@centos8 | + | [root@redhat9 |
+ | public | ||
+ | target: default | ||
+ | icmp-block-inversion: | ||
+ | interfaces: | ||
+ | sources: | ||
+ | services: cockpit dhcpv6-client ssh | ||
+ | ports: | ||
+ | protocols: | ||
+ | forward: yes | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | source-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
+ | rule port port=" | ||
</ | </ | ||
- | ==La Commande cgdelete== | ||
- | Une fois le script terminé, cette commande permet | + | Pour supprimer une Rich Rule, il faut copier la ligne entière la concernant qui se trouve dans la sortie |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | root | + | success |
- | root | + | |
- | [root@centos8 | + | [root@redhat9 |
- | + | public | |
- | root@centos8 ~]# ps aux | grep *.sh | + | |
- | root | + | |
- | [1]+ Terminated | + | interfaces: |
- | + | sources: | |
- | [root@centos8 ~]# cgdelete memory:helloworld2 | + | services: cockpit dhcpv6-client ssh |
- | + | | |
- | [root@centos8 ~]# ls -l / | + | |
- | ls: cannot access '/ | + | |
+ | | ||
+ | | ||
+ | | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
</ | </ | ||
- | ==Le Fichier / | + | ====4.5 - Le mode Panic de firewalld==== |
- | Afin de les rendre persistants, | + | Le mode Panic de firewalld permet de bloquer tout le trafic avec une seule commande. Pour connaître l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# cat / | + | no |
- | # | + | |
- | # Copyright IBM Corporation. 2007 | + | |
- | # | + | |
- | # Authors: | + | |
- | # This program is free software; you can redistribute it and/or modify it | + | |
- | # under the terms of version 2.1 of the GNU Lesser General Public License | + | |
- | # as published by the Free Software Foundation. | + | |
- | # | + | |
- | # This program is distributed in the hope that it would be useful, but | + | |
- | # WITHOUT ANY WARRANTY; without even the implied warranty of | + | |
- | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | |
- | # | + | |
- | # | + | |
- | # By default, we expect systemd mounts everything on boot, | + | |
- | # so there is not much to do. | + | |
- | # See man cgconfig.conf for further details, how to create groups | + | |
- | # on system boot using this file. | + | |
- | group helloworld2 { | + | |
- | cpu { | + | |
- | cpu.shares = 100; | + | |
- | } | + | |
- | memory { | + | |
- | memory.limit_in_bytes = 40000; | + | |
- | } | + | |
- | } | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour activer le mode Panic, il convient |
- | **Important** - Notez la création de **deux** limitations, une de 40 000 octets de mémoire et l' | + | |
- | </ | + | |
- | + | ||
- | Créez donc les deux CGroups concernés | + | |
< | < | ||
- | [root@centos8 ~]# cgcreate | + | # firewall-cmd --panic-on |
- | [root@centos8 ~]# ls -l / | + | |
- | total 0 | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children | + | |
- | --w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt | + | |
- | --w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control | + | |
- | ----------. 1 root root 0 Jul 13 10:46 memory.pressure_level | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks | + | |
</ | </ | ||
- | < | + | Pour désactiver |
- | [root@centos8 ~]# cgcreate -g cpu: | + | |
- | [root@centos8 ~]# ls -l / | + | |
- | total 0 | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks | + | |
- | </ | + | |
- | + | ||
- | ==La Commande cgconfigparser== | + | |
- | + | ||
- | Appliquez | + | |
< | < | ||
- | [root@centos8 ~]# cgconfigparser | + | # firewall-cmd --panic-off |
- | [root@centos8 ~]# cat / | + | |
- | 36864 | + | |
- | [root@centos8 ~]# cat / | + | |
- | 100 | + | |
</ | </ | ||
----- | ----- | ||
- | Copyright © 2023 Hugh Norris. | + | Copyright © 2024 Hugh Norris.< |