You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not able to fully check his suggestions and more, I think a lot of his suggestions should be addressed at this repository :)
I quote friendica/docker#165 (comment) so we can discuss it here:
Basically as I use docker.io/library/friendica:latest the first thing I do after podman-exec into it is:
The things we learn here is that it is using apache and apache does chown() to www-data as soon as it has claimed port 80. We need that Information later.
drwxrwxrwx 2 www-data www-data 6 Sep 3 16:26 /run/lock/apache2
This one should be at least chmod 755 ; chown www-data.root however in my opinion chmod 700 ; chown www-data.www-data will work fine as well.
drwxrwxrwx 1 www-data www-data 25 Sep 10 16:09 /run/apache2
run apache containd the pid of the running apache process which is written when apache is still root, so chown root.root ; chmod 755 is what debian sets on this one.
drwxrwxrwx 2 www-data www-data 72 Sep 3 16:26 /var/log/apache2
This should be chown root:adm ; chmod 750 apache2 will open those logs when it is still root. This makes it impossible for processes running as www-data to modify apache logs, making it harder for attackers to hide their footprints.
drwxrwxrwx 1 www-data www-data 430 Sep 10 16:09 /var/www/html
This should be chown root:root chmod 755 as with all the files in there chmod 644 readable for the www-data user but not writeable.
[...]
So far all my findings I hope it helps.
The text was updated successfully, but these errors were encountered:
Every time we've added a chmod 777 to a directory was to support running as an arbitrary user/group #743, #745, #754, #755, #787. I.E. so that docker run --user [any-id]:[any-group] php:... just works. This assumes that they have --sysctl net.ipv4.ip_unprivileged_port_start=0 or a new enough docker when using a "privileged" port like 80.
For example, the wordpress image also uses these php images and so can start as an arbitrary user, but that user needs access to write the initial WordPress files into /var/www/html (which is a volume to support WordPress managing itself after the first start).
I'm using this image as a base for the Friendica images (see https://github.com/friendica/docker)
Recently @zem opened this issue: friendica/docker#165
I'm not able to fully check his suggestions and more, I think a lot of his suggestions should be addressed at this repository :)
I quote friendica/docker#165 (comment) so we can discuss it here:
The text was updated successfully, but these errors were encountered: