GithubHelp home page GithubHelp logo

blucobalt / guacamole-keycloak Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cynthia-rempel/guacamole-compose

0.0 0.0 0.0 656 KB

Docker compose project with keycloak and guacamole

License: BSD 2-Clause "Simplified" License

Shell 100.00%

guacamole-keycloak's Introduction

guacamole-compose

Docker compose project with oeycloak and guacamole

To get started with no configurations, run

./setup.sh

docker-compose up

Requires name resolution to work, so added the following entry to /etc/hosts:

127.0.1.1 guacamole.rfa.net keycloak.rfa.net

Trust the certs

Please add init/guacamole.crt and init/keycloak.crt to your trusted certificates.

Create the guacadmin user in keycloak

# Add the guacadmin user to keycloak with an email
docker exec guacamole-compose_keycloak_1 \
  /opt/jboss/keycloak/bin/kcadm.sh \
  create users \
  -s username=guacadmin@guacadmin \
  -s enabled=true \
  -s email=guacadmin@guacadmin \
  -r master \
  --server https://keycloak.rfa.net:8443/auth \
  --realm master \
  --user admin \
  --password admin

# Set the password
docker exec guacamole-compose_keycloak_1 \
  /opt/jboss/keycloak/bin/kcadm.sh \
  set-password \
  --username guacadmin@guacadmin \
  --new-password guacadmin \
  -r master \
  --server https://keycloak.rfa.net:8443/auth \
  --realm master \
  --user admin \
  --password admin

# Make guacadmin an admin
docker exec guacamole-compose_keycloak_1 \
  /opt/jboss/keycloak/bin/kcadm.sh \
  add-roles \
  --uusername guacadmin@guacadmin \
  --rolename admin \
  -r master \
  --server https://keycloak.rfa.net:8443/auth \
  --realm master \
  --user admin \
  --password admin

Add the guacamole-client

config/keycloak/guacamole-client.json

docker exec guacamole-compose_keycloak_1 \
  /opt/jboss/keycloak/bin/kcadm.sh \
  create clients \
  --file guacamole-client.json \
  -r master \
  --server https://keycloak.rfa.net:8443/auth \
  --realm master \
  --user admin \
  --password admin

TODO: add "read-only" role for keycloak

In current configuration all qery and read-roles.

TODO: make "read-only" role a default role in keycloak

To customize:

Find all instances of rfa.net, and replace them to you're liking

grep -R rfa.net | grep -v Binary

Please note: haproxy sni requires uniq certs for each backend so you'll need separate certs for guacamole and keycloak

To use

Then browsed to:

https://guacamole.rfa.net:8443/guacamole

https://keycloak.rfa.net:8443

To add users


Guacamole uses keycloak for identity, and uses postgres for authorization.

Guacamole's OpenID Connect ... removing the need for users to log into Guacamole
directly. This module must be layered on top of ... that provide connection
information ... database authentication ....

Because of this, users have to be added to both keycloak and postgres.

Reference: https://guacamole.apache.org/doc/gug/openid-auth.html


Adding a user to Postgres

To add users to postgres, add them through the guacamole application.

https://guacamole.rfa.net:8443/guacamole

username: guacadmin@guacadmin

password: guacadmin


Upper right corner, username, settings

Upper right corner, username, settings


Middle top, users, left middle, new user

Middle top, users, left middle, new user


Make sure the username is in email format, make appropriate selections

Make sure the username is in email format, make appropriate selections


Scroll down, continuing to make appropriate selections, then click save

Scroll down, continuing to make appropriate selections, then click save

NOTE: if a connection is under a subgroup, both the subgroup and connection must be checked for the user to create a connection.


Adding user to Keycloak

https://keycloak.rfa.net:8443

Administration Console


Scroll down, click users, view all users, add user

Scroll down, click users, view all users, add user


Make the keycloak user's email match the username and email of guacamole user

Make the keycloak user's email match the username and email of guacamole user

NOTE: The email of the keycloak user must match the username and email of the guacamole user.


Set the password

Set the password

Why doesn't keycloak let you set the password when you create the user ?!?


Adding Connections


Upper right corner, username, settings

Upper right corner, username, settings


Middle top, connections, left, new connection

Middle top, connections, left, new connection


Make an SSH connection

  • Name: some-name

  • Location: the-group

  • Protocol: SSH

  • Max number of connections: 2

  • Max number of connections per user: 2

Reference: https://jasoncoltrin.com/2017/10/04/setup-guacamole-remote-desktop-gateway-on-ubuntu-with-one-script/

Protocol SSH


Set the host

Scroll Down, under the Network Section set the host

Set the host and port

**CLICK SAVE **

Where to send users when you want to tell them RTFM

https://guacamole.apache.org/doc/gug/using-guacamole.html

To uninstall

docker-compose down
./teardown.sh

Reference:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.