cloud-setup: require to explicitly opt-in for providers via environment variable

System Internals / NetworkManager - Thomas Haller [redhat.com] - 3 December 2019 15:18 EST

"nm-cloud-setup" is supposed to work without configuration.

However, it (obviously) fetches data from the network you are connected to (which might be untrusted or controlled by somebody malicious). The tool cannot protect you against that, also because the meta data services uses HTTP and not HTTPS. It means, you should run the tool only when it's suitable for your environment, that is: in the right cloud.

Usually, the user/admin/distributor would know for which cloud the enable the tool. It's also wasteful to repeatedly probe for the unavailable cloud.

So, instead disable all providers by default and require to opt-in by setting an environment variable.

This can be conveniently done via `systemctl edit nm-cloud-provider.service` to set Environment=. Of course, a image can also pre-deploy such am override file.

ff816dec1 cloud-setup: require to explicitly opt-in for providers via environment variable
clients/cloud-setup/nm-cloud-setup.service.in | 5 +++++
clients/cloud-setup/nmcs-provider-ec2.c | 7 ++++---
clients/cloud-setup/nmcs-provider.c | 9 +++++++++
clients/cloud-setup/nmcs-provider.h | 1 +
4 files changed, 19 insertions(+), 3 deletions(-)

Upstream: cgit.freedesktop.org


  • Share