]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not run neutron-ns-metadata-proxy as root on L3 agent
authorCedric Brandily <zzelle@gmail.com>
Mon, 24 Nov 2014 15:53:04 +0000 (15:53 +0000)
committerCedric Brandily <zzelle@gmail.com>
Wed, 24 Dec 2014 00:21:44 +0000 (01:21 +0100)
commitb78c5e54abd10fc71a46788110f9f36e6496414e
tree0950bf1bc78f8ccd91e7b10f37f72f5cf7728aff
parentb99ba2716f919577ea1dabca40599b0580e8f2d6
Do not run neutron-ns-metadata-proxy as root on L3 agent

Currently neutron-ns-metadata-proxy runs with root permissions when
namespaces are enabled on the l3 agent because root permissions are
required to "enter" in the namespace. But neutron-ns-metadata-proxy
permissions should be reduced as much as possible because it is
reachable from vms.

This change allows to change neutron-ns-metadata-proxy permissions
after its startup through the 2 new options metadata_proxy_user and
metadata_proxy_group which allow to define user/group running metadata
proxy after its initialization. Their default values are
neutron-l3-agent effective user and group.

Permissions drop is done after metadata proxy daemon writes its
pid in its pidfile (it could be disallowed after permissions drop).

Using nobody as metadata_proxy_user/group (more secure) is currently
not supported because:

* nobody has not the permission to connect the metadata socket,
* nobody has not the permission to log to file because neutron uses
  WatchedFileHandler (which requires read/write permissions after
  permissions drop).
This limitation will be addressed in a daughter change.

DocImpact
Partial-Bug: #1187107
Change-Id: I55c8c3fb14ed91ae8570f98f19c2cdbaf89d42fc
etc/l3_agent.ini
neutron/agent/l3/agent.py
neutron/agent/linux/daemon.py
neutron/agent/metadata/namespace_proxy.py
neutron/common/exceptions.py
neutron/tests/unit/test_l3_agent.py
neutron/tests/unit/test_linux_daemon.py
neutron/tests/unit/test_metadata_namespace_proxy.py