amazon-ec2-metadata-mock icon indicating copy to clipboard operation
amazon-ec2-metadata-mock copied to clipboard

SSH metadata doesn't match the IMDS format

Open arianvp opened this issue 9 months ago • 6 comments

Describe the bug

The mock server returns SSH keys in a different format than EC2 IMDS.

e.g.

http://169.254.169.254/latest/meta-data/public-keys/

returns

0=mykey

on EC2 whilst this project returns

0/

Which means that the ec2-metadata tool that ships with Amazon Linux 2 chokes on the output:

ec2-metadata --public-keys

garblles output:

$ ec2-metadata --public-keys
public-keys: 
keyname:0/
index:0/
format:public-keys/
key:(begins from next line)


Steps to reproduce

$ sudo ip addr add 169.254.169.254 dev enp0s1
$ sudo  ec2-metadata-mock  --hostname 169.254.169.254 --port 80
$ ec2-metadata --public-keys
public-keys: 
keyname:0/
index:0/
format:public-keys/
key:(begins from next line)

Expected outcome

$ ec2-metadata --public-keys
public-keys: 
keyname:framework
index:0
format:openssh-key
key:(begins from next line)
ssh-ed25519 XXXXXXXX framework

Application Logs The log output when experiencing the issue.

Environment

  • AEMM Version: v1.12.0
  • OS/Arch: Amazon Linux 2
  • Installation method:

arianvp avatar Feb 17 '25 15:02 arianvp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.

github-actions[bot] avatar Mar 19 '25 17:03 github-actions[bot]

Not stale. Can somebody at least react on an issue before stale-botting it?

arianvp avatar Mar 19 '25 19:03 arianvp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.

github-actions[bot] avatar Apr 20 '25 17:04 github-actions[bot]

Still not stale. Can anybody react?

arianvp avatar Apr 20 '25 20:04 arianvp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.

github-actions[bot] avatar May 21 '25 17:05 github-actions[bot]

Please apply the "stalebot-ignore" label

arianvp avatar May 21 '25 17:05 arianvp