50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -f /usr/local/src/SharedLibraries/Bash/header ]; then
|
|
echo This script requires the SharedLibraries package.
|
|
exit 1;
|
|
fi
|
|
source /usr/local/src/SharedLibraries/Bash/header
|
|
export logfile="/var/log/silent-guardian.log"
|
|
|
|
|
|
logstatement "Started $(date)"
|
|
|
|
# Fix the Webserver permissions
|
|
chown -R cxford:http /srv/http/*
|
|
find /srv/http/* -type f -exec chmod 0640 {} \;
|
|
find /srv/http/* -type d -exec chmod 0750 {} \;
|
|
|
|
# Fix the media permissions
|
|
chown -R cxford:http /srv/yggdrasil
|
|
find /srv/yggdrasil/ -type f -exec chmod 0440 {} \;
|
|
find /srv/yggdrasil/ -type d -exec chmod 0550 {} \;
|
|
chmod -R u+w /srv/yggdrasil/new_acquisition
|
|
|
|
# fix the WolfPack results location
|
|
find /srv/WolfPackResults -type d -exec chmod 0755 {} \;
|
|
find /srv/WolfPackResults -type f -exec chmod 0644 {} \;
|
|
|
|
# Seal the special directories.
|
|
for i in $(ls -a /srv/yggdrasil/Digital_Library/ | egrep '^\.[a-zA-Z0-9]+$'); do
|
|
chown cxford:cxford -R $i;
|
|
find $i -type f -exec chmod 0400 {} \;
|
|
find $i -type d -exec chmod 0500 {} \;
|
|
done
|
|
|
|
# Guard root
|
|
chmod 0700 /root
|
|
chown -R root:root /root
|
|
find /root -type d -exec chmod 0700 {} \;
|
|
|
|
# Guard home directories
|
|
chmod 0750 /home/*
|
|
chmod 0700 /home/.root-only/
|
|
|
|
# Guard API's
|
|
chmod 0750 /usr/local/bin/api-keys
|
|
chown root:api /usr/local/bin/api-keys
|
|
|
|
logstatement "Ended $(date)"
|
|
logstatement " "
|