-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow defining start/stop command setting per connection #3
Comments
Yes I have a problem like this as well. I have both RDP and SSH connections, and I use "ForceCommand docker start --attach --interactive " in the sshd_config file to start the container. This allows both Guacamole and normal SSH clients to use the containers. So I only need guacamole-trigger for the RDP connections. What I'm currently doing is using hostnames like "cnt1-ssh" and "cnt2-rdp" then ignoring the START_COMMAND (and STOP_COMMAND for what it matters) if the hostname ends in "-ssh". The issue with this is that my containers aren't in the same docker network as the guacamole, for security reasons. Therefore using the hostname means that I also need a DNS as well in the same network as the guacamole to resolve the hostnames to IP. It would be so much easier if guacamole-trigger also exported the profile name so the START_COMMAND can see it rather than just hostname and guacamoleUsername.. I could then easily use the container name as the name of the profile and filter on that and leave the hostname with the correct IP addresses, and no longer need a local DNS |
Yes. I agree that would be nice. I am also looking for a way to specify It might be possible to pass all protocol option, and connection name to the script. hopefully this include made up protocol options. But have to lookup how that works with different authentication plugins. another thing to consider is the stop command. now it checks if multiple people/connections logged in into the same machine. Also if multiple connections start/stop the same host. but have different options. might be hard to debug. But about your use case.If i understand you correctly:
What is the problem with starting the container with both ssh and RDP connection? Do you use tools like kubernetes, docker-compose docker swarm? |
Sorry I wasn't really clear in my use case. I'm using only docker with bash script for the orchestration. The reason for this are
The containers for guacamole, gaucd and postgresql are all in a service network and the guacamole is only exposed to the users behind a reverse proxy. This service network was created with
Now imagine if the gateway for the network "service" is 172.19.0.1, basically what I'm doing when I add a user to the platform is
and the user after that
The ssh and rdp containers are the same.. The ssh container is used with the openssh config as
In the host machines configuration so the user have real accounts on the local machine. As ssh/rdp to isolated containers are the only means supplied to the user to connect to the machine this is not a problem , and the SSH containers are destroyed by the use of the TMOUT bash environment variable to kill the shell after an idle time. Each user is isolated in their own network for security reasons and with a little iptables magic on the DOCKER_USER chain each user can only see a dedicated reverse proxy exposing only what I want them to see. As the containers user1-* and user2-* are not in the "service" network I expose their RDP port to the guacd on the gateway of the "service" network, with port number incrementing from 3389. The guacamole and gaucd containers therefore can't use docker hostname resolution to find the user machines IP addresses. Now the issue is that guacamole-trigger only passes the "hostname" variable to the START_COMMAND script.. So the hostname must contain an indication to the START_COMMAND script of what container to start. Here "user1-rdp" or "user2-rdp". For me the hostnames all point to the "service" network gateway of "172.19.0.1" but with different ports.. At the moment I'm using dnsmasq with a hosts file
So that the START_COMMAND script can have a hostname that determines the container to start and the guacamole and guacd can do a DNS lookup from these hostnames and always get the service network gateway. If guacamole-trigger was modified to also pass the "name" field of the connection profile, I could keep the hostname as the correct IP address and choose the container to start based on the "name" field and so get rid of the dnsmasq server. PS: Yes I could use START_COMMAND to start the SSH container as well and modify the "ForceCommand" of openssh to run "docker exec -it .... $USER-ssh bash" instead, but this would mean that normal ssh is no longer possible. |
With latest version that i also mentions in #5. For your use case |
Now gucamole-trigger settings apply to all connections.
But you might want only use this plugin on some connections.
Or have different command for different connections.
This is easy to do for default authentication via user-mappings.xml.
But have to find out you can make it so you can also set it via mysql/posgress etc authentication
The text was updated successfully, but these errors were encountered: