harden kolla horzion usage of /tmp/

Bug #2068126 reported by Sven Kieske
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Status tracked in Dalmatian
Antelope
New
Undecided
Unassigned
Bobcat
New
Undecided
Unassigned
Caracal
New
Undecided
Unassigned
Dalmatian
In Progress
Low
Sven Kieske

Bug Description

currently kolla-ansible bindmounts /tmp/ from the docker host (so usually the control-plane node) inside the container.

The Webapp itself runs as user horizon, but the Webserver (apache2) runs as root and is able to manipulate arbitrary files in private tmp dirs of services running inside other namespaces/containers on the host, including admin system services like systemd-logind:

dragon@ctl001:~$ docker exec -it --user=root horizon bash
(horizon)[root@ctl001 /]# cd /tmp/systemd-private-9dd6fe4987b6480e821f3e5a0333b4b7-systemd-logind.service-srLJIk/tmp/
(horizon)[root@ctl001 tmp]# touch pwned
(horizon)[root@ctl001 tmp]# ls -lashin
total 8.0K
2097732 4.0K drwxrwxrwt 2 0 0 4.0K Jun 5 07:55 .
2097731 4.0K drwx------ 3 0 0 4.0K Jun 5 07:50 ..
2097519 0 -rw-r--r-- 1 0 0 0 Jun 5 07:55 pwned
dragon@ctl001:~$ sudo su -
root@ctl001:~# ls -lashin /tmp/systemd-private-9dd6fe4987b6480e821f3e5a0333b4b7-systemd-logind.service-srLJIk/tmp
total 8.0K
2097732 4.0K drwxrwxrwt 2 0 0 4.0K Jun 5 07:55 .
2097731 4.0K drwx------ 3 0 0 4.0K Jun 5 07:50 ..
2097519 0 -rw-r--r-- 1 0 0 0 Jun 5 07:55 pwned

I'll provide a patch for that.

See also my downstream bug report at:

https://github.com/osism/issues/issues/1047

I found this bug when researching kolla-ansible for unsafe usage of /tmp/ directories.

Sven Kieske (s-kieske)
Changed in kolla-ansible:
assignee: nobody → Sven Kieske (s-kieske)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)
Changed in kolla-ansible:
status: New → In Progress
Sven Kieske (s-kieske)
Changed in kolla-ansible:
milestone: none → 19.0.0
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.