Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 3242 2024-12-24 16:17:47Z rexy $
|
2 |
# $Id: alcasar.sh 3243 2025-01-19 17:33:09Z rexy $
|
3 |
|
3 |
|
4 |
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
4 |
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
5 |
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, apache, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
|
5 |
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, apache, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
|
6 |
# contact : info@alcasar.net
|
6 |
# contact : info@alcasar.net
|
7 |
|
7 |
|
Line 1447... |
Line 1447... |
1447 |
$SED "s?^#groupname =.*?groupname = 'blacklisted_users'?g" $DIR_E2G/e2guardianf1.conf
|
1447 |
$SED "s?^#groupname =.*?groupname = 'blacklisted_users'?g" $DIR_E2G/e2guardianf1.conf
|
1448 |
$SED "s?^#htmltemplate =.*?htmltemplate = 'alcasar-e2g.html'?g" $DIR_E2G/e2guardianf1.conf
|
1448 |
$SED "s?^#htmltemplate =.*?htmltemplate = 'alcasar-e2g.html'?g" $DIR_E2G/e2guardianf1.conf
|
1449 |
$SED "s?^\.Define LISTDIR.*?\.Define LISTDIR <$DIR_E2G/lists/group1>?g" $DIR_E2G/e2guardianf1.conf
|
1449 |
$SED "s?^\.Define LISTDIR.*?\.Define LISTDIR <$DIR_E2G/lists/group1>?g" $DIR_E2G/e2guardianf1.conf
|
1450 |
DIR_E2G_GROUP1="$DIR_E2G/lists/group1"
|
1450 |
DIR_E2G_GROUP1="$DIR_E2G/lists/group1"
|
1451 |
cp -r $DIR_E2G/lists/example.group $DIR_E2G_GROUP1
|
1451 |
cp -r $DIR_E2G/lists/example.group $DIR_E2G_GROUP1
|
1452 |
chown -R e2guardian:root $DIR_E2G_GROUP1
|
- |
|
- |
|
1452 |
|
1453 |
# RAZ bannedphraselist
|
1453 |
# RAZ bannedphraselist
|
1454 |
$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedphraselist # (comment what is not)
|
1454 |
$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedphraselist # (comment what is not)
|
1455 |
# Disable URL control with regex
|
1455 |
# Disable URL control with regex
|
1456 |
$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedregexpurllist # (comment what is not)
|
1456 |
$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedregexpurllist # (comment what is not)
|
1457 |
# Dont filtering files by extension or mime-type (empty list)
|
1457 |
# Dont filtering files by extension or mime-type (empty list)
|
Line 1473... |
Line 1473... |
1473 |
# E2guardian URL filter config for ALCASAR
|
1473 |
# E2guardian URL filter config for ALCASAR
|
1474 |
EOF
|
1474 |
EOF
|
1475 |
# Creation of files for rehabilited domains
|
1475 |
# Creation of files for rehabilited domains
|
1476 |
> $DIR_E2G_GROUP1/exceptionsitelist
|
1476 |
> $DIR_E2G_GROUP1/exceptionsitelist
|
1477 |
# Creation of files for rehabilited IP
|
1477 |
# Creation of files for rehabilited IP
|
1478 |
[ -e $DIR_E2G/lists/common/exceptioniplist.default ] || mv $DIR_E2G/lists/common/exceptioniplist $DIR_E2G/lists/common/exceptioniplist.default
|
1478 |
[ -e $DIR_E2G_GROUP1/exceptionsiteiplist.default ] || mv $DIR_E2G_GROUP1/exceptionsiteiplist $DIR_E2G_GROUP1/exceptionsiteiplist.default
|
1479 |
touch $DIR_E2G/lists/common/exceptioniplist
|
1479 |
> $DIR_E2G_GROUP1/exceptionsiteiplist
|
1480 |
# Add Bing to the safesearch url regext list (parental control)
|
1480 |
# Add Bing to the safesearch url regext list (parental control)
|
1481 |
cat <<EOF >> $DIR_E2G_GROUP1/urlregexplist
|
1481 |
cat <<EOF >> $DIR_E2G_GROUP1/urlregexplist
|
1482 |
# Bing - add 'adlt=strict'
|
1482 |
# Bing - add 'adlt=strict'
|
1483 |
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
|
1483 |
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
|
1484 |
EOF
|
1484 |
EOF
|
1485 |
# 'Safesearch' regex actualisation
|
1485 |
# 'Safesearch' regex actualisation
|
1486 |
$SED "s?images?search?g" $DIR_E2G_GROUP1/urlregexplist
|
1486 |
$SED "s?images?search?g" $DIR_E2G_GROUP1/urlregexplist
|
1487 |
# change the google safesearch ("safe=strict" instead of "safe=vss")
|
1487 |
# change the google safesearch ("safe=strict" instead of "safe=vss")
|
1488 |
$SED "s?safe=vss?safe=strict?g" $DIR_E2G_GROUP1/urlregexplist
|
1488 |
$SED "s?safe=vss?safe=strict?g" $DIR_E2G_GROUP1/urlregexplist
|
1489 |
|
- |
|
- |
|
1489 |
chown -R e2guardian:root $DIR_E2G_GROUP1
|
- |
|
1490 |
chmod -R 660 $DIR_E2G_GROUP1
|
1490 |
###### ALCASAR filtering for group2 (previously av_users) ####
|
1491 |
###### ALCASAR filtering for group2 (previously av_users) ####
|
1491 |
# Create & adapt group2 conf file (av + av_wl)
|
1492 |
# Create & adapt group2 conf file (av + av_wl)
|
1492 |
cp $DIR_E2G/e2guardianf1.conf.default $DIR_E2G/e2guardianf2.conf
|
1493 |
cp $DIR_E2G/e2guardianf1.conf.default $DIR_E2G/e2guardianf2.conf
|
1493 |
$SED "s?^#reportinglevel =.*?reportinglevel = 3?g" $DIR_E2G/e2guardianf2.conf
|
1494 |
$SED "s?^#reportinglevel =.*?reportinglevel = 3?g" $DIR_E2G/e2guardianf2.conf
|
1494 |
$SED "s?^#groupname =.*?groupname = 'antimalware + whitelested users'?g" $DIR_E2G/e2guardianf2.conf
|
1495 |
$SED "s?^#groupname =.*?groupname = 'antimalware + whitelested users'?g" $DIR_E2G/e2guardianf2.conf
|
1495 |
|
1496 |
|