tustvold commented on code in PR #2610:
URL: https://github.com/apache/arrow-rs/pull/2610#discussion_r958355255


##########
object_store/src/aws/credential.rs:
##########
@@ -365,31 +366,39 @@ async fn instance_creds(
     const AWS_EC2_METADATA_TOKEN_HEADER: &str = "X-aws-ec2-metadata-token";
 
     let token_url = format!("{}/latest/api/token", endpoint);
-    let token = client
+
+    let token_result = client
         .request(Method::PUT, token_url)
         .header("X-aws-ec2-metadata-token-ttl-seconds", "600") // 10 minute TTL
         .send_retry(retry_config)
-        .await?
-        .text()
-        .await?;
+        .await;
+
+    let token = match token_result {
+        Ok(t) => Some(t.text().await?),
+        Err(e) if matches!(e.status(), Some(StatusCode::FORBIDDEN)) => {

Review Comment:
   Tbh the security issue is the fact the endpoint has IMDSv1 enabled, not 
whether the application is actually using it. However, adding an option so you 
can be confident you aren't using IMDSv1 seems sensible



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to