Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
8ae508f
Moving SSHArc changes from private repo to the public repo
vthiebaut10 Sep 29, 2021
75aab5c
Fix linter exclusions
vthiebaut10 Sep 29, 2021
74c35d7
Added license header to constants file
vthiebaut10 Sep 29, 2021
af62216
Fixed the local user parameter options for the config command
vthiebaut10 Sep 30, 2021
12e1c15
Changed --local-user-name to --local-user for the config command
vthiebaut10 Sep 30, 2021
5c9170c
Host for arc servers on config is not rg-vm instead of just vm
vthiebaut10 Oct 7, 2021
2601ea2
Merge branch 'Azure:main' into ssharc
vthiebaut10 Oct 11, 2021
67c61e1
Merge origin
vthiebaut10 Oct 15, 2021
1eb2100
Add HostName to arc config files
vthiebaut10 Oct 17, 2021
53e4cd2
Fixed config tests
vthiebaut10 Oct 18, 2021
0c08a46
Include OS and architecture in the proxy filename
vthiebaut10 Oct 20, 2021
7c99a1e
Stop throwing exception immediately if user not authorized to get vm …
vthiebaut10 Oct 21, 2021
b89a631
Merge pull request #8 from vthiebaut10/ssharc-exceptionhandling
vthiebaut10 Nov 1, 2021
be6ffb2
addind hybridconnectivity
vthiebaut10 Nov 2, 2021
be11b71
Change hybrid connectivity SDK to be subscription bound
vthiebaut10 Nov 3, 2021
adb6237
Adjust request for access details
vthiebaut10 Nov 5, 2021
5411e7e
Using the latest stable version of connected machines sdk
vthiebaut10 Nov 5, 2021
2029802
Merge pull request #9 from vthiebaut10/ssharc-v2-hybridconnectivity
vthiebaut10 Nov 5, 2021
61d7a66
add a exception handling to requesting relay info
vthiebaut10 Nov 5, 2021
d4d8b53
Initial changes to clean up credentials on ssh arc
vthiebaut10 Nov 9, 2021
337a5ce
Fixing a few bugs
vthiebaut10 Nov 10, 2021
d317d35
clean-up credentials
vthiebaut10 Nov 11, 2021
206ac44
config for arc no longer create temp folder for relay if there isn't …
vthiebaut10 Nov 11, 2021
5ba2fb6
Clean up, resource type param, and tests
vthiebaut10 Nov 12, 2021
32273d3
Add ssharc telemetry
vthiebaut10 Nov 12, 2021
f814e06
Style fixes
vthiebaut10 Nov 12, 2021
cac0a79
Changed some Telemetry data points names
vthiebaut10 Nov 16, 2021
426971a
Debug logs with OS and architecture
vthiebaut10 Nov 16, 2021
5e3977e
Address comments
vthiebaut10 Nov 16, 2021
ec0900d
Merge pull request #13 from vthiebaut10/ssharc-v2-cleanup-removeid-te…
vthiebaut10 Nov 16, 2021
02bbf16
remove print statement
vthiebaut10 Nov 16, 2021
3f42be5
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
vthiebaut10 Nov 16, 2021
0479a62
fix order of args
vthiebaut10 Nov 17, 2021
bbf28ab
Fix telemetry. Collect strings instead of floats
vthiebaut10 Nov 30, 2021
26d3437
Revert "Fix telemetry. Collect strings instead of floats"
vthiebaut10 Dec 2, 2021
eb7c022
Make --local-user mandatory for windows
vthiebaut10 Dec 10, 2021
a3b55a5
local-user mandatory for windows, check resources
vthiebaut10 Dec 10, 2021
ba9d01a
az ssh config always stores relay on /az_ssh_config/myrg-myvm
vthiebaut10 Dec 10, 2021
c9a7e14
Add new parameter --arc-proxy-folder
vthiebaut10 Dec 14, 2021
b5d11ee
Add quotation marks around paths in config file
vthiebaut10 Dec 14, 2021
a96356c
Ignore capitalization on resource type
vthiebaut10 Dec 14, 2021
7e578e5
Sync validity of relay information with certificate validity
vthiebaut10 Dec 14, 2021
9cff8a1
Style fixes
vthiebaut10 Dec 14, 2021
44a2014
Fixes based on review comments
vthiebaut10 Dec 15, 2021
c767210
Change the way we print the lifetime of the relay and certificate
vthiebaut10 Dec 15, 2021
b3fddde
Style check
vthiebaut10 Dec 15, 2021
a96c59f
Fix error with IP as parameter
vthiebaut10 Dec 15, 2021
1b7e3ea
datetime.fromisoformat() fails for python lower than 3.7
vthiebaut10 Dec 15, 2021
679cd1e
Changes based on review comments
vthiebaut10 Dec 16, 2021
cd3829a
Fix config console messages
vthiebaut10 Dec 16, 2021
976dc87
Sync
vthiebaut10 Dec 16, 2021
0e0268b
Revert "Sync"
vthiebaut10 Dec 16, 2021
dfee170
Merge remote-tracking branch 'upstream/main' into ssharc
vthiebaut10 Dec 16, 2021
69c8f98
Fix a few style errors
vthiebaut10 Dec 16, 2021
19a621a
Use constant for validity
vthiebaut10 Dec 17, 2021
01fdf2b
Change message for resource not found error
vthiebaut10 Dec 17, 2021
b01b728
Change format of expiration date from military time to standard time
vthiebaut10 Dec 17, 2021
63c89db
Merge branch 'Azure:main' into ssharc
vthiebaut10 Dec 20, 2021
b6e4cb6
Merge pull request #17 from vthiebaut10/ssharc-v3
vthiebaut10 Dec 20, 2021
0fd3f30
Style changes
vthiebaut10 Dec 20, 2021
80c8ab8
fix unit tests
vthiebaut10 Dec 20, 2021
771a11d
1 line instead of 2
vthiebaut10 Dec 20, 2021
1d733b4
Merge branch 'Azure:main' into ssharc
vthiebaut10 Feb 22, 2022
c3bbe60
Merge upstream
vthiebaut10 Mar 21, 2022
5507554
Initial enhancements for public preview
vthiebaut10 Mar 23, 2022
9115399
Avoid failures caused by ips with unsupported characters
vthiebaut10 Mar 23, 2022
794d403
Fix style and tests
vthiebaut10 Mar 24, 2022
878ce73
fix history
vthiebaut10 Mar 24, 2022
a5469e1
Change tests
vthiebaut10 Mar 24, 2022
d81ed27
Fix one error message
vthiebaut10 Mar 24, 2022
5f37ef7
Merge pull request #24 from vthiebaut10/public_preview
vthiebaut10 Mar 24, 2022
ac6f575
Merge branch 'Azure:main' into ssharc
vthiebaut10 Mar 24, 2022
e61dc1c
fix history
vthiebaut10 Mar 24, 2022
ac4a0bf
Address review comments
vthiebaut10 Mar 25, 2022
412af5e
Fix test failures
vthiebaut10 Mar 25, 2022
5b5007e
Change error message for endpoint creation
vthiebaut10 Mar 25, 2022
e4029ce
Change cleanup logic
vthiebaut10 Mar 28, 2022
9a5daa0
A few final improvements
vthiebaut10 Mar 28, 2022
b9f1bba
Fix cleanup logic
vthiebaut10 Mar 30, 2022
c27f6e7
Address review comments. Change ACL of generated files, search for pr…
vthiebaut10 Apr 5, 2022
7acea38
Catch stderr
vthiebaut10 Apr 7, 2022
2a935e7
Improve help, remove explicit exception telemetry, a few changes
vthiebaut10 Apr 8, 2022
0756512
Address review comments
vthiebaut10 Apr 8, 2022
5125936
Change ssh not found error message
vthiebaut10 Apr 8, 2022
f63ec2c
Fix help and add localuser name to ip entry
vthiebaut10 Apr 8, 2022
abd4a28
help improvements
vthiebaut10 Apr 8, 2022
fb61c79
Add ssh not found error recommendation to constants
vthiebaut10 Apr 8, 2022
24bdef4
Make sure we capture stderr only when log is not supposed to be displyed
vthiebaut10 Apr 8, 2022
39be94f
update tests, help, and style
vthiebaut10 Apr 11, 2022
e224c70
Merge pull request #25 from vthiebaut10/ssharc-proxyerror
vthiebaut10 Apr 11, 2022
f7769b8
Fix linter tests
vthiebaut10 Apr 11, 2022
8c130f2
Improve some error messages
vthiebaut10 Apr 12, 2022
72f1668
Address review comments
vthiebaut10 Apr 13, 2022
a29b56c
Fix one error message
vthiebaut10 Apr 13, 2022
dd62ee4
Fix help file
vthiebaut10 Apr 13, 2022
546fa01
Add new telemetry event: TargetResourceType
vthiebaut10 Apr 13, 2022
b61b590
Fix style error
vthiebaut10 Apr 13, 2022
2692e78
Add changes to HISTORY file
vthiebaut10 Apr 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
config for arc no longer create temp folder for relay if there isn't …
…a cert and a priv key
  • Loading branch information
