Tag-scoped SSH key can access untagged VMs

GitHub issue #232 Feature Shipped figelwumpvia github 24 days ago View original

I created a new SSH key and registered it with ssh exe.dev ssh-key add --tag=<tag name>.

The response returned successfully:

  {
    "name": <name>,
    "permissions": {
      "tag": <tag name>
    },
    "status": "added"
  }

However when I tried to use this key to SSH into an untagged VM, it unexpectedly worked:

  ssh \
    -F /dev/null \
    -i ./worker-key \
    -o IdentityAgent=none \
    -o IdentitiesOnly=yes \
    -o BatchMode=yes \
    -o StrictHostKeyChecking=yes \
    -o UserKnownHostsFile=./known-hosts \
    <vm name> \
    true

After revoking the key, ssh failed as expected.

My expectation is that ssh-key add --tag would restrict SSH access to only VMs carrying that tag. If that is correct, it looks like the restriction isn't being enforced.

2 Comments

philzvia github 24 days ago

Tag-scoped keys allow you to ssh to the lobby and manipulate resources with that tag as well. I believe the true here is falling through to the exe.dev lobby. Replacing with a command that the lobby doesn’t have (eg hostname) should verify the point. Email us at support@exe.dev if you’d like us to trace it a bit deeper for your account.

figelwumpvia github 24 days ago

Ah I see; it's working fine, closing. Thanks!