diff --git a/README.md b/README.md index ee50188..688038c 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,17 @@ Gatekeeper provides basic authentication, authorization and notifier (default is Checkout usage of gatekeeper [here](https://github.com/agrim123/gatekeeper-cli). +A sample run of gatekeeper +```bash +$ gatekeeper run-plan service1 shell +[SUCCESS] | Authenticated as agrim +[SUCCESS] | Authorized `agrim` to perform `service1 shell` +[INFO] | Executing plan: service1 shell +[INFO] | Spawning shell for @ +[INFO] 🔐 | Reading private key + +``` + ### Future prospects Gatekeeper is not limited to only providing shell access, it can used to run deploy commands, as a proxy intermediary, currently the config is entirely file based but can be extended to a database for easy updates and more observability, can be used to run restricted commands on the local system which otherwise unprivileged user cannot run and many more. diff --git a/internal/pkg/services/remote/remote.go b/internal/pkg/services/remote/remote.go index 055af58..9054fab 100644 --- a/internal/pkg/services/remote/remote.go +++ b/internal/pkg/services/remote/remote.go @@ -113,6 +113,7 @@ func (r *Remote) SpawnShell() error { // Ctrl-C exists the shell signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func(session *ssh.Session) { + logger.Info("Started shell. Press %s to exit", logger.Bold("Ctrl+C")) <-c logger.Info("Ctrl+C pressed. Exiting remote shell") session.Signal(ssh.SIGTERM)