You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For AWS EC2 instances that are using IMDSv2, a session token needs to be added to metadata endpoint requests. This PR documents the changes to the gcloud command to generate the config and how the auth libraries use the new imdsv2_session_token_url.
Copy file name to clipboardExpand all lines: aip/auth/4117.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,18 @@ The following values would need to be replaced:
62
62
impersonate.
63
63
-**FILEPATH**: File to save configuration to.
64
64
65
+
If you are using [AWS IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html),
66
+
an additional flag `--enable-imdsv2` should be added to the [`gcloud iam workload-identity-pools create-cred-config`](/sdk/gcloud/reference/iam/workload-identity-pools/create-cred-config) command:
67
+
68
+
```bash
69
+
$ gcloud iam workload-identity-pools create-cred-config \
The external identities configuration file can be used with
66
78
[Application Default Credentials][6]. In order to use external identities with
67
79
Application Default Credentials, the full path to this file should be stored
@@ -178,6 +190,7 @@ endpoint.
178
190
| region_url | Yes | This URL should be used to determine the current AWS region needed for the signed request construction. |
179
191
| url | No | This AWS metadata server URL should be used to retrieve the access key, secret key and security token needed to sign the `GetCallerIdentity` request. The $ROLE_NAME should be retrieved from calling this endpoint without any parameter and then calling again with the returned role name appended to this URL: http://169.254.169.254/latest/meta-data/iam/security-credentials/$ROLE_NAME|
180
192
| regional_cred_verification_url | Yes | This defines the regional AWS `GetCallerIdentity` action URL. This URL should be used to determine the AWS account ID and its roles. This should not actually be called by the Auth libraries. It should be called on the STS token server. The region should be substituted by SDK, e.g. `sts.eu-west-1.amazonaws`.com. |
193
+
| imdsv2_session_token_url | No | Presence of this URL enforces the auth libraries to fetch a Session Token from AWS. This field is required for EC2 instances using IMDSv2. This Session Token would later be used while making calls to the metadata enpoint. |
181
194
182
195
The JSON file for AWS configuration files should have the following form:
183
196
@@ -192,7 +205,8 @@ The JSON file for AWS configuration files should have the following form:
0 commit comments