-
Notifications
You must be signed in to change notification settings - Fork 30
New Feature: Two Man Realms #68
base: master
Are you sure you want to change the base?
Changes from all commits
76a1f7e
8e3a92e
1c64f9b
78e9fe2
558f443
0e0648a
2924e62
e132a11
8c5bd38
1c35692
c386689
7c06967
5d915e6
c9724fa
14bfca8
11d3e07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # This dockerfile builds an Ubuntu container with Keybase installed | ||
| FROM ubuntu:18.04 | ||
|
|
||
| # Dependencies | ||
| RUN apt-get -qq update && apt-get -qq install curl software-properties-common ca-certificates gnupg -y | ||
| RUN useradd -ms /bin/bash keybase | ||
| USER keybase | ||
| WORKDIR /home/keybase | ||
|
|
||
| # Download and verify the deb | ||
| RUN curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb | ||
| RUN curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb.sig | ||
| # Import our gpg key from our website. Pulling from key servers caused a flakey build so | ||
| # we get the key from the Keybase website instead. | ||
| RUN curl -sSL https://keybase.io/docs/server_security/code_signing_key.asc | gpg --import | ||
| # This line will error if the fingerprint of the key in the file does not match the | ||
| # known fingerprint of the our PGP key | ||
| RUN gpg --fingerprint 222B85B0F90BE2D24CFEB93F47484E50656D16C7 | ||
| # And then verify the signature now that we have the key | ||
| RUN gpg --verify keybase_amd64.deb.sig keybase_amd64.deb | ||
|
|
||
| # Silence the error from dpkg about failing to configure keybase since `apt-get install -f` fixes it | ||
| USER root | ||
| RUN dpkg -i keybase_amd64.deb || true | ||
| RUN apt-get install -fy | ||
| USER keybase | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,45 @@ export ANNOUNCEMENT="Hello! I'm {USERNAME} and I'm an SSH bot! I'm currently lis | |
| export ANNOUNCEMENT="Hello! I'm {USERNAME} and I'm an SSH bot! Being in {CURRENT_TEAM} will grant you SSH access to certain servers. Reach out to @dworken for more information." | ||
| ``` | ||
|
|
||
| ## M of N Realms | ||
|
|
||
| It is possible to configure the SSH CA bot to require approval prior to granting access. For example, one could require | ||
| that in order to use kssh with servers in the `team.ssh.root_everywhere` realm two other people must approve the request. | ||
| Approvals are done by reacting with a :+1: emoji to the message inside of Keybase chat. | ||
|
|
||
| In order to configure this, there are 3 environment variables that can be used: | ||
|
|
||
| ``` | ||
| export CTRL_POLICY_MOFN_TEAMS="team.ssh.root_everywhere, team.ssh.ci" | ||
| export CTRL_POLICY_MOFN_APPROVERS="username0, username1, username2" | ||
| export CTRL_POLICY_MOFN_REQUIRED_COUNT="2" | ||
| ``` | ||
|
|
||
| The above will require that anyone who wants to use kssh with `team.ssh.root_everywhere` or `team.ssh.ci` gets approval | ||
| from two other people. Only three people are configured to approve requests: `username0, username1, username2`. | ||
|
|
||
| A few other example configurations are: | ||
|
|
||
| ``` | ||
| export CTRL_POLICY_MOFN_TEAMS="team.ssh.root_everywhere" | ||
| export CTRL_POLICY_MOFN_APPROVERS="username" | ||
| ``` | ||
|
|
||
| This would require that in order to use kssh with `team.ssh.root_everywhere` it must be approved by `username`. | ||
|
|
||
| As a user, this would be done by running: | ||
|
|
||
| ``` | ||
| kssh --request-realm team.ssh.root_everywhere root@production | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is kind of a mouthful. any chance it can work more like: OR
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly, there isn't really a way to make that work :/ In your first example, there is no way for kssh to know which servers need which principals. This becomes especially hard when talking about ssh configs which can define custom names like "production" for a hostname. The second example runs into essentially the same issue. While kssh could attempt to go first and then alert the user if the connection fails, there is no way for A feature that could be built out is allowing the user to configure this sort of thing on the client side. Eg: The difficulty with the local config strategy is that it will break in weird ways when using proxy commands or any more advanced SSH features. Eg
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it seems really sub-optimal to me to push the onus of knowing how everything is set-up down to the kssh user.
but doesn't the bot know? or if not, can we make it know with additional environment variables? |
||
| ``` | ||
|
|
||
| For a user, the standard commands would work for all other configured teams: | ||
|
|
||
| ``` | ||
| kssh dev@staging | ||
| kssh dev@prod | ||
| ``` | ||
|
|
||
| ## Developer Options | ||
|
|
||
| These environment variables are mainly useful for dev work. For security reasons, it is recommended always to run a | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.