element-hq / element-hq/element-docker-demo

Bind mounts of config files and the like should be read-only

Open
#8 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
170
Forks
30
PR merge metrics
No merged PRs in 30d

Description

`compose.yml` has many bind mounts to config files. If you don't make them read-only by appending `:ro`, for an attacker who compromises a container can edit the configuration and for example add a persistent backdoor.

Perhaps the most glaring example is this:

`- ${VOLUME_PATH}/data/ssl/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt`

An attacker can edit the host's list of CA certificates, and also for all other containers that mount this.

Generally, if in doubt, bind mounts should be read-only. Only if there is a clear reason for why the container should be able to write, `:rw` is appropriate. In my experience, this is the exception.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.