Skip to content

Commit d259d60

Browse files
committed
Correct comment on TCP connection behavior when max-response-hop is set to 1
1 parent a695bf2 commit d259d60

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/managed-kubernetes-auditing-toolkit/eks/imds/imds_tester.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ func (m *ImdsTester) TestImdsV2Accessible() (*ImdsTestResult, error) {
6868
commandToRun := []string{
6969
"sh",
7070
"-c",
71-
// We use "--max-time" because when the IMDS max-response-hop is enabled, the TCP connection succeeds initially
72-
// but then hangs
71+
// We use "--max-time" because when the IMDS max-response-hop is set to 1, the TCP connection succeeds initially but hangs indefinitely when calling /latest/api/token
7372
`TOKEN=$(curl --show-error --max-time 2 --silent -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
7473
(curl --silent --show-error --max-time 2 -H "X-aws-ec2-metadata-token: $TOKEN" 169.254.169.254/latest/meta-data/iam/security-credentials/ || true)`,
7574
}

0 commit comments

Comments
 (0)