I am trying to grant read permissions to group grafana-cloud
to files under /var/lib/docker/containers
:
0515ccad974eb0e4577c7b35a0c517ab889db95d996e6188e9d0377cfa2265d4
Executing this snippet, it grants permissions to all the files and folders that already exists.
getfacl: Removing leading '/' from absolute path names
user::rwx
group::---
group:grafana-agent:r-x
mask::r-x
other::---
default:user::rwx
default:group::---
default:group:grafana-agent:r-x
default:mask::r-x
default:other::---
If I create a new file or folder inside /var/lib/docker/containers
, the acls are correctly kept:
getfacl: Removing leading '/' from absolute path names
user::rwx
group::---
group:grafana-agent:r-x
mask::r-x
other::---
default:user::rwx
default:group::---
default:group:grafana-agent:r-x
default:mask::r-x
default:other::---
The problem comes when a new container is created, where the acls seems that are not applied as I'm expecting:
70216a6debce117563d2273da01a1219edc9e1357864cde5026076548b7169e8
getfacl: Removing leading '/' from absolute path names
user::rwx
group::---
group:grafana-agent:r-x
mask::---
other::---
default:user::rwx
default:group::---
default:group:grafana-agent:r-x
default:mask::r-x
default:other::---
ls: cannot open directory '/var/lib/docker/containers/70216a6debce117563d2273da01a1219edc9e1357864cde5026076548b7169e8/': Permission denied
If now I run again the setfacl command, the acls are applied to the new container file tree and user can read the files:
70216a6debce117563d2273da01a1219edc9e1357864cde5026076548b7169e8-json.log checkpoints config.v2.json hostconfig.json hostname hosts mounts resolv.conf resolv.conf.hash
getfacl: Removing leading '/' from absolute path names
user::rwx
user:grafana-agent:r-x
group::---
group:grafana-agent:r-x
mask::r-x
other::---
default:user::rwx
default:user:grafana-agent:r-x
default:group::---
default:group:grafana-agent:r-x
default:mask::r-x
default:other::---
Is there something wrong in my process? It seems acls are not applied in first place as we can read #effective:---
next to the grafana-agent
user, but I could not find any
I've tried granting the acls to the users instead of the group with same results.
Thank you.