cloudx-proxy 0.4.6__tar.gz → 0.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloudx_proxy-0.4.8/.clinerules +103 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/CHANGELOG.md +9 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/PKG-INFO +7 -1
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/README.md +6 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/_version.py +2 -2
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/cli.py +11 -5
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/PKG-INFO +7 -1
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/SOURCES.txt +1 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/.github/workflows/release.yml +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/.gitignore +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/.releaserc +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/CONTRIBUTING.md +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/LICENSE +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/_1password.py +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/__init__.py +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/core.py +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy/setup.py +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/dependency_links.txt +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/entry_points.txt +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/requires.txt +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/cloudx_proxy.egg-info/top_level.txt +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/package.json +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/pyproject.toml +0 -0
- {cloudx_proxy-0.4.6 → cloudx_proxy-0.4.8}/setup.cfg +0 -0
@@ -0,0 +1,103 @@
|
|
1
|
+
# cloudX-proxy
|
2
|
+
|
3
|
+
CloudX is a development environment consisting of
|
4
|
+
|
5
|
+
- a local VSCode installation
|
6
|
+
- a remote development server (EC2 instance) running with auto-shutdown
|
7
|
+
|
8
|
+
The AWS side consists of the following components:
|
9
|
+
|
10
|
+
- an CloudX-environment
|
11
|
+
- a CloudX-user
|
12
|
+
- a CloudX-instance
|
13
|
+
|
14
|
+
The CloudX-environment is a set of resources that are used to run the CloudX-instance.
|
15
|
+
Most importantly, it defines the VPC subnet where the instances are launched.
|
16
|
+
|
17
|
+
A CloudX-user is an IAM user with the necessary permissions to manage their CloudX-instance(s) based on a ABAC tag defined in the cloudX-environment.
|
18
|
+
|
19
|
+
A CloudX-instance is an EC2 instance that is launched in the CloudX-environment.
|
20
|
+
It's most important feature is that it is automatically stopped after a certain period of inactivity.
|
21
|
+
|
22
|
+
The AWS components are deployed from AWS Service Catalog.
|
23
|
+
|
24
|
+
The cloudX-proxy is a tool that allows you to access the remote development server from your local VSCode installation over an ssh connection established by the cloudX-proxy. The cloudX-proxy takes care of starting the instance should it be stopped. Also, it pushes an ssh key to the instance to allow you to connect to it. Given that the proxy uses AWS Systems Manager to initiate the connection, you don't need to open any inbound ports in the security group of the instance.
|
25
|
+
|
26
|
+
## Architecture
|
27
|
+
|
28
|
+
### SSH Configuration Structure
|
29
|
+
|
30
|
+
CloudX-proxy uses a hierarchical three-tier SSH configuration approach:
|
31
|
+
|
32
|
+
1. **Generic Configuration (cloudx-*)**: Common settings for all environments
|
33
|
+
- User settings (ec2-user)
|
34
|
+
- TCP keepalive
|
35
|
+
- SSH multiplexing configuration
|
36
|
+
|
37
|
+
2. **Environment Configuration (cloudx-{env}-*)**: Environment-specific settings
|
38
|
+
- Authentication configuration (identity settings)
|
39
|
+
- ProxyCommand with environment-specific parameters
|
40
|
+
|
41
|
+
3. **Host Configuration (cloudx-{env}-hostname)**: Instance-specific settings
|
42
|
+
- HostName (instance ID)
|
43
|
+
- Optional overrides for incompatible settings
|
44
|
+
|
45
|
+
This tiered approach minimizes configuration duplication and makes it clear which settings apply broadly and which are specific to an environment or host.
|
46
|
+
|
47
|
+
### Security Model
|
48
|
+
|
49
|
+
The primary security boundary is enforced through AWS IAM via Systems Manager (SSM) and EC2 Instance Connect:
|
50
|
+
- Only authenticated AWS users with appropriate IAM permissions can establish SSM sessions
|
51
|
+
- EC2 Instance Connect allows temporary injection of SSH public keys
|
52
|
+
- No inbound SSH ports need to be exposed, as all connections are through AWS SSM's secure tunneling
|
53
|
+
- All connection attempts and key pushes are logged in AWS CloudTrail
|
54
|
+
|
55
|
+
## Operating Modes
|
56
|
+
|
57
|
+
CloudX-proxy runs in either of two modes:
|
58
|
+
|
59
|
+
- setup
|
60
|
+
- connect
|
61
|
+
|
62
|
+
### Setup Mode
|
63
|
+
|
64
|
+
With setup mode, the config files and directories for the connect mode are established. The setup mode is typically only run once per CloudX-instance. When running setup, the user is asked for their AWS AK/SK of the IAM user created as CloudX-user. This will be stored in ~/.aws/credentials. Alternatively the user can store this data themselves in ~/.aws/credentials. The profile name is 'vscode' by default, but can be overruled with the --profile option. When multiple instances are used, it is recommended to use a profile cloudx-env-user where env is the environment and user the username.
|
65
|
+
|
66
|
+
By default an ssh key named vscode will be used - and created if not available in the configuration directory (~/.ssh/vscode). The user can specify a different key with the --ssh-key option.
|
67
|
+
|
68
|
+
A 'Host cloudx-{env}-*' entry will be created in the ~/.ssh/vscode/config file for each environment. A user can potentially have multiple instances in a single environment as well as multiple environments.
|
69
|
+
|
70
|
+
#### Setup Options
|
71
|
+
|
72
|
+
- **--profile**: AWS profile to use (default: 'vscode')
|
73
|
+
- **--ssh-key**: SSH key name to use (default: 'vscode')
|
74
|
+
- **--ssh-config**: SSH config file to use (default: ~/.ssh/vscode/config)
|
75
|
+
- **--aws-env**: AWS environment directory (default: ~/.aws)
|
76
|
+
- **--1password**: Use 1Password SSH agent for SSH authentication
|
77
|
+
- **--instance**: EC2 instance ID to set up connection for
|
78
|
+
- **--hostname**: Hostname to use for SSH configuration (without this, hostname will be generated from instance ID or prompted)
|
79
|
+
- **--yes**: Non-interactive mode, use default values for all prompts
|
80
|
+
|
81
|
+
### Connect Mode
|
82
|
+
|
83
|
+
In connect mode, the actual connection is established. This is not used by the user directly, but in the ssh configuration as a proxy command. The command is run using uvx.
|
84
|
+
|
85
|
+
### 1Password Integration
|
86
|
+
|
87
|
+
When the --1password option is used:
|
88
|
+
1. CloudX-proxy first checks if any SSH key with the specified name exists in any 1Password vault
|
89
|
+
2. If the key exists, it's reused (the public key is exported to the filesystem)
|
90
|
+
3. If the key doesn't exist, the user selects which vault to store the newly created key in
|
91
|
+
4. The SSH configuration uses the 1Password SSH agent socket and the public key
|
92
|
+
|
93
|
+
### Automation Support
|
94
|
+
|
95
|
+
The --yes option enables non-interactive mode for use in scripts and automated processes:
|
96
|
+
- All prompts use default values
|
97
|
+
- Hostname is automatically generated based on instance ID
|
98
|
+
- AWS profile must already be configured
|
99
|
+
- EC2 instance ID must be provided with the --instance option
|
100
|
+
|
101
|
+
## Future Considerations
|
102
|
+
|
103
|
+
[Potential Breaking Change] Replacing all default values from 'vscode' to 'cloudx' would align the naming but would be a breaking change. This would affect default profile names, SSH key names, and configuration directories.
|
@@ -1,3 +1,12 @@
|
|
1
|
+
## [0.4.8](https://github.com/easytocloud/cloudX-proxy/compare/v0.4.7...v0.4.8) (2025-03-07)
|
2
|
+
|
3
|
+
## [0.4.7](https://github.com/easytocloud/cloudX-proxy/compare/v0.4.6...v0.4.7) (2025-03-07)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* added --hostname ([0fb0aa4](https://github.com/easytocloud/cloudX-proxy/commit/0fb0aa4bfa17d58eee958d6e5ade9d9c14a11a6c))
|
9
|
+
|
1
10
|
## [0.4.6](https://github.com/easytocloud/cloudX-proxy/compare/v0.4.5...v0.4.6) (2025-03-07)
|
2
11
|
|
3
12
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.8
|
4
4
|
Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
|
5
5
|
Author-email: easytocloud <info@easytocloud.com>
|
6
6
|
License: MIT License
|
@@ -119,6 +119,9 @@ uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
|
119
119
|
# Setup with 1Password integration
|
120
120
|
uvx cloudx-proxy setup --1password
|
121
121
|
|
122
|
+
# Setup with non-interactive automation
|
123
|
+
uvx cloudx-proxy setup --instance i-0123456789abcdef0 --hostname myserver --yes
|
124
|
+
|
122
125
|
# Combine options
|
123
126
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
124
127
|
```
|
@@ -274,6 +277,9 @@ Options:
|
|
274
277
|
- `--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.
|
275
278
|
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
276
279
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
280
|
+
- `--instance` (optional): EC2 instance ID to set up connection for. If provided, skips the instance ID prompt.
|
281
|
+
- `--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.
|
282
|
+
- `--yes` (flag): Non-interactive mode, use default values for all prompts. Requires sufficient defaults or explicit parameters for all required values.
|
277
283
|
|
278
284
|
Example usage:
|
279
285
|
```bash
|
@@ -69,6 +69,9 @@ uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
|
69
69
|
# Setup with 1Password integration
|
70
70
|
uvx cloudx-proxy setup --1password
|
71
71
|
|
72
|
+
# Setup with non-interactive automation
|
73
|
+
uvx cloudx-proxy setup --instance i-0123456789abcdef0 --hostname myserver --yes
|
74
|
+
|
72
75
|
# Combine options
|
73
76
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
74
77
|
```
|
@@ -224,6 +227,9 @@ Options:
|
|
224
227
|
- `--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.
|
225
228
|
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
226
229
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
230
|
+
- `--instance` (optional): EC2 instance ID to set up connection for. If provided, skips the instance ID prompt.
|
231
|
+
- `--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.
|
232
|
+
- `--yes` (flag): Non-interactive mode, use default values for all prompts. Requires sufficient defaults or explicit parameters for all required values.
|
227
233
|
|
228
234
|
Example usage:
|
229
235
|
```bash
|
@@ -56,9 +56,10 @@ def connect(instance_id: str, port: int, profile: str, region: str, ssh_key: str
|
|
56
56
|
@click.option('--aws-env', help='AWS environment directory (default: ~/.aws, use name of directory in ~/.aws/aws-envs/)')
|
57
57
|
@click.option('--1password', 'use_1password', is_flag=True, help='Use 1Password SSH agent for SSH authentication')
|
58
58
|
@click.option('--instance', help='EC2 instance ID to set up connection for')
|
59
|
+
@click.option('--hostname', help='Hostname to use for SSH configuration')
|
59
60
|
@click.option('--yes', 'non_interactive', is_flag=True, help='Non-interactive mode, use default values for all prompts')
|
60
61
|
def setup(profile: str, ssh_key: str, ssh_config: str, aws_env: str, use_1password: bool,
|
61
|
-
instance: str, non_interactive: bool):
|
62
|
+
instance: str, hostname: str, non_interactive: bool):
|
62
63
|
"""Set up AWS profile, SSH keys, and configuration for CloudX.
|
63
64
|
|
64
65
|
This command will:
|
@@ -72,7 +73,7 @@ def setup(profile: str, ssh_key: str, ssh_config: str, aws_env: str, use_1passwo
|
|
72
73
|
cloudx-proxy setup --profile myprofile --ssh-key mykey
|
73
74
|
cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
74
75
|
cloudx-proxy setup --1password
|
75
|
-
cloudx-proxy setup --instance i-0123456789abcdef0 --yes
|
76
|
+
cloudx-proxy setup --instance i-0123456789abcdef0 --hostname myserver --yes
|
76
77
|
"""
|
77
78
|
try:
|
78
79
|
setup = CloudXSetup(
|
@@ -101,9 +102,14 @@ def setup(profile: str, ssh_key: str, ssh_config: str, aws_env: str, use_1passwo
|
|
101
102
|
# Use the --instance parameter if provided, otherwise prompt
|
102
103
|
instance_id = instance or setup.prompt("Enter EC2 instance ID (e.g., i-0123456789abcdef0)")
|
103
104
|
|
104
|
-
#
|
105
|
-
|
106
|
-
|
105
|
+
# Use --hostname if provided, otherwise generate default based on instance ID in non-interactive mode
|
106
|
+
if hostname:
|
107
|
+
# If hostname is explicitly provided, use it directly
|
108
|
+
setup.print_status(f"Using provided hostname: {hostname}", True, 2)
|
109
|
+
else:
|
110
|
+
# Generate default hostname based on instance ID for non-interactive mode
|
111
|
+
hostname_default = f"instance-{instance_id[-7:]}" if non_interactive else None
|
112
|
+
hostname = setup.prompt("Enter hostname for the instance", hostname_default)
|
107
113
|
|
108
114
|
# Set up SSH config
|
109
115
|
if not setup.setup_ssh_config(cloudx_env, instance_id, hostname):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.8
|
4
4
|
Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
|
5
5
|
Author-email: easytocloud <info@easytocloud.com>
|
6
6
|
License: MIT License
|
@@ -119,6 +119,9 @@ uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
|
119
119
|
# Setup with 1Password integration
|
120
120
|
uvx cloudx-proxy setup --1password
|
121
121
|
|
122
|
+
# Setup with non-interactive automation
|
123
|
+
uvx cloudx-proxy setup --instance i-0123456789abcdef0 --hostname myserver --yes
|
124
|
+
|
122
125
|
# Combine options
|
123
126
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
124
127
|
```
|
@@ -274,6 +277,9 @@ Options:
|
|
274
277
|
- `--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.
|
275
278
|
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
276
279
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
280
|
+
- `--instance` (optional): EC2 instance ID to set up connection for. If provided, skips the instance ID prompt.
|
281
|
+
- `--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.
|
282
|
+
- `--yes` (flag): Non-interactive mode, use default values for all prompts. Requires sufficient defaults or explicit parameters for all required values.
|
277
283
|
|
278
284
|
Example usage:
|
279
285
|
```bash
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|