Skip to content

Conversation

@carole-lavillonniere
Copy link
Contributor

This PR fixes two installation issues with the LocalStack CLI:

  1. Global installation on Linux without desktop environment (using i3 in my case): When pkexec fails due to missing polkit agent (graphical authentication dialog), the installer now falls back to prompting for sudo password via VS Code input box
  2. Local installation PATH availability: The LocalStack CLI binary path is now immediately added to the current VS Code process environment, eliminating the need to restart VS Code after installation

This is the password prompt when using i3 (using vscode):

i3-vscode-pw

This is the password prompt when using Gnome desktop env (using pkexec):
IMG_2699
Sorry for the literal screen shot 😁

@carole-lavillonniere carole-lavillonniere marked this pull request as ready for review November 28, 2025 15:39
Copy link
Collaborator

@tiurin tiurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this! 👏

I think it's not the best security practice to ask for system credentials in the VS Code input box. A malicious extension could easily mimic such input box. However, I think the implementation is acceptable as long as:

  • it stays only as a fallback for advanced Linux users who use custom setups and are more likely to understand the risks/find a workaround to install LocalStack in a different way.
  • password variable scope is kept as the smallest possible so that the password string is garbage-collected as soon as possible.
  • stdin approach is kept
  • no storage/caching - every command should ask for password again.

suggestion: add these points and risks as comments, this code path should be as guarded as possible from misuse.

});

// Write password to stdin and close it
child.stdin.write(`${password}\n`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice way to avoid exposing password in any kind of output! 👍

@carole-lavillonniere carole-lavillonniere force-pushed the drg-151-vs-code-installation-wizard-fails branch from 65537b2 to c23df92 Compare December 1, 2025 08:47
@carole-lavillonniere
Copy link
Contributor Author

Thanks for addressing this! 👏

I think it's not the best security practice to ask for system credentials in the VS Code input box. A malicious extension could easily mimic such input box. However, I think the implementation is acceptable as long as:

* it stays only as a fallback for advanced Linux users who use custom setups and are more likely to understand the risks/find a workaround to install LocalStack in a different way.

* `password` variable scope is kept as the smallest possible so that the password string is garbage-collected as soon as possible.

* `stdin` approach is kept

* no storage/caching - every command should ask for password again.

suggestion: add these points and risks as comments, this code path should be as guarded as possible from misuse.

Totally agree. I decided to go with this because it seemed the only alternative was to let the install fail on such systems. Added a comment explaining the security concern like you suggested.

@carole-lavillonniere carole-lavillonniere force-pushed the drg-151-vs-code-installation-wizard-fails branch from c23df92 to 8e33d30 Compare December 1, 2025 08:55
@carole-lavillonniere carole-lavillonniere merged commit 71577ac into main Dec 1, 2025
3 checks passed
@carole-lavillonniere carole-lavillonniere deleted the drg-151-vs-code-installation-wizard-fails branch December 1, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants