Subversion Repositories ALCASAR

Rev

Rev 2767 | Rev 2769 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2767 Rev 2768
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2767 2019-11-22 16:33:55Z rexy $
2
#  $Id: alcasar.sh 2768 2019-11-24 15:19:27Z rexy $
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
5
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
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
#  team@alcasar.net
7
#  team@alcasar.net
Line 1377... Line 1377...
1377
	$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config		# active libclamav AV
1377
	$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config		# active libclamav AV
1378
	$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config			# log only when malware matches
1378
	$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config			# log only when malware matches
1379
	$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 10?g" /etc/havp/havp.config		# 10 daemons are started simultaneously
1379
	$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 10?g" /etc/havp/havp.config		# 10 daemons are started simultaneously
1380
	$SED "s?^# SCANIMAGES.*?SCANIMAGES false?g" /etc/havp/havp.config		# doesn't scan image files
1380
	$SED "s?^# SCANIMAGES.*?SCANIMAGES false?g" /etc/havp/havp.config		# doesn't scan image files
1381
	$SED "s?^# SKIPMIME.*?SKIPMIME image\/\* video\/\* audio\/\*?g" /etc/havp/havp.config # doesn't scan some multimedia files
1381
	$SED "s?^# SKIPMIME.*?SKIPMIME image\/\* video\/\* audio\/\*?g" /etc/havp/havp.config # doesn't scan some multimedia files
-
 
1382
	$SED "s?^# SCANTEMPFILE.*?SCANTEMPFILE /var/tmp/havp/havp-XXXXXX?g" /etc/havp/havp.config		# Use our special tmp FS (memfs)
1382
# skip checking of youtube flow (too heavy load / risk too low)
1383
# skip checking of youtube flow (too heavy load / risk too low)
1383
	[ -e /etc/havp/whitelist.default ] || cp /etc/havp/whitelist /etc/havp/whitelist.default
1384
	[ -e /etc/havp/whitelist.default ] || cp /etc/havp/whitelist /etc/havp/whitelist.default
1384
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1385
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1385
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1386
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1386
# adapt init script and systemd unit
1387
# adapt init script and systemd unit
1387
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1388
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1388
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
1389
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
1389
	[ -e /lib/systemd/system/havp.service.default ] || cp /lib/systemd/system/havp.service /lib/systemd/system/havp.service.default
-
 
1390
	$SED "/^PIDFile/i ExecStartPre=/bin/mkdir -p /var/run/havp" /lib/systemd/system/havp.service
1390
    cp -f $DIR_CONF/havp.service /lib/systemd/system/
1391
	$SED "/^PIDFile/i ExecStartPre=/bin/chown -R havp:havp /var/run/havp /var/log/havp" /lib/systemd/system/havp.service
-
 
1392
# replace of the intercept page (template)
1391
	# replace of the intercept page (template)
1393
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1392
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1394
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1393
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1395
# update virus database every 4 hours (24h/6)
1394
# update virus database every 4 hours (24h/6)
1396
	[ -e /etc/freshclam.conf.default ] || cp /etc/freshclam.conf /etc/freshclam.conf.default
1395
	[ -e /etc/freshclam.conf.default ] || cp /etc/freshclam.conf /etc/freshclam.conf.default
1397
	$SED "s?^Checks.*?Checks 6?g" /etc/freshclam.conf
1396
	$SED "s?^Checks.*?Checks 6?g" /etc/freshclam.conf