Skip to content

Commit

Permalink
Update documentation to make it easier to understand
Browse files Browse the repository at this point in the history
  • Loading branch information
tlbdk committed Sep 8, 2022
1 parent e9a18e9 commit db966b1
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,47 @@ This can be used in:
* CI/CD pipelines when checking code out, running package installers pulling code from private repos.
* Auditing and restricting access to distributed SSH servers in a central location

## How to use
# Setup

### Git checkout
Add key location to your shell enviroment:

Git clone with key store in Google Cloud KMS:
Google KMS hosted key:

``` bash
export SSH_KEY_PATH=kms://projects/yourprojectname/locations/global/keyRings/yourkeyring/cryptoKeys/ssh-key/cryptoKeyVersions/1
auth-wrapper git clone [email protected]:connectedcars/private-module.git
```

Git clone with local key:
Local key:

``` bash
export SSH_KEY_PATH=build.pem
export SSH_KEY_PASSWORD=thepassword
```

# How to use

## SSH login

``` bash
auth-wrapper ssh user@ip
auth-wrapper ssh user@ip 'echo hello'
```

## Git checkout

``` bash
auth-wrapper git clone [email protected]:connectedcars/private-module.git
```

### SSH Certs
## Docker build

``` bash
auth-wrapper docker build --progress=plain --ssh default .
```

# Advanced

## SSH Certs

Signing server:

Expand Down Expand Up @@ -76,21 +97,13 @@ To configure a SSH server to trust the signing server CA for a specific user:
cert-authority,principals="user1,serverType:gw" ssh-rsa AAAA...(copy from output of signing server) ca key
```

# Options

## Use Examples
```
auth-wrapper ssh user@ip
auth-wrapper ssh user@ip 'echo hello'
```


## Options

### Arguments
## Arguments

* -principals : Principals to request

### Environment variables
## Environment variables

Client options:

Expand All @@ -107,7 +120,7 @@ Signing server options:
SHA256 Digest"
* SSH_CA_AUTHORIZED_KEYS_PATH": Path to authorized_keys following [AUTHORIZED_KEYS_FILE_FORMAT](http://man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT)

## Google Cloud KMS key setup
# Google Cloud KMS key setup

Create keyring and key:

Expand All @@ -120,7 +133,7 @@ gcloud kms keys create ssh-key --keyring ssh-keys --location global --default-al
gcloud kms keys add-iam-policy-binding ssh-key --keyring=ssh-keys --location=global --member [email protected] --role roles/cloudkms.signerVerifier
```

## Local key
# Local key

Current the go ssh key implementation does not support the new OpenSSH format so you need to use a PEM formated key:

Expand All @@ -129,10 +142,11 @@ ssh-keygen -f build.key
ssh-keygen -f build.key -m 'PEM' -e > build.pem
```

## Release new version
# Release new version

``` bash
export GITHUB_TOKEN="YOUR_GH_TOKEN"
git tag -a v2.0.2 -m "Release 2.0.2"
git push origin v2.0.2
goreleaser release --rm-dist
```

0 comments on commit db966b1

Please sign in to comment.