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

SEC: Add :z/:Z to mounted volumes in {local,production}.yml #2663

Merged

Conversation

westurner
Copy link
Contributor

@westurner westurner commented Jul 6, 2020

Description

Add :z or :Z suffixes to volumes in the local.yml and production.yml docker-compose configuration files.

Rationale

Without these in local.yml, I was getting the following errors:

$ docker-compose -f local.yml up
[...]
django          | python: can't open file 'manage.py': [Errno 13] Permission denied
flower          | Unable to load celery application.
flower          | The module config was not found.
node            | Error: EACCES: permission denied, scandir '/app'

I've only cursorily tested that the modifications to local.yml do seem to work; I see the index page and the django-debug-toolbar sidebar when I navigate to http://localhost:8000/

  • (Have someone else?) test these modifications to production.yml
  • Get feedback on whether relabeling is the only way to make this work on a platform with SELinux enabled (e.g. Fedora, CentOS, RHEL, SUSE)
  • Verify that :z and :Z are silently ignored on non-selinux platforms
  • Reference the docs:
  • Should production_postgres_data_backups:/backups:z be :z or :Z?

Use case(s) / visualization(s)

  • Users developing in docker containers on systems with SELinux in enforcing mode (Fedora, CentOS, RHEL, SUSE)
  • Users deploying to production with docker on systems with SELinux in enforcing mode (Fedora, CentOS, RHEL, SUSE)

@westurner westurner force-pushed the add_selinux_z_to_volumes branch from fded282 to 9fa002b Compare July 6, 2020 21:38
Copy link
Member

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

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

Tried on macOS, and it seems to work. Would be nice if someone on Windows could confirm that it doesn't break anything.

{{cookiecutter.project_slug}}/production.yml Outdated Show resolved Hide resolved
{{cookiecutter.project_slug}}/production.yml Show resolved Hide resolved
@browniebroke browniebroke changed the title SEC: add :z/:Z to volumes for SELinux in {local,production}.yml Add :z/:Z to mounted volumes in {local,production}.yml Sep 7, 2020
@browniebroke browniebroke merged commit 624dd94 into cookiecutter:master Sep 7, 2020
@browniebroke
Copy link
Member

Ok let's try this. Let's keep an eye on issues reported from Windows users in the coming days.

Thank you for your contribution! 🎉

@westurner
Copy link
Contributor Author

westurner commented Sep 7, 2020 via email

@westurner westurner changed the title Add :z/:Z to mounted volumes in {local,production}.yml SEC: Add :z/:Z to mounted volumes in {local,production}.yml Oct 1, 2020
@professorhaseeb
Copy link
Contributor

Ok let's try this. Let's keep an eye on issues reported from Windows users in the coming days.

Thank you for your contribution! 🎉

Works properly on windows 👍

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.

3 participants