Skip to content

Commit 6eca748

Browse files
author
Serghey Rodin
committed
apparmor rules for bind9
1 parent 7d08a3a commit 6eca748

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

install/vst-install-debian.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,6 @@ rm -f /usr/sbin/policy-rc.d
606606
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
607607
service ssh restart
608608

609-
# AppArmor
610-
#aa-complain /usr/sbin/named
611-
612609
# Disable awstats cron
613610
rm -f /etc/cron.d/awstats
614611

@@ -965,6 +962,12 @@ if [ "$named" = 'yes' ]; then
965962
sed -i "s%listen-on%//listen%" /etc/bind/named.conf.options
966963
chown root:bind /etc/bind/named.conf
967964
chmod 640 /etc/bind/named.conf
965+
aa-complain /usr/sbin/named 2>/dev/null
966+
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2>/dev/null
967+
service apparmor status >/dev/null 2>&1
968+
if [ $? -ne 0 ]; then
969+
service apparmor restart
970+
fi
968971
update-rc.d bind9 defaults
969972
service bind9 start
970973
check_result $? "bind9 start failed"

install/vst-install-ubuntu.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,6 @@ rm -f /usr/sbin/policy-rc.d
595595
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
596596
service ssh restart
597597

598-
# AppArmor
599-
#aa-complain /usr/sbin/named
600-
601598
# Disable awstats cron
602599
rm -f /etc/cron.d/awstats
603600

@@ -627,8 +624,6 @@ chmod 755 /usr/bin/rssh
627624
# Configure VESTA #
628625
#----------------------------------------------------------#
629626

630-
# AppArmor
631-
aa-complain /usr/sbin/named 2>/dev/null
632627

633628
# Downlading sudo configuration
634629
mkdir -p /etc/sudoers.d
@@ -957,6 +952,12 @@ if [ "$named" = 'yes' ]; then
957952
sed -i "s%listen-on%//listen%" /etc/bind/named.conf.options
958953
chown root:bind /etc/bind/named.conf
959954
chmod 640 /etc/bind/named.conf
955+
aa-complain /usr/sbin/named 2>/dev/null
956+
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2>/dev/null
957+
service apparmor status >/dev/null 2>&1
958+
if [ $? -ne 0 ]; then
959+
service apparmor restart
960+
fi
960961
update-rc.d bind9 defaults
961962
service bind9 start
962963
check_result $? "bind9 start failed"

0 commit comments

Comments
 (0)