Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 832 2012-03-04 21:17:43Z richard $
|
2 |
# $Id: alcasar.sh 835 2012-03-11 22:21:27Z 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 997... |
Line 997... |
997 |
echo "request_timeout 5 minutes" >> /etc/squid/squid.conf
|
997 |
echo "request_timeout 5 minutes" >> /etc/squid/squid.conf
|
998 |
echo "persistent_request_timeout 2 minutes" >> /etc/squid/squid.conf
|
998 |
echo "persistent_request_timeout 2 minutes" >> /etc/squid/squid.conf
|
999 |
echo "cache_mem 256 MB" >> /etc/squid/squid.conf
|
999 |
echo "cache_mem 256 MB" >> /etc/squid/squid.conf
|
1000 |
echo "maximum_object_size_in_memory 4096 KB" >> /etc/squid/squid.conf
|
1000 |
echo "maximum_object_size_in_memory 4096 KB" >> /etc/squid/squid.conf
|
1001 |
echo "maximum_object_size 4096 KB" >> /etc/squid/squid.conf
|
1001 |
echo "maximum_object_size 4096 KB" >> /etc/squid/squid.conf
|
1002 |
# anonymisation de la version de squid
|
1002 |
# anonymisation of squid version
|
1003 |
echo "via off" >> /etc/squid/squid.conf
|
1003 |
echo "via off" >> /etc/squid/squid.conf
|
1004 |
# suppression de la primitive http 'X_forwarded'
|
1004 |
# remove the 'X_forwarded' http option
|
1005 |
echo "forwarded_for delete" >> /etc/squid/squid.conf
|
1005 |
echo "forwarded_for delete" >> /etc/squid/squid.conf
|
- |
|
1006 |
# linked squid output in HAVP input
|
- |
|
1007 |
echo "cache_peer 127.0.0.1 parent 8090 0 no-query default" >> /etc/squid/squid.conf
|
- |
|
1008 |
echo "never_direct allow all" >> /etc/squid/squid.conf
|
1006 |
# pour éviter les message d'erreur lors des changement d'état des interfaces réseaux
|
1009 |
# avoid error messages on network interfaces state changes
|
1007 |
$SED "s?^SQUID_AUTO_RELOAD.*?SQUID_AUTO_RELOAD=no?g" /etc/sysconfig/squid
|
1010 |
$SED "s?^SQUID_AUTO_RELOAD.*?SQUID_AUTO_RELOAD=no?g" /etc/sysconfig/squid
|
1008 |
# Initialisation du cache de Squid
|
1011 |
# Squid cache init
|
1009 |
/usr/sbin/squid -z
|
1012 |
/usr/sbin/squid -z
|
1010 |
} # End of param_squid ()
|
1013 |
} # End of param_squid ()
|
1011 |
|
1014 |
|
1012 |
##################################################################
|
1015 |
##################################################################
|
1013 |
## Fonction param_dansguardian ##
|
1016 |
## Fonction param_dansguardian ##
|
Line 1022... |
Line 1025... |
1022 |
$SED "s/^reportinglevel =.*/reportinglevel = -1/g" $DIR_DG/dansguardian.conf
|
1025 |
$SED "s/^reportinglevel =.*/reportinglevel = -1/g" $DIR_DG/dansguardian.conf
|
1023 |
# la page d'interception est en français
|
1026 |
# la page d'interception est en français
|
1024 |
$SED "s?^language =.*?language = french?g" $DIR_DG/dansguardian.conf
|
1027 |
$SED "s?^language =.*?language = french?g" $DIR_DG/dansguardian.conf
|
1025 |
# on limite l'écoute de Dansguardian côté LAN
|
1028 |
# on limite l'écoute de Dansguardian côté LAN
|
1026 |
$SED "s?^filterip.*?filterip = $PRIVATE_IP?g" $DIR_DG/dansguardian.conf
|
1029 |
$SED "s?^filterip.*?filterip = $PRIVATE_IP?g" $DIR_DG/dansguardian.conf
|
1027 |
# on chaîne Dansguardian au proxy antivirus HAVP
|
1030 |
# on chaîne Dansguardian au proxy cache SQUID
|
1028 |
$SED "s?^proxyport.*?proxyport = 8090?g" $DIR_DG/dansguardian.conf
|
1031 |
$SED "s?^proxyport.*?proxyport = 3128?g" $DIR_DG/dansguardian.conf
|
1029 |
# on remplace la page d'interception (template)
|
1032 |
# on remplace la page d'interception (template)
|
1030 |
cp -f $DIR_CONF/template.html /usr/share/dansguardian/languages/ukenglish/
|
1033 |
cp -f $DIR_CONF/template.html /usr/share/dansguardian/languages/ukenglish/
|
1031 |
cp -f $DIR_CONF/template-fr.html /usr/share/dansguardian/languages/french/template.html
|
1034 |
cp -f $DIR_CONF/template-fr.html /usr/share/dansguardian/languages/french/template.html
|
1032 |
# on ne loggue que les deny (pour le reste, on a squid)
|
1035 |
# on ne loggue que les deny (pour le reste, on a squid)
|
1033 |
$SED "s?^loglevel =.*?loglevel = 1?g" $DIR_DG/dansguardian.conf
|
1036 |
$SED "s?^loglevel =.*?loglevel = 1?g" $DIR_DG/dansguardian.conf
|
Line 1075... |
Line 1078... |
1075 |
chown -R havp /var/tmp/havp /var/log/havp /var/run/havp
|
1078 |
chown -R havp /var/tmp/havp /var/log/havp /var/run/havp
|
1076 |
$SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp
|
1079 |
$SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp
|
1077 |
# configuration d'HAVP
|
1080 |
# configuration d'HAVP
|
1078 |
[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
|
1081 |
[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
|
1079 |
$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
|
1082 |
$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
|
1080 |
$SED "s?^# PARENTPROXY.*?PARENTPROXY 127.0.0.1?g" /etc/havp/havp.config # datas come from DG
|
- |
|
1081 |
$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config # datas are send to squid (3128)
|
- |
|
1082 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config # datas come on 8090
|
1083 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config # datas come on 8090
|
1083 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config # we listen only on loopback
|
1084 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config # we listen only on loopback
|
1084 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config # active libclamav AV
|
1085 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config # active libclamav AV
|
1085 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config # log only when malware matches
|
1086 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config # log only when malware matches
|
1086 |
$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 10?g" /etc/havp/havp.config # 10 daemons are started simultaneously
|
1087 |
$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 10?g" /etc/havp/havp.config # 10 daemons are started simultaneously
|
- |
|
1088 |
$SED "s?^# SCANIMAGES.*?SCANIMAGES false?g" /etc/havp/havp.config # doesn't scan image files
|
- |
|
1089 |
$SED "s?^# SKIPMIME.*?SKIPMIME image\/\* video\/\* audio\/\*?g" /etc/havp/havp.config # doesn't scan some multimedia files
|
1087 |
# remplacement du fichier d'initialisation
|
1090 |
# remplacement du fichier d'initialisation
|
1088 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
1091 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
1089 |
cp -f $DIR_CONF/havp-init /etc/init.d/havp
|
1092 |
cp -f $DIR_CONF/havp-init /etc/init.d/havp
|
1090 |
# on remplace la page d'interception (template)
|
1093 |
# on remplace la page d'interception (template)
|
1091 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|
1094 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|