Search…
Deploying Cased Shell on Heroku
How to get Cased Shell up and running in minutes on Heroku.

Overview

The following serves as a step-by-step guide on how to create a Heroku application that contains Cased Shell, a SSH daemon that authenticates against Heroku, and the Heroku CLI. The result allows you to use the Heroku CLI in a secure, auditable fashion.

Deployment

  1. 1.
    Create a new Heroku app.
  2. 2.
    Create a new Cased Shell instance with a matching hostname. On the Settings tab, enable Certificate Authentication.
  3. 3.
    Fork and clone this repo.
  4. 4.
    Run the following commands to deploy Cased Shell to Heroku:
1
export APP_NAME=your-heroku-app-name
2
3
heroku git:remote -a $APP_NAME
4
heroku stack:set container
5
heroku labs:enable runtime-dyno-metadata
6
7
heroku config:add CASED_SHELL_HOSTNAME=$APP_NAME.herokuapp.com
8
heroku config:add CASED_SHELL_SECRET=<obtain from your Shell Instance's Settings tab on https://app.cased.com/>
9
10
# Create a new Heroku OAuth client. Used to authenticate and authorize connections to the Heroku CLI.
11
heroku plugins:install heroku-cli-oauth
12
heroku clients:create "$APP_NAME.herokuapp.com" https://$APP_NAME.herokuapp.com/oauth/auth/callback
13
heroku config:add HEROKU_OAUTH_ID=<set to `HEROKU_OAUTH_ID` from command output above>
14
heroku config:add HEROKU_OAUTH_SECRET=<set to `HEROKU_OAUTH_SECRET` from command output above>
15
heroku config:add COOKIE_SECRET=`openssl rand -hex 32`
16
heroku config:add COOKIE_ENCRYPT=`openssl rand -hex 16`
17
18
git push heroku main
Copied!
5. Open https://$APP_NAME.herokuapp.com in your browser and login.

Configuring your shell

To change the prompts displayed by your shell, edit jump.yaml, commit, and push to Heroku. See https://github.com/cased/jump#writing-queries for documentation covering the format of jump.yaml.