Ignorer les liens de navigation | |
Quitter l'aperu | |
![]() |
Sécurisation du réseau dans Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library (Français) |
1. Utilisation de la protection des liens dans des environnements virtualisés
3. Serveurs Web et protocole SSL (Secure Sockets Layer)
4. IP Filter dans Oracle Solaris (présentation)
Affichage des valeurs par défaut du service IP Filter
Création de fichiers de configuration IP Filter
Activation et actualisation d'IP Filter
Désactivation du réassemblage des paquets
Activation du filtrage de loopback
Désactivation du filtrage de paquets
Utilisation des ensembles de règles IP Filter
Gérez les ensembles de règles de filtrage de paquets d'IP Filter
Affichage de l'ensemble actif de règles de filtrage de paquets
Affichage de l'ensemble inactif de règles de filtrage de paquets
Activation d'un nouvel ensemble de règles de filtrage de paquets ou d'un ensemble mis à jour
Suppression d'un ensemble de règles de filtrage de paquets
Ajout de règles à l'ensemble actif de règles de filtrage de paquets
Ajout de règles à l'ensemble inactif de règles de filtrage de paquets
Basculement entre les ensembles actif et inactif de règles de filtrage de paquets
Suppression d'un ensemble inactif de règles de filtrage de paquets du noyau
Gestion des règles NAT d'IP Filter
Affichage des règles NAT actives dans IP Filter
Désactivation des règles NAT dans IP Filter
Ajout de règles aux règles de filtrage de paquets NAT
Gestion des pools d'adresses d'IP Filter
Affichage des pools d'adresses actifs
Suppression d'un pool d'adresses
Ajout de règles à un pool d'adresses
Affichage des statistiques et des informations relatives à IP Filter
Affichage des tables d'état d'IP Filter
Affichage des statistiques d'état d'IP Filter
Affichage des paramètres réglables IP Filter
Affichage des statistiques NAT d'IP Filter
Affichage des statistiques de pool d'adresses d'IP Filter
Utilisation des fichiers journaux IP Filter
Configuration d'un fichier journal d'IP Filter
Affichage des fichiers journaux IP Filter
Vidage du tampon du journal de paquets
Enregistrement dans un fichier des paquets consignés
6. Architecture IPsec (présentation)
7. Configuration d'IPsec (tâches)
8. Architecture IPsec (référence)
9. Protocole IKE (présentation)
Les exemples suivants illustrent les règles de filtrage de paquets qui s'appliquent à un hôte unique, un serveur et un routeur.
Les fichiers de configuration suivent les règles de syntaxe UNIX standard :
Le signe dièse (#) indique qu'une ligne contient des commentaires.
Une ligne peut contenir à la fois des commentaires et des règles.
Vous pouvez ajouter des espaces supplémentaires afin de faciliter la lecture des règles.
La définition d'une règle peut s'étaler sur plusieurs lignes. Insérez un backslash (\) à la fin d'une ligne pour indiquer que la règle continue sur la ligne suivante.
Pour plus d'informations sur la syntaxe, reportez-vous à la section Configuration des règles de filtrage de paquets.
Exemple 5-20 Configuration d'un hôte IP Filter
Cet exemple illustre une configuration définie sur une machine hôte avec une interface réseau net0.
# pass and log everything by default pass in log on net0 all pass out log on net0 all # block, but don't log, incoming packets from other reserved addresses block in quick on net0 from 10.0.0.0/8 to any block in quick on net0 from 172.16.0.0/12 to any # block and log untrusted internal IPs. 0/32 is notation that replaces # address of the machine running IP Filter. block in log quick from 192.168.1.15 to <thishost> block in log quick from 192.168.1.43 to <thishost> # block and log X11 (port 6000) and remote procedure call # and portmapper (port 111) attempts block in log quick on net0 proto tcp from any to net0/32 port = 6000 keep state block in log quick on net0 proto tcp/udp from any to net0/32 port = 111 keep state
Cet ensemble de règles commence par deux règles sans restrictions qui permettent à tous les type de données d'entrer et de sortir via l'interface net0. Le deuxième ensemble de règles empêche tout paquet entrant issu des espaces d'adressage privés 10.0.0.0 et 172.16.0.0 de traverser le pare-feu. L'ensemble de règles suivant bloque des adresses internes spécifiques de la machine hôte. Enfin, le dernier ensemble de règles empêche l'entrée des paquets via les ports 6000 et 111.
Exemple 5-21 Configuration d'un serveur IP Filter
Cet exemple présente la configuration d'une machine hôte tenant lieu de serveur Web. Cette machine possède une interface réseau net0.
# web server with an net0 interface # block and log everything by default; # then allow specific services # group 100 - inbound rules # group 200 - outbound rules # (0/32) resolves to our IP address) *** FTP proxy *** # block short packets which are packets # fragmented too short to be real. block in log quick all with short # block and log inbound and outbound by default, # group by destination block in log on net0 from any to any head 100 block out log on net0 from any to any head 200 # web rules that get hit most often pass in quick on net0 proto tcp from any \ to net0/32 port = http flags S keep state group 100 pass in quick on net0 proto tcp from any \ to net0/32 port = https flags S keep state group 100 # inbound traffic - ssh, auth pass in quick on net0 proto tcp from any \ to net0/32 port = 22 flags S keep state group 100 pass in log quick on net0 proto tcp from any \ to net0/32 port = 113 flags S keep state group 100 pass in log quick on net0 proto tcp from any port = 113 \ to net0/32 flags S keep state group 100 # outbound traffic - DNS, auth, NTP, ssh, WWW, smtp pass out quick on net0 proto tcp/udp from net0/32 \ to any port = domain flags S keep state group 200 pass in quick on net0 proto udp from any \ port = domain to net0/32 group 100 pass out quick on net0 proto tcp from net0/32 \ to any port = 113 flags S keep state group 200 pass out quick on net0 proto tcp from net0/32 port = 113 \ to any flags S keep state group 200 pass out quick on net0 proto udp from net0/32 to any \ port = ntp group 200 pass in quick on net0 proto udp from any \ port = ntp to net0/32 port = ntp group 100 pass out quick on net0 proto tcp from net0/32 \ to any port = ssh flags S keep state group 200 pass out quick on net0 proto tcp from net0/32 \ to any port = http flags S keep state group 200 pass out quick on net0 proto tcp from net0/32 \ to any port = https flags S keep state group 200 pass out quick on net0 proto tcp from net0/32 \ to any port = smtp flags S keep state group 200 # pass icmp packets in and out pass in quick on net0 proto icmp from any to net0/32 keep state group 100 pass out quick on net0 proto icmp from net0/32 to any keep state group 200 # block and ignore NETBIOS packets block in quick on net0 proto tcp from any \ to any port = 135 flags S keep state group 100 block in quick on net0 proto tcp from any port = 137 \ to any flags S keep state group 100 block in quick on net0 proto udp from any to any port = 137 group 100 block in quick on net0 proto udp from any port = 137 to any group 100 block in quick on net0 proto tcp from any port = 138 \ to any flags S keep state group 100 block in quick on net0 proto udp from any port = 138 to any group 100 block in quick on net0 proto tcp from any port = 139 to any flags S keep state group 100 block in quick on net0 proto udp from any port = 139 to any group 100
Exemple 5-22 Configuration d'un routeur IP Filter
Cet exemple présente la configuration d'un routeur possédant une interface interne, net0, et une interface externe, net1.
# internal interface is net0 at 192.168.1.1 # external interface is net1 IP obtained via DHCP # block all packets and allow specific services *** NAT *** *** POOLS *** # Short packets which are fragmented too short to be real. block in log quick all with short # By default, block and log everything. block in log on net0 all block in log on net1 all block out log on net0 all block out log on net1 all # Packets going in/out of network interfaces that aren't on the loopback # interface should not exist. block in log quick on net0 from 127.0.0.0/8 to any block in log quick on net0 from any to 127.0.0.0/8 block in log quick on net1 from 127.0.0.0/8 to any block in log quick on net1 from any to 127.0.0.0/8 # Deny reserved addresses. block in quick on net1 from 10.0.0.0/8 to any block in quick on net1 from 172.16.0.0/12 to any block in log quick on net1 from 192.168.1.0/24 to any block in quick on net1 from 192.168.0.0/16 to any # Allow internal traffic pass in quick on net0 from 192.168.1.0/24 to 192.168.1.0/24 pass out quick on net0 from 192.168.1.0/24 to 192.168.1.0/24 # Allow outgoing DNS requests from our servers on .1, .2, and .3 pass out quick on net1 proto tcp/udp from net1/32 to any port = domain keep state pass in quick on net0 proto tcp/udp from 192.168.1.2 to any port = domain keep state pass in quick on net0 proto tcp/udp from 192.168.1.3 to any port = domain keep state # Allow NTP from any internal hosts to any external NTP server. pass in quick on net0 proto udp from 192.168.1.0/24 to any port = 123 keep state pass out quick on net1 proto udp from any to any port = 123 keep state # Allow incoming mail pass in quick on net1 proto tcp from any to net1/32 port = smtp keep state pass in quick on net1 proto tcp from any to net1/32 port = smtp keep state pass out quick on net1 proto tcp from 192.168.1.0/24 to any port = smtp keep state # Allow outgoing connections: SSH, WWW, NNTP, mail, whois pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = 22 keep state pass out quick on net1 proto tcp from 192.168.1.0/24 to any port = 22 keep state pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = 80 keep state pass out quick on net1 proto tcp from 192.168.1.0/24 to any port = 80 keep state pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = 443 keep state pass out quick on net1 proto tcp from 192.168.1.0/24 to any port = 443 keep state pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = nntp keep state block in quick on net1 proto tcp from any to any port = nntp keep state pass out quick on net1 proto tcp from 192.168.1.0/24 to any port = nntp keep state pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = smtp keep state pass in quick on net0 proto tcp from 192.168.1.0/24 to any port = whois keep state pass out quick on net1 proto tcp from any to any port = whois keep state # Allow ssh from offsite pass in quick on net1 proto tcp from any to net1/32 port = 22 keep state # Allow ping out pass in quick on net0 proto icmp all keep state pass out quick on net1 proto icmp all keep state # allow auth out pass out quick on net1 proto tcp from net1/32 to any port = 113 keep state pass out quick on net1 proto tcp from net1/32 port = 113 to any keep state # return rst for incoming auth block return-rst in quick on net1 proto tcp from any to any port = 113 flags S/SA # log and return reset for any TCP packets with S/SA block return-rst in log on net1 proto tcp from any to any flags S/SA # return ICMP error packets for invalid UDP packets block return-icmp(net-unr) in proto udp all