You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question: is "quorum of unseal share holders, no token at all" still a supported way to get a root token back? Today it works only on deprecated endpoints. Removal is "unplanned", not "never".
Setup
Use case: we run with no standing root or sudo token (break-glass on demand). Lost token = only share holders can get back in.
Main listener, default: legacy sys/generate-root/* returns 405.
Second listener with disable_unauthed_generate_root_endpoints = false: 3 of 5 shares, no token, full regeneration works (start, update x3, sys/decode-token).
# main listener (default), no token
bao read sys/generate-root/attempt -> Code: 405 * unsupported operation
bao write sys/generate-root/attempt ... -> Code: 405 * unsupported operation
bao write sys/generate-root/update ... -> Code: 405 * unsupported operation
# legacy listener, no token, CLI command
bao operator generate-root -status -> GET /v1/sys/generate-root-token/attempt Code: 403 * permission denied
# legacy listener, no token, generic calls, 3 of 5 shares
"complete":false,"progress":1
"complete":false,"progress":2
"complete":true,"progress":3
sys/decode-token -> token with display_name root
# legacy listener, no token, cancel
started: true -> bao delete sys/generate-root/attempt -> started: false
Script (bao CLI only)
#!/bin/sh# Item C: regenerate a root from unseal shares with NO token, on 2.7.1.# Needs: server with two-listeners.hcl (8200 default, 8210 legacy endpoints on), initialised 5 shares / threshold 3,# unsealed. Env: SHARE1 SHARE2 SHARE3 (three unseal keys). No token anywhere: empty HOME, BAO_TOKEN unset.# POSIX sh, bao CLI only.set -u
unset BAO_TOKEN ||trueexport HOME="$(mktemp -d)"
MAIN=http://127.0.0.1:8200
LEGACY=http://127.0.0.1:8210
bao version
echo"== 1. main listener (default): legacy endpoints, no token"
BAO_ADDR=$MAIN bao read sys/generate-root/attempt 2>&1| grep -E "Code:|^\*"||true
BAO_ADDR=$MAIN bao write sys/generate-root/attempt otp=x 2>&1| grep -E "Code:|^\*"||true
BAO_ADDR=$MAIN bao write sys/generate-root/update key=x nonce=x 2>&1| grep -E "Code:|^\*"||trueecho"== 2. 2.6+ CLI on the legacy listener, no token"
BAO_ADDR=$LEGACY bao operator generate-root -status 2>&1| grep -E "URL:|Code:|^\*"||true
BAO_ADDR=$LEGACY bao operator generate-root -init -generate-otp 2>&1| grep -E "URL:|Code:|^\*"||trueecho"== 3. share-only regeneration on the legacy listener, no token (generic CLI calls = raw HTTP)"export BAO_ADDR=$LEGACY
LEN=$(bao read -field=otp_length sys/generate-root/attempt)
OTP=$(head -c 512 /dev/urandom | tr -dc 'A-Za-z0-9'| head -c "$LEN")echo"otp_length=$LEN"
NONCE=$(bao write -field=nonce sys/generate-root/attempt otp="$OTP")echo"started, nonce=$NONCE"forKin"$SHARE1""$SHARE2""$SHARE3";do
bao write -format=json sys/generate-root/update key="$K" nonce="$NONCE"> /tmp/upd.json
grep -E '"progress"|"complete"' /tmp/upd.json | tr -d ' \n';echodone
ENC=$(grep '"encoded_token"' /tmp/upd.json | sed 's/.*"encoded_token": "\([^"]*\)".*/\1/')
ROOT=$(bao write -field=token sys/decode-token encoded_token="$ENC" otp="$OTP")echo"decoded token length ${#ROOT}"
BAO_ADDR=$MAIN BAO_TOKEN="$ROOT" bao token lookup -format=json | grep -E '"display_name"|"root"'| head -2
BAO_ADDR=$MAIN BAO_TOKEN="$ROOT" bao token revoke -self
echo"== 4. cancel on the legacy listener, no token"
NONCE2=$(bao write -field=nonce sys/generate-root/attempt otp="$OTP")
bao read -field=started sys/generate-root/attempt
bao delete sys/generate-root/attempt
echo"started after cancel: $(bao read -field=started sys/generate-root/attempt)"
Asks
Is share-only, no-token root regeneration still supported?
If so then document the procedure (restricted listener, legacy endpoints) and keep the endpoints until a replacement exists.
Would you take a replacement that keeps share-only but drops the unauthenticated cancel? Ideas:
cancel needs the nonce or a share
share-only endpoints only on a Unix socket or a listener marked local
CLI flag so bao operator generate-root can target the legacy endpoints on such a listener
Happy to test, and to write an RFC or PR if wanted.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Question: is "quorum of unseal share holders, no token at all" still a supported way to get a root token back? Today it works only on deprecated endpoints. Removal is "unplanned", not "never".
Setup
What works today (2.7.1, verified)
sys/generate-root/*returns 405.disable_unauthed_generate_root_endpoints = false: 3 of 5 shares, no token, full regeneration works (start, update x3,sys/decode-token).bao operator generate-rootcannot use it -sys/generate-root-token/*(needs a token, Use new /sys/generate-root-token endpoint in API and CLI #3190), 403. Only genericbao read/write sys/generate-root/*or raw HTTP work.sys/rawonly, nodes sealed or stopped.Script (bao CLI only)
Asks
If so then document the procedure (restricted listener, legacy endpoints) and keep the endpoints until a replacement exists.
bao operator generate-rootcan target the legacy endpoints on such a listenerRelated: #2912, #3041, #3190, #3077, #4211, #4212.
All reactions