Skip to content

Commit cf5943a

Browse files
committed
docs: minor improvements
1 parent 325c28f commit cf5943a

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# biscuit-ssh
22

3-
SSH authorization using Biscuit tokens embedded in SSH certificates.
3+
SSH authorization using biscuit tokens embedded in SSH certificates.
44

55
biscuit-ssh is an OpenSSH `AuthorizedKeysCommand` program that validates SSH certificates containing embedded biscuit tokens. It's inspired by [opkssh](https://github.com/openpubkey/opkssh) but uses biscuit tokens instead of PK tokens for service to service authorization.
66

77
Have a look at the [example](example) folder for a demonstration of how this works.
88

99
This crate is experimental and has not been tested in production. Use it at your own risk.
1010

11-
## Installation on a Server
11+
## Installation on a SSH Server
1212

1313
### 1. Install the binary
1414

@@ -19,7 +19,7 @@ cargo build --release
1919
sudo install -m 0755 target/release/biscuit-ssh /usr/local/bin/
2020
```
2121

22-
### 2. Create configuration file
22+
### 2. Create the configuration file
2323

2424
Store the public key file to validate biscuits in `/etc/biscuit-ssh/keys/default.key`:
2525

@@ -73,7 +73,7 @@ biscuit-ssh generate \
7373
ssh -i ~/.ssh/id_ed25519 alice@server
7474
```
7575

76-
## Biscuit Facts
76+
## Authority facts
7777

7878
The biscuit token **must** provide these facts for authorization to succeed:
7979

@@ -88,7 +88,7 @@ The biscuit token **must** provide these facts for authorization to succeed:
8888
ssh:authorized_key("ssh-ed25519", "AAAAC3NzaC1lZDI1NTE5AAAAIKzPvv...", "comment")
8989
```
9090

91-
## Server Facts
91+
## Authorizer facts
9292

9393
The biscuit-ssh authorizer provides facts that can be used by checks in biscuit blocks:
9494

@@ -109,9 +109,10 @@ The biscuit-ssh authorizer provides facts that can be used by checks in biscuit
109109
time(2025-07-22T22:39:12Z)
110110
```
111111

112-
### Using Server Facts for Attenuation
112+
### Biscuit Attenuation
113113

114-
Biscuits can be attenuated based on server-provided facts:
114+
The embedded biscuit should be attenuated so that it may only be used for SSH
115+
connections with the right key pair:
115116

116117
```datalog
117118
// Original token authority
@@ -147,7 +148,7 @@ log_level = "info"
147148

148149
```
149150
/etc/biscuit-ssh/keys/
150-
├── default.key # Default key (no key ID)
151+
├── default.key # Default key (no key ID)
151152
├── 1.key # Key ID 1
152153
├── 2.key # Key ID 2
153154
└── 3.key # Key ID 3

example/demo.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@ YELLOW='\033[1;33m'
77
BOLD='\033[1m'
88
NC='\033[0m'
99

10+
echo_cmd() {
11+
echo "Running: $*" >&2
12+
"$@"
13+
}
14+
1015
echo -e "${BLUE}${BOLD}Step 1: Generating SSH keypair...${NC}"
1116
if [[ ! -f ~/.ssh/id_ed25519 ]]
1217
then
1318
mkdir -p ~/.ssh
14-
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" -C "demo@biscuit-ssh"
19+
echo_cmd ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" -C "demo@biscuit-ssh"
20+
echo
1521
echo -e "${GREEN}✓ SSH keypair generated${NC}"
1622
echo
23+
else
24+
echo
25+
echo -e "${GREEN}✓ Re-using existing SSH keypair${NC}"
26+
echo
1727
fi
1828

1929
echo -e "${BLUE}${BOLD}Step 2: Generating biscuit token for demo-user...${NC}"
@@ -28,7 +38,7 @@ check if time(\$time), \$time <= $(date -d 'now 5min' --rfc-3339=seconds| tr -s
2838
EOF
2939

3040
PRIVATE_KEY=$(cat /shared/biscuit-keys/private.key)
31-
biscuit-cli generate --private-key $PRIVATE_KEY /tmp/token.datalog > /tmp/token.biscuit
41+
echo_cmd biscuit-cli generate --private-key $PRIVATE_KEY /tmp/token.datalog > /tmp/token.biscuit
3242

3343
echo -e "${YELLOW}${BOLD}Biscuit token contents:${NC}"
3444
biscuit-cli inspect /tmp/token.biscuit
@@ -37,18 +47,17 @@ echo -e "${GREEN}✓ Biscuit token generated${NC}"
3747
echo
3848

3949
echo -e "${BLUE}${BOLD}Step 3: Generating SSH certificate with embedded biscuit...${NC}"
40-
BISCUIT_SSH_CONFIG=/tmp/biscuit-ssh.conf biscuit-ssh generate \
50+
echo_cmd biscuit-ssh generate \
4151
--biscuit /tmp/token.biscuit \
4252
--identity ~/.ssh/id_ed25519 \
4353
--output ~/.ssh/id_ed25519-cert.pub
44-
4554
echo
4655
echo -e "${GREEN}✓ SSH certificate generated${NC}"
4756
echo
4857

4958
echo -e "${BLUE}${BOLD}Step 4: Connecting to server as demo-user...${NC}"
50-
ssh -o UserKnownHostsFile=/dev/null \
51-
-o StrictHostKeyChecking=no \
52-
demo-user@server \
53-
'echo Hello I am $USER on $(hostname)'
59+
echo_cmd ssh -o StrictHostKeyChecking=no \
60+
demo-user@server \
61+
'echo Hello I am $USER on $(hostname)'
62+
echo
5463
echo -e "${GREEN}${BOLD}✓ Demo completed successfully!${NC}"

0 commit comments

Comments
 (0)