Skip to content

Dropped access to unnecessary kernel capabilities in docker compose - #779

Open
JValtteri wants to merge 1 commit into
community-valheim-tools:mainfrom
JValtteri:main
Open

Dropped access to unnecessary kernel capabilities in docker compose#779
JValtteri wants to merge 1 commit into
community-valheim-tools:mainfrom
JValtteri:main

Conversation

@JValtteri

Copy link
Copy Markdown

In this configuration, all capabilities are first removed, then only the necessary capabilities are reintroduced.

Allowed capabilities:

  • sys_nice # adjusting process priority (I assume)
  • CHOWN # changing file ownership
  • SETUID # allows changing user
  • SETGID # allows changing user group
  • KILL # allows killing processes

This set of necessary capabilities were found with manual testings, including starting, playing and stopping the server. With this set no errors were observed.

If someone were to use privileged ports (<1024) for some reason, they'd also need

  • NET_BIND_SERVICE

Capability SYS_MODULE is explicitly removed. Though listing it after ALL is redundant, it's there as a safeguard in case anyone removes ALL for any reason. SYS_MODULE is considered a high risk capability in containers.

In this configuration, all capabilities are first removed, then
only the necessary capabilities are reintroduced.

Allowed capabilities:
- sys_nice  # adjusting process priority (I assume)
- CHOWN     # changing file ownership
- SETUID    # allows changing user
- SETGID    # allows changing user group
- KILL      # allows killing processes

This set of necessary capabilities were found with manual testings,
including starting, playing and stopping the server. With this set
no errors were observed.

If someone were to use privileged ports (<1024) for some reason,
they'd also need
- NET_BIND_SERVICE

Capability `SYS_MODULE` is explicitly removed. Though listing it
after `ALL` is redundant, it's there as a safeguard in case anyone
removes `ALL` for any reason. `SYS_MODULE` is considered a high
risk capability in containers.
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.

1 participant