Skip to content

Commit 8c000b7

Browse files
committed
Add more details to readme, add api-docs
1 parent 8e321be commit 8c000b7

File tree

4 files changed

+81
-18
lines changed

4 files changed

+81
-18
lines changed

.goreleaser.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ archives:
1919
- samples
2020
- README.md
2121
- LICENSE
22-
- install/Makefile
2322
checksum:
2423
name_template: 'checksums.txt'
2524
snapshot:

README.md

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
A simple to use and deploy SSH CA server.
44

5-
**This is a Work In Progress** - the project is in its early days. It is functional and I'm using it for my own hosts **but** you use it at your own risk
5+
**This is a Work In Progress** - the project is in its early days. It is functional, and I'm using it for my own hosts, **but** you use it at your own risk
6+
7+
## Goals
8+
9+
There are a couple of SSH CA servers out there - I have found them all difficult to use and have specific platform
10+
requirements. This projects aims to:
11+
12+
- Be simple to use and deploy
13+
- Use sensible secure defaults
14+
15+
I'm also using this project to learn go, so if you come across it and notice something dumb please let me know by opening an issue!
616

717
## Installation
818

@@ -17,10 +27,12 @@ mkdir /opt/sentinel
1727
# Copy archive into directory
1828
tar xvzf ssh-sentinel-server_$VERSION_$ARCH.tar.gz
1929

20-
make install
30+
cp samples/config.json .
31+
cp samples/ssh-sentinel.service /etc/systemd/system/
32+
systemctl daemon-reload
2133
```
2234

23-
## Configuration
35+
### Configuration
2436

2537
Configuration is defined in the `config.json`. Properties are explained below. Full paths must be provided
2638

@@ -39,13 +51,61 @@ Configuration is defined in the `config.json`. Properties are explained below. F
3951
- `tls.dnsProvider` - Only `cloudflare` is supported at the moment. A future release will open up support for other providers
4052
- `tls.dnsAPIToken` - The zone API token from cloudflare
4153

42-
## Goals
54+
### Generate a CA
4355

44-
There are a couple of SSH CA servers out there - I have found them all difficult to use and have specific platform
45-
requirements. This projects aims to:
56+
You can generate a SSH CA with `ssh-keygen`. I suggest using ECDSA keys as they are smaller but this is not a requirement.
4657

47-
- Be simple to use and deploy
48-
- Use sensible secure defaults
58+
```shell
59+
ssh-keygen -t ed25519 -f sentinel-ca -C sentinel-CA
60+
```
61+
62+
**The key must not have a password** - this will be improved in a future release
63+
64+
### Adding users
65+
66+
Once you have the service installed you'll need to add some users. I hope to improve this process later but for now you can do it via the `admin` command
67+
68+
```shell
69+
./ssh-sentinel-server admin -h
70+
Create / delete users
71+
72+
Usage:
73+
ssh-sentinel-server admin [flags]
74+
75+
Flags:
76+
-c, --config string Config file
77+
-C, --create If set a new user will be created
78+
-h, --help help for admin
79+
-n, --name string User's name
80+
-P, --principals strings A list of principals for the user
81+
-U, --username string Username
82+
```
83+
84+
So to add a user
85+
86+
```shell
87+
./ssh-sentinel-server admin -c config.json -C -n test -P test1 test2 -U test
88+
```
89+
90+
Not that the username is the user associated with this service. The principals list the allowed usernames on the server you will ssh to.
91+
92+
## Usage
93+
94+
Here are some high level usage details
95+
96+
### Clients
97+
98+
The server stands up as a restful HTTP/S service. You can post requests via curl ( see [api docs](./api-docs.yaml) for the API ) or you can use the [CLI client](https://github.com/ST2Projects/ssh-sentinel-client)
99+
100+
### Servers
101+
102+
Servers require some configuration to use the CA. In short:
103+
104+
- Copy the CA **public key** to the server and save it in `/etc/ssh/ca.pub`
105+
- Edit `/etc/ssh/sshd_config` and add `TrustedUserCAKeys /etc/ssh/ca.pub`
106+
- Restart SSHD `service sshd restart`
107+
108+
The easiest way to do this across an estate is with ansible. I will publish a role on ansible-galaxy to do this but you can create your own if required / desired
49109
50110
## Releases
51111

api-docs.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ definitions:
5858
example: 1666793056
5959
Pong:
6060
type: string
61+
CAPubKey:
62+
type: string
6163

6264

6365

@@ -98,4 +100,14 @@ paths:
98100
description: Unauthorized
99101
schema:
100102
$ref: "#/definitions/KeySignResponse"
101-
103+
/capubkey:
104+
get:
105+
summary: Get the current CA public key
106+
produces:
107+
- text/plain
108+
security: []
109+
responses:
110+
200:
111+
description: A successful response
112+
schema:
113+
$ref: "#/definitions/CAPubKey"

install/Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)