8000 Can not drop dac_override capability because of docker-entrypoint.sh · Issue #907 · docker-library/postgres · GitHub
[go: up one dir, main page]

Skip to content
Can not drop dac_override capability because of docker-entrypoint.sh #907
Closed
@mwester117

Description

@mwester117

Currently the container needs the capability dac_override. This is a potential security issue also mentioned in this Red Hat article.
In Issue #208 and pull request #209 5802 this issue was fixed but was reintroduced later.

If I drop the capability dac_override on an already initialized postgres installation serveral "permission denied" errors appear in the logs:
find: /var/lib/postgresql/data: Permission denied

You can workaround this error if you change the following line to chmod 750 "$PGDATA" || :

chmod 700 "$PGDATA" || :

The group of the files is "root" in this case. This is the reason why dac_override is not needed anymore and the find command can operate on the files anyway.

I'm not sure if this is only a fix for already initialized databases. Maybe other fixes are needed to be sure that dac_override can be dropped on non initialized databases.

For security reason it would be really great if we can drop the dac_override capability for this container again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0