vthiebaut10 committed Nov 11, 2021
commit 206ac44ff778dc396400af9e2accdced571a208e
16 changes: 7 additions & 9 deletions src/ssh/azext_ssh/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def ssh_vm(cmd, resource_group_name=None, vm_name=None, resource_id=None, ssh_ip
_assert_args(resource_group_name, vm_name, ssh_ip, resource_id, cert_file, local_user)
credentials_folder = None
do_ssh_op = _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, None, None,
ssh_client_path, ssh_args, delete_credentials)
ssh_client_path, ssh_args, delete_credentials, credentials_folder)
do_ssh_op(cmd, ssh_ip, public_key_file, private_key_file, local_user,
cert_file, port, use_private_ip, credentials_folder)

Expand All @@ -49,10 +49,7 @@ def ssh_config(cmd, config_path, resource_group_name=None, vm_name=None, ssh_ip=
if (public_key_file or private_key_file) and credentials_folder:
raise azclierror.ArgumentUsageError("--keys-destination-folder can't be used in conjunction with "
"--public-key-file/-p or --private-key-file/-i.")

do_ssh_op = _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, config_path, overwrite,
None, None, None)


# Default credential location
if not credentials_folder:
config_folder = os.path.dirname(config_path)
Expand All @@ -67,6 +64,9 @@ def ssh_config(cmd, config_path, resource_group_name=None, vm_name=None, ssh_ip=
folder_name = resource_info['resource_group'] + "-" + resource_info['resource_name']

credentials_folder = os.path.join(config_folder, os.path.join("az_ssh_config", folder_name))

do_ssh_op = _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, config_path, overwrite,
None, None, False, credentials_folder)
do_ssh_op(cmd, ssh_ip, public_key_file, private_key_file, local_user,
cert_file, port, use_private_ip, credentials_folder)

