Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aptly container fails when "/" filesystem is mounted read-only #4

Open
archmangler opened this issue Aug 15, 2018 · 0 comments
Open

Comments

@archmangler
Copy link

Regarding the docker-aptly container: To implement the Docker CIS security benchmark (item 5.12 in the benchmark) we need to be able to run the aptly container with read-only "/" filesystem. However, it appears aptly requires "/" to be mounted rw on container startup, or else it fails as follows:

Aug 15 14:43:41 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: gpg: fatal: can't create directory `/root/.gnupg': Read-only file system
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: secmem usage: 0/0 bytes in 0/0 blocks of pool 0/65536
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: gpg: fatal: can't create directory `/root/.gnupg': Read-only file system
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: secmem usage: 0/0 bytes in 0/0 blocks of pool 0/65536
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: gpg: fatal: can't create directory `/root/.gnupg': Read-only file system
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: secmem usage: 0/0 bytes in 0/0 blocks of pool 0/65536
Aug 15 14:43:48 tfvm docker.05b9adcea05e/bryanhong/aptly:latest[18739]: ln: failed to create symbolic link '/root/.gnupg/secring.gpg': No such file or directory

The container is run as follows:

docker run --read-only --detach=true --log-driver=syslog --name="aptly" --restart=always --env FULL_NAME="First Last" --env EMAIL_ADDRESS="[email protected]" --env GPG_PASSWORD="PickAPassword" --env HOSTNAME=tfvm --volume /var/aptly:/opt/aptly --publish 8880:80 bryanhong/aptly:latest

a) Can the aptly docker container be configured to work with read-only "/" (i.e docker run with --read-only) flag?
b) If not, what are the technical reasons for this (which can be used to justify it under a security analysis)?

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

No branches or pull requests

1 participant