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
fix(toolkit): attach lifetime to generated ssh keys. (#5578)
## Problem
For connecting VSCode to EC2 instance, we generate an ssh key pair on
disk. This results in writing the private ssh key to VSCode global
storage, allowing the key to be potentially reused by other users on the
same machine.
## Solution
Attach a lifetime to any key pair generated such that they wipe from
disk after X seconds. Value is currently set is 30 seconds to allow
connection to reliably establish. Also, change file permissions to
read/write owner only and change behavior to overwrite existing keys.
Unable to test file permissions, due to VSCode file system unable to
provide us with enough detail. Only provides whether it is readonly or
not (somewhat unreliably:
microsoft/vscode-discussions#673). VSCode
file system is what is used in `fs.ts` implementation.
This is in-line with how ec2 instance connect works:
https://github.com/aws/aws-ec2-instance-connect-cli/blob/master/ec2instanceconnectcli/EC2InstanceConnectKey.py
---
<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->
License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
---------
Co-authored-by: JadenSimon <31319484+JadenSimon@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Weinstock <hkobew@80a9971f0a95.ant.amazon.com>
0 commit comments