这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@inetol
Copy link
Member

@inetol inetol commented Aug 23, 2024

The container only runs without permissions at the moment it runs the uWSGI server, the rest of the script runs with the ownership that Docker is running (by default root unless overriden with "user" directive) so other container managers such as Podman or Docker rootless are (should) not affected by this issue. See this.

Before you go and copypaste this into your compose file, you must know that this solution is UNSAFE and you will give the container FULL ACCESS to your host FILESYSTEM. Also this does not work for systems that actively enforce a SELinux policy. By setting the DAC_OVERRIDE flag you are giving the privilege to completely override permissions allowing you to modify other files on the host such as the mounted searxng/ folder, doing this will give new files the root ownership:

Screenshot

The good and not so flexible solution is to set with "user" directive in your compose file the UID/GID of the ownership where that folder is located, avoiding the use of that devil's flag and continue to use SELinux without adding new policies:

Screenshot

As this solution requires additional config (besides not being possible in some cases) it is omitted as a default solution, at most a note about this could be added on README.

Closes #238
Closes #252
Closes #258
Related #115

@Bnyro Bnyro self-requested a review September 27, 2024 16:43
@Bnyro Bnyro closed this Oct 4, 2024
@Bnyro Bnyro reopened this Oct 4, 2024
Copy link
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steve Grubb, security standards expert at Red Hat, says that "nothing should need this. If your container needs this, it’s probably doing something horrible."

Source: https://www.redhat.com/en/blog/secure-your-containers-one-weird-trick

I don't even think that we should optionally include this with a note in the README, since it's never a good idea, not even when you read the warning.

@Bnyro Bnyro closed this Oct 4, 2024
@inetol inetol deleted the dockerness branch October 7, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cap_drop option prevents uwsgi file creation, resulting in an error

2 participants