Setting permissions for SSL files

This commit is contained in:
m8in committed 2026-09-08 00:18:42 +02:00
1 parent c1d78ed599
commit 199f474e49
2 files changed
+22 -4

No files matched your search

+18
View File
@@ -115,6 +115,22 @@ function getRemoteRepositoryPath() {
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(){
local _REPOSITORY
_REPOSITORY="$(getRemoteRepositoryPath)cis-definition-${CIS[DOMAIN]}.git"
@@ -147,6 +163,8 @@ function addState() {
&& echo "Running setup as 'root' trying to add state repository:" \
&& "${CIS[COREROOT]:?"Missing CORE_SCRIPTS"}addAndCheckGitRepository.sh" "${CIS[DOMAINSTATES]}" writable "${_REPOSITORY}" \
&& echo " - states are usable for this host." \
&& setSSLPermissions \
&& echo " - permissions for SSL are set." \
&& return 0
[ "$(id -u)" != "0" ] \