Closed manelclos closed 4 years ago
Did you install anything to harden permissions, such as pam_umask
?
@josegonzalez yes, https://github.com/dev-sec/ansible-os-hardening, which sets a more conservative umask. Though the base plugins are owned by the dokku user and this is not a problem.
Did this ansible-os-hardening thing suddenly get posted somewhere fancy? Seems like it came up here as well...
I found it on ansible galaxy while searching for some other packages. I started using it a couple of months ago, and yes, the umask thing forces little changes on other procedures as well,
Do you know if there are any other issues with umask usage?
If you mean issues related to dokku, I just started using ansible-dokku to build a devel server, so first time in combination with os-hardening. I tried it because a co-worker is already using dokku, but he is using standalone installer and not in combination with os-hardening role.
Closing as this should be fixed via https://github.com/dokku/dokku/pull/4074 (and released in 0.21.3).
Description of problem
When installing a plugin, the files are owned by root. Given the umask we are using, the files are NOT accessible by the dokku user.
How reproducible
Every time
Steps to Reproduce
ansible-playbook dokku.yml --tags dokku-plugins
Actual Results
See that all plugins are owned by dokku, but clone is not:
Expected Results
Correct ownership of files
Environment Information
dokku report APP_NAME
output-----> uname: Linux xxxx 5.6.1-x86_64-linode134 #1 SMP PREEMPT Wed Apr 1 22:25:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux -----> memory: total used free shared buff/cache available Mem: 7944 233 6960 0 749 7710 Swap: 511 0 511 -----> docker version: Client: Docker Engine - Community Version: 19.03.11 API version: 1.40 Go version: go1.13.10 Git commit: 42e35e61f3 Built: Mon Jun 1 09:12:22 2020 OS/Arch: linux/amd64 Experimental: false
-----> docker daemon info: Client: Debug Mode: true
-----> sigil version: 0.6.0 -----> herokuish version: herokuish: 0.5.5 buildpacks: heroku-buildpack-multi v1.0.0 heroku-buildpack-ruby v207 heroku-buildpack-nodejs v166 heroku-buildpack-clojure v84 heroku-buildpack-python v162 heroku-buildpack-java v66 heroku-buildpack-gradle v31 heroku-buildpack-scala v86 heroku-buildpack-play v26 heroku-buildpack-php v166 heroku-buildpack-go v136 buildpack-nginx v12 -----> dokku version: dokku version 0.19.11 -----> dokku plugins: plugn: 0.3.2 00_dokku-standard 0.19.11 enabled dokku core standard plugin 20_events 0.19.11 enabled dokku core events logging plugin app-json 0.19.11 enabled dokku core app-json plugin apps 0.19.11 enabled dokku core apps plugin builder-dockerfile 0.19.11 enabled dokku core builder-dockerfile plugin builder-herokuish 0.19.11 enabled dokku core builder-herokuish plugin buildpacks 0.19.11 enabled dokku core buildpacks plugin certs 0.19.11 enabled dokku core certificate management plugin checks 0.19.11 enabled dokku core checks plugin cat: /var/lib/dokku/plugins/available/clone/plugin.toml: Permission denied panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 1 [running]: main.TomlGet(0xc000010080, 0x2, 0x2) github.com/dokku/plugn/plugn.go:30 +0x2d1 github.com/progrium/go-basher.(*Context).HandleFuncs(0xc000096280, 0xc000010050, 0x5, 0x5, 0x0) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:195 +0x26d github.com/progrium/go-basher.ApplicationWithPath(0xc000043e48, 0xc000043e78, 0x4, 0x4, 0x62cde8, 0x1, 0xc000016420, 0x18) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:77 +0x19c github.com/progrium/go-basher.Application(0xc000043e48, 0xc000043e78, 0x4, 0x4, 0x62cde8, 0x660d01) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:58 +0x1ce main.main() github.com/dokku/plugn/plugn.go:102 +0x396 cat: /var/lib/dokku/plugins/available/clone/plugin.toml: Permission denied panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 1 [running]: main.TomlGet(0xc000096030, 0x2, 0x2) github.com/dokku/plugn/plugn.go:30 +0x2d1 github.com/progrium/go-basher.(*Context).HandleFuncs(0xc0000aa280, 0xc000096000, 0x5, 0x5, 0x0) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:195 +0x26d github.com/progrium/go-basher.ApplicationWithPath(0xc000073e48, 0xc000073e78, 0x4, 0x4, 0x62cde8, 0x1, 0xc0000ae180, 0x18) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:77 +0x19c github.com/progrium/go-basher.Application(0xc000073e48, 0xc000073e78, 0x4, 0x4, 0x62cde8, 0x660d01) /go/pkg/mod/github.com/progrium/go-basher@v0.0.0-20150902213704-ad5de635edd1/basher.go:58 +0x1ce main.main() github.com/dokku/plugn/plugn.go:102 +0x396 clone enabled
common 0.19.11 enabled dokku core common plugin config 0.19.11 enabled dokku core config plugin docker-options 0.19.11 enabled dokku core docker-options plugin domains 0.19.11 enabled dokku core domains plugin enter 0.19.11 enabled dokku core enter plugin git 0.19.11 enabled dokku core git plugin logs 0.19.11 enabled dokku core logs plugin network 0.19.11 enabled dokku core network plugin nginx-vhosts 0.19.11 enabled dokku core nginx-vhosts plugin plugin 0.19.11 enabled dokku core plugin plugin proxy 0.19.11 enabled dokku core proxy plugin ps 0.19.11 enabled dokku core ps plugin repo 0.19.11 enabled dokku core repo plugin resource 0.19.11 enabled dokku core resource plugin scheduler-docker-local 0.19.11 enabled dokku core scheduler-docker-local plugin shell 0.19.11 enabled dokku core shell plugin ssh-keys 0.19.11 enabled dokku core ssh-keys plugin storage 0.19.11 enabled dokku core storage plugin tags 0.19.11 enabled dokku core tags plugin tar 0.19.11 enabled dokku core tar plugin trace 0.19.11 enabled dokku core trace plugin
How (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
Installed using ansible-dokku