Expand Down Expand Up @@ -137,8 +137,6 @@ def _do_ssh_op(cmd, ssh_ip, public_key_file, private_key_file, username,
private_key_file,
credentials_folder)
cert_file, username = _get_and_write_certificate(cmd, public_key_file, None)

print(cert_file)

op_call(relay_info, proxy_path, vm_name, ssh_ip, username, cert_file, private_key_file, port, is_arc, delete_keys, delete_cert, public_key_file)

Expand Down Expand Up @@ -378,7 +376,7 @@ def _arc_list_access_details(cmd, resource_group, vm_name):


def _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, config_path, overwrite,
ssh_client_path, ssh_args, delete_credentials):
ssh_client_path, ssh_args, delete_credentials, credentials_folder):

# If the user provides an IP address the target will be treated as an Azure VM even if it is an
# Arc Server. Which just means that the Connectivity Proxy won't be used to establish connection.
Expand Down Expand Up @@ -419,7 +417,7 @@ def _decide_op_call(cmd, resource_group_name, vm_name, resource_id, ssh_ip, conf

if config_path:
op_call = functools.partial(ssh_utils.write_ssh_config, config_path=config_path, overwrite=overwrite,
resource_group=resource_group_name)
resource_group=resource_group_name, credentials_folder=credentials_folder)
else:
op_call = functools.partial(ssh_utils.start_ssh_connection, ssh_client_path=ssh_client_path, ssh_args=ssh_args,
delete_credentials=delete_credentials)
Expand Down
8 changes: 5 additions & 3 deletions src/ssh/azext_ssh/ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_ssh_cert_validity(cert_file):

def write_ssh_config(relay_info, proxy_path, vm_name, ip, username,
cert_file, private_key_file, port, is_arc, delete_keys, delete_cert, _,
config_path, overwrite, resource_group):
config_path, overwrite, resource_group, credentials_folder):

common_lines = []
common_lines.append("\tUser " + username)
Expand All @@ -148,7 +148,10 @@ def write_ssh_config(relay_info, proxy_path, vm_name, ip, username,
elif private_key_file:
relay_info_dir = os.path.dirname(private_key_file)
else:
relay_info_dir = tempfile.mkdtemp(prefix="ssharcrelayinfo")
# create the custom folder
relay_info_dir = credentials_folder
if not os.path.isdir(relay_info_dir):
os.makedirs(credentials_folder)

if ip:
relay_info_filename = ip + "-relay_info"
Expand Down Expand Up @@ -266,7 +269,6 @@ def _build_args(cert_file, private_key_file, port):

def _do_cleanup(delete_keys, delete_cert, cert_file, private_key, public_key, log_file=None, wait=False):
if log_file:
print("reading log")
t0 = time.time()
match = False
while (time.time() - t0) < const.CLEANUP_TOTAL_TIME_LIMIT_IN_SECONDS and not match:
Expand Down
2 changes: 1 addition & 1 deletion src/ssh/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import setup, find_packages

VERSION = "0.1.9"
VERSION = "0.2.1"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down