aker-gateway / Aker

SSH bastion/jump host/jumpserver
Other
566 stars 71 forks source link

[RFE] Base connections off of host object #31

Closed faux-eccles closed 6 years ago

faux-eccles commented 7 years ago

Currently when list_allowed() is called on line 70 of aker.py, a list of strings that contain the host names are returned.

I suggest that a list of host objects are returned instead. This will allow for host based configuration when listed.

psudo representation of some of the proposed host class properties


class Host(object):
   # Hostname used when connecting
   self.hostname

   # Canonical name for the list
   self.name                              

   # Type of private key: encrypted_direct, direct, encrypted_path, path.  
   #        Where direct has the value of the private key in memory 
   self.private_key_type           

   # Depending on key type should either be a path to local file or the value of the private key  
   self.private_key_value

   # If the key is encrypted the phrase used to decrypt the key
   self.private_key_password

In the list of available hosts in tui, I suggest changing the display to:

<canonical name> (<hostname>)

so if I had a host with "name = NAS" and "hostname = nas.internal.example.com", it would be displayed as so:

nas (nas.internal.example.com)

This would require some refactoring to handle the hosts as object and not strings but would allow for more complex per host configuration if defined as additional properties via ldap or other authority

This might help when dealing with #29 as it suggests a format of what properties of a host would need to be stored

anazmy commented 7 years ago

An excellent point, specially now when I'm evaluating the caching mechanism to be used , thanks .

anazmy commented 7 years ago

This host object idea is partially applied now , yet I still think it needs to be revisited again later, will keep this issue opened

faux-eccles commented 7 years ago

This is further worked upon in #35

anazmy commented 6 years ago

handled in #42