mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-17 14:03:15 +02:00
Also set the FACL recursively on the DEV stack
This commit is contained in:
@@ -54,15 +54,24 @@ chmod 0440 /etc/sudoers.d/fail2ban-ui
|
|||||||
mkdir -p /config/fail2ban/{action.d,filter.d,jail.d}
|
mkdir -p /config/fail2ban/{action.d,filter.d,jail.d}
|
||||||
|
|
||||||
# Apply both access ACL and default ACL (so new files/dirs inherit)
|
# Apply both access ACL and default ACL (so new files/dirs inherit)
|
||||||
|
# First apply recursively to existing files/directories, then set default ACLs
|
||||||
for d in /config/fail2ban /config/fail2ban/action.d /config/fail2ban/filter.d /config/fail2ban/jail.d; do
|
for d in /config/fail2ban /config/fail2ban/action.d /config/fail2ban/filter.d /config/fail2ban/jail.d; do
|
||||||
setfacl -m u:testuser:rwX,m::rwX "$d"
|
# Apply access ACL recursively to existing files/directories
|
||||||
|
setfacl -R -m u:testuser:rwX,m::rwX "$d"
|
||||||
|
# Set default ACL so new files/dirs inherit permissions
|
||||||
setfacl -d -m u:testuser:rwX,m::rwX "$d"
|
setfacl -d -m u:testuser:rwX,m::rwX "$d"
|
||||||
|
# Also ensure the directory itself has the access ACL
|
||||||
|
setfacl -m u:testuser:rwX,m::rwX "$d"
|
||||||
done
|
done
|
||||||
|
|
||||||
# /etc/fail2ban is a symlink to /config/fail2ban in this image; setfacl follows symlinks by default.
|
# /etc/fail2ban is a symlink to /config/fail2ban in this image; setfacl follows symlinks by default.
|
||||||
if [ -e /etc/fail2ban ]; then
|
if [ -e /etc/fail2ban ]; then
|
||||||
setfacl -m u:testuser:rwX,m::rwX /etc/fail2ban || true
|
# Apply recursively to existing files/directories
|
||||||
|
setfacl -R -m u:testuser:rwX,m::rwX /etc/fail2ban || true
|
||||||
|
# Set default ACL
|
||||||
setfacl -d -m u:testuser:rwX,m::rwX /etc/fail2ban || true
|
setfacl -d -m u:testuser:rwX,m::rwX /etc/fail2ban || true
|
||||||
|
# Ensure the symlink target has access ACL
|
||||||
|
setfacl -m u:testuser:rwX,m::rwX /etc/fail2ban || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[custom-init] ssh + acl setup complete"
|
echo "[custom-init] ssh + acl setup complete"
|
||||||
|
|||||||
Reference in New Issue
Block a user