Rework init order again

This commit is contained in:
TheSpad 2022-07-14 22:19:49 +01:00
parent d7ac0a9a4e
commit 4f51cb2f4f
No known key found for this signature in database
GPG key ID: 08F06191F4587860
31 changed files with 6 additions and 16 deletions

View file

@ -1 +0,0 @@
# This file doesn't do anything, it's just the end of the base image init process

View file

@ -0,0 +1 @@
# This file doesn't do anything, it's just the start of the downstream image init process

View file

@ -0,0 +1 @@
# This file doesn't do anything, it's just the end of the mod init process

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
# This file doesn't do anything, it's just the start of the mod init process

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
# This file doesn't do anything, it's just the end of the mod init process

View file

@ -1,14 +0,0 @@
#!/usr/bin/with-contenv bash
if ([ -d "/config/custom-cont-init.d" ] && [ -n "$(find /config/custom-cont-init.d ! -user root)" ]); then
echo "**** Potential tampering with custom scripts detected ****"
randstr=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-8};echo;)
mv "/config/custom-cont-init.d" "/config/custom-cont-init.d.${randstr}"
echo "**** Folder /config/custom-cont-init.d is moved to /config/custom-cont-init.d.${randstr} ****"
echo "**** The folder '/config/custom-cont-init.d' and its contents need to all be owned by root to prevent root escalation inside the container!!! ****"
mkdir -p /config/custom-cont-init.d
chown 0:0 /config/custom-cont-init.d
elif ([ -d "/config/custom-cont-init.d" ] && [ -n "$(find /config/custom-cont-init.d -perm -o+w)" ]); then
echo "**** The folder '/config/custom-cont-init.d' or some of its contents have write permissions for others, which is a security risk. ****"
echo "**** Please review the permissions of this folder and its contents to make sure they are owned by root, and can only be modified by root. ****"
fi

View file

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-tamper-check/run