Skip to main content

AWS Multi-Account Setup using Leapp

Table of Contents

πŸ€” The problem
#

As an AWS Consultant, the most important part of my job is being able to actually get into the client’s AWS account. (Yes, that first week and a half spent just getting the right access is a story for another time.)

If you’re working in a similar space, you’re probably juggling at least two AWS accounts at once, if not more. Work Sandbox, client’s dev account, client’s prod account, you get the idea…

Keeping track of credentials and opening a Private Window in Firefox/Chrome for every new account never felt right. It felt clunky, like there just MUST be a better way. Turns out there is, and it’s quite simple!

No more of this:

alt text

πŸ’‘ The Solution
#

There are various solutions to the browser problem, but the most elegant one is containerised browser tabs. The concept is simple: you need to run multiple sessions for the same website simultaneously, so you silo them into separate containers (like docker for browsers). Think of it as having de facto private windows, but all living as tabs in the same browser window. Clean, color-coded and easy to navigate, in one word neat!

Firefox has had this feature baked-in for a few years:

πŸ”– How to use Firefox containers

But here’s where it gets spicy🌢️. Browser tabs are only half the battle. We still need to manage AWS credentials for the terminal. Sure, you could use the AWS CLI with profiles for different accounts, but that typically means storing persistent access keys in plain text. And let’s be honest, that’s usually frowned upon or sometimes outright forbidden by most security-conscious clients.

Enter Leapp!

Leapp is the missing piece that ties it all together. It authenticates you through Identity Centre (the secure way), automatically provisions those credentials to your terminal, and opens a containerised browser tab in Firefox, all in one go. No persistent keys, no security nightmares, just seamless multi-account access in both your terminal and browser!

Leapp is no longer actively maintained by Noovolari, but has an active community.

πŸ› οΈ Configuration
#

  1. Download and install Firefox here
  2. Download the latest version of Leapp here
  3. Extract the files out of the Leapp archive
  4. Install Leapp
  5. Open Leapp
    alt text
  6. Go into Leapp settings -> Multi-Console
  7. Press the Get for Firefox button
  8. Install the extension in Firefox
  9. Enable Multi-Console Extension using the toggle in Leapp. It should all look something like this:
    alt text
  10. Add a New Integration using an account’s AWS SSO url
    alt text
  11. After filling in the details, double click on the new integration or right-click -> Login
  12. After a successful login, your Leapp integration should turn green
    alt text
  13. Now you should be able to see all accounts belonging to that integration that you have access to in the session tab like so:
    alt text
  14. Click on the Play button that appears when you hover over the AWS logo next to the account of choice or double click on it.
  15. This should take you to your browser and automatically open up a new Container tab belonging to that session
    alt text
    alt text
  16. Remember that your terminal has always the currently active session in Leapp as the active credentials!
  17. You are now good to go πŸ₯³ Open up as many sessions and tabs as you like!
  1. Download and install Firefox here
  2. Download the latest version of Leapp here
  3. Extract the files out of the Leapp archive
  4. Install Leapp
  5. Open Leapp
  6. You should now see something like this:
    alt text
    The error in the bottom left is to be expected. Since we want to run Leapp and connect it with WSL, we will need to create a symlink between the Windows and WSL .aws folders
  7. Delete your existing WSL .aws folder, or make a backup of existing credentials
  8. Create a symlink inside WSL (change the username to your Windows username):
    1ln -s /mnt/c/Users/<your Windows username>/.aws .aws
    Warning! The folder and its contents will be 777 due to the filesystem interop being terrible. Ensure that your WSL instance is secure, otherwise it could be an unintended backdoor to your Windows OS.
  9. Restart Leapp
  10. Go into Leapp settings -> Multi-Console
  11. Press the Get for Firefox button
  12. Install the extension in Firefox
  13. Enable Multi-Console Extension using the toggle in Leapp. It should all look something like this:
    alt text
  14. Add a New Integration using an account’s AWS SSO url
    alt text
  15. After filling in the details, double click on the new integration or right-click -> Login
  16. After a successful login, your Leapp integration should turn green
    alt text
  17. Now you should be able to see all accounts belonging to that integration that you have access to in the session tab like so:
    alt text
  18. Click on the Play button that appears when you hover over the AWS logo next to the account of choice or double click on it.
  19. This should take you to your browser and automatically open up a new Container tab belonging to that session
    alt text
    alt text
  20. Remember that your terminal has always the currently active session in Leapp as the active credentials!
  21. You are now good to go πŸ₯³ Open up as many sessions and tabs as you like!
Michal (Mike) Witkovsky
Author
Michal (Mike) Witkovsky
I’m a 27-year-old Senior IoT Engineer with a strong passion for both hardware and software. In my free time I enjoy hiking, swimming, playing guitar and exploring the unknown πŸ”οΈ