mirror of
https://github.com/m8tin/cis.git
synced 2026-11-02 14:17:24 +01:00
Setting permissions for SSL files
This commit is contained in:
2 files changed
+22
-4
No files matched your search
@@ -115,6 +115,22 @@ function getRemoteRepositoryPath() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setSSLPermissions(){
|
||||||
|
local _SSLPATHS
|
||||||
|
_SSLPATHS="${CIS[DOMAINSTATES]}hosts/*/etc/ssl/domains/"
|
||||||
|
readonly _SSLPATHS
|
||||||
|
|
||||||
|
addgroup --gid 775 ssl 2> /dev/null
|
||||||
|
for _path in ${_SSLPATHS}; do
|
||||||
|
[ -d "${_path}" ] || continue
|
||||||
|
chown -R root:ssl "${_path}"
|
||||||
|
chmod -R o-rwx "${_path}"
|
||||||
|
find "${_path}" -type d -exec chmod g+s {} +
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
function addDefinition(){
|
function addDefinition(){
|
||||||
local _REPOSITORY
|
local _REPOSITORY
|
||||||
_REPOSITORY="$(getRemoteRepositoryPath)cis-definition-${CIS[DOMAIN]}.git"
|
_REPOSITORY="$(getRemoteRepositoryPath)cis-definition-${CIS[DOMAIN]}.git"
|
||||||
@@ -147,6 +163,8 @@ function addState() {
|
|||||||
&& echo "Running setup as 'root' trying to add state repository:" \
|
&& echo "Running setup as 'root' trying to add state repository:" \
|
||||||
&& "${CIS[COREROOT]:?"Missing CORE_SCRIPTS"}addAndCheckGitRepository.sh" "${CIS[DOMAINSTATES]}" writable "${_REPOSITORY}" \
|
&& "${CIS[COREROOT]:?"Missing CORE_SCRIPTS"}addAndCheckGitRepository.sh" "${CIS[DOMAINSTATES]}" writable "${_REPOSITORY}" \
|
||||||
&& echo " - states are usable for this host." \
|
&& echo " - states are usable for this host." \
|
||||||
|
&& setSSLPermissions \
|
||||||
|
&& echo " - permissions for SSL are set." \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
[ "$(id -u)" != "0" ] \
|
[ "$(id -u)" != "0" ] \
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ function update_repositories() {
|
|||||||
[ "${_MODE}" == "--repair" ] \
|
[ "${_MODE}" == "--repair" ] \
|
||||||
&& (git -C "${CIS[ROOT]:?"Missing CISROOT"}" reset --hard origin/main; \
|
&& (git -C "${CIS[ROOT]:?"Missing CISROOT"}" reset --hard origin/main; \
|
||||||
git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" reset --hard origin/main; \
|
git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" reset --hard origin/main; \
|
||||||
git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" reset --hard origin/main; \
|
umask 0027; git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" reset --hard origin/main; \
|
||||||
echo "Run repairs") \
|
echo "Run repairs") \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
[ "${_MODE}" == "--test" ] \
|
[ "${_MODE}" == "--test" ] \
|
||||||
&& git -C "${CIS[ROOT]:?"Missing CISROOT"}" pull \
|
&& git -C "${CIS[ROOT]:?"Missing CISROOT"}" pull \
|
||||||
&& git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" pull \
|
&& git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" pull \
|
||||||
&& git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull \
|
&& (umask 0027; git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull) \
|
||||||
&& echo "Run in testMode successfully." \
|
&& echo "Run in testMode successfully." \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ function update_repositories() {
|
|||||||
|
|
||||||
[ "${_MODE}" == "--states" ] \
|
[ "${_MODE}" == "--states" ] \
|
||||||
&& printf -- "Host ${HOSTNAME} updating states: ${CIS[DOMAINSTATES]:?"Missing STATES"} ... " \
|
&& printf -- "Host ${HOSTNAME} updating states: ${CIS[DOMAINSTATES]:?"Missing STATES"} ... " \
|
||||||
&& (git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull &> /dev/null) \
|
&& (umask 0027; git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull &> /dev/null) \
|
||||||
&& echo "(done)" \
|
&& echo "(done)" \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ function update_repositories() {
|
|||||||
&& printf -- "Host ${HOSTNAME} updating core including scripts, definitions and states ... " \
|
&& printf -- "Host ${HOSTNAME} updating core including scripts, definitions and states ... " \
|
||||||
&& (git -C "${CIS[ROOT]:?"Missing CISROOT"}" pull &> /dev/null) \
|
&& (git -C "${CIS[ROOT]:?"Missing CISROOT"}" pull &> /dev/null) \
|
||||||
&& (git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" pull &> /dev/null) \
|
&& (git -C "${CIS[DOMAINDEFINITIONS]:?"Missing DEFINITIONS"}" pull &> /dev/null) \
|
||||||
&& (git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull &> /dev/null) \
|
&& (umask 0027; git -C "${CIS[DOMAINSTATES]:?"Missing STATES"}" pull &> /dev/null) \
|
||||||
&& echo "(done)" \
|
&& echo "(done)" \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user