Bug 2151987

Summary: [RHEL8] [RFE] Add support for IMDSv2 to nm-cloud-setup
Product: Red Hat Enterprise Linux 8 Reporter: Sara Ferguson <sferguso>
Component: NetworkManagerAssignee: NetworkManager Development Team <nm-team>
Status: CLOSED ERRATA QA Contact: David Jaša <djasa>
Severity: medium Docs Contact: Mayur Patil <maypatil>
Priority: medium    
Version: 8.7CC: bgalvani, ferferna, fguilher, jklech, lrintel, maypatil, rkhan, sfaye, sukulkar, thaller, till, vbenes
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: NetworkManager-1.40.16-2.el8 Doc Type: Enhancement
Doc Text:
.The `nm-cloud-setup` utility now supports IMDSv2 configuration Users can configure an AWS Red Hat Enterprise Linux EC2 instance with Instance Metadata Service Version 2 (IMDSv2) with the `nm-cloud-setup` utility. To comply with improved security that restricts unauthorized access to EC2 metadata and new features, integration between AWS and Red Hat services is necessary to provide advanced features. This enhancement enables the `nm-cloud-setup` utility to fetch and save the IMDSv2 tokens, verify an EC2 environment, and retrieve information about available interfaces and IP configuration by using the secured IMDSv2 tokens.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-14 15:49:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2183216    

Comment 11 David Jaša 2023-05-01 18:24:42 UTC
VERIFIED in NetworkManager-1.40.16-4.el8:

Token is requested:
Hypertext Transfer Protocol
    PUT /latest/api/token HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): PUT /latest/api/token HTTP/1.1\r\n]
            [PUT /latest/api/token HTTP/1.1\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Method: PUT
        Request URI: /latest/api/token
        Request Version: HTTP/1.1
    Host: 169.254.169.254\r\n
    Accept: */*\r\n
    X-aws-ec2-metadata-token-ttl-seconds: 180\r\n
    \r\n
    [Full request URI: http://169.254.169.254/latest/api/token]
    [HTTP request 1/1]
    [Response in frame: 2]


And then used:
Hypertext Transfer Protocol
    GET /2018-09-24/meta-data/network/interfaces/macs/ HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): GET /2018-09-24/meta-data/network/interfaces/macs/ HTTP/1.1\r\n]
            [GET /2018-09-24/meta-data/network/interfaces/macs/ HTTP/1.1\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Method: GET
        Request URI: /2018-09-24/meta-data/network/interfaces/macs/
        Request Version: HTTP/1.1
    Host: 169.254.169.254\r\n
    Accept: */*\r\n
    X-aws-ec2-metadata-token: AQAAALH-k7i18JMkK-ORLZQfAa7nkNjQbKwpQPExNHqzk1oL_7eh-A==\r\n
    \r\n
    [Full request URI: http://169.254.169.254/2018-09-24/meta-data/network/interfaces/macs/]
    [HTTP request 1/1]
    [Response in frame: 4]

Comment 17 errata-xmlrpc 2023-11-14 15:49:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7118