| Line 1... | 
            Line 1... | 
          
          
            | 1 | 
            #!/bin/bash
  | 
            1 | 
            #!/bin/bash
  | 
          
          
            | 2 | 
            #  $Id: alcasar.sh 1488 2014-11-16 23:10:57Z richard $ 
  | 
            2 | 
            #  $Id: alcasar.sh 1489 2014-11-17 17:04:04Z richard $ 
  | 
          
          
            | 3 | 
             
  | 
            3 | 
             
  | 
          
          
            | 4 | 
            # alcasar.sh
  | 
            4 | 
            # alcasar.sh
  | 
          
          
            | 5 | 
             
  | 
            5 | 
             
  | 
          
          
            | 6 | 
            # ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
  | 
            6 | 
            # ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
  | 
          
          
            | 7 | 
            # Ce programme est un logiciel libre ; This software is free and open source
  | 
            7 | 
            # Ce programme est un logiciel libre ; This software is free and open source
  | 
          
          
            | Line 590... | 
            Line 590... | 
          
          
            | 590 | 
            	$SED "s?\$DB_RADIUS = .*?\$DB_RADIUS = \"$DB_RADIUS\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
            590 | 
            	$SED "s?\$DB_RADIUS = .*?\$DB_RADIUS = \"$DB_RADIUS\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
          
          
            | 591 | 
            	$SED "s?\$DB_USER = .*?\$DB_USER = \"$DB_USER\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
            591 | 
            	$SED "s?\$DB_USER = .*?\$DB_USER = \"$DB_USER\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
          
          
            | 592 | 
            	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
            592 | 
            	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
          
          
            | 593 | 
            	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
            593 | 
            	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
  | 
          
          
            | 594 | 
            	chown -R apache:apache $DIR_WEB/*
  | 
            594 | 
            	chown -R apache:apache $DIR_WEB/*
  | 
          
          
            | - | 
               | 
            595 | 
            # create the backup structure :
  | 
          
          
            | - | 
               | 
            596 | 
            # - base = users database
  | 
          
          
            | - | 
               | 
            597 | 
            # - system_backup = alcasar conf file + users database
  | 
          
          
            | - | 
               | 
            598 | 
            # - archive = tarball of "base + http firewall + netflow"
  | 
          
          
            | - | 
               | 
            599 | 
            # - security = watchdog disconnection)
  | 
          
          
            | 595 | 
            	for i in system_backup base logs/firewall logs/httpd logs/security;
  | 
            600 | 
            	for i in system_backup base archive security;
  | 
          
          
            | 596 | 
            	do
  | 
            601 | 
            	do
  | 
          
          
            | 597 | 
            		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
  | 
            602 | 
            		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
  | 
          
          
            | 598 | 
            	done
  | 
            603 | 
            	done
  | 
          
          
            | 599 | 
            	chown -R root:apache $DIR_SAVE
  | 
            604 | 
            	chown -R root:apache $DIR_SAVE
  | 
          
          
            | 600 | 
            # Configuration et sécurisation php
  | 
            605 | 
            # Configuration et sécurisation php
  | 
          
          
            | Line 1650... | 
            Line 1655... | 
          
          
            | 1650 | 
            fail2ban()
  | 
            1655 | 
            fail2ban()
  | 
          
          
            | 1651 | 
            {
  | 
            1656 | 
            {
  | 
          
          
            | 1652 | 
            	$DIR_CONF/fail2ban.sh
  | 
            1657 | 
            	$DIR_CONF/fail2ban.sh
  | 
          
          
            | 1653 | 
            # Autorise la lecture seule 2 des 3 fichiers de log concernés, havp est traité dans le script d'init de havp
  | 
            1658 | 
            # Autorise la lecture seule 2 des 3 fichiers de log concernés, havp est traité dans le script d'init de havp
  | 
          
          
            | 1654 | 
            	[ -e /var/log/fail2ban.log ] || touch /var/log/fail2ban.log
  | 
            1659 | 
            	[ -e /var/log/fail2ban.log ] || touch /var/log/fail2ban.log
  | 
          
          
            | 1655 | 
            	[ -e /var/Save/logs/security/watchdog.log ] || touch /var/Save/logs/security/watchdog.log
  | 
            1660 | 
            	[ -e /var/Save/security/watchdog.log ] || touch /var/Save/security/watchdog.log
  | 
          
          
            | 1656 | 
            	chmod 644 /var/log/fail2ban.log
  | 
            1661 | 
            	chmod 644 /var/log/fail2ban.log
  | 
          
          
            | 1657 | 
            	chmod 644 /var/Save/logs/security/watchdog.log
  | 
            1662 | 
            	chmod 644 /var/Save/security/watchdog.log
  | 
          
          
            | 1658 | 
            	/usr/bin/touch /var/log/auth.log
  | 
            1663 | 
            	/usr/bin/touch /var/log/auth.log
  | 
          
          
            | 1659 | 
            	
  | 
            1664 | 
            	
  | 
          
          
            | 1660 | 
             
  | 
            1665 | 
             
  | 
          
          
            | 1661 | 
            # Edition de l'unité fail2ban
  | 
            1666 | 
            # Edition de l'unité fail2ban
  | 
          
          
            | 1662 | 
            [ -e /usr/lib/systemd/system/fail2ban.service ] && cp /usr/lib/systemd/system/fail2ban.service /usr/lib/systemd/system/fail2ban.service.default
  | 
            1667 | 
            [ -e /usr/lib/systemd/system/fail2ban.service ] && cp /usr/lib/systemd/system/fail2ban.service /usr/lib/systemd/system/fail2ban.service.default
  |