NetworkManager/clients/cloud-setup
Lubomir Rintel ef3d4758d6 cloud-setup/ec2: start with requesting a IMDSv2 token
The present version of the EC2 metadata API (IMDSv2) requires a header
with a token to be present in all requests. The token is essentially a
cookie that's not actually a cookie that's obtained with a PUT call that
doesn't put anything. Apparently it's too easy to trick someone into
calling a GET method.

EC2 now supports IMDSv2 everywhere with IMDSv1 being optional, so let's
just use IMDSv2 unconditionally. Also, the presence of a token API can
be used to detect the AWS EC2 cloud.

Conflicts:
- variable alignments
- missing 494819bbbf ("cloud-setup: move common code for get_config()
  to base class and improve cancellation"). From it we only needed
  the `get_config_data->self` part, but used g_task_get_source_object
  instead.
- missing 5fb2f7e717 ("cloud-setup/trivial: rename "response_data"
  variable")

https://bugzilla.redhat.com/show_bug.cgi?id=2151986
(cherry picked from commit 8b7e12c2d6)
(cherry picked from commit 429f36cd81)
(cherry picked from commit e3ac982b32)
(cherry picked from commit c5a3e739b1)
(cherry picked from commit ee157ad48b)
(cherry picked from commit ae3ec36462)
(cherry picked from commit 865fe0732e)
(cherry picked from commit d75e307ebc)
2023-09-18 16:16:11 +02:00
..
90-nm-cloud-setup.sh cloud-setup: let dispatcher script run tool only if service is enabled 2019-12-03 16:18:33 +01:00
main.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
meson.build cloud-setup: add tool for automatic IP configuration in cloud 2020-07-29 15:56:15 +02:00
nm-cloud-setup-utils.c cloud-setup: fix replacing IPv4 addresses during update 2021-03-12 12:43:03 +01:00
nm-cloud-setup-utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-cloud-setup.service.in cloud-setup: add tool for automatic IP configuration in cloud 2020-07-29 15:56:15 +02:00
nm-cloud-setup.timer cloud-setup: add tool for automatic IP configuration in cloud 2019-11-28 19:52:18 +01:00
nm-http-client.c cloud-setup: make nm_http_client_req() accept a method argument 2023-09-18 11:50:27 +02:00
nm-http-client.h cloud-setup: make nm_http_client_req() accept a method argument 2023-09-18 11:50:27 +02:00
nmcs-provider-azure.c cloud-setup: make nm_http_client_req() accept a method argument 2023-09-18 11:50:27 +02:00
nmcs-provider-azure.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nmcs-provider-ec2.c cloud-setup/ec2: start with requesting a IMDSv2 token 2023-09-18 16:16:11 +02:00
nmcs-provider-ec2.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nmcs-provider-gcp.c cloud-setup: make nm_http_client_req() accept a method argument 2023-09-18 11:50:27 +02:00
nmcs-provider-gcp.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nmcs-provider.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nmcs-provider.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00