Skip to content

Commit a9b397d

Browse files
committed
chore: small changes in documentation
1 parent 28c2fc8 commit a9b397d

File tree

1 file changed

+62
-22
lines changed

1 file changed

+62
-22
lines changed

README.md

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# cloudX-proxy
1+
# cloudx-proxy
22

33
[![PyPI Version](https://img.shields.io/pypi/v/cloudx-proxy.svg)](https://pypi.org/project/cloudx-proxy/)
44
[![Python Support](https://img.shields.io/pypi/pyversions/cloudx-proxy.svg)](https://pypi.org/project/cloudx-proxy/)
5-
[![License](https://img.shields.io/github/license/easytocloud/cloudX-proxy.svg)](https://github.com/easytocloud/cloudX-proxy/blob/main/LICENSE)
6-
[![Release](https://github.com/easytocloud/cloudX-proxy/actions/workflows/release.yml/badge.svg)](https://github.com/easytocloud/cloudX-proxy/actions/workflows/release.yml)
7-
[![Security Audit](https://img.shields.io/badge/security-pip--audit-blue?logo=python)](https://github.com/easytocloud/cloudX-proxy/actions/workflows/release.yml)
8-
[![License Check](https://img.shields.io/badge/license-MIT%20compatible-green?logo=legal)](https://github.com/easytocloud/cloudX-proxy/actions/workflows/release.yml)
9-
[![Dependabot](https://img.shields.io/badge/dependabot-enabled-brightgreen?logo=dependabot)](https://github.com/easytocloud/cloudX-proxy/network/updates)
5+
[![License](https://img.shields.io/github/license/easytocloud/cloudx-proxy.svg)](https://github.com/easytocloud/cloudx-proxy/blob/main/LICENSE)
6+
[![Release](https://github.com/easytocloud/cloudx-proxy/actions/workflows/release.yml/badge.svg)](https://github.com/easytocloud/cloudx-proxy/actions/workflows/release.yml)
7+
[![Security Audit](https://img.shields.io/badge/security-pip--audit-blue?logo=python)](https://github.com/easytocloud/cloudx-proxy/actions/workflows/release.yml)
8+
[![License Check](https://img.shields.io/badge/license-MIT%20compatible-green?logo=legal)](https://github.com/easytocloud/cloudx-proxy/actions/workflows/release.yml)
9+
[![Dependabot](https://img.shields.io/badge/dependabot-enabled-brightgreen?logo=dependabot)](https://github.com/easytocloud/cloudx-proxy/network/updates)
1010
[![Downloads](https://img.shields.io/pypi/dm/cloudx-proxy.svg)](https://pypi.org/project/cloudx-proxy/)
1111

1212
A cross-platform SSH proxy command for connecting VSCode to CloudX/Cloud9 EC2 instances using AWS Systems Manager Session Manager.
1313

1414
## Overview
1515

16-
cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using AWS Systems Manager Session Manager, eliminating the need for direct SSH access or public IP addresses. It handles:
16+
cloudx-proxy enables seamless SSH connections from VSCode to EC2 instances using AWS Systems Manager Session Manager, eliminating the need for direct SSH access or public IP addresses. It handles:
1717

1818
- Automatic instance startup if stopped
1919
- SSH key distribution via EC2 Instance Connect
@@ -54,7 +54,7 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
5454

5555
## Prerequisites
5656

57-
1. **Python 3.9+** - Required for cloudX-proxy and uv package manager
57+
1. **Python 3.9+** - Required for cloudx-proxy and uv package manager
5858
- [Python Installation Guide](https://www.python.org/downloads/)
5959
- Check your version: `python --version` or `python3 --version`
6060
- Supports Python 3.9, 3.10, 3.11, 3.12, 3.13
@@ -84,7 +84,7 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
8484
- Downloads and installs the package and its dependencies
8585
- Runs the package without explicit environment activation
8686

87-
This means you can run cloudX-proxy directly with `uvx cloudx-proxy` without manually managing virtual environments or dependencies.
87+
This means you can run cloudx-proxy directly with `uvx cloudx-proxy` without manually managing virtual environments or dependencies.
8888

8989
6. **VSCode with Remote SSH Extension** - Your development environment
9090
- Provides the integrated development environment
@@ -93,11 +93,11 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
9393

9494
## Installation
9595

96-
The cloudX-proxy package is available on PyPI and can run using uvx without explicit installation.
96+
The cloudx-proxy package is available on PyPI and can run using uvx without explicit installation.
9797

9898
## Setup
9999

100-
cloudX-proxy includes a setup command that automates the entire configuration process:
100+
cloudx-proxy includes a setup command that automates the entire configuration process:
101101

102102
```bash
103103
# Basic setup with defaults (vscode profile and key)
@@ -131,6 +131,8 @@ The setup command will:
131131

132132
2. Manage SSH Keys:
133133
- Creates new SSH key pair if needed
134+
* Defaults to key name "vscode" in ~/.ssh/vscode/
135+
* Custom key name/location via --ssh-key and --ssh-config
134136
- Fully supports 1Password integration:
135137
* Using 1Password SSH agent via `--1password` flag
136138
* Creates keys directly in 1Password's secure vault
@@ -151,7 +153,7 @@ The setup command will:
151153

152154
### SSH Configuration
153155

154-
The setup command configures SSH to use cloudX-proxy as a ProxyCommand, enabling seamless connections through AWS Systems Manager. For example, running:
156+
The setup command configures SSH to use cloudx-proxy as a ProxyCommand, enabling seamless connections through AWS Systems Manager. For example, running:
155157

156158
```bash
157159
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
@@ -226,7 +228,7 @@ This three-tier structure offers better maintainability by reducing duplication
226228

227229
### Security Model: AWS and SSH Integration
228230

229-
cloudX-proxy implements a unique dual-layer security approach that combines AWS's robust authentication mechanisms with SSH's connection handling capabilities:
231+
cloudx-proxy implements a unique dual-layer security approach that combines AWS's robust authentication mechanisms with SSH's connection handling capabilities:
230232

231233
#### AWS Security Layer (Primary)
232234
The primary security boundary is enforced through AWS Systems Manager (SSM) and EC2 Instance Connect. This layer provides:
@@ -250,7 +252,7 @@ This architecture means that:
250252

251253
### VSCode Configuration
252254

253-
After completing the setup, configure VSCode to use the SSH configuration created by cloudX-proxy:
255+
After completing the setup, configure VSCode to use the SSH configuration created by cloudx-proxy:
254256

255257
1. **Install VSCode Extensions:**
256258
- Install the "Remote - SSH" extension from the VSCode marketplace
@@ -271,7 +273,7 @@ After completing the setup, configure VSCode to use the SSH configuration create
271273
```
272274

273275
3. **Configuration Explanations:**
274-
- `configFile`: Points to the SSH config created by cloudX-proxy setup
276+
- `configFile`: Points to the SSH config created by cloudx-proxy setup
275277
- `connectTimeout`: Extended timeout (90s) for instance startup and connection establishment
276278
- `serverInstallTimeout`: Additional time (120s) for VSCode server installation on first connect
277279
- `showLoginTerminal`: Shows connection progress for troubleshooting
@@ -293,15 +295,15 @@ Understanding the connection flow helps with troubleshooting and explains why ce
293295

294296
1. **VSCode Initiates SSH Connection**
295297
- User clicks "Connect" or runs `ssh cloudx-{env}-{hostname}`
296-
- SSH reads the configuration and calls cloudX-proxy as ProxyCommand
298+
- SSH reads the configuration and calls cloudx-proxy as ProxyCommand
297299

298300
2. **AWS Authentication & Instance Check**
299-
- cloudX-proxy authenticates using the specified AWS profile
301+
- cloudx-proxy authenticates using the specified AWS profile
300302
- Checks if the target EC2 instance exists and is accessible
301303
- Verifies SSM agent is installed and running on the instance
302304

303305
3. **Instance Startup (if needed)**
304-
- If instance is stopped, cloudX-proxy starts it automatically
306+
- If instance is stopped, cloudx-proxy starts it automatically
305307
- Waits for instance to reach "running" state (typically 30-60 seconds)
306308
- Monitors SSM connectivity until agent responds
307309

@@ -345,10 +347,10 @@ uvx cloudx-proxy setup [OPTIONS]
345347
```
346348

347349
Options:
348-
- `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup.
350+
- `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup. When the profile is an SSO profile (role), ensure you have logged in using `aws sso login --profile {profile}` before running the setup and when connecting.
349351
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in the SSH config directory. This same name can be used in the connect command.
350352
- `--ssh-config` (optional): Path to the SSH config file to use. If specified, configuration and keys will be stored in this location. Default is ~/.ssh/vscode/config.
351-
- `--1password` (optional): Enable 1Password SSH agent integration. Can be used as a flag or with a vault name (e.g., `--1password Private`). First searches all vaults for existing keys with name "cloudX SSH Key - {keyname}". If no existing key found, creates new keys directly in the specified (or selected) 1Password vault and configures SSH to use the 1Password SSH agent. If a vault name is specified, that vault will be used for key storage; otherwise, prompts user to select from available vaults. By default, the "Private" vault is used when no vault specified. Note that only the "Private" vault is enabled for SSH by default in 1Password settings - other vaults must be manually enabled in 1Password SSH agent settings.
353+
- `--1password` (optional): Enable 1Password SSH agent integration. Can be used as a flag or with a vault name (e.g., `--1password Private`). First searches all vaults for existing keys with name "cloudX SSH Key - {keyname}". If no existing key found, creates new keys directly in the specified (or selected) 1Password vault and configures SSH to use the 1Password SSH agent. If a vault name is specified, that vault will be used for key storage. By default, the "Private" vault is used when no vault specified. Note that only the "Private" vault is enabled for SSH by default in 1Password settings - other vaults must be manually enabled in 1Password SSH agent settings.
352354
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
353355
- `--instance` (optional): EC2 instance ID to set up connection for. If provided, skips the instance ID prompt.
354356
- `--hostname` (optional): Hostname to use for SSH configuration. If not provided, a hostname will be generated from the instance ID in non-interactive mode or prompted for in interactive mode.
@@ -370,7 +372,7 @@ uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config --1password
370372
uvx cloudx-proxy setup --1password Work
371373

372374
# Complete setup with all options
373-
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
375+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod --instance i-0123456789abcdef0 --hostname myserver --yes
374376
```
375377

376378
#### Connect Command
@@ -441,7 +443,7 @@ The list command displays all configured cloudx-proxy hosts, grouped by environm
441443
2. Select "SSH Targets" from the dropdown
442444
3. Your configured hosts will appear (e.g., cloudx-dev)
443445
4. Click the "+" icon next to a host to connect
444-
5. VSCode will handle the rest, using cloudX-proxy to establish the connection
446+
5. VSCode will handle the rest, using cloudx-proxy to establish the connection
445447

446448
## AWS Permissions
447449
### IAM User Permissions
@@ -457,6 +459,44 @@ Note: This user should be created using the cloudX-user product from Service Cat
457459

458460
The EC2 instance should have the tag `cloudxuser` with the value of the username of the user that is connecting to the instance. This is automatically set when the instance is created using the cloudX-instance product from Service Catalog in the AWS Console.
459461

462+
463+
### IAM Role Permissions
464+
465+
In organizations with AWS IAM Identity Center (formerly AWS SSO), the IAM entity is often a role that is assumed by the user. The role must have the same permissions as described for the IAM user above, typically in the form of a permission set. ABAC aside, the following permissions are required for the role:
466+
467+
```
468+
InlinePolicy:
469+
Version: '2012-10-17'
470+
Statement:
471+
- Sid: GetStatusWithSSM1
472+
Effect: Allow
473+
Action: ssm:DescribeInstanceInformation
474+
Resource: !Sub 'arn:aws:ec2:*:*:instance/*'
475+
- Sid: GetStatusWithSSM2
476+
Effect: Allow
477+
Action: ssm:DescribeInstanceInformation
478+
Resource: !Sub 'arn:aws:ssm:*:*:*'
479+
- Sid: StartEc2
480+
Effect: Allow
481+
Action: ec2:StartInstances
482+
Resource: !Sub 'arn:aws:ec2:*:*:instance/*'
483+
- Sid: StartSession1
484+
Effect: Allow
485+
Action: ssm:StartSession
486+
Resource: !Sub 'arn:aws:ec2:*:*:instance/*'
487+
- Sid: StartSession2
488+
Effect: Allow
489+
Action: ssm:StartSession
490+
Resource: !Sub 'arn:aws:ssm:*:*:document/AWS-StartSSHSession'
491+
- Sid: AllowSendPubKey
492+
Effect: Allow
493+
Action:
494+
- ec2-instance-connect:SendSSHPublicKey
495+
Resource: !Sub 'arn:aws:ec2:*:*:instance/*'
496+
497+
```
498+
499+
460500
### EC2 Instance Permissions
461501

462502
The EC2 instance has a profile/role that provides enough permissions to allow the AWS SSM agent to connect to the instance, as well as

0 commit comments

Comments
 (0)