Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 310 2010-11-05 17:01:52Z richard $
|
2 |
# $Id: alcasar.sh 311 2010-11-07 22:31:52Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 923... |
Line 923... |
923 |
touch /etc/dansguardian/lists/bannedextensionlist
|
923 |
touch /etc/dansguardian/lists/bannedextensionlist
|
924 |
touch /etc/dansguardian/lists/bannedmimetypelist
|
924 |
touch /etc/dansguardian/lists/bannedmimetypelist
|
925 |
# on vide la liste des @IP du Lan ne subissant pas le filtrage WEB
|
925 |
# on vide la liste des @IP du Lan ne subissant pas le filtrage WEB
|
926 |
[ -e /etc/dansguardian/lists/exceptioniplist.default ] || mv /etc/dansguardian/lists/exceptioniplist /etc/dansguardian/lists/exceptioniplist.default
|
926 |
[ -e /etc/dansguardian/lists/exceptioniplist.default ] || mv /etc/dansguardian/lists/exceptioniplist /etc/dansguardian/lists/exceptioniplist.default
|
927 |
touch /etc/dansguardian/lists/exceptioniplist
|
927 |
touch /etc/dansguardian/lists/exceptioniplist
|
928 |
# on configure le filtrage de domaine
|
928 |
# on garde une copie des fichiers de configuration du filtrage d'URL et de domaine
|
929 |
[ -e /etc/dansguardian/lists/bannedsitelist.default ] || cp /etc/dansguardian/lists/bannedsitelist /etc/dansguardian/lists/bannedsitelist.default
|
929 |
[ -e /etc/dansguardian/lists/bannedsitelist.default ] || mv /etc/dansguardian/lists/bannedsitelist /etc/dansguardian/lists/bannedsitelist.default
|
930 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedsitelist # (on commente ce qui ne l'est pas)
|
- |
|
931 |
# on bloque les sites ne possédant pas de nom de domaine (ex: http://12.13.14.15)
|
- |
|
932 |
$SED "s?^#\*ip?\*ip?g" /etc/dansguardian/lists/bannedsitelist
|
- |
|
933 |
# on bloque le ssl sur port 80
|
- |
|
934 |
$SED "s?^#\*\*s?\*\*s?g" /etc/dansguardian/lists/bannedsitelist
|
- |
|
935 |
# on configure le filtrage d'url
|
- |
|
936 |
[ -e /etc/dansguardian/lists/bannedurllist.default ] || cp /etc/dansguardian/lists/bannedurllist /etc/dansguardian/lists/bannedurllist.default
|
930 |
[ -e /etc/dansguardian/lists/bannedurllist.default ] || mv /etc/dansguardian/lists/bannedurllist /etc/dansguardian/lists/bannedurllist.default
|
937 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedurllist # (on commente ce qui ne l'est pas)
|
- |
|
938 |
chown -R dansguardian:apache /etc/dansguardian/
|
- |
|
939 |
chmod -R g+rw /etc/dansguardian
|
- |
|
940 |
} # End of param_dansguardian ()
|
931 |
} # End of param_dansguardian ()
|
941 |
|
932 |
|
942 |
##################################################################
|
933 |
##################################################################
|
943 |
## Fonction antivirus ##
|
934 |
## Fonction antivirus ##
|
944 |
## - configuration havp + clamav ##
|
935 |
## - configuration havp + clamav ##
|
Line 1092... |
Line 1083... |
1092 |
touch /etc/dansguardian/lists/blacklists/ossi/urls
|
1083 |
touch /etc/dansguardian/lists/blacklists/ossi/urls
|
1093 |
# On crée les fichiers vides de sites ou d'URL réhabilités
|
1084 |
# On crée les fichiers vides de sites ou d'URL réhabilités
|
1094 |
[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist /etc/dansguardian/lists/exceptionsitelist.default
|
1085 |
[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist /etc/dansguardian/lists/exceptionsitelist.default
|
1095 |
[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist /etc/dansguardian/lists/exceptionurllist.default
|
1086 |
[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist /etc/dansguardian/lists/exceptionurllist.default
|
1096 |
touch /etc/dansguardian/lists/exceptionsitelist
|
1087 |
touch /etc/dansguardian/lists/exceptionsitelist
|
- |
|
1088 |
# On crée la configuration de base du filtrage de domaine et d'URL pour Dansguardian
|
1097 |
touch /etc/dansguardian/lists/exceptionurllist
|
1089 |
cat <<EOF > /etc/dansguardian/lists/bannedurllist
|
- |
|
1090 |
# Dansguardian filter config for ALCASAR
|
- |
|
1091 |
EOF
|
- |
|
1092 |
cat <<EOF > /etc/dansguardian/lists/bannedsitelist
|
- |
|
1093 |
# Dansguardian domain filter config for ALCASAR
|
- |
|
1094 |
# block all sites except those in the exceptionsitelist --> liste blanche (désactivée)
|
- |
|
1095 |
#**
|
- |
|
1096 |
# block all SSL and CONNECT tunnels
|
- |
|
1097 |
**s
|
- |
|
1098 |
# block all SSL and CONNECT tunnels specified only as an IP
|
- |
|
1099 |
*ips
|
- |
|
1100 |
# block all sites specified only by an IP
|
- |
|
1101 |
*ip
|
- |
|
1102 |
EOF
|
- |
|
1103 |
chown -R dansguardian:apache /etc/dansguardian/
|
- |
|
1104 |
chmod -R g+rw /etc/dansguardian
|
1098 |
# On crée la structure du DNS-blackhole :
|
1105 |
# On crée la structure du DNS-blackhole :
|
1099 |
mkdir /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1106 |
mkdir /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1100 |
chown -R 770 /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1107 |
chown -R 770 /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1101 |
chown -R root:apache /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1108 |
chown -R root:apache /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1102 |
# On fait pointer le black-hole sur une page interne
|
1109 |
# On fait pointer le black-hole sur une page interne